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 b666f21d0..ba3160ff7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java @@ -1457,12 +1457,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() {