]> source.dussan.org Git - jgit.git/commit
Do not rely on ArrayIndexOutOfBoundsException to detect end of input 54/150254/1
authorSaša Živkov <sasa.zivkov@sap.com>
Fri, 27 Sep 2019 13:58:10 +0000 (15:58 +0200)
committerSaša Živkov <sasa.zivkov@sap.com>
Fri, 27 Sep 2019 13:58:10 +0000 (15:58 +0200)
commit3d8649ddef2874aeea7e3e83b47e5fd4867c5cd5
treead73af9197b84974378e38f2e811e023206b8e99
parente3f535cb15a75d6b2448bfadbc9839da8085f1ec
Do not rely on ArrayIndexOutOfBoundsException to detect end of input

In the Config#StringReader we relied on ArrayIndexOutOfBoundsException
to detect the end of the input. Creation of exception with (deep) stack
trace can significantly degrade performance in case when we read
thousands of config files, like in the case when Gerrit reads all
external ids from the NoteDb.

Use the buf.length to detect the end of the input.

Change-Id: I12266f25751373a870ce3fa623cf2a95d882d521
org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java