This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-bcel.git
The following commit(s) were added to refs/heads/master by this push: new 179058d Fix formatting. 179058d is described below commit 179058d2bbca78c1f27d043ed4b32740662a3f73 Author: Gary Gregory <gardgreg...@gmail.com> AuthorDate: Fri Jul 5 16:56:45 2019 -0400 Fix formatting. --- .../java/org/apache/bcel/classfile/ConstantUtf8.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/apache/bcel/classfile/ConstantUtf8.java b/src/main/java/org/apache/bcel/classfile/ConstantUtf8.java index b9b7e6e..21d17a9 100644 --- a/src/main/java/org/apache/bcel/classfile/ConstantUtf8.java +++ b/src/main/java/org/apache/bcel/classfile/ConstantUtf8.java @@ -37,15 +37,16 @@ public final class ConstantUtf8 extends Constant { private static class CACHE_HOLDER { private static final int MAX_CACHE_ENTRIES = 20000; - private static final int INITIAL_CACHE_CAPACITY = (int)(MAX_CACHE_ENTRIES/0.75); + private static final int INITIAL_CACHE_CAPACITY = (int) (MAX_CACHE_ENTRIES / 0.75); - private static final HashMap<String, ConstantUtf8> CACHE = - new LinkedHashMap<String, ConstantUtf8>(INITIAL_CACHE_CAPACITY, 0.75f, true) { + private static final HashMap<String, ConstantUtf8> CACHE = new LinkedHashMap<String, ConstantUtf8>( + INITIAL_CACHE_CAPACITY, 0.75f, true) { + private static final long serialVersionUID = -8506975356158971766L; @Override protected boolean removeEldestEntry(final Map.Entry<String, ConstantUtf8> eldest) { - return size() > MAX_CACHE_ENTRIES; + return size() > MAX_CACHE_ENTRIES; } }; @@ -58,8 +59,7 @@ public final class ConstantUtf8 extends Constant { private static volatile int created = 0; // Set the size to 0 or below to skip caching entirely - private static final int MAX_CACHED_SIZE = - Integer.getInteger("bcel.maxcached.size", 200).intValue();// CHECKSTYLE IGNORE MagicNumber + private static final int MAX_CACHED_SIZE = Integer.getInteger("bcel.maxcached.size", 200).intValue(); private static final boolean BCEL_STATISTICS = Boolean.getBoolean("bcel.statistics"); @@ -94,15 +94,15 @@ public final class ConstantUtf8 extends Constant { public static ConstantUtf8 getCachedInstance(final String s) { if (s.length() > MAX_CACHED_SIZE) { skipped++; - return new ConstantUtf8(s); + return new ConstantUtf8(s); } considered++; synchronized (ConstantUtf8.class) { // might be better with a specific lock object ConstantUtf8 result = CACHE_HOLDER.CACHE.get(s); if (result != null) { - hits++; - return result; - } + hits++; + return result; + } result = new ConstantUtf8(s); CACHE_HOLDER.CACHE.put(s, result); return result;