Skip to content

Commit 45f23fc

Browse files
committed
Added Eclipse config (fixes some classpath issues when using m2eclipse).
Removed hundreds of warnings reported by Eclipse.
1 parent dc500b2 commit 45f23fc

File tree

77 files changed

+530
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+530
-153
lines changed

.classpath

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<classpath>
3-
<classpathentry kind="src" path="sources"/>
4-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
5-
<classpathentry kind="lib" path="libraries/antlr-runtime-3.1.jar"/>
6-
<classpathentry kind="lib" path="libraries/junit-4.4-src.jar"/>
7-
<classpathentry kind="lib" path="libraries/junit-4.4.jar"/>
8-
<classpathentry kind="lib" path="libraries/rococoa.jar"/>
9-
<classpathentry kind="lib" path="libraries/trove.jar"/>
10-
<classpathentry kind="lib" path="libraries/anarres/build/tar/lib/anarres-cpp.jar"/>
11-
<classpathentry kind="lib" path="libraries/anarres/build/tar/lib/gnu.getopt.jar"/>
12-
<classpathentry kind="lib" path="C:/Prog/jnaerator/trunk/libraries/jna.jar"/>
13-
<classpathentry kind="output" path="output"/>
14-
</classpath>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
4+
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
5+
<classpathentry kind="output" path="target/classes"/>
6+
</classpath>

.project

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<projectDescription>
3-
<name>JNAerator</name>
4-
<comment></comment>
5-
<projects>
6-
</projects>
7-
<buildSpec>
8-
<buildCommand>
9-
<name>org.eclipse.jdt.core.javabuilder</name>
10-
<arguments>
11-
</arguments>
12-
</buildCommand>
13-
</buildSpec>
14-
<natures>
15-
<nature>org.eclipse.jdt.core.javanature</nature>
16-
</natures>
17-
</projectDescription>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>jnaerator-root</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.maven.ide.eclipse.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.maven.ide.eclipse.maven2Nature</nature>
21+
<nature>org.eclipse.jdt.core.javanature</nature>
22+
</natures>
23+
</projectDescription>

.settings/org.eclipse.jdt.core.prefs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#Thu Jan 28 23:48:28 CET 2010
2+
eclipse.preferences.version=1
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
4+
org.eclipse.jdt.core.compiler.compliance=1.4
5+
org.eclipse.jdt.core.compiler.source=1.3

.settings/org.maven.ide.eclipse.prefs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#Thu Jan 28 23:46:11 CET 2010
2+
activeProfiles=
3+
eclipse.preferences.version=1
4+
fullBuildGoals=process-test-resources
5+
includeModules=false
6+
resolveWorkspaceProjects=true
7+
resourceFilterGoals=process-resources resources\:testResources
8+
skipCompilerPlugin=true
9+
version=1

jna-jnaerator/.classpath

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
5+
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
6+
<classpathentry kind="output" path="target/classes"/>
7+
</classpath>

jna-jnaerator/.project

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>jna-jnaerator</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.maven.ide.eclipse.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.maven.ide.eclipse.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#Thu Jan 28 23:48:08 CET 2010
2+
eclipse.preferences.version=1
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
4+
org.eclipse.jdt.core.compiler.compliance=1.5
5+
org.eclipse.jdt.core.compiler.source=1.5
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#Thu Jan 28 23:46:11 CET 2010
2+
activeProfiles=
3+
eclipse.preferences.version=1
4+
fullBuildGoals=process-test-resources
5+
includeModules=false
6+
resolveWorkspaceProjects=true
7+
resourceFilterGoals=process-resources resources\:testResources
8+
skipCompilerPlugin=true
9+
version=1

jna-jnaerator/src/main/java/com/sun/jna/BitFields.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ public int size() {
274274
WSTRING_HANDLER = new StringHandler(true)
275275
;
276276

277-
private static final Map primHandlers = new IdentityHashMap(10);
277+
private static final Map<Class<?>, PrimHandler> primHandlers = new IdentityHashMap<Class<?>, PrimHandler>(10);
278278
static {
279279
primHandlers.put(Integer.TYPE, INT_HANDLER);
280280
primHandlers.put(Integer.class, INT_HANDLER);
@@ -324,7 +324,7 @@ private static PrimHandler getHandlerWithAtLeastNBytes(final int n) {
324324
}
325325
}
326326

327-
private static PrimHandler getPrimHandler(Class type, int bitOffset, int bits) {
327+
private static PrimHandler getPrimHandler(Class<?> type, int bitOffset, int bits) {
328328
PrimHandler handler = (PrimHandler)primHandlers.get(type);
329329
// if (handler == null && Pointer.class.isAssignableFrom(type))
330330
// handler = (PrimHandler)primHandlers.get(Pointer.class);
@@ -382,7 +382,7 @@ private static void revert(byte[] bs) {
382382
}
383383
public static final Object UNHANDLED_TYPE = new Object() {};
384384

385-
public static boolean setPrimitiveValue(Pointer pointer, long offset, int bitOffset, int bits, Object value, Class type) {
385+
public static boolean setPrimitiveValue(Pointer pointer, long offset, int bitOffset, int bits, Object value, Class<?> type) {
386386
PrimHandler handler = getPrimHandler(type, bitOffset, bits);
387387
if (handler == null)
388388
return false;
@@ -428,7 +428,7 @@ public static boolean setPrimitiveValue(Pointer pointer, long offset, int bitOff
428428
}
429429
return true;
430430
}
431-
public static Object getPrimitiveValue(Pointer pointer, long offset, int bitOffset, int bits, Class type) {
431+
public static Object getPrimitiveValue(Pointer pointer, long offset, int bitOffset, int bits, Class<?> type) {
432432
PrimHandler handler = getPrimHandler(type, bitOffset, bits);
433433
if (handler == null)
434434
return UNHANDLED_TYPE;

jna-jnaerator/src/main/java/com/sun/jna/Pointer.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@
1010
*/
1111
package com.sun.jna;
1212

13-
import com.sun.jna.ptr.ByReference;
1413
import java.io.UnsupportedEncodingException;
1514
import java.lang.reflect.Array;
1615
import java.nio.Buffer;
1716
import java.nio.ByteBuffer;
1817
import java.nio.ByteOrder;
1918
import java.util.ArrayList;
20-
import java.util.HashMap;
2119
import 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

Comments
 (0)