10
10
*/
11
11
package com .sun .jna ;
12
12
13
- import com .sun .jna .ptr .ByReference ;
14
13
import java .io .UnsupportedEncodingException ;
15
14
import java .lang .reflect .Array ;
16
15
import java .nio .Buffer ;
17
16
import java .nio .ByteBuffer ;
18
17
import java .nio .ByteOrder ;
19
18
import java .util .ArrayList ;
20
- import java .util .HashMap ;
21
19
import java .util .List ;
22
- import java .util .Map ;
23
20
24
21
/**
25
22
* 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) {
379
376
// Java type read methods
380
377
//////////////////////////////////////////////////////////////////////////
381
378
382
- Object getValue (long offset , Class type , Object currentValue ) {
379
+ Object getValue (long offset , Class <?> type , Object currentValue ) {
383
380
return getValue (offset , 0 , 0 , type , currentValue );
384
381
}
385
382
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 ) {
387
384
388
385
Object result = BitFields .getPrimitiveValue (this , offset , bitOffset , bits , type );
389
386
if (result != BitFields .UNHANDLED_TYPE )
@@ -467,7 +464,7 @@ else if (type.isArray()) {
467
464
return result ;
468
465
}
469
466
470
- private void getArrayValue (long offset , Object o , Class cls ) {
467
+ private void getArrayValue (long offset , Object o , Class <?> cls ) {
471
468
int length = 0 ;
472
469
length = Array .getLength (o );
473
470
Object result = o ;
@@ -766,7 +763,7 @@ public double[] getDoubleArray(long offset, int arraySize) {
766
763
* determined by a NULL-valued terminating element.
767
764
*/
768
765
public Pointer [] getPointerArray (long base ) {
769
- List array = new ArrayList ();
766
+ List < Pointer > array = new ArrayList < Pointer > ();
770
767
int offset = 0 ;
771
768
Pointer p = getPointer (base );
772
769
while (p != null ) {
@@ -814,7 +811,7 @@ public String[] getStringArray(long base, boolean wide) {
814
811
*/
815
812
public String [] getStringArray (long base , int length , boolean wide ) {
816
813
817
- List strings = new ArrayList ();
814
+ List < String > strings = new ArrayList < String > ();
818
815
int offset = 0 ;
819
816
Pointer p = getPointer (base );
820
817
if (length != -1 ) {
@@ -839,11 +836,11 @@ public String[] getStringArray(long base, int length, boolean wide) {
839
836
// Java type write methods
840
837
//////////////////////////////////////////////////////////////////////////
841
838
842
- void setValue (long offset , Object value , Class type ) {
839
+ void setValue (long offset , Object value , Class <?> type ) {
843
840
setValue (offset , 0 , 0 , value , type );
844
841
}
845
842
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 ) {
847
844
848
845
if (BitFields .setPrimitiveValue (this , offset , bitOffset , bits , value , type ))
849
846
return ;
@@ -873,7 +870,7 @@ else if (Buffer.class.isAssignableFrom(type)) {
873
870
}
874
871
else if (NativeMapped .class .isAssignableFrom (type )) {
875
872
NativeMappedConverter tc = NativeMappedConverter .getInstance (type );
876
- Class nativeType = tc .nativeType ();
873
+ Class <?> nativeType = tc .nativeType ();
877
874
setValue (offset , bitOffset , bits , tc .toNative (value , new ToNativeContext ()), nativeType );
878
875
}
879
876
else if (type .isArray ()) {
@@ -884,7 +881,7 @@ else if (type.isArray()) {
884
881
}
885
882
}
886
883
887
- private void setArrayValue (long offset , Object value , Class cls ) {
884
+ private void setArrayValue (long offset , Object value , Class <?> cls ) {
888
885
if (cls == byte .class ) {
889
886
byte [] buf = (byte [])value ;
890
887
write (offset , buf , 0 , buf .length );
@@ -940,7 +937,7 @@ else if (Structure.class.isAssignableFrom(cls)) {
940
937
else if (NativeMapped .class .isAssignableFrom (cls )) {
941
938
NativeMapped [] buf = (NativeMapped [])value ;
942
939
NativeMappedConverter tc = NativeMappedConverter .getInstance (cls );
943
- Class nativeType = tc .nativeType ();
940
+ Class <?> nativeType = tc .nativeType ();
944
941
int size = Native .getNativeSize (value .getClass (), value ) / buf .length ;
945
942
for (int i =0 ;i < buf .length ;i ++) {
946
943
Object element = tc .toNative (buf [i ], new ToNativeContext ());
0 commit comments