use of org.apache.jena.atlas.AtlasException in project jena by apache.
the class NumberUtils method formatUnsignedInt$.
// No checking. char[] filled backwards
private static int formatUnsignedInt$(char[] b, int x, int width) {
// x >= 0
// Inserts chars backwards
int idx = 0;
while (width > 0) {
int i = x % 10;
char ch = Chars.digits10[i];
b[idx] = ch;
width--;
idx++;
x = x / 10;
if (x == 0)
break;
}
if (x != 0)
throw new AtlasException("formatInt: overflow[x=" + x + ", width=" + width + "]");
while (width > 0) {
b[idx] = '0';
idx++;
width--;
}
return width;
}
use of org.apache.jena.atlas.AtlasException in project jena by apache.
the class JSONInputIterator method nextToken.
protected final Token nextToken() {
if (eof())
return tokenEOF;
// Tokenizer errors appear here!
try {
Token t = peekIter.next();
currLine = t.getLine();
currCol = t.getColumn();
return t;
} catch (RiotParseException ex) {
// Intercept to log it.
raiseException(ex);
throw ex;
} catch (AtlasException ex) {
// Bad I/O
RiotParseException ex2 = new RiotParseException(ex.getMessage(), -1, -1);
raiseException(ex2);
throw ex2;
}
}
Aggregations