diff options
author | Sven Gothel <[email protected]> | 2014-07-03 16:06:47 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-03 16:06:47 +0200 |
commit | df9ff7f340a5ab4e07efc613f5f264eeae63d4c7 (patch) | |
tree | 239ae276b82024b140428e6c0fe5d739fdd686a4 /src/java/jogamp/common/os | |
parent | eb47aaba63e3b1bf55f274a0f338f1010a017ae4 (diff) |
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Add final modifier to private fields
- Add final modifier to method parameters
- Add final modifier to local variables
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Remove trailing white spaces on all lines
Diffstat (limited to 'src/java/jogamp/common/os')
20 files changed, 145 insertions, 151 deletions
diff --git a/src/java/jogamp/common/os/AndroidUtils.java b/src/java/jogamp/common/os/AndroidUtils.java index bb09ba9..299dbc5 100644 --- a/src/java/jogamp/common/os/AndroidUtils.java +++ b/src/java/jogamp/common/os/AndroidUtils.java @@ -58,7 +58,7 @@ public class AndroidUtils { * via {@link jogamp.common.os.android.StaticContext#init(android.content.Context) StaticContext.init(..)}, * otherwise the found package version code of <code>packageName</code> is returned. */ - public static final int getPackageInfoVersionCode(String packageName) { + public static final int getPackageInfoVersionCode(final String packageName) { if(null != androidGetPackageInfoVersionCodeMethod) { return ((Integer) ReflectionUtil.callMethod(null, androidGetPackageInfoVersionCodeMethod, packageName)).intValue(); } @@ -70,7 +70,7 @@ public class AndroidUtils { * via {@link jogamp.common.os.android.StaticContext#init(android.content.Context) StaticContext.init(..)}, * otherwise the found package version name of <code>packageName</code> is returned. */ - public static final String getPackageInfoVersionName(String packageName) { + public static final String getPackageInfoVersionName(final String packageName) { if(null != androidGetPackageInfoVersionNameMethod) { return (String) ReflectionUtil.callMethod(null, androidGetPackageInfoVersionNameMethod, packageName); } diff --git a/src/java/jogamp/common/os/BionicDynamicLinkerImpl.java b/src/java/jogamp/common/os/BionicDynamicLinkerImpl.java index 09057f8..b293776 100644 --- a/src/java/jogamp/common/os/BionicDynamicLinkerImpl.java +++ b/src/java/jogamp/common/os/BionicDynamicLinkerImpl.java @@ -44,17 +44,17 @@ public final class BionicDynamicLinkerImpl extends UnixDynamicLinkerImpl { private static final int RTLD_GLOBAL = 0x00002; @Override - public final long openLibraryLocal(String pathname, boolean debug) throws SecurityException { + public final long openLibraryLocal(final String pathname, final boolean debug) throws SecurityException { return this.openLibraryImpl(pathname, RTLD_LAZY | RTLD_LOCAL, debug); } @Override - public final long openLibraryGlobal(String pathname, boolean debug) throws SecurityException { + public final long openLibraryGlobal(final String pathname, final boolean debug) throws SecurityException { return this.openLibraryImpl(pathname, RTLD_LAZY | RTLD_GLOBAL, debug); } @Override - public final long lookupSymbolGlobal(String symbolName) throws SecurityException { + public final long lookupSymbolGlobal(final String symbolName) throws SecurityException { return this.lookupSymbolGlobalImpl(RTLD_DEFAULT, symbolName); } diff --git a/src/java/jogamp/common/os/DynamicLinkerImpl.java b/src/java/jogamp/common/os/DynamicLinkerImpl.java index dde4d5c..392d906 100644 --- a/src/java/jogamp/common/os/DynamicLinkerImpl.java +++ b/src/java/jogamp/common/os/DynamicLinkerImpl.java @@ -41,7 +41,7 @@ import com.jogamp.common.util.LongObjectHashMap; private final LongObjectHashMap libHandle2Name = new LongObjectHashMap( 16 /* initialCapacity */ ); protected static final class LibRef { - public LibRef(String name) { + public LibRef(final String name) { this.name = name; this.refCount = 1; } @@ -57,11 +57,11 @@ import com.jogamp.common.util.LongObjectHashMap; private int refCount; } - protected final synchronized LibRef getLibRef(long handle) { + protected final synchronized LibRef getLibRef(final long handle) { return (LibRef) libHandle2Name.get(handle); } - protected final synchronized LibRef incrLibRefCount(long handle, String libName) { + protected final synchronized LibRef incrLibRefCount(final long handle, final String libName) { LibRef libRef = getLibRef(handle); if( null == libRef ) { libRef = new LibRef(libName); @@ -75,8 +75,8 @@ import com.jogamp.common.util.LongObjectHashMap; return libRef; } - protected final synchronized LibRef decrLibRefCount(long handle) { - LibRef libRef = getLibRef(handle); + protected final synchronized LibRef decrLibRefCount(final long handle) { + final LibRef libRef = getLibRef(handle); if( null != libRef ) { if( 0 == libRef.decrRefCount() ) { libHandle2Name.remove(handle); diff --git a/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java b/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java index b2f0f31..0fdfc8b 100644 --- a/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java +++ b/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java @@ -42,17 +42,17 @@ public final class MacOSXDynamicLinkerImpl extends UnixDynamicLinkerImpl { private static final int RTLD_GLOBAL = 0x00008; @Override - public final long openLibraryLocal(String pathname, boolean debug) throws SecurityException { + public final long openLibraryLocal(final String pathname, final boolean debug) throws SecurityException { return this.openLibraryImpl(pathname, RTLD_LAZY | RTLD_LOCAL, debug); } @Override - public final long openLibraryGlobal(String pathname, boolean debug) throws SecurityException { + public final long openLibraryGlobal(final String pathname, final boolean debug) throws SecurityException { return this.openLibraryImpl(pathname, RTLD_LAZY | RTLD_GLOBAL, debug); } @Override - public final long lookupSymbolGlobal(String symbolName) throws SecurityException { + public final long lookupSymbolGlobal(final String symbolName) throws SecurityException { return this.lookupSymbolGlobalImpl(RTLD_DEFAULT, symbolName); } diff --git a/src/java/jogamp/common/os/MachineDescriptionRuntime.java b/src/java/jogamp/common/os/MachineDescriptionRuntime.java index 254cda2..e62c914 100644 --- a/src/java/jogamp/common/os/MachineDescriptionRuntime.java +++ b/src/java/jogamp/common/os/MachineDescriptionRuntime.java @@ -131,11 +131,11 @@ public class MachineDescriptionRuntime { private static MachineDescription getRuntimeImpl() { try { Platform.initSingleton(); // loads native gluegen-rt library - } catch (UnsatisfiedLinkError err) { + } catch (final UnsatisfiedLinkError err) { return null; } - int pointerSizeInBytes = getPointerSizeInBytesImpl(); + final int pointerSizeInBytes = getPointerSizeInBytesImpl(); switch(pointerSizeInBytes) { case 4: case 8: diff --git a/src/java/jogamp/common/os/PlatformPropsImpl.java b/src/java/jogamp/common/os/PlatformPropsImpl.java index 1b9128d..61a5369 100644 --- a/src/java/jogamp/common/os/PlatformPropsImpl.java +++ b/src/java/jogamp/common/os/PlatformPropsImpl.java @@ -106,7 +106,7 @@ public abstract class PlatformPropsImpl { usOff = 1; } if( 0 < usIdx ) { - final String buildS = Platform.JAVA_VERSION.substring(usIdx+usOff); + final String buildS = PlatformPropsImpl.JAVA_VERSION.substring(usIdx+usOff); final VersionNumber update = new VersionNumber(buildS); JAVA_VERSION_UPDATE = update.getMajor(); } else { @@ -251,7 +251,7 @@ public abstract class PlatformPropsImpl { Class.forName("java.nio.LongBuffer"); Class.forName("java.nio.DoubleBuffer"); return true; - } catch(ClassNotFoundException ex) { + } catch(final ClassNotFoundException ex) { // continue with Java SE check } @@ -259,9 +259,9 @@ public abstract class PlatformPropsImpl { } private static final boolean queryIsLittleEndianImpl() { - ByteBuffer tst_b = Buffers.newDirectByteBuffer(Buffers.SIZEOF_INT); // 32bit in native order - IntBuffer tst_i = tst_b.asIntBuffer(); - ShortBuffer tst_s = tst_b.asShortBuffer(); + final ByteBuffer tst_b = Buffers.newDirectByteBuffer(Buffers.SIZEOF_INT); // 32bit in native order + final IntBuffer tst_i = tst_b.asIntBuffer(); + final ShortBuffer tst_s = tst_b.asShortBuffer(); tst_i.put(0, 0x0A0B0C0D); return 0x0C0D == tst_s.get(0); } @@ -356,7 +356,7 @@ public abstract class PlatformPropsImpl { if( null != file ) { res = queryABITypeImpl(file, cpuType, abiType); } - } catch(Throwable t) { + } catch(final Throwable t) { if(DEBUG) { t.printStackTrace(); } @@ -408,7 +408,7 @@ public abstract class PlatformPropsImpl { abiType[0] = ABIType.GENERIC_ABI; } res = eh; - } catch(Throwable t) { + } catch(final Throwable t) { if(DEBUG) { System.err.println("Caught: "+t.getMessage()); t.printStackTrace(); @@ -417,7 +417,7 @@ public abstract class PlatformPropsImpl { if(null != in) { try { in.close(); - } catch (IOException e) { } + } catch (final IOException e) { } } } if(DEBUG) { @@ -428,7 +428,7 @@ public abstract class PlatformPropsImpl { private static boolean checkFileReadAccess(final File file) { try { return file.isFile() && file.canRead(); - } catch (Throwable t) { } + } catch (final Throwable t) { } return false; } private static File findSysLib(final String libName) { diff --git a/src/java/jogamp/common/os/PosixDynamicLinkerImpl.java b/src/java/jogamp/common/os/PosixDynamicLinkerImpl.java index f2aa360..f929e03 100644 --- a/src/java/jogamp/common/os/PosixDynamicLinkerImpl.java +++ b/src/java/jogamp/common/os/PosixDynamicLinkerImpl.java @@ -38,17 +38,17 @@ public final class PosixDynamicLinkerImpl extends UnixDynamicLinkerImpl { private static final int RTLD_GLOBAL = 0x00100; @Override - public final long openLibraryLocal(String pathname, boolean debug) throws SecurityException { + public final long openLibraryLocal(final String pathname, final boolean debug) throws SecurityException { return this.openLibraryImpl(pathname, RTLD_LAZY | RTLD_LOCAL, debug); } @Override - public final long openLibraryGlobal(String pathname, boolean debug) throws SecurityException { + public final long openLibraryGlobal(final String pathname, final boolean debug) throws SecurityException { return this.openLibraryImpl(pathname, RTLD_LAZY | RTLD_GLOBAL, debug); } @Override - public final long lookupSymbolGlobal(String symbolName) throws SecurityException { + public final long lookupSymbolGlobal(final String symbolName) throws SecurityException { return this.lookupSymbolGlobalImpl(RTLD_DEFAULT, symbolName); } } diff --git a/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java b/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java index 7a0e3b0..59be76c 100644 --- a/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java +++ b/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java @@ -49,7 +49,7 @@ import com.jogamp.common.util.SecurityUtil; /** Interface to C language function: <br> <code> void * dlsym(void * , const char * ); </code> */ protected static native long dlsym(long arg0, java.lang.String arg1); - protected final long openLibraryImpl(String pathname, int dlSymFlags, boolean debug) throws SecurityException { + protected final long openLibraryImpl(final String pathname, final int dlSymFlags, final boolean debug) throws SecurityException { SecurityUtil.checkLinkPermission(pathname); final long handle = dlopen(pathname, dlSymFlags); if( 0 != handle ) { @@ -60,7 +60,7 @@ import com.jogamp.common.util.SecurityUtil; return handle; } - protected final long lookupSymbolGlobalImpl(long dlSymGlobalFlag, String symbolName) throws SecurityException { + protected final long lookupSymbolGlobalImpl(final long dlSymGlobalFlag, final String symbolName) throws SecurityException { SecurityUtil.checkAllLinkPermission(); final long addr = dlsym(dlSymGlobalFlag, symbolName); if(DEBUG_LOOKUP) { @@ -70,7 +70,7 @@ import com.jogamp.common.util.SecurityUtil; } @Override - public final long lookupSymbol(long libraryHandle, String symbolName) throws IllegalArgumentException { + public final long lookupSymbol(final long libraryHandle, final String symbolName) throws IllegalArgumentException { if( null == getLibRef( libraryHandle ) ) { throw new IllegalArgumentException("Library handle 0x"+Long.toHexString(libraryHandle)+" unknown."); } @@ -82,7 +82,7 @@ import com.jogamp.common.util.SecurityUtil; } @Override - public final void closeLibrary(long libraryHandle) throws IllegalArgumentException { + public final void closeLibrary(final long libraryHandle) throws IllegalArgumentException { if( null == decrLibRefCount( libraryHandle ) ) { throw new IllegalArgumentException("Library handle 0x"+Long.toHexString(libraryHandle)+" unknown."); } diff --git a/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java b/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java index 76bb2f8..de69d0c 100644 --- a/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java +++ b/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java @@ -44,27 +44,27 @@ public final class WindowsDynamicLinkerImpl extends DynamicLinkerImpl { private static native long LoadLibraryW(java.lang.String lpLibFileName); @Override - public final long openLibraryLocal(String libraryName, boolean debug) throws SecurityException { + public final long openLibraryLocal(final String libraryName, final boolean debug) throws SecurityException { // How does that work under Windows ? // Don't know .. so it's an alias for the time being return openLibraryGlobal(libraryName, debug); } @Override - public final long openLibraryGlobal(String libraryName, boolean debug) throws SecurityException { + public final long openLibraryGlobal(final String libraryName, final boolean debug) throws SecurityException { SecurityUtil.checkLinkPermission(libraryName); final long handle = LoadLibraryW(libraryName); if( 0 != handle ) { incrLibRefCount(handle, libraryName); } else if ( DEBUG || debug ) { - int err = GetLastError(); + final int err = GetLastError(); System.err.println("LoadLibraryW \""+libraryName+"\" failed, error code: 0x"+Integer.toHexString(err)+", "+err); } return handle; } @Override - public final long lookupSymbolGlobal(String symbolName) throws SecurityException { + public final long lookupSymbolGlobal(final String symbolName) throws SecurityException { SecurityUtil.checkAllLinkPermission(); if(DEBUG_LOOKUP) { System.err.println("lookupSymbolGlobal: Not supported on Windows"); @@ -74,7 +74,7 @@ public final class WindowsDynamicLinkerImpl extends DynamicLinkerImpl { } @Override - public final long lookupSymbol(long libraryHandle, String symbolName) throws IllegalArgumentException { + public final long lookupSymbol(final long libraryHandle, final String symbolName) throws IllegalArgumentException { if( null == getLibRef( libraryHandle ) ) { throw new IllegalArgumentException("Library handle 0x"+Long.toHexString(libraryHandle)+" unknown."); } @@ -97,7 +97,7 @@ public final class WindowsDynamicLinkerImpl extends DynamicLinkerImpl { } @Override - public final void closeLibrary(long libraryHandle) throws IllegalArgumentException { + public final void closeLibrary(final long libraryHandle) throws IllegalArgumentException { if( null == decrLibRefCount( libraryHandle ) ) { throw new IllegalArgumentException("Library handle 0x"+Long.toHexString(libraryHandle)+" unknown."); } diff --git a/src/java/jogamp/common/os/android/AndroidUtilsImpl.java b/src/java/jogamp/common/os/android/AndroidUtilsImpl.java index fc8d606..8dcdd6f 100644 --- a/src/java/jogamp/common/os/android/AndroidUtilsImpl.java +++ b/src/java/jogamp/common/os/android/AndroidUtilsImpl.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. @@ -36,39 +36,39 @@ import android.util.Log; public class AndroidUtilsImpl { private static boolean DEBUG = false; - - public static final PackageInfo getPackageInfo(String packageName) { + + public static final PackageInfo getPackageInfo(final String packageName) { return getPackageInfo(StaticContext.getContext(), packageName); } - - public static final PackageInfo getPackageInfo(Context ctx, String packageName) { + + public static final PackageInfo getPackageInfo(final Context ctx, final String packageName) { if(null != ctx) { try { final PackageInfo pi = ctx.getPackageManager().getPackageInfo(packageName, PackageManager.GET_META_DATA); if(DEBUG) Log.d(MD.TAG, "getPackageInfo("+packageName+"): "+pi); return pi; - } catch (Exception e) { if(DEBUG) { Log.d(MD.TAG, "getPackageInfo("+packageName+")", e); } } + } catch (final Exception e) { if(DEBUG) { Log.d(MD.TAG, "getPackageInfo("+packageName+")", e); } } } if(DEBUG) Log.d(MD.TAG, "getPackageInfo("+packageName+"): NULL"); return null; } - - public static final int getPackageInfoVersionCode(String packageName) { + + public static final int getPackageInfoVersionCode(final String packageName) { final PackageInfo pInfo = getPackageInfo(packageName); return ( null != pInfo ) ? pInfo.versionCode : -1 ; } - - public static final String getPackageInfoVersionName(String packageName) { + + public static final String getPackageInfoVersionName(final String packageName) { final PackageInfo pInfo = getPackageInfo(packageName); final String s = ( null != pInfo ) ? pInfo.versionName : null ; if(DEBUG) Log.d(MD.TAG, "getPackageInfoVersionName("+packageName+"): "+s); return s; } - + /** - * @return null if no Android Context is registered - * via {@link jogamp.common.os.android.StaticContext#init(android.content.Context) StaticContext.init(..)}, - * otherwise the context relative world readable <code>temp</code> directory returned. + * @return null if no Android Context is registered + * via {@link jogamp.common.os.android.StaticContext#init(android.content.Context) StaticContext.init(..)}, + * otherwise the context relative world readable <code>temp</code> directory returned. */ public static File getTempRoot() throws SecurityException, RuntimeException @@ -86,5 +86,5 @@ public class AndroidUtilsImpl { } return null; } - + } diff --git a/src/java/jogamp/common/os/android/GluegenVersionActivity.java b/src/java/jogamp/common/os/android/GluegenVersionActivity.java index 5db3213..c216867 100644 --- a/src/java/jogamp/common/os/android/GluegenVersionActivity.java +++ b/src/java/jogamp/common/os/android/GluegenVersionActivity.java @@ -28,6 +28,8 @@ package jogamp.common.os.android; +import jogamp.common.os.PlatformPropsImpl; + import com.jogamp.common.GlueGenVersion; import com.jogamp.common.os.Platform; import com.jogamp.common.util.VersionUtil; @@ -42,7 +44,7 @@ public class GluegenVersionActivity extends Activity { TextView tv = null; @Override - public void onCreate(Bundle savedInstanceState) { + public void onCreate(final Bundle savedInstanceState) { Log.d(MD.TAG, "onCreate - S"); super.onCreate(savedInstanceState); StaticContext.init(this.getApplicationContext()); @@ -54,7 +56,7 @@ public class GluegenVersionActivity extends Activity { scroller.addView(tv); setContentView(scroller); - tv.setText(VersionUtil.getPlatformInfo()+Platform.NEWLINE+GlueGenVersion.getInstance()+Platform.NEWLINE+Platform.NEWLINE); + tv.setText(VersionUtil.getPlatformInfo()+PlatformPropsImpl.NEWLINE+GlueGenVersion.getInstance()+PlatformPropsImpl.NEWLINE+PlatformPropsImpl.NEWLINE); Log.d(MD.TAG, "onCreate - X"); } @@ -63,7 +65,7 @@ public class GluegenVersionActivity extends Activity { Log.d(MD.TAG, "onStart - S"); super.onStart(); if(null != tv) { - tv.append("> started"+Platform.NEWLINE); + tv.append("> started"+PlatformPropsImpl.NEWLINE); } Log.d(MD.TAG, "onStart - X"); } @@ -73,7 +75,7 @@ public class GluegenVersionActivity extends Activity { Log.d(MD.TAG, "onRestart - S"); super.onRestart(); if(null != tv) { - tv.append("> restarted"+Platform.NEWLINE); + tv.append("> restarted"+PlatformPropsImpl.NEWLINE); } Log.d(MD.TAG, "onRestart - X"); } @@ -82,7 +84,7 @@ public class GluegenVersionActivity extends Activity { public void onResume() { Log.d(MD.TAG, "onResume - S"); if(null != tv) { - tv.append("> resumed"+Platform.NEWLINE); + tv.append("> resumed"+PlatformPropsImpl.NEWLINE); } super.onResume(); Log.d(MD.TAG, "onResume - X"); @@ -92,7 +94,7 @@ public class GluegenVersionActivity extends Activity { public void onPause() { Log.d(MD.TAG, "onPause - S"); if(null != tv) { - tv.append("> paused"+Platform.NEWLINE); + tv.append("> paused"+PlatformPropsImpl.NEWLINE); } super.onPause(); // Log.d(MD.TAG, "onPause - x"); @@ -104,7 +106,7 @@ public class GluegenVersionActivity extends Activity { public void onStop() { Log.d(MD.TAG, "onStop - S"); if(null != tv) { - tv.append("> stopped"+Platform.NEWLINE); + tv.append("> stopped"+PlatformPropsImpl.NEWLINE); } super.onStop(); Log.d(MD.TAG, "onStop - X"); @@ -114,7 +116,7 @@ public class GluegenVersionActivity extends Activity { public void onDestroy() { Log.d(MD.TAG, "onDestroy - S"); if(null != tv) { - tv.append("> destroyed"+Platform.NEWLINE); + tv.append("> destroyed"+PlatformPropsImpl.NEWLINE); } Log.d(MD.TAG, "onDestroy - x"); StaticContext.clear(); diff --git a/src/java/jogamp/common/os/android/MD.java b/src/java/jogamp/common/os/android/MD.java index d6a2e48..4d0d631 100644 --- a/src/java/jogamp/common/os/android/MD.java +++ b/src/java/jogamp/common/os/android/MD.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. diff --git a/src/java/jogamp/common/os/android/StaticContext.java b/src/java/jogamp/common/os/android/StaticContext.java index 359e603..5585407 100644 --- a/src/java/jogamp/common/os/android/StaticContext.java +++ b/src/java/jogamp/common/os/android/StaticContext.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. @@ -34,27 +34,27 @@ import android.view.ViewGroup; public class StaticContext { private static Context appContext = null; private static ViewGroup contentViewGroup = null; - + private static boolean DEBUG = false; - + /** * Register Android application context for static usage. - * + * * @param appContext mandatory application Context * @throws RuntimeException if the context is already registered. */ - public static final synchronized void init(Context appContext) { + public static final synchronized void init(final Context appContext) { init(appContext, null); } - + /** * Register Android application context w/ a ViewGroup for static usage. - * + * * @param appContext mandatory application Context * @param contentViewGroup optional ViewGroup acting as the Window's ContentView, usually a FrameLayout instance. * @throws RuntimeException if the context is already registered. */ - public static final synchronized void init(Context appContext, ViewGroup contentViewGroup) { + public static final synchronized void init(final Context appContext, final ViewGroup contentViewGroup) { if(null != StaticContext.appContext) { throw new RuntimeException("Context already set"); } @@ -62,7 +62,7 @@ public class StaticContext { StaticContext.appContext = appContext; StaticContext.contentViewGroup = contentViewGroup; } - + /** * Unregister the Android application Context and ViewGroup */ @@ -71,15 +71,15 @@ public class StaticContext { appContext = null; contentViewGroup = null; } - + /** * Return the registered Android application Context * @return */ public static final synchronized Context getContext() { return appContext; - } - + } + /** * Return the registered Android ViewGroup acting as the Window's ContentView * @return diff --git a/src/java/jogamp/common/os/elf/Ehdr.java b/src/java/jogamp/common/os/elf/Ehdr.java index d787f67..e12ef4f 100644 --- a/src/java/jogamp/common/os/elf/Ehdr.java +++ b/src/java/jogamp/common/os/elf/Ehdr.java @@ -3,10 +3,6 @@ package jogamp.common.os.elf; -import java.nio.*; - -import com.jogamp.gluegen.runtime.*; -import com.jogamp.common.os.*; import com.jogamp.common.nio.*; import jogamp.common.os.MachineDescriptionRuntime; @@ -41,11 +37,11 @@ public class Ehdr { return create(Buffers.newDirectByteBuffer(size())); } - public static Ehdr create(java.nio.ByteBuffer buf) { + public static Ehdr create(final java.nio.ByteBuffer buf) { return new Ehdr(buf); } - Ehdr(java.nio.ByteBuffer buf) { + Ehdr(final java.nio.ByteBuffer buf) { accessor = new StructAccessor(buf); } @@ -53,14 +49,14 @@ public class Ehdr { return accessor.getBuffer(); } - public Ehdr setE_ident(byte[] val) { + public Ehdr setE_ident(final byte[] val) { accessor.setBytesAt(e_ident_offset[mdIdx], val); return this; } public byte[] getE_ident() { return accessor.getBytesAt(e_ident_offset[mdIdx], new byte[16]); } - public Ehdr setE_type(short val) { + public Ehdr setE_type(final short val) { accessor.setShortAt(e_type_offset[mdIdx], val); return this; } @@ -69,7 +65,7 @@ public class Ehdr { return accessor.getShortAt(e_type_offset[mdIdx]); } - public Ehdr setE_machine(short val) { + public Ehdr setE_machine(final short val) { accessor.setShortAt(e_machine_offset[mdIdx], val); return this; } @@ -78,7 +74,7 @@ public class Ehdr { return accessor.getShortAt(e_machine_offset[mdIdx]); } - public Ehdr setE_version(int val) { + public Ehdr setE_version(final int val) { accessor.setIntAt(e_version_offset[mdIdx], val); return this; } @@ -87,7 +83,7 @@ public class Ehdr { return accessor.getIntAt(e_version_offset[mdIdx]); } - public Ehdr setE_entry(long val) { + public Ehdr setE_entry(final long val) { accessor.setLongAt(e_entry_offset[mdIdx], val, MachineDescriptionRuntime.getStatic().md.longSizeInBytes()); return this; } @@ -96,7 +92,7 @@ public class Ehdr { return accessor.getLongAt(e_entry_offset[mdIdx], MachineDescriptionRuntime.getStatic().md.longSizeInBytes()); } - public Ehdr setE_phoff(long val) { + public Ehdr setE_phoff(final long val) { accessor.setLongAt(e_phoff_offset[mdIdx], val, MachineDescriptionRuntime.getStatic().md.longSizeInBytes()); return this; } @@ -105,7 +101,7 @@ public class Ehdr { return accessor.getLongAt(e_phoff_offset[mdIdx], MachineDescriptionRuntime.getStatic().md.longSizeInBytes()); } - public Ehdr setE_shoff(long val) { + public Ehdr setE_shoff(final long val) { accessor.setLongAt(e_shoff_offset[mdIdx], val, MachineDescriptionRuntime.getStatic().md.longSizeInBytes()); return this; } @@ -114,7 +110,7 @@ public class Ehdr { return accessor.getLongAt(e_shoff_offset[mdIdx], MachineDescriptionRuntime.getStatic().md.longSizeInBytes()); } - public Ehdr setE_flags(int val) { + public Ehdr setE_flags(final int val) { accessor.setIntAt(e_flags_offset[mdIdx], val); return this; } @@ -123,7 +119,7 @@ public class Ehdr { return accessor.getIntAt(e_flags_offset[mdIdx]); } - public Ehdr setE_ehsize(short val) { + public Ehdr setE_ehsize(final short val) { accessor.setShortAt(e_ehsize_offset[mdIdx], val); return this; } @@ -132,7 +128,7 @@ public class Ehdr { return accessor.getShortAt(e_ehsize_offset[mdIdx]); } - public Ehdr setE_phentsize(short val) { + public Ehdr setE_phentsize(final short val) { accessor.setShortAt(e_phentsize_offset[mdIdx], val); return this; } @@ -141,7 +137,7 @@ public class Ehdr { return accessor.getShortAt(e_phentsize_offset[mdIdx]); } - public Ehdr setE_phnum(short val) { + public Ehdr setE_phnum(final short val) { accessor.setShortAt(e_phnum_offset[mdIdx], val); return this; } @@ -150,7 +146,7 @@ public class Ehdr { return accessor.getShortAt(e_phnum_offset[mdIdx]); } - public Ehdr setE_shentsize(short val) { + public Ehdr setE_shentsize(final short val) { accessor.setShortAt(e_shentsize_offset[mdIdx], val); return this; } @@ -159,7 +155,7 @@ public class Ehdr { return accessor.getShortAt(e_shentsize_offset[mdIdx]); } - public Ehdr setE_shnum(short val) { + public Ehdr setE_shnum(final short val) { accessor.setShortAt(e_shnum_offset[mdIdx], val); return this; } @@ -168,7 +164,7 @@ public class Ehdr { return accessor.getShortAt(e_shnum_offset[mdIdx]); } - public Ehdr setE_shstrndx(short val) { + public Ehdr setE_shstrndx(final short val) { accessor.setShortAt(e_shstrndx_offset[mdIdx], val); return this; } diff --git a/src/java/jogamp/common/os/elf/ElfHeader.java b/src/java/jogamp/common/os/elf/ElfHeader.java index f12ccad..3447107 100644 --- a/src/java/jogamp/common/os/elf/ElfHeader.java +++ b/src/java/jogamp/common/os/elf/ElfHeader.java @@ -358,7 +358,7 @@ public class ElfHeader { public static final short EM_MICROBLAZE = 189; public static final short EM_CUDA = 190; - public static final boolean isIdentityValid(byte[] ident) { + public static final boolean isIdentityValid(final byte[] ident) { return ELFMAG0 == ident[0] && ELFMAG1 == ident[1] && ELFMAG2 == ident[2] && @@ -381,7 +381,7 @@ public class ElfHeader { * @throws IOException if reading from the given input stream fails or less then ELF Header size bytes * @throws IllegalArgumentException if the given input stream does not represent an ELF Header */ - public static ElfHeader read(RandomAccessFile in) throws IOException, IllegalArgumentException { + public static ElfHeader read(final RandomAccessFile in) throws IOException, IllegalArgumentException { final int eh_sz = Ehdr.size(); final byte[] buf = new byte[eh_sz]; readBytes (in, buf, 0, eh_sz); @@ -394,7 +394,7 @@ public class ElfHeader { * @throws IllegalArgumentException if the given buffer does not represent an ELF Header * @throws IOException */ - ElfHeader(java.nio.ByteBuffer buf, RandomAccessFile in) throws IllegalArgumentException, IOException { + ElfHeader(final java.nio.ByteBuffer buf, final RandomAccessFile in) throws IllegalArgumentException, IOException { d = Ehdr.create(buf); if( !isIdentityValid(d.getE_ident()) ) { throw new IllegalArgumentException("Buffer is not an ELF Header"); @@ -530,7 +530,7 @@ public class ElfHeader { } /** Returns the 1st occurence of matching SectionHeader {@link SectionHeader#getType() type}, or null if not exists. */ - public final SectionHeader getSectionHeader(int type) { + public final SectionHeader getSectionHeader(final int type) { for(int i=0; i<sht.length; i++) { final SectionHeader sh = sht[i]; if( sh.getType() == type ) { @@ -541,7 +541,7 @@ public class ElfHeader { } /** Returns the 1st occurence of matching SectionHeader {@link SectionHeader#getName() name}, or null if not exists. */ - public final SectionHeader getSectionHeader(String name) { + public final SectionHeader getSectionHeader(final String name) { for(int i=0; i<sht.length; i++) { final SectionHeader sh = sht[i]; if( sh.getName().equals(name) ) { @@ -589,7 +589,7 @@ public class ElfHeader { ", abi[os "+getOSABI()+", vers "+getOSABIVersion()+"], flags["+toHexString(getFlags())+armFlagsS+"], type "+getType()+", sh-num "+sht.length+"]"; } - final SectionHeader[] readSectionHeaderTable(RandomAccessFile in) throws IOException, IllegalArgumentException { + final SectionHeader[] readSectionHeaderTable(final RandomAccessFile in) throws IOException, IllegalArgumentException { // positioning { final long off = d.getE_shoff(); // absolute offset @@ -607,7 +607,7 @@ public class ElfHeader { // Read 1st table 1st and use it's sh_size final byte[] buf0 = new byte[size]; readBytes(in, buf0, 0, size); - SectionHeader sh0 = new SectionHeader(buf0, 0, size, 0); + final SectionHeader sh0 = new SectionHeader(buf0, 0, size, 0); num = (int) sh0.d.getSh_size(); if( 0 >= num ) { throw new IllegalArgumentException("EHdr sh_num == 0 and 1st SHdr size == 0"); diff --git a/src/java/jogamp/common/os/elf/IOUtils.java b/src/java/jogamp/common/os/elf/IOUtils.java index 57b7a48..62b47db 100644 --- a/src/java/jogamp/common/os/elf/IOUtils.java +++ b/src/java/jogamp/common/os/elf/IOUtils.java @@ -36,11 +36,11 @@ import com.jogamp.common.util.Bitstream; class IOUtils { static final long MAX_INT_VALUE = ( Integer.MAX_VALUE & 0xffffffffL ) ; - static String toHexString(int i) { return "0x"+Integer.toHexString(i); } + static String toHexString(final int i) { return "0x"+Integer.toHexString(i); } - static String toHexString(long i) { return "0x"+Long.toHexString(i); } + static String toHexString(final long i) { return "0x"+Long.toHexString(i); } - static int shortToInt(short s) { + static int shortToInt(final short s) { return s & 0x0000ffff; } @@ -57,7 +57,7 @@ class IOUtils { in.readFully(out, offset, len); } - static void seek(final RandomAccessFile in, long newPos) throws IOException { + static void seek(final RandomAccessFile in, final long newPos) throws IOException { in.seek(newPos); } @@ -83,7 +83,7 @@ class IOUtils { * @return the parsed string * @throws IndexOutOfBoundsException if <code>offset + remaining > sb.length</code>. */ - static String getString(final byte[] sb, final int offset, final int remaining, int[] offset_post) throws IndexOutOfBoundsException { + static String getString(final byte[] sb, final int offset, final int remaining, final int[] offset_post) throws IndexOutOfBoundsException { Bitstream.checkBounds(sb, offset, remaining); int strlen = 0; for(; strlen < remaining && sb[strlen + offset] != 0; strlen++) { } @@ -102,7 +102,7 @@ class IOUtils { * @return the number of parsed strings * @throws IndexOutOfBoundsException if <code>offset + remaining > sb.length</code>. */ - static int getStringCount(final byte[] sb, int offset, final int remaining) throws IndexOutOfBoundsException { + static int getStringCount(final byte[] sb, final int offset, final int remaining) throws IndexOutOfBoundsException { Bitstream.checkBounds(sb, offset, remaining); int strnum=0; for(int i=0; i < remaining; i++) { @@ -120,7 +120,7 @@ class IOUtils { * @return the parsed strings * @throws IndexOutOfBoundsException if <code>offset + remaining > sb.length</code>. */ - public static String[] getStrings(final byte[] sb, int offset, final int remaining) throws IndexOutOfBoundsException { + public static String[] getStrings(final byte[] sb, final int offset, final int remaining) throws IndexOutOfBoundsException { final int strnum = getStringCount(sb, offset, remaining); // System.err.println("XXX: strnum "+strnum+", sb_off "+sb_off+", sb_len "+sb_len); diff --git a/src/java/jogamp/common/os/elf/Section.java b/src/java/jogamp/common/os/elf/Section.java index 01dc62b..29dc209 100644 --- a/src/java/jogamp/common/os/elf/Section.java +++ b/src/java/jogamp/common/os/elf/Section.java @@ -33,7 +33,7 @@ public class Section { public int offset; public int length; - Section(SectionHeader sh, byte[] data, int offset, int length) { + Section(final SectionHeader sh, final byte[] data, final int offset, final int length) { this.sh = sh; this.data = data; this.offset = offset; diff --git a/src/java/jogamp/common/os/elf/SectionArmAttributes.java b/src/java/jogamp/common/os/elf/SectionArmAttributes.java index db6710a..91e8c31 100644 --- a/src/java/jogamp/common/os/elf/SectionArmAttributes.java +++ b/src/java/jogamp/common/os/elf/SectionArmAttributes.java @@ -48,7 +48,7 @@ public class SectionArmAttributes extends Section { * Returns true if value is either {@link #ABI_VFP_ARGS_IS_VFP_VARIANT} or {@link #ABI_VFP_ARGS_IS_BOTH_BASE_AND_VFP_VARIANT} * @param v ULEB128 Value from {@link Tag#ABI_VFP_args} attribute */ - public static final boolean abiVFPArgsAcceptsVFPVariant(byte v) { + public static final boolean abiVFPArgsAcceptsVFPVariant(final byte v) { return ABI_VFP_ARGS_IS_VFP_VARIANT == v || ABI_VFP_ARGS_IS_BOTH_BASE_AND_VFP_VARIANT == v; } @@ -113,7 +113,7 @@ public class SectionArmAttributes extends Section { return null; } - Tag(int id, Type type){ + Tag(final int id, final Type type){ this.id = id; this.type = type; } @@ -123,7 +123,7 @@ public class SectionArmAttributes extends Section { public final Tag tag; private final Object value; - Attribute(Tag tag, Object value) { + Attribute(final Tag tag, final Object value) { this.tag = tag; this.value = value; } @@ -158,7 +158,7 @@ public class SectionArmAttributes extends Section { public final String vendor; public final List<Attribute> attributes; - VendorAttributes(String vendor, List<Attribute> attributes) { + VendorAttributes(final String vendor, final List<Attribute> attributes) { this.vendor = vendor; this.attributes = attributes; } @@ -170,7 +170,7 @@ public class SectionArmAttributes extends Section { } public final List<VendorAttributes> vendorAttributesList; - SectionArmAttributes(SectionHeader sh, byte[] data, int offset, int length) throws IndexOutOfBoundsException, IllegalArgumentException { + SectionArmAttributes(final SectionHeader sh, final byte[] data, final int offset, final int length) throws IndexOutOfBoundsException, IllegalArgumentException { super(sh, data, offset, length); this.vendorAttributesList = parse(data, offset, length); } @@ -180,7 +180,7 @@ public class SectionArmAttributes extends Section { return "SectionArmAttributes["+super.toSubString()+", "+vendorAttributesList.toString()+"]"; } - public final Attribute get(Tag tag) { + public final Attribute get(final Tag tag) { for(int i=0; i<vendorAttributesList.size(); i++) { final List<Attribute> attributes = vendorAttributesList.get(i).attributes; for(int j=0; j<attributes.size(); j++) { @@ -193,11 +193,11 @@ public class SectionArmAttributes extends Section { return null; } - public final List<Attribute> get(String vendor) { + public final List<Attribute> get(final String vendor) { return get(vendorAttributesList, vendor); } - static final List<Attribute> get(final List<VendorAttributes> vendorAttributesList, String vendor) { + static final List<Attribute> get(final List<VendorAttributes> vendorAttributesList, final String vendor) { for(int i=0; i<vendorAttributesList.size(); i++) { final VendorAttributes vas = vendorAttributesList.get(i); if( vas.vendor.equals(vendor) ) { @@ -232,7 +232,7 @@ public class SectionArmAttributes extends Section { final String vendor; { - int[] i_post = new int[] { 0 }; + final int[] i_post = new int[] { 0 }; vendor = getString(in, i, secLen - 4, i_post); i = i_post[0]; } @@ -240,7 +240,7 @@ public class SectionArmAttributes extends Section { final List<Attribute> attributes = new ArrayList<Attribute>(); while(i < secLen) { - int[] i_post = new int[] { 0 }; + final int[] i_post = new int[] { 0 }; parseSub(in, i, secLen - i, i_post, attributes); i = i_post[0]; } @@ -268,7 +268,7 @@ public class SectionArmAttributes extends Section { * @throws IndexOutOfBoundsException if <code>offset + remaining > sb.length</code>. * @throws IllegalArgumentException if section parsing failed, i.e. incompatible version or data. */ - static void parseSub(final byte[] in, final int offset, final int remaining, int[] offset_post, List<Attribute> attributes) throws IndexOutOfBoundsException, IllegalArgumentException { + static void parseSub(final byte[] in, final int offset, final int remaining, final int[] offset_post, final List<Attribute> attributes) throws IndexOutOfBoundsException, IllegalArgumentException { Bitstream.checkBounds(in, offset, remaining); // Starts w/ sub-section Tag @@ -299,7 +299,7 @@ public class SectionArmAttributes extends Section { switch(tag.type) { case NTBS: { - int[] i_post = new int[] { 0 }; + final int[] i_post = new int[] { 0 }; final String value = getString(in, i, subSecLen + offset - i, i_post); attributes.add(new Attribute(tag, value)); i = i_post[0]; diff --git a/src/java/jogamp/common/os/elf/SectionHeader.java b/src/java/jogamp/common/os/elf/SectionHeader.java index 8a83b61..20a40a5 100644 --- a/src/java/jogamp/common/os/elf/SectionHeader.java +++ b/src/java/jogamp/common/os/elf/SectionHeader.java @@ -174,13 +174,13 @@ public class SectionHeader { /** Public access to the raw elf section header */ public final Shdr d; - private int idx; + private final int idx; private String name; - SectionHeader(byte[] buf, int offset, int length, int sectionIdx) { + SectionHeader(final byte[] buf, final int offset, final int length, final int sectionIdx) { this( ByteBuffer.wrap(buf, 0, buf.length), sectionIdx ); } - SectionHeader(java.nio.ByteBuffer buf, int idx) { + SectionHeader(final java.nio.ByteBuffer buf, final int idx) { d = Shdr.create(buf); this.idx = idx; name = null; @@ -231,7 +231,7 @@ public class SectionHeader { * @throws IOException if read error occurs * @throws IllegalArgumentException if section offset or size mismatch including size > {@link Integer#MAX_VALUE} */ - public Section readSection(RandomAccessFile in) throws IOException, IllegalArgumentException { + public Section readSection(final RandomAccessFile in) throws IOException, IllegalArgumentException { final int s_size = long2Int(d.getSh_size()); if( 0 == s_size || 0 > s_size ) { throw new IllegalArgumentException("Shdr["+idx+"] has invalid int size: "+d.getSh_size()+" -> "+s_size); @@ -251,7 +251,7 @@ public class SectionHeader { * @throws IllegalArgumentException if section offset or size mismatch including size > {@link Integer#MAX_VALUE} * @throws IllegalArgumentException if requested read length is > section size */ - public Section readSection(RandomAccessFile in, byte[] b, int b_off, int r_len) throws IOException, IllegalArgumentException { + public Section readSection(final RandomAccessFile in, final byte[] b, final int b_off, final int r_len) throws IOException, IllegalArgumentException { final int s_size = long2Int(d.getSh_size()); if( 0 == s_size || 0 > s_size ) { throw new IllegalArgumentException("Shdr["+idx+"] has invalid int size: "+d.getSh_size()+" -> "+s_size); @@ -262,7 +262,7 @@ public class SectionHeader { return readSectionImpl(in, b, b_off, r_len); } - Section readSectionImpl(RandomAccessFile in, byte[] b, int b_off, int r_len) throws IOException, IllegalArgumentException { + Section readSectionImpl(final RandomAccessFile in, final byte[] b, final int b_off, final int r_len) throws IOException, IllegalArgumentException { final long s_off = d.getSh_offset(); seek(in, s_off); readBytes(in, b, b_off, r_len); diff --git a/src/java/jogamp/common/os/elf/Shdr.java b/src/java/jogamp/common/os/elf/Shdr.java index 5465b3d..d31aec2 100644 --- a/src/java/jogamp/common/os/elf/Shdr.java +++ b/src/java/jogamp/common/os/elf/Shdr.java @@ -3,10 +3,6 @@ package jogamp.common.os.elf; -import java.nio.*; - -import com.jogamp.gluegen.runtime.*; -import com.jogamp.common.os.*; import com.jogamp.common.nio.*; import jogamp.common.os.MachineDescriptionRuntime; @@ -37,11 +33,11 @@ public class Shdr { return create(Buffers.newDirectByteBuffer(size())); } - public static Shdr create(java.nio.ByteBuffer buf) { + public static Shdr create(final java.nio.ByteBuffer buf) { return new Shdr(buf); } - Shdr(java.nio.ByteBuffer buf) { + Shdr(final java.nio.ByteBuffer buf) { accessor = new StructAccessor(buf); } @@ -49,7 +45,7 @@ public class Shdr { return accessor.getBuffer(); } - public Shdr setSh_name(int val) { + public Shdr setSh_name(final int val) { accessor.setIntAt(sh_name_offset[mdIdx], val); return this; } @@ -58,7 +54,7 @@ public class Shdr { return accessor.getIntAt(sh_name_offset[mdIdx]); } - public Shdr setSh_type(int val) { + public Shdr setSh_type(final int val) { accessor.setIntAt(sh_type_offset[mdIdx], val); return this; } @@ -67,7 +63,7 @@ public class Shdr { return accessor.getIntAt(sh_type_offset[mdIdx]); } - public Shdr setSh_flags(long val) { + public Shdr setSh_flags(final long val) { accessor.setLongAt(sh_flags_offset[mdIdx], val, MachineDescriptionRuntime.getStatic().md.longSizeInBytes()); return this; } @@ -76,7 +72,7 @@ public class Shdr { return accessor.getLongAt(sh_flags_offset[mdIdx], MachineDescriptionRuntime.getStatic().md.longSizeInBytes()); } - public Shdr setSh_addr(long val) { + public Shdr setSh_addr(final long val) { accessor.setLongAt(sh_addr_offset[mdIdx], val, MachineDescriptionRuntime.getStatic().md.longSizeInBytes()); return this; } @@ -85,7 +81,7 @@ public class Shdr { return accessor.getLongAt(sh_addr_offset[mdIdx], MachineDescriptionRuntime.getStatic().md.longSizeInBytes()); } - public Shdr setSh_offset(long val) { + public Shdr setSh_offset(final long val) { accessor.setLongAt(sh_offset_offset[mdIdx], val, MachineDescriptionRuntime.getStatic().md.longSizeInBytes()); return this; } @@ -94,7 +90,7 @@ public class Shdr { return accessor.getLongAt(sh_offset_offset[mdIdx], MachineDescriptionRuntime.getStatic().md.longSizeInBytes()); } - public Shdr setSh_size(long val) { + public Shdr setSh_size(final long val) { accessor.setLongAt(sh_size_offset[mdIdx], val, MachineDescriptionRuntime.getStatic().md.longSizeInBytes()); return this; } @@ -103,7 +99,7 @@ public class Shdr { return accessor.getLongAt(sh_size_offset[mdIdx], MachineDescriptionRuntime.getStatic().md.longSizeInBytes()); } - public Shdr setSh_link(int val) { + public Shdr setSh_link(final int val) { accessor.setIntAt(sh_link_offset[mdIdx], val); return this; } @@ -112,7 +108,7 @@ public class Shdr { return accessor.getIntAt(sh_link_offset[mdIdx]); } - public Shdr setSh_info(int val) { + public Shdr setSh_info(final int val) { accessor.setIntAt(sh_info_offset[mdIdx], val); return this; } @@ -121,7 +117,7 @@ public class Shdr { return accessor.getIntAt(sh_info_offset[mdIdx]); } - public Shdr setSh_addralign(long val) { + public Shdr setSh_addralign(final long val) { accessor.setLongAt(sh_addralign_offset[mdIdx], val, MachineDescriptionRuntime.getStatic().md.longSizeInBytes()); return this; } @@ -130,7 +126,7 @@ public class Shdr { return accessor.getLongAt(sh_addralign_offset[mdIdx], MachineDescriptionRuntime.getStatic().md.longSizeInBytes()); } - public Shdr setSh_entsize(long val) { + public Shdr setSh_entsize(final long val) { accessor.setLongAt(sh_entsize_offset[mdIdx], val, MachineDescriptionRuntime.getStatic().md.longSizeInBytes()); return this; } |