diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java index 4726975d0..6ab5c149f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java @@ -1465,12 +1465,10 @@ public class Config { } int read() { - try { - return buf[pos++]; - } catch (ArrayIndexOutOfBoundsException e) { - pos = buf.length; + if (pos >= buf.length) { return -1; } + return buf[pos++]; } void reset() {