1010 */
1111package com .sun .jna ;
1212
13- import com .sun .jna .ptr .ByReference ;
1413import java .io .UnsupportedEncodingException ;
1514import java .lang .reflect .Array ;
1615import java .nio .Buffer ;
1716import java .nio .ByteBuffer ;
1817import java .nio .ByteOrder ;
1918import java .util .ArrayList ;
20- import java .util .HashMap ;
2119import java .util .List ;
22- import java .util .Map ;
2320
2421/**
2522 * An abstraction for a native pointer data type. A Pointer instance
@@ -379,11 +376,11 @@ public void write(long bOff, Pointer[] buf, int index, int length) {
379376 // Java type read methods
380377 //////////////////////////////////////////////////////////////////////////
381378
382- Object getValue (long offset , Class type , Object currentValue ) {
379+ Object getValue (long offset , Class <?> type , Object currentValue ) {
383380 return getValue (offset , 0 , 0 , type , currentValue );
384381 }
385382
386- Object getValue (long offset , int bitOffset , int bits , Class type , Object currentValue ) {
383+ Object getValue (long offset , int bitOffset , int bits , Class <?> type , Object currentValue ) {
387384
388385 Object result = BitFields .getPrimitiveValue (this , offset , bitOffset , bits , type );
389386 if (result != BitFields .UNHANDLED_TYPE )
@@ -467,7 +464,7 @@ else if (type.isArray()) {
467464 return result ;
468465 }
469466
470- private void getArrayValue (long offset , Object o , Class cls ) {
467+ private void getArrayValue (long offset , Object o , Class <?> cls ) {
471468 int length = 0 ;
472469 length = Array .getLength (o );
473470 Object result = o ;
@@ -766,7 +763,7 @@ public double[] getDoubleArray(long offset, int arraySize) {
766763 * determined by a NULL-valued terminating element.
767764 */
768765 public Pointer [] getPointerArray (long base ) {
769- List array = new ArrayList ();
766+ List < Pointer > array = new ArrayList < Pointer > ();
770767 int offset = 0 ;
771768 Pointer p = getPointer (base );
772769 while (p != null ) {
@@ -814,7 +811,7 @@ public String[] getStringArray(long base, boolean wide) {
814811 */
815812 public String [] getStringArray (long base , int length , boolean wide ) {
816813
817- List strings = new ArrayList ();
814+ List < String > strings = new ArrayList < String > ();
818815 int offset = 0 ;
819816 Pointer p = getPointer (base );
820817 if (length != -1 ) {
@@ -839,11 +836,11 @@ public String[] getStringArray(long base, int length, boolean wide) {
839836 // Java type write methods
840837 //////////////////////////////////////////////////////////////////////////
841838
842- void setValue (long offset , Object value , Class type ) {
839+ void setValue (long offset , Object value , Class <?> type ) {
843840 setValue (offset , 0 , 0 , value , type );
844841 }
845842
846- void setValue (long offset , int bitOffset , int bits , Object value , Class type ) {
843+ void setValue (long offset , int bitOffset , int bits , Object value , Class <?> type ) {
847844
848845 if (BitFields .setPrimitiveValue (this , offset , bitOffset , bits , value , type ))
849846 return ;
@@ -873,7 +870,7 @@ else if (Buffer.class.isAssignableFrom(type)) {
873870 }
874871 else if (NativeMapped .class .isAssignableFrom (type )) {
875872 NativeMappedConverter tc = NativeMappedConverter .getInstance (type );
876- Class nativeType = tc .nativeType ();
873+ Class <?> nativeType = tc .nativeType ();
877874 setValue (offset , bitOffset , bits , tc .toNative (value , new ToNativeContext ()), nativeType );
878875 }
879876 else if (type .isArray ()) {
@@ -884,7 +881,7 @@ else if (type.isArray()) {
884881 }
885882 }
886883
887- private void setArrayValue (long offset , Object value , Class cls ) {
884+ private void setArrayValue (long offset , Object value , Class <?> cls ) {
888885 if (cls == byte .class ) {
889886 byte [] buf = (byte [])value ;
890887 write (offset , buf , 0 , buf .length );
@@ -940,7 +937,7 @@ else if (Structure.class.isAssignableFrom(cls)) {
940937 else if (NativeMapped .class .isAssignableFrom (cls )) {
941938 NativeMapped [] buf = (NativeMapped [])value ;
942939 NativeMappedConverter tc = NativeMappedConverter .getInstance (cls );
943- Class nativeType = tc .nativeType ();
940+ Class <?> nativeType = tc .nativeType ();
944941 int size = Native .getNativeSize (value .getClass (), value ) / buf .length ;
945942 for (int i =0 ;i < buf .length ;i ++) {
946943 Object element = tc .toNative (buf [i ], new ToNativeContext ());
0 commit comments