@Test public void acquireSameSizeWithoutRelease() { RoomSQLiteQuery query = RoomSQLiteQuery.acquire("abc", 3); assertThat(RoomSQLiteQuery.acquire("fda", 3), not(sameInstance(query))); }
@SuppressWarnings("WeakerAccess") public static RoomSQLiteQuery acquire(String query, int argumentCount) { synchronized (sQueryPool) { final Map.Entry<Integer, RoomSQLiteQuery> entry = sQueryPool.ceilingEntry(argumentCount); if (entry != null) { sQueryPool.remove(entry.getKey()); final RoomSQLiteQuery sqliteQuery = entry.getValue(); sqliteQuery.init(query, argumentCount); return sqliteQuery; } } RoomSQLiteQuery sqLiteQuery = new RoomSQLiteQuery(argumentCount); sqLiteQuery.init(query, argumentCount); return sqLiteQuery; }
RoomSQLiteQuery implements SupportSQLiteQuery, SupportSQLiteProgram { @SuppressWarnings("WeakerAccess") public static RoomSQLiteQuery acquire(String query, int argumentCount) { synchronized (sQueryPool) { final Map.Entry<Integer, RoomSQLiteQuery> entry = sQueryPool.ceilingEntry(argumentCount); if (entry != null) { sQueryPool.remove(entry.getKey()); final RoomSQLiteQuery sqliteQuery = entry.getValue(); sqliteQuery.init(query, argumentCount); return sqliteQuery; } } RoomSQLiteQuery sqLiteQuery = new RoomSQLiteQuery(argumentCount); sqLiteQuery.init(query, argumentCount); return sqLiteQuery; } }
RoomSQLiteQuery implements SupportSQLiteQuery, SupportSQLiteProgram { @SuppressWarnings("WeakerAccess") public static RoomSQLiteQuery acquire(String query, int argumentCount) { synchronized (sQueryPool) { final Map.Entry<Integer, RoomSQLiteQuery> entry = sQueryPool.ceilingEntry(argumentCount); if (entry != null) { sQueryPool.remove(entry.getKey()); final RoomSQLiteQuery sqliteQuery = entry.getValue(); sqliteQuery.init(query, argumentCount); return sqliteQuery; } } RoomSQLiteQuery sqLiteQuery = new RoomSQLiteQuery(argumentCount); sqLiteQuery.init(query, argumentCount); return sqLiteQuery; } private  RoomSQLiteQuery(int capacity); }
RoomSQLiteQuery implements SupportSQLiteQuery, SupportSQLiteProgram { @SuppressWarnings("WeakerAccess") public static RoomSQLiteQuery acquire(String query, int argumentCount) { synchronized (sQueryPool) { final Map.Entry<Integer, RoomSQLiteQuery> entry = sQueryPool.ceilingEntry(argumentCount); if (entry != null) { sQueryPool.remove(entry.getKey()); final RoomSQLiteQuery sqliteQuery = entry.getValue(); sqliteQuery.init(query, argumentCount); return sqliteQuery; } } RoomSQLiteQuery sqLiteQuery = new RoomSQLiteQuery(argumentCount); sqLiteQuery.init(query, argumentCount); return sqLiteQuery; } private  RoomSQLiteQuery(int capacity); @SuppressWarnings("WeakerAccess") static RoomSQLiteQuery acquire(String query, int argumentCount); @SuppressWarnings("WeakerAccess") void release(); @Override String getSql(); int getArgCount(); @Override void bindTo(SupportSQLiteProgram program); @Override void bindNull(int index); @Override void bindLong(int index, long value); @Override void bindDouble(int index, double value); @Override void bindString(int index, String value); @Override void bindBlob(int index, byte[] value); @Override void close(); void copyArgumentsFrom(RoomSQLiteQuery other); @Override void clearBindings(); }
RoomSQLiteQuery implements SupportSQLiteQuery, SupportSQLiteProgram { @SuppressWarnings("WeakerAccess") public static RoomSQLiteQuery acquire(String query, int argumentCount) { synchronized (sQueryPool) { final Map.Entry<Integer, RoomSQLiteQuery> entry = sQueryPool.ceilingEntry(argumentCount); if (entry != null) { sQueryPool.remove(entry.getKey()); final RoomSQLiteQuery sqliteQuery = entry.getValue(); sqliteQuery.init(query, argumentCount); return sqliteQuery; } } RoomSQLiteQuery sqLiteQuery = new RoomSQLiteQuery(argumentCount); sqLiteQuery.init(query, argumentCount); return sqLiteQuery; } private  RoomSQLiteQuery(int capacity); @SuppressWarnings("WeakerAccess") static RoomSQLiteQuery acquire(String query, int argumentCount); @SuppressWarnings("WeakerAccess") void release(); @Override String getSql(); int getArgCount(); @Override void bindTo(SupportSQLiteProgram program); @Override void bindNull(int index); @Override void bindLong(int index, long value); @Override void bindDouble(int index, double value); @Override void bindString(int index, String value); @Override void bindBlob(int index, byte[] value); @Override void close(); void copyArgumentsFrom(RoomSQLiteQuery other); @Override void clearBindings();  }