static ConstantUtf8 getInstance(final DataInput input) throws IOException { return new ConstantUtf8(input.readUTF()); }
private static synchronized ConstantUtf8 getCachedInstance(String s) { if (s.length() > 200) { return new ConstantUtf8(s); } if (cache == null) { cache = new LinkedHashMap<String, ConstantUtf8>(INITIAL_CACHE_CAPACITY, 0.75f, true) { private static final long serialVersionUID = 1L; @Override protected boolean removeEldestEntry(Map.Entry<String, ConstantUtf8> eldest) { return size() > MAX_CACHE_ENTRIES; } }; } ConstantUtf8 result = cache.get(s); if (result != null) { return result; } result = new ConstantUtf8(s); cache.put(s, result); return result; }
return new ConstantNameAndType(file); case Constants.CONSTANT_Utf8: return new ConstantUtf8(file); default: throw new ClassFormatException("Invalid byte tag in constant pool: " + b);
return new ConstantNameAndType(file); case Constants.CONSTANT_Utf8: return new ConstantUtf8(file); default: throw new ClassFormatException("Invalid byte tag in constant pool: " + b);
return new ConstantNameAndType(file); case Constants.CONSTANT_Utf8: return new ConstantUtf8(file); case Constants.CONSTANT_MethodHandle: return new ConstantMethodHandle(file);