diff options
author | Vadim Caen <caen@google.com> | 2017-07-04 11:36:57 +0100 |
---|---|---|
committer | Vadim Caen <caen@google.com> | 2017-07-04 11:37:23 +0100 |
commit | d0adfd1ec04ec12d478b5816a89c29a2bf763fd5 (patch) | |
tree | 4a2bc3b9f551196aecf0c67c829257992f7c09e7 | |
parent | 943adaf638e361d20a2ef5a690b6b1ee6f921152 (diff) | |
download | layoutlib-d0adfd1ec04ec12d478b5816a89c29a2bf763fd5.tar.gz |
Removing some warnings
Test: N/A
Change-Id: Id11c5585aaa501834eb04bc24dbb4575dc1e366a
-rw-r--r-- | bridge/src/android/graphics/NinePatch_Delegate.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/bridge/src/android/graphics/NinePatch_Delegate.java b/bridge/src/android/graphics/NinePatch_Delegate.java index 1f0eb3bab5..43e5b0f974 100644 --- a/bridge/src/android/graphics/NinePatch_Delegate.java +++ b/bridge/src/android/graphics/NinePatch_Delegate.java @@ -19,14 +19,11 @@ package android.graphics; import com.android.ide.common.rendering.api.LayoutLog; import com.android.layoutlib.bridge.Bridge; import com.android.layoutlib.bridge.impl.DelegateManager; -import com.android.layoutlib.bridge.impl.GcSnapshot; import com.android.ninepatch.NinePatchChunk; import com.android.tools.layoutlib.annotations.LayoutlibDelegate; import android.graphics.drawable.NinePatchDrawable; -import java.awt.Graphics2D; -import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -50,7 +47,7 @@ public final class NinePatch_Delegate { // ---- delegate manager ---- private static final DelegateManager<NinePatch_Delegate> sManager = - new DelegateManager<NinePatch_Delegate>(NinePatch_Delegate.class); + new DelegateManager<>(NinePatch_Delegate.class); // ---- delegate helper data ---- /** @@ -62,8 +59,7 @@ public final class NinePatch_Delegate { * Using the cache map allows us to not have to deserialize the byte[] back into a * {@link NinePatchChunk} every time a rendering is done. */ - private final static Map<byte[], SoftReference<NinePatchChunk>> sChunkCache = - new HashMap<byte[], SoftReference<NinePatchChunk>>(); + private final static Map<byte[], SoftReference<NinePatchChunk>> sChunkCache = new HashMap<>(); // ---- delegate data ---- private byte[] chunk; @@ -97,7 +93,7 @@ public final class NinePatch_Delegate { // get the array and add it to the cache byte[] array = baos.toByteArray(); - sChunkCache.put(array, new SoftReference<NinePatchChunk>(chunk)); + sChunkCache.put(array, new SoftReference<>(chunk)); return array; } @@ -122,7 +118,7 @@ public final class NinePatch_Delegate { // put back the chunk in the cache if (chunk != null) { - sChunkCache.put(array, new SoftReference<NinePatchChunk>(chunk)); + sChunkCache.put(array, new SoftReference<>(chunk)); } } catch (IOException e) { Bridge.getLog().error(LayoutLog.TAG_BROKEN, @@ -151,7 +147,6 @@ public final class NinePatch_Delegate { /*package*/ static boolean isNinePatchChunk(byte[] chunk) { NinePatchChunk chunkObject = getChunk(chunk); return chunkObject != null; - } @LayoutlibDelegate |