diff options
Diffstat (limited to 'src/java/com/jogamp')
43 files changed, 162 insertions, 0 deletions
diff --git a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java index 1b19d04..201fc59 100644 --- a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java +++ b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java @@ -88,6 +88,7 @@ public class JNILibLoaderBase { } private static class DefaultAction implements LoaderAction { + @Override public boolean loadLibrary(String libname, boolean ignoreError, ClassLoader cl) { boolean res = true; if(!isLoaded(libname)) { @@ -110,6 +111,7 @@ public class JNILibLoaderBase { return res; } + @Override public void loadLibrary(String libname, String[] preload, boolean preloadIgnoreError, ClassLoader cl) { if(!isLoaded(libname)) { if (null!=preload) { @@ -437,6 +439,7 @@ public class JNILibLoaderBase { final String sunAppletLauncherClassName = "org.jdesktop.applet.util.JNLPAppletLauncher"; final Method loadLibraryMethod = AccessController.doPrivileged(new PrivilegedAction<Method>() { + @Override public Method run() { // FIXME: remove final boolean usingJNLPAppletLauncher = Debug.getBooleanProperty(sunAppletLauncherProperty, true); diff --git a/src/java/com/jogamp/common/net/GenericURLStreamHandlerFactory.java b/src/java/com/jogamp/common/net/GenericURLStreamHandlerFactory.java index 4ec3f19..b5c5177 100644 --- a/src/java/com/jogamp/common/net/GenericURLStreamHandlerFactory.java +++ b/src/java/com/jogamp/common/net/GenericURLStreamHandlerFactory.java @@ -49,6 +49,7 @@ public class GenericURLStreamHandlerFactory implements URLStreamHandlerFactory { public synchronized static GenericURLStreamHandlerFactory register() { if(null == factory) { factory = AccessController.doPrivileged(new PrivilegedAction<GenericURLStreamHandlerFactory>() { + @Override public GenericURLStreamHandlerFactory run() { boolean ok = false; GenericURLStreamHandlerFactory f = new GenericURLStreamHandlerFactory(); diff --git a/src/java/com/jogamp/common/nio/AbstractBuffer.java b/src/java/com/jogamp/common/nio/AbstractBuffer.java index 4213a4d..1be279b 100644 --- a/src/java/com/jogamp/common/nio/AbstractBuffer.java +++ b/src/java/com/jogamp/common/nio/AbstractBuffer.java @@ -68,22 +68,27 @@ public abstract class AbstractBuffer<B extends AbstractBuffer> implements Native this.position = 0; } + @Override public final int elementSize() { return elementSize; } + @Override public final int limit() { return capacity; } + @Override public final int capacity() { return capacity; } + @Override public final int position() { return position; } + @Override public final B position(int newPos) { if (0 > newPos || newPos >= capacity) { throw new IndexOutOfBoundsException("Sorry to interrupt, but the position "+newPos+" was out of bounds. " + @@ -93,31 +98,38 @@ public abstract class AbstractBuffer<B extends AbstractBuffer> implements Native return (B)this; } + @Override public final int remaining() { return capacity - position; } + @Override public final boolean hasRemaining() { return position < capacity; } + @Override public final B rewind() { position = 0; return (B) this; } + @Override public final Buffer getBuffer() { return buffer; } + @Override public final boolean isDirect() { return buffer.isDirect(); } + @Override public final boolean hasArray() { return buffer.hasArray(); } + @Override public final int arrayOffset() { if( hasArray() ) { return buffer.arrayOffset(); @@ -126,6 +138,7 @@ public abstract class AbstractBuffer<B extends AbstractBuffer> implements Native } } + @Override public Object array() throws UnsupportedOperationException { return buffer.array(); } diff --git a/src/java/com/jogamp/common/nio/PointerBuffer.java b/src/java/com/jogamp/common/nio/PointerBuffer.java index 4a479f0..5d470d5 100644 --- a/src/java/com/jogamp/common/nio/PointerBuffer.java +++ b/src/java/com/jogamp/common/nio/PointerBuffer.java @@ -117,6 +117,7 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> { /** * Relative bulk get method. Copy the source values <code> src[position .. capacity] [</code> * to this buffer and increment the position by <code>capacity-position</code>. */ + @Override public final PointerBuffer put(PointerBuffer src) { if (remaining() < src.remaining()) { throw new IndexOutOfBoundsException(); @@ -147,6 +148,7 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> { } /** Relative get method. Get the pointer value at the current position and increment the position by one. */ + @Override public final long get() { long r = get(position); position++; @@ -154,6 +156,7 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> { } /** Absolute get method. Get the pointer value at the given index */ + @Override public final long get(int idx) { if (0 > idx || idx >= capacity) { throw new IndexOutOfBoundsException(); @@ -184,6 +187,7 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> { } /** Absolute put method. Put the pointer value at the given index */ + @Override public final PointerBuffer put(int idx, long v) { if (0 > idx || idx >= capacity) { throw new IndexOutOfBoundsException(); @@ -197,6 +201,7 @@ public class PointerBuffer extends AbstractBuffer<PointerBuffer> { } /** Relative put method. Put the pointer value at the current position and increment the position by one. */ + @Override public final PointerBuffer put(long value) { put(position, value); position++; diff --git a/src/java/com/jogamp/common/os/DynamicLibraryBundle.java b/src/java/com/jogamp/common/os/DynamicLibraryBundle.java index a69fd7a..6ac8d94 100644 --- a/src/java/com/jogamp/common/os/DynamicLibraryBundle.java +++ b/src/java/com/jogamp/common/os/DynamicLibraryBundle.java @@ -119,6 +119,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper { } info.getLibLoaderExecutor().invoke(true, new Runnable() { + @Override public void run() { loadLibraries(); } } ) ; diff --git a/src/java/com/jogamp/common/os/MachineDescription.java b/src/java/com/jogamp/common/os/MachineDescription.java index aea9de1..8ff3ff7 100644 --- a/src/java/com/jogamp/common/os/MachineDescription.java +++ b/src/java/com/jogamp/common/os/MachineDescription.java @@ -291,6 +291,7 @@ public class MachineDescription { * @return <code>true</code> if the two MachineDescription are equal; * otherwise <code>false</code>. */ + @Override public final boolean equals(Object obj) { if (this == obj) { return true; } if ( !(obj instanceof MachineDescription) ) { return false; } diff --git a/src/java/com/jogamp/common/os/NativeLibrary.java b/src/java/com/jogamp/common/os/NativeLibrary.java index df59611..794d712 100644 --- a/src/java/com/jogamp/common/os/NativeLibrary.java +++ b/src/java/com/jogamp/common/os/NativeLibrary.java @@ -132,6 +132,7 @@ public final class NativeLibrary implements DynamicLookupHelper { } } + @Override public final String toString() { return "NativeLibrary[" + libraryPath + ", 0x" + Long.toHexString(libraryHandle) + ", global " + global + "]"; } @@ -362,6 +363,7 @@ public final class NativeLibrary implements DynamicLookupHelper { // Add entries from java.library.path final String[] javaLibraryPaths = AccessController.doPrivileged(new PrivilegedAction<String[]>() { + @Override public String[] run() { int count = 0; final String usrPath = System.getProperty("java.library.path"); @@ -402,6 +404,7 @@ public final class NativeLibrary implements DynamicLookupHelper { // Add current working directory String userDir = AccessController.doPrivileged(new PrivilegedAction<String>() { + @Override public String run() { return System.getProperty("user.dir"); } @@ -523,6 +526,7 @@ public final class NativeLibrary implements DynamicLookupHelper { } if (!initializedFindLibraryMethod) { AccessController.doPrivileged(new PrivilegedAction<Object>() { + @Override public Object run() { try { findLibraryMethod = ClassLoader.class.getDeclaredMethod("findLibrary", @@ -539,6 +543,7 @@ public final class NativeLibrary implements DynamicLookupHelper { if (findLibraryMethod != null) { try { return AccessController.doPrivileged(new PrivilegedAction<String>() { + @Override public String run() { try { return (String) findLibraryMethod.invoke(loader, new Object[] { libName }); diff --git a/src/java/com/jogamp/common/os/Platform.java b/src/java/com/jogamp/common/os/Platform.java index 896ea56..23135ae 100644 --- a/src/java/com/jogamp/common/os/Platform.java +++ b/src/java/com/jogamp/common/os/Platform.java @@ -171,6 +171,7 @@ public class Platform extends PlatformPropsImpl { final boolean[] _AWT_AVAILABLE = new boolean[] { false }; AccessController.doPrivileged(new PrivilegedAction<Object>() { + @Override public Object run() { PlatformPropsImpl.initSingleton(); // documenting the order of static initialization diff --git a/src/java/com/jogamp/common/util/FloatStack.java b/src/java/com/jogamp/common/util/FloatStack.java index 725491c..8cb2e5b 100644 --- a/src/java/com/jogamp/common/util/FloatStack.java +++ b/src/java/com/jogamp/common/util/FloatStack.java @@ -79,6 +79,7 @@ public class /*name*/FloatStack/*name*/ implements PrimitiveStack { @Override public final void setGrowSize(int newGrowSize) { growSize = newGrowSize; } + @Override public final String toString() { return "FloatStack[0..(pos "+position+").."+buffer.length+", remaining "+remaining()+"]"; } diff --git a/src/java/com/jogamp/common/util/IntIntHashMap.java b/src/java/com/jogamp/common/util/IntIntHashMap.java index 06b9a3f..ef6159b 100644 --- a/src/java/com/jogamp/common/util/IntIntHashMap.java +++ b/src/java/com/jogamp/common/util/IntIntHashMap.java @@ -85,6 +85,7 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable, if(!isPrimitive) { final EntryCM cm = AccessController.doPrivileged(new PrivilegedAction<EntryCM>() { + @Override @SuppressWarnings("unchecked") public EntryCM run() { EntryCM r = new EntryCM(); @@ -501,6 +502,7 @@ public class /*name*/IntIntHashMap/*name*/ implements Cloneable, private static Method getCloneMethod(Object obj) { final Class<?> clazz = obj.getClass(); return AccessController.doPrivileged(new PrivilegedAction<Method>() { + @Override public Method run() { try { return clazz.getDeclaredMethod("clone"); diff --git a/src/java/com/jogamp/common/util/LFRingbuffer.java b/src/java/com/jogamp/common/util/LFRingbuffer.java index 1ca1e20..a0418c5 100644 --- a/src/java/com/jogamp/common/util/LFRingbuffer.java +++ b/src/java/com/jogamp/common/util/LFRingbuffer.java @@ -81,10 +81,12 @@ public class LFRingbuffer<T> implements Ringbuffer<T> { private volatile int writePos; private volatile int size; + @Override public final String toString() { return "LFRingbuffer<?>[filled "+size+" / "+(capacityPlusOne-1)+", writePos "+writePos+", readPos "+readPos+"]"; } + @Override public final void dump(PrintStream stream, String prefix) { stream.println(prefix+" "+toString()+" {"); for(int i=0; i<capacityPlusOne; i++) { diff --git a/src/java/com/jogamp/common/util/PropertyAccess.java b/src/java/com/jogamp/common/util/PropertyAccess.java index 5a8f082..830bfe4 100644 --- a/src/java/com/jogamp/common/util/PropertyAccess.java +++ b/src/java/com/jogamp/common/util/PropertyAccess.java @@ -176,6 +176,7 @@ public class PropertyAccess { private static final String getTrustedPropKey(final String propertyKey) { return AccessController.doPrivileged(new PrivilegedAction<String>() { + @Override public String run() { try { return System.getProperty(propertyKey); diff --git a/src/java/com/jogamp/common/util/Ringbuffer.java b/src/java/com/jogamp/common/util/Ringbuffer.java index 7faf5dd..6c2507f 100644 --- a/src/java/com/jogamp/common/util/Ringbuffer.java +++ b/src/java/com/jogamp/common/util/Ringbuffer.java @@ -45,6 +45,7 @@ import java.io.PrintStream; public interface Ringbuffer<T> { /** Returns a short string representation incl. size/capacity and internal r/w index (impl. dependent). */ + @Override public String toString(); /** Debug functionality - Dumps the contents of the internal array. */ diff --git a/src/java/com/jogamp/common/util/SecurityUtil.java b/src/java/com/jogamp/common/util/SecurityUtil.java index 742de84..4586d22 100644 --- a/src/java/com/jogamp/common/util/SecurityUtil.java +++ b/src/java/com/jogamp/common/util/SecurityUtil.java @@ -48,6 +48,7 @@ public class SecurityUtil { final boolean hasAllPermissions; { final ProtectionDomain insecPD = AccessController.doPrivileged(new PrivilegedAction<ProtectionDomain>() { + @Override public ProtectionDomain run() { return SecurityUtil.class.getProtectionDomain(); } } ); @@ -64,6 +65,7 @@ public class SecurityUtil { System.err.println("SecurityUtil: Has SecurityManager: "+ ( null != securityManager ) ) ; System.err.println("SecurityUtil: Has AllPermissions: "+hasAllPermissions); final Certificate[] certs = AccessController.doPrivileged(new PrivilegedAction<Certificate[]>() { + @Override public Certificate[] run() { return getCerts(SecurityUtil.class); } } ); diff --git a/src/java/com/jogamp/common/util/cache/TempFileCache.java b/src/java/com/jogamp/common/util/cache/TempFileCache.java index 5898d50..cc7014a 100644 --- a/src/java/com/jogamp/common/util/cache/TempFileCache.java +++ b/src/java/com/jogamp/common/util/cache/TempFileCache.java @@ -237,6 +237,7 @@ public class TempFileCache { // We do this so that the locks never get garbage-collected. Runtime.getRuntime().addShutdownHook(new Thread() { /* @Override */ + @Override public void run() { // NOTE: we don't really expect that this code will ever // be called. If it does, we will close the output @@ -263,6 +264,7 @@ public class TempFileCache { // Start a new Reaper thread to do stuff... Thread reaperThread = new Thread() { /* @Override */ + @Override public void run() { deleteOldTempDirs(); } @@ -286,6 +288,7 @@ public class TempFileCache { final String ourLockFile = tmpRootPropValue + ".lck"; FilenameFilter lckFilter = new FilenameFilter() { /* @Override */ + @Override public boolean accept(File dir, String name) { return name.endsWith(".lck") && !name.equals(ourLockFile); } diff --git a/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java b/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java index 7ae3192..d856767 100644 --- a/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java +++ b/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java @@ -147,6 +147,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { public final MethodBinding getBinding() { return binding; } + @Override public String getName() { return binding.getName(); } @@ -291,12 +292,14 @@ public class CMethodBindingEmitter extends FunctionEmitter { public final MachineDescription getMachineDescription() { return machDesc; } + @Override protected void emitReturnType(PrintWriter writer) { writer.print("JNIEXPORT "); writer.print(binding.getJavaReturnType().jniTypeName()); writer.print(" JNICALL"); } + @Override protected void emitName(PrintWriter writer) { writer.println(); // start name on new line writer.print("Java_"); @@ -326,6 +329,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { return ""; } + @Override protected int emitArguments(PrintWriter writer) { writer.print("JNIEnv *env, "); int numEmitted = 1; // initially just the JNIEnv @@ -374,6 +378,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { } + @Override protected void emitBody(PrintWriter writer) { writer.println(" {"); // writer.println("printf(\" - - - - "+ getName() + getImplSuffix() +" - - - -\\n\");"); @@ -1478,6 +1483,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { * emitter java method. */ protected static class DefaultCommentEmitter implements CommentEmitter { + @Override public void emit(FunctionEmitter emitter, PrintWriter writer) { emitBeginning((CMethodBindingEmitter)emitter, writer); emitEnding((CMethodBindingEmitter)emitter, writer); diff --git a/src/java/com/jogamp/gluegen/DebugEmitter.java b/src/java/com/jogamp/gluegen/DebugEmitter.java index d5fab6e..781188e 100644 --- a/src/java/com/jogamp/gluegen/DebugEmitter.java +++ b/src/java/com/jogamp/gluegen/DebugEmitter.java @@ -48,26 +48,33 @@ import com.jogamp.gluegen.cgram.types.*; public class DebugEmitter implements GlueEmitter { + @Override public void readConfigurationFile(String filename) {} + @Override public void beginEmission(GlueEmitterControls controls) { System.out.println("----- BEGIN EMISSION OF GLUE CODE -----"); } + @Override public void endEmission() { System.out.println("----- END EMISSION OF GLUE CODE -----"); } + @Override public void beginDefines() {} + @Override public void emitDefine(ConstantDefinition def, String optionalComment) { String name = def.getName(); String value = def.getValue(); System.out.println("#define " + name + " " + value + (optionalComment != null ? ("// " + optionalComment) : "")); } + @Override public void endDefines() {} + @Override public void beginFunctions(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map<Type, Type> canonMap) { @@ -78,6 +85,7 @@ public class DebugEmitter implements GlueEmitter { } } + @Override public Iterator<FunctionSymbol> emitFunctions(List<FunctionSymbol> originalCFunctions) throws Exception { for (FunctionSymbol sym : originalCFunctions) { emitSingleFunction(sym); @@ -88,15 +96,21 @@ public class DebugEmitter implements GlueEmitter { System.out.println(sym); System.out.println(" -> " + sym.toString()); } + @Override public void endFunctions() {} + @Override public void beginStructLayout() throws Exception {} + @Override public void layoutStruct(CompoundType t) throws Exception {} + @Override public void endStructLayout() throws Exception {} + @Override public void beginStructs(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map<Type, Type> canonMap) { } + @Override public void emitStruct(CompoundType t, String alternateName) { String name = t.getName(); if (name == null && alternateName != null) { @@ -106,5 +120,6 @@ public class DebugEmitter implements GlueEmitter { System.out.println("Referenced type \"" + name + "\""); } + @Override public void endStructs() {} } diff --git a/src/java/com/jogamp/gluegen/GlueGen.java b/src/java/com/jogamp/gluegen/GlueGen.java index 76eda1f..6a2b854 100644 --- a/src/java/com/jogamp/gluegen/GlueGen.java +++ b/src/java/com/jogamp/gluegen/GlueGen.java @@ -71,14 +71,17 @@ public class GlueGen implements GlueEmitterControls { public static boolean debug() { return debug; } + @Override public void forceStructEmission(String typedefName) { forcedStructNames.add(typedefName); } + @Override public String findHeaderFile(String headerFileName) { return preprocessor.findFile(headerFileName); } + @Override public void runSymbolFilter(SymbolFilter filter) { filter.filterSymbols(constants, functions); List<ConstantDefinition> newConstants = filter.getConstants(); diff --git a/src/java/com/jogamp/gluegen/JavaEmitter.java b/src/java/com/jogamp/gluegen/JavaEmitter.java index 33b089a..380b5e4 100644 --- a/src/java/com/jogamp/gluegen/JavaEmitter.java +++ b/src/java/com/jogamp/gluegen/JavaEmitter.java @@ -105,6 +105,7 @@ public class JavaEmitter implements GlueEmitter { protected final static Logger LOG = Logger.getLogger(JavaEmitter.class.getPackage().getName()); + @Override public void readConfigurationFile(String filename) throws Exception { cfg = createConfig(); cfg.read(filename); @@ -114,15 +115,18 @@ public class JavaEmitter implements GlueEmitter { private List<ConstantDefinition> constants; + @Override public void filterSymbols(List<ConstantDefinition> constants, List<FunctionSymbol> functions) { this.constants = constants; doWork(); } + @Override public List<ConstantDefinition> getConstants() { return constants; } + @Override public List<FunctionSymbol> getFunctions() { return null; } @@ -138,6 +142,7 @@ public class JavaEmitter implements GlueEmitter { } } + @Override public void beginEmission(GlueEmitterControls controls) throws IOException { // Request emission of any structs requested @@ -158,6 +163,7 @@ public class JavaEmitter implements GlueEmitter { } } + @Override public void endEmission() { if (!cfg.structsOnly()) { emitAllFileFooters(); @@ -170,6 +176,7 @@ public class JavaEmitter implements GlueEmitter { } } + @Override public void beginDefines() throws Exception { if ((cfg.allStatic() || cfg.emitInterface()) && !cfg.structsOnly()) { javaWriter().println(); @@ -342,6 +349,7 @@ public class JavaEmitter implements GlueEmitter { "\" cannot be assigned to a int, long, float, or double"); } + @Override public void emitDefine(ConstantDefinition def, String optionalComment) throws Exception { if (cfg.allStatic() || cfg.emitInterface()) { @@ -376,9 +384,11 @@ public class JavaEmitter implements GlueEmitter { } } + @Override public void endDefines() throws Exception { } + @Override public void beginFunctions(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map<Type, Type> canonMap) throws Exception { @@ -391,6 +401,7 @@ public class JavaEmitter implements GlueEmitter { } } + @Override public Iterator<FunctionSymbol> emitFunctions(List<FunctionSymbol> originalCFunctions) throws Exception { // Sometimes headers will have the same function prototype twice, once @@ -412,6 +423,7 @@ public class JavaEmitter implements GlueEmitter { ArrayList<FunctionSymbol> funcsToBind = new ArrayList<FunctionSymbol>(funcsToBindSet); // sort functions to make them easier to find in native code Collections.sort(funcsToBind, new Comparator<FunctionSymbol>() { + @Override public int compare(FunctionSymbol o1, FunctionSymbol o2) { return o1.getName().compareTo(o2.getName()); } @@ -739,6 +751,7 @@ public class JavaEmitter implements GlueEmitter { } + @Override public void endFunctions() throws Exception { if (!cfg.structsOnly()) { if (cfg.allStatic() || cfg.emitInterface()) { @@ -750,12 +763,16 @@ public class JavaEmitter implements GlueEmitter { } } + @Override public void beginStructLayout() throws Exception {} + @Override public void layoutStruct(CompoundType t) throws Exception { getLayout().layout(t); } + @Override public void endStructLayout() throws Exception {} + @Override public void beginStructs(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map<Type, Type> canonMap) throws Exception { @@ -763,6 +780,7 @@ public class JavaEmitter implements GlueEmitter { this.canonMap = canonMap; } + @Override public void emitStruct(CompoundType structType, String alternateName) throws Exception { String name = structType.getName(); if (name == null && alternateName != null) { @@ -1124,6 +1142,7 @@ public class JavaEmitter implements GlueEmitter { newWriter.close(); } } + @Override public void endStructs() throws Exception {} public static int addStrings2Buffer(StringBuilder buf, String sep, String first, Collection<String> col) { @@ -1576,6 +1595,7 @@ public class JavaEmitter implements GlueEmitter { final List<String> intfDocs = cfg.javadocForClass(cfg.className()); CodeGenUtils.EmissionCallback docEmitter = new CodeGenUtils.EmissionCallback() { + @Override public void emit(PrintWriter w) { for (Iterator<String> iter = intfDocs.iterator(); iter.hasNext(); ) { w.println(iter.next()); @@ -1606,6 +1626,7 @@ public class JavaEmitter implements GlueEmitter { final List<String> implDocs = cfg.javadocForClass(cfg.implClassName()); CodeGenUtils.EmissionCallback docEmitter = new CodeGenUtils.EmissionCallback() { + @Override public void emit(PrintWriter w) { for (Iterator<String> iter = implDocs.iterator(); iter.hasNext(); ) { w.println(iter.next()); diff --git a/src/java/com/jogamp/gluegen/JavaMethodBindingEmitter.java b/src/java/com/jogamp/gluegen/JavaMethodBindingEmitter.java index 81188a5..46ecab2 100644 --- a/src/java/com/jogamp/gluegen/JavaMethodBindingEmitter.java +++ b/src/java/com/jogamp/gluegen/JavaMethodBindingEmitter.java @@ -162,6 +162,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter { public boolean isForDirectBufferImplementation() { return forDirectBufferImplementation; } public boolean isForIndirectBufferAndArrayImplementation() { return forIndirectBufferAndArrayImplementation; } + @Override public String getName() { return binding.getName(); } @@ -234,6 +235,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter { this.forIndirectBufferAndArrayImplementation = indirect; } + @Override protected void emitReturnType(PrintWriter writer) { writer.print(getReturnTypeString(false)); } @@ -303,6 +305,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter { return erasedTypeString(binding.getJavaReturnType(), true) + "[]"; } + @Override protected void emitName(PrintWriter writer) { if (forImplementingMethodCall) { writer.print(getImplMethodName()); @@ -311,6 +314,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter { } } + @Override protected int emitArguments(PrintWriter writer) { boolean needComma = false; int numEmitted = 0; @@ -404,6 +408,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter { return getArgumentName(i) + "_offset"; } + @Override protected void emitBody(PrintWriter writer) { if (!emitBody) { writer.println(';'); @@ -804,6 +809,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter { * emitter java method. */ protected class DefaultCommentEmitter implements CommentEmitter { + @Override public void emit(FunctionEmitter emitter, PrintWriter writer) { emitBeginning(emitter, writer); emitBindingCSignature(((JavaMethodBindingEmitter)emitter).getBinding(), writer); diff --git a/src/java/com/jogamp/gluegen/ReferencedStructs.java b/src/java/com/jogamp/gluegen/ReferencedStructs.java index f88594e..50c39b8 100644 --- a/src/java/com/jogamp/gluegen/ReferencedStructs.java +++ b/src/java/com/jogamp/gluegen/ReferencedStructs.java @@ -54,6 +54,7 @@ public class ReferencedStructs implements TypeVisitor { return results.iterator(); } + @Override public void visitType(Type t) { if (t.isPointer()) { PointerType p = t.asPointer(); diff --git a/src/java/com/jogamp/gluegen/ant/GlueGenTask.java b/src/java/com/jogamp/gluegen/ant/GlueGenTask.java index 0b74bc3..a3d134f 100644 --- a/src/java/com/jogamp/gluegen/ant/GlueGenTask.java +++ b/src/java/com/jogamp/gluegen/ant/GlueGenTask.java @@ -371,6 +371,7 @@ public void setIncludeRefid(Reference reference) { * * @see org.apache.tools.ant.Task#execute() */ + @Override public void execute() throws BuildException { diff --git a/src/java/com/jogamp/gluegen/cgram/CSymbolTable.java b/src/java/com/jogamp/gluegen/cgram/CSymbolTable.java index 69ec0ed..ec2f979 100644 --- a/src/java/com/jogamp/gluegen/cgram/CSymbolTable.java +++ b/src/java/com/jogamp/gluegen/cgram/CSymbolTable.java @@ -114,6 +114,7 @@ public class CSymbolTable { } /** convert this table to a string */ + @Override public String toString() { StringBuilder buff = new StringBuilder(300); buff.append("CSymbolTable { \nCurrentScope: " + currentScopeAsString() + diff --git a/src/java/com/jogamp/gluegen/cgram/CToken.java b/src/java/com/jogamp/gluegen/cgram/CToken.java index 7bd48ad..cfa88fc 100644 --- a/src/java/com/jogamp/gluegen/cgram/CToken.java +++ b/src/java/com/jogamp/gluegen/cgram/CToken.java @@ -26,6 +26,7 @@ public class CToken extends antlr.CommonToken { tokenNumber = i; } + @Override public String toString() { return "CToken:" +"(" + hashCode() + ")" + "[" + getType() + "] "+ getText() + " line:" + getLine() + " source:" + source ; } diff --git a/src/java/com/jogamp/gluegen/cgram/LineObject.java b/src/java/com/jogamp/gluegen/cgram/LineObject.java index 4914759..31489fc 100644 --- a/src/java/com/jogamp/gluegen/cgram/LineObject.java +++ b/src/java/com/jogamp/gluegen/cgram/LineObject.java @@ -105,6 +105,7 @@ class LineObject { return treatAsC; } + @Override public String toString() { StringBuilder ret; ret = new StringBuilder("# " + line + " \"" + source + "\""); diff --git a/src/java/com/jogamp/gluegen/cgram/PreprocessorInfoChannel.java b/src/java/com/jogamp/gluegen/cgram/PreprocessorInfoChannel.java index 7cf64b0..3bc8056 100644 --- a/src/java/com/jogamp/gluegen/cgram/PreprocessorInfoChannel.java +++ b/src/java/com/jogamp/gluegen/cgram/PreprocessorInfoChannel.java @@ -50,6 +50,7 @@ public class PreprocessorInfoChannel return lines; } + @Override public String toString() { StringBuilder sb = new StringBuilder("PreprocessorInfoChannel:\n"); diff --git a/src/java/com/jogamp/gluegen/cgram/TNode.java b/src/java/com/jogamp/gluegen/cgram/TNode.java index 00c4ffa..2840d01 100644 --- a/src/java/com/jogamp/gluegen/cgram/TNode.java +++ b/src/java/com/jogamp/gluegen/cgram/TNode.java @@ -51,6 +51,7 @@ public class TNode extends CommonAST { } +@Override public void initialize(Token token) { CToken tok = (CToken) token; setText(tok.getText()); @@ -59,6 +60,7 @@ public void initialize(Token token) { setAttribute("source", tok.getSource()); setAttribute("tokenNumber", new Integer(tok.getTokenNumber())); } +@Override public void initialize(AST tr) { TNode t = (TNode) tr; setText(t.getText()); @@ -70,9 +72,11 @@ public void initialize(AST tr) { /** Get the token type for this node */ + @Override public int getType() { return ttype; } /** Set the token type for this node */ + @Override public void setType(int ttype_) { ttype = ttype_; } @@ -146,9 +150,11 @@ public void initialize(AST tr) { } /** Get the token text for this node */ + @Override public String getText() { return text; } /** Set the token text for this node */ + @Override public void setText(String text_) { text = text_; } @@ -303,6 +309,7 @@ public void initialize(AST tr) { /** return a short string representation of the node */ + @Override public String toString() { StringBuilder str = new StringBuilder( getNameForType(getType()) + "[" + getText() + ", " + "]"); diff --git a/src/java/com/jogamp/gluegen/cgram/TNodeFactory.java b/src/java/com/jogamp/gluegen/cgram/TNodeFactory.java index 2984a84..ccbd233 100644 --- a/src/java/com/jogamp/gluegen/cgram/TNodeFactory.java +++ b/src/java/com/jogamp/gluegen/cgram/TNodeFactory.java @@ -9,11 +9,13 @@ import antlr.collections.AST; public class TNodeFactory extends ASTFactory { /** Create a new ampty AST node */ + @Override public AST create() { return new TNode(); } /** Create a new AST node from type and text */ + @Override public AST create(int ttype, String text) { AST ast = new TNode(); ast.setType(ttype); @@ -22,6 +24,7 @@ public class TNodeFactory extends ASTFactory { } /** Create a new AST node from an existing AST node */ + @Override public AST create(AST ast) { AST newast = new TNode(); newast.setType(ast.getType()); diff --git a/src/java/com/jogamp/gluegen/cgram/types/ArrayType.java b/src/java/com/jogamp/gluegen/cgram/types/ArrayType.java index bad63db..6cedc9c 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/ArrayType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/ArrayType.java @@ -129,6 +129,7 @@ public class ArrayType extends MemoryLayoutType implements Cloneable { elementType.visit(arg); } + @Override Type newCVVariant(int cvAttributes) { return new ArrayType(elementType, getSize(), length, cvAttributes); } diff --git a/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java b/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java index 4582a81..803cb50 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java @@ -71,6 +71,7 @@ public abstract class CompoundType extends MemoryLayoutType implements Cloneable } } + @Override public Object clone() { CompoundType n = (CompoundType) super.clone(); if(null!=this.fields) { diff --git a/src/java/com/jogamp/gluegen/cgram/types/DoubleType.java b/src/java/com/jogamp/gluegen/cgram/types/DoubleType.java index e95ffb9..278b3d8 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/DoubleType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/DoubleType.java @@ -62,6 +62,7 @@ public class DoubleType extends PrimitiveType implements Cloneable { return this; } + @Override Type newCVVariant(int cvAttributes) { return new DoubleType(getName(), getSize(), cvAttributes); } diff --git a/src/java/com/jogamp/gluegen/cgram/types/EnumType.java b/src/java/com/jogamp/gluegen/cgram/types/EnumType.java index 9e142bd..d02388b 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/EnumType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/EnumType.java @@ -85,6 +85,7 @@ public class EnumType extends IntType implements Cloneable { this.underlyingType = underlyingType; } + @Override public Object clone() { EnumType n = (EnumType) super.clone(); if(null!=this.underlyingType) { diff --git a/src/java/com/jogamp/gluegen/cgram/types/FloatType.java b/src/java/com/jogamp/gluegen/cgram/types/FloatType.java index dff7a00..ef1b4b9 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/FloatType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/FloatType.java @@ -61,6 +61,7 @@ public class FloatType extends PrimitiveType implements Cloneable { @Override public FloatType asFloat() { return this; } + @Override Type newCVVariant(int cvAttributes) { return new FloatType(getName(), getSize(), cvAttributes); } diff --git a/src/java/com/jogamp/gluegen/cgram/types/FunctionType.java b/src/java/com/jogamp/gluegen/cgram/types/FunctionType.java index c32d184..bb62eba 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/FunctionType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/FunctionType.java @@ -54,6 +54,7 @@ public class FunctionType extends Type implements Cloneable { this.returnType = returnType; } + @Override public Object clone() { FunctionType n = (FunctionType) super.clone(); if(null!=this.argumentTypes) { @@ -195,6 +196,7 @@ public class FunctionType extends Type implements Cloneable { } } + @Override Type newCVVariant(int cvAttributes) { // Functions don't have const/volatile attributes return this; diff --git a/src/java/com/jogamp/gluegen/cgram/types/IntType.java b/src/java/com/jogamp/gluegen/cgram/types/IntType.java index b37e741..ffc5696 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/IntType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/IntType.java @@ -87,6 +87,7 @@ public class IntType extends PrimitiveType implements Cloneable { return getCVAttributesString() + ((isUnsigned() & (!typedefedUnsigned)) ? "unsigned " : "") + getName(); } + @Override Type newCVVariant(int cvAttributes) { return new IntType(getName(), getSize(), isUnsigned(), cvAttributes, typedefedUnsigned); } diff --git a/src/java/com/jogamp/gluegen/cgram/types/PointerType.java b/src/java/com/jogamp/gluegen/cgram/types/PointerType.java index 92544c5..4922d28 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/PointerType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/PointerType.java @@ -153,6 +153,7 @@ public class PointerType extends Type implements Cloneable { targetType.visit(arg); } + @Override Type newCVVariant(int cvAttributes) { return new PointerType(getSize(), targetType, cvAttributes, hasTypedefedName, (hasTypedefedName ? getName() : null)); } diff --git a/src/java/com/jogamp/gluegen/cgram/types/SizeThunk.java b/src/java/com/jogamp/gluegen/cgram/types/SizeThunk.java index b40d4f3..021fa90 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/SizeThunk.java +++ b/src/java/com/jogamp/gluegen/cgram/types/SizeThunk.java @@ -53,6 +53,7 @@ public abstract class SizeThunk implements Cloneable { // Private constructor because there are only a few of these private SizeThunk(boolean fixedNativeSize) { this.fixedNativeSize = fixedNativeSize; } + @Override public Object clone() { try { return super.clone(); @@ -67,81 +68,99 @@ public abstract class SizeThunk implements Cloneable { public abstract long computeAlignment(MachineDescription machDesc); public static final SizeThunk INT8 = new SizeThunk(true) { + @Override public long computeSize(MachineDescription machDesc) { return machDesc.int8SizeInBytes(); } + @Override public long computeAlignment(MachineDescription machDesc) { return machDesc.int8AlignmentInBytes(); } }; public static final SizeThunk INT16 = new SizeThunk(true) { + @Override public long computeSize(MachineDescription machDesc) { return machDesc.int16SizeInBytes(); } + @Override public long computeAlignment(MachineDescription machDesc) { return machDesc.int16AlignmentInBytes(); } }; public static final SizeThunk INT32 = new SizeThunk(true) { + @Override public long computeSize(MachineDescription machDesc) { return machDesc.int32SizeInBytes(); } + @Override public long computeAlignment(MachineDescription machDesc) { return machDesc.int32AlignmentInBytes(); } }; public static final SizeThunk INTxx = new SizeThunk(false) { + @Override public long computeSize(MachineDescription machDesc) { return machDesc.intSizeInBytes(); } + @Override public long computeAlignment(MachineDescription machDesc) { return machDesc.intAlignmentInBytes(); } }; public static final SizeThunk LONG = new SizeThunk(false) { + @Override public long computeSize(MachineDescription machDesc) { return machDesc.longSizeInBytes(); } + @Override public long computeAlignment(MachineDescription machDesc) { return machDesc.longAlignmentInBytes(); } }; public static final SizeThunk INT64 = new SizeThunk(true) { + @Override public long computeSize(MachineDescription machDesc) { return machDesc.int64SizeInBytes(); } + @Override public long computeAlignment(MachineDescription machDesc) { return machDesc.int64AlignmentInBytes(); } }; public static final SizeThunk FLOAT = new SizeThunk(true) { + @Override public long computeSize(MachineDescription machDesc) { return machDesc.floatSizeInBytes(); } + @Override public long computeAlignment(MachineDescription machDesc) { return machDesc.floatAlignmentInBytes(); } }; public static final SizeThunk DOUBLE = new SizeThunk(true) { + @Override public long computeSize(MachineDescription machDesc) { return machDesc.doubleSizeInBytes(); } + @Override public long computeAlignment(MachineDescription machDesc) { return machDesc.doubleAlignmentInBytes(); } }; public static final SizeThunk POINTER = new SizeThunk(false) { + @Override public long computeSize(MachineDescription machDesc) { return machDesc.pointerSizeInBytes(); } + @Override public long computeAlignment(MachineDescription machDesc) { return machDesc.pointerAlignmentInBytes(); } @@ -152,9 +171,11 @@ public abstract class SizeThunk implements Cloneable { public static SizeThunk add(final SizeThunk thunk1, final SizeThunk thunk2) { return new SizeThunk(false) { + @Override public long computeSize(MachineDescription machDesc) { return thunk1.computeSize(machDesc) + thunk2.computeSize(machDesc); } + @Override public long computeAlignment(MachineDescription machDesc) { final long thunk1A = thunk1.computeAlignment(machDesc); final long thunk2A = thunk2.computeAlignment(machDesc); @@ -166,9 +187,11 @@ public abstract class SizeThunk implements Cloneable { public static SizeThunk mul(final SizeThunk thunk1, final SizeThunk thunk2) { return new SizeThunk(false) { + @Override public long computeSize(MachineDescription machDesc) { return thunk1.computeSize(machDesc) * thunk2.computeSize(machDesc); } + @Override public long computeAlignment(MachineDescription machDesc) { final long thunk1A = thunk1.computeAlignment(machDesc); final long thunk2A = thunk2.computeAlignment(machDesc); @@ -180,6 +203,7 @@ public abstract class SizeThunk implements Cloneable { public static SizeThunk align(final SizeThunk offsetThunk, final SizeThunk alignmentThunk) { return new SizeThunk(false) { + @Override public long computeSize(MachineDescription machDesc) { // x % 2n == x & (2n - 1) // remainder = net_size & ( alignment - 1 ) @@ -194,6 +218,7 @@ public abstract class SizeThunk implements Cloneable { return size + padding; } + @Override public long computeAlignment(MachineDescription machDesc) { final long thunk1A = offsetThunk.computeAlignment(machDesc); final long thunk2A = alignmentThunk.computeAlignment(machDesc); @@ -205,9 +230,11 @@ public abstract class SizeThunk implements Cloneable { public static SizeThunk max(final SizeThunk thunk1, final SizeThunk thunk2) { return new SizeThunk(false) { + @Override public long computeSize(MachineDescription machDesc) { return Math.max(thunk1.computeSize(machDesc), thunk2.computeSize(machDesc)); } + @Override public long computeAlignment(MachineDescription machDesc) { final long thunk1A = thunk1.computeAlignment(machDesc); final long thunk2A = thunk2.computeAlignment(machDesc); @@ -218,9 +245,11 @@ public abstract class SizeThunk implements Cloneable { public static SizeThunk constant(final int constant) { return new SizeThunk(false) { + @Override public long computeSize(MachineDescription machDesc) { return constant; } + @Override public long computeAlignment(MachineDescription machDesc) { return 1; // no alignment for constants } diff --git a/src/java/com/jogamp/gluegen/cgram/types/StructType.java b/src/java/com/jogamp/gluegen/cgram/types/StructType.java index 74fca7c..da58a5f 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/StructType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/StructType.java @@ -45,9 +45,12 @@ public class StructType extends CompoundType { return super.equals(arg); } + @Override public final boolean isStruct() { return true; } + @Override public final boolean isUnion() { return false; } + @Override Type newCVVariant(int cvAttributes) { StructType t = new StructType(getName(), getSize(), cvAttributes, getStructName()); t.setFields(getFields()); diff --git a/src/java/com/jogamp/gluegen/cgram/types/Type.java b/src/java/com/jogamp/gluegen/cgram/types/Type.java index cffbb67..a403de6 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/Type.java +++ b/src/java/com/jogamp/gluegen/cgram/types/Type.java @@ -63,6 +63,7 @@ public abstract class Type implements Cloneable { hasTypedefName = false; } + @Override public Object clone() { try { return super.clone(); diff --git a/src/java/com/jogamp/gluegen/cgram/types/UnionType.java b/src/java/com/jogamp/gluegen/cgram/types/UnionType.java index 857507c..36b4fdb 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/UnionType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/UnionType.java @@ -45,9 +45,12 @@ public class UnionType extends CompoundType { return super.equals(arg); } + @Override public final boolean isStruct() { return false; } + @Override public final boolean isUnion() { return true; } + @Override Type newCVVariant(int cvAttributes) { UnionType t = new UnionType(getName(), getSize(), cvAttributes, getStructName()); t.setFields(getFields()); diff --git a/src/java/com/jogamp/gluegen/cgram/types/VoidType.java b/src/java/com/jogamp/gluegen/cgram/types/VoidType.java index 1f76e70..afde0d2 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/VoidType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/VoidType.java @@ -54,6 +54,7 @@ public class VoidType extends Type implements Cloneable { return this; } + @Override Type newCVVariant(int cvAttributes) { return new VoidType(getName(), cvAttributes); } diff --git a/src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java b/src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java index 14b15d2..3341e45 100644 --- a/src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java +++ b/src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java @@ -197,6 +197,7 @@ public class ProcAddressConfiguration extends JavaConfiguration { msgFmt = new MessageFormat(fmt); } + @Override String convert(String funcName) { StringBuffer buf = new StringBuffer(); msgFmt.format(new Object[]{funcName}, buf, null); @@ -212,6 +213,7 @@ public class ProcAddressConfiguration extends JavaConfiguration { this.str = str; } + @Override String convert(String funcName) { return str; } @@ -225,6 +227,7 @@ public class ProcAddressConfiguration extends JavaConfiguration { this.children = children; } + @Override String convert(String funcName) { StringBuilder res = new StringBuilder(); for (ConvNode node : children) { @@ -244,6 +247,7 @@ public class ProcAddressConfiguration extends JavaConfiguration { this.child = child; } + @Override public String convert(String funcName) { if (upperCase) { return child.convert(funcName).toUpperCase(); diff --git a/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java b/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java index f54d5db..727d0b4 100644 --- a/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java +++ b/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java @@ -90,6 +90,7 @@ public abstract class ProcAddressTable { static { AccessController.doPrivileged(new PrivilegedAction<Object>() { + @Override public Object run() { DEBUG = (System.getProperty("jogamp.debug.ProcAddressHelper") != null); if (DEBUG) { @@ -206,6 +207,7 @@ public abstract class ProcAddressTable { */ private final Field fieldForFunctionInSec(final String name) throws IllegalArgumentException { return AccessController.doPrivileged(new PrivilegedAction<Field>() { + @Override public Field run() { try { final Field addressField = ProcAddressTable.this.getClass().getDeclaredField(PROCADDRESS_VAR_PREFIX + name); @@ -340,6 +342,7 @@ public abstract class ProcAddressTable { } private static class One2OneResolver implements FunctionAddressResolver { + @Override public long resolve(String name, DynamicLookupHelper lookup) { return lookup.dynamicLookupFunction(name); } |