src/share/classes/sun/management/snmp/jvminstr/JvmThreadInstanceEntryImpl.java

Print this page
rev 10203 : 8048874: Replace uses of 'new Byte', 'new Short' and 'new Character' with appropriate alternative across core classes
Reviewed-by: chegar, prappo
Contributed-by: Otavio Santana <otaviojava@java.net>


 122             byte[] bitmap = new byte[] {(byte)0x00, (byte)0x00};
 123             try {
 124                 final Thread.State state = info.getThreadState();
 125                 final boolean inNative  = info.isInNative();
 126                 final boolean suspended = info.isSuspended();
 127                 log.debug("getJvmThreadInstState",
 128                           "[State=" + state +
 129                           ",isInNative=" + inNative +
 130                           ",isSuspended=" + suspended + "]");
 131                 setState(bitmap,state);
 132                 if (inNative)  setNative(bitmap);
 133                 if (suspended) setSuspended(bitmap);
 134                 checkOther(bitmap);
 135             } catch (RuntimeException r) {
 136                 bitmap[0]=(byte)0x00;
 137                 bitmap[1]=Byte1.other;
 138                 log.trace("getJvmThreadInstState",
 139                           "Unexpected exception: " + r);
 140                 log.debug("getJvmThreadInstState",r);
 141             }
 142             Byte[] result = { new Byte(bitmap[0]), new Byte(bitmap[1]) };
 143             return result;
 144         }
 145     }
 146 
 147     private final ThreadInfo info;
 148     private final Byte[] index;
 149 
 150     /**
 151      * Constructor for the "JvmThreadInstanceEntry" group.
 152      */
 153     public JvmThreadInstanceEntryImpl(ThreadInfo info,
 154                                       Byte[] index) {
 155         this.info = info;
 156         this.index = index;
 157     }
 158 
 159 
 160     private static String  jvmThreadInstIndexOid = null;
 161     public static String getJvmThreadInstIndexOid()
 162         throws SnmpStatusException {




 122             byte[] bitmap = new byte[] {(byte)0x00, (byte)0x00};
 123             try {
 124                 final Thread.State state = info.getThreadState();
 125                 final boolean inNative  = info.isInNative();
 126                 final boolean suspended = info.isSuspended();
 127                 log.debug("getJvmThreadInstState",
 128                           "[State=" + state +
 129                           ",isInNative=" + inNative +
 130                           ",isSuspended=" + suspended + "]");
 131                 setState(bitmap,state);
 132                 if (inNative)  setNative(bitmap);
 133                 if (suspended) setSuspended(bitmap);
 134                 checkOther(bitmap);
 135             } catch (RuntimeException r) {
 136                 bitmap[0]=(byte)0x00;
 137                 bitmap[1]=Byte1.other;
 138                 log.trace("getJvmThreadInstState",
 139                           "Unexpected exception: " + r);
 140                 log.debug("getJvmThreadInstState",r);
 141             }
 142             Byte[] result = {bitmap[0], bitmap[1]};
 143             return result;
 144         }
 145     }
 146 
 147     private final ThreadInfo info;
 148     private final Byte[] index;
 149 
 150     /**
 151      * Constructor for the "JvmThreadInstanceEntry" group.
 152      */
 153     public JvmThreadInstanceEntryImpl(ThreadInfo info,
 154                                       Byte[] index) {
 155         this.info = info;
 156         this.index = index;
 157     }
 158 
 159 
 160     private static String  jvmThreadInstIndexOid = null;
 161     public static String getJvmThreadInstIndexOid()
 162         throws SnmpStatusException {