From 83cc11676314488ca0669366933e807e8fdead87 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 9 Jun 2013 05:39:51 +0200 Subject: Bug 747: AndroidVersion: HashMap -> IntObjectHashMap --- src/java/com/jogamp/common/os/AndroidVersion.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/java/com/jogamp/common/os/AndroidVersion.java') diff --git a/src/java/com/jogamp/common/os/AndroidVersion.java b/src/java/com/jogamp/common/os/AndroidVersion.java index cb6c3e5..d2afbbc 100644 --- a/src/java/com/jogamp/common/os/AndroidVersion.java +++ b/src/java/com/jogamp/common/os/AndroidVersion.java @@ -28,9 +28,8 @@ package com.jogamp.common.os; import java.lang.reflect.Field; -import java.util.HashMap; -import java.util.Map; +import com.jogamp.common.util.IntObjectHashMap; import com.jogamp.common.util.ReflectionUtil; public class AndroidVersion { @@ -72,8 +71,8 @@ public class AndroidVersion { INCREMENTAL = getString(abvClass, abvObject, "INCREMENTAL"); RELEASE = getString(abvClass, abvObject, "RELEASE"); SDK_INT = getInt(abvClass, abvObject, "SDK_INT"); - final Map version_codes = getVersionCodes(abvcClass, abvcObject); - String sdk_name = version_codes.get(new Integer(SDK_INT)); + final IntObjectHashMap version_codes = getVersionCodes(abvcClass, abvcObject); + final String sdk_name = (String) version_codes.get(SDK_INT); SDK_NAME = ( null != sdk_name ) ? sdk_name : "SDK_"+SDK_INT ; } else { CODENAME = null; @@ -84,9 +83,9 @@ public class AndroidVersion { } } - private static final Map getVersionCodes(Class cls, Object obj) { - HashMap map = new HashMap(); - Field[] fields = cls.getFields(); + private static final IntObjectHashMap getVersionCodes(Class cls, Object obj) { + final Field[] fields = cls.getFields(); + IntObjectHashMap map = new IntObjectHashMap( 3 * fields.length / 2, 0.75f ); for(int i=0; i