From 556d92b63555a085b25e32b1cd55afce24edd07a Mon Sep 17 00:00:00 2001
From: Sven Gothel source
into this instance.
* @return this instance
*/
- public Capabilities copyFrom(CapabilitiesImmutable other) {
+ public Capabilities copyFrom(final CapabilitiesImmutable other) {
redBits = other.getRedBits();
greenBits = other.getGreenBits();
blueBits = other.getBlueBits();
@@ -122,12 +122,12 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if(this == obj) { return true; }
if(!(obj instanceof CapabilitiesImmutable)) {
return false;
}
- CapabilitiesImmutable other = (CapabilitiesImmutable)obj;
+ final CapabilitiesImmutable other = (CapabilitiesImmutable)obj;
boolean res = other.getRedBits()==redBits &&
other.getGreenBits()==greenBits &&
other.getBlueBits()==blueBits &&
@@ -171,7 +171,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
}
@Override
- public int getVisualID(VIDType type) throws NativeWindowException {
+ public int getVisualID(final VIDType type) throws NativeWindowException {
switch(type) {
case INTRINSIC:
case NATIVE:
@@ -189,7 +189,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
/** Sets the number of bits requested for the color buffer's red
component. On some systems only the color depth, which is the
sum of the red, green, and blue bits, is considered. */
- public void setRedBits(int redBits) {
+ public void setRedBits(final int redBits) {
this.redBits = redBits;
}
@@ -201,7 +201,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
/** Sets the number of bits requested for the color buffer's green
component. On some systems only the color depth, which is the
sum of the red, green, and blue bits, is considered. */
- public void setGreenBits(int greenBits) {
+ public void setGreenBits(final int greenBits) {
this.greenBits = greenBits;
}
@@ -213,7 +213,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
/** Sets the number of bits requested for the color buffer's blue
component. On some systems only the color depth, which is the
sum of the red, green, and blue bits, is considered. */
- public void setBlueBits(int blueBits) {
+ public void setBlueBits(final int blueBits) {
this.blueBits = blueBits;
}
@@ -234,7 +234,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
* not to reflect a current state. Nevertheless if this is the case - call it at last.
*
The default implementation of the {@link @@ -70,7 +72,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser { static { Debug.initSingleton(); - DEBUG = Debug.isPropertyDefined("nativewindow.debug.CapabilitiesChooser", true); + DEBUG = PropertyAccess.isPropertyDefined("nativewindow.debug.CapabilitiesChooser", true); } private final static int NO_SCORE = -9999999; @@ -100,7 +102,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser { } // Create score array - int[] scores = new int[availnum]; + final int[] scores = new int[availnum]; for (int i = 0; i < availnum; i++) { scores[i] = NO_SCORE; } @@ -137,7 +139,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser { int scoreClosestToZero = NO_SCORE; int chosenIndex = -1; for (int i = 0; i < availnum; i++) { - int score = scores[i]; + final int score = scores[i]; if (score == NO_SCORE) { continue; } @@ -161,7 +163,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser { return chosenIndex; } - private static int sign(int score) { + private static int sign(final int score) { if (score < 0) { return -1; } diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java index 42d7f3a23..7912832c1 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java +++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java @@ -41,8 +41,8 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics protected CapabilitiesImmutable capabilitiesChosen; protected CapabilitiesImmutable capabilitiesRequested; - public DefaultGraphicsConfiguration(AbstractGraphicsScreen screen, - CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested) { + public DefaultGraphicsConfiguration(final AbstractGraphicsScreen screen, + final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested) { if(null == screen) { throw new IllegalArgumentException("Null screen"); } @@ -64,7 +64,7 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics public Object clone() { try { return super.clone(); - } catch (CloneNotSupportedException e) { + } catch (final CloneNotSupportedException e) { throw new NativeWindowException(e); } } @@ -90,7 +90,7 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics } @Override - final public int getVisualID(VIDType type) throws NativeWindowException { + final public int getVisualID(final VIDType type) throws NativeWindowException { return capabilitiesChosen.getVisualID(type); } @@ -103,7 +103,7 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics *
* @see javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen) */ - protected void setChosenCapabilities(CapabilitiesImmutable capsChosen) { + protected void setChosenCapabilities(final CapabilitiesImmutable capsChosen) { this.capabilitiesChosen = capsChosen; } @@ -115,7 +115,7 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics * a change of the graphics device in a multi-screen environment. * */ - protected void setScreen(AbstractGraphicsScreen screen) { + protected void setScreen(final AbstractGraphicsScreen screen) { this.screen = screen; } @@ -127,11 +127,11 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics "]"; } - public static String toHexString(int val) { + public static String toHexString(final int val) { return "0x"+Integer.toHexString(val); } - public static String toHexString(long val) { + public static String toHexString(final long val) { return "0x"+Long.toHexString(val); } } diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java index f733f91de..ab9286b3f 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java +++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java @@ -82,7 +82,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice public Object clone() { try { return super.clone(); - } catch (CloneNotSupportedException e) { + } catch (final CloneNotSupportedException e) { throw new NativeWindowException(e); } } @@ -178,7 +178,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice * Set the native handle of the underlying native device * and return the previous one. */ - protected final long setHandle(long newHandle) { + protected final long setHandle(final long newHandle) { final long oldHandle = handle; handle = newHandle; return oldHandle; @@ -187,7 +187,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice protected Object getHandleOwnership() { return null; } - protected Object setHandleOwnership(Object newOwnership) { + protected Object setHandleOwnership(final Object newOwnership) { return null; } @@ -222,7 +222,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice * @param locker the ToolkitLock, if null, {@link jogamp.nativewindow.NullToolkitLock} is being used * @return the previous ToolkitLock instance */ - protected ToolkitLock setToolkitLock(ToolkitLock locker) { + protected ToolkitLock setToolkitLock(final ToolkitLock locker) { final ToolkitLock _toolkitLock = toolkitLock; _toolkitLock.lock(); try { diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java index 4bd548916..3ee775904 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java +++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java @@ -36,12 +36,12 @@ public class DefaultGraphicsScreen implements Cloneable, AbstractGraphicsScreen private final AbstractGraphicsDevice device; private final int idx; - public DefaultGraphicsScreen(AbstractGraphicsDevice device, int idx) { + public DefaultGraphicsScreen(final AbstractGraphicsDevice device, final int idx) { this.device = device; this.idx = idx; } - public static AbstractGraphicsScreen createDefault(String type) { + public static AbstractGraphicsScreen createDefault(final String type) { return new DefaultGraphicsScreen(new DefaultGraphicsDevice(type, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT), 0); } @@ -49,7 +49,7 @@ public class DefaultGraphicsScreen implements Cloneable, AbstractGraphicsScreen public Object clone() { try { return super.clone(); - } catch (CloneNotSupportedException e) { + } catch (final CloneNotSupportedException e) { throw new NativeWindowException(e); } } diff --git a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java index c09e6eaa4..3f8113baa 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java +++ b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java @@ -70,7 +70,7 @@ public abstract class GraphicsConfigurationFactory { public final Class> capsType; private final int hash32; - public DeviceCapsType(Class> deviceType, Class> capsType) { + public DeviceCapsType(final Class> deviceType, final Class> capsType) { this.deviceType = deviceType; this.capsType = capsType; @@ -86,10 +86,10 @@ public abstract class GraphicsConfigurationFactory { } @Override - public final boolean equals(Object obj) { + public final boolean equals(final Object obj) { if(this == obj) { return true; } if (obj instanceof DeviceCapsType) { - DeviceCapsType dct = (DeviceCapsType)obj; + final DeviceCapsType dct = (DeviceCapsType)obj; return deviceType == dct.deviceType && capsType == dct.capsType; } return false; @@ -135,14 +135,14 @@ public abstract class GraphicsConfigurationFactory { try { ReflectionUtil.callStaticMethod("jogamp.nativewindow.x11.X11GraphicsConfigurationFactory", "registerFactory", null, null, GraphicsConfigurationFactory.class.getClassLoader()); - } catch (Exception e) { + } catch (final Exception e) { throw new RuntimeException(e); } if(NativeWindowFactory.isAWTAvailable()) { try { ReflectionUtil.callStaticMethod("jogamp.nativewindow.x11.awt.X11AWTGraphicsConfigurationFactory", "registerFactory", null, null, GraphicsConfigurationFactory.class.getClassLoader()); - } catch (Exception e) { /* n/a */ } + } catch (final Exception e) { /* n/a */ } } } } @@ -162,11 +162,11 @@ public abstract class GraphicsConfigurationFactory { return Thread.currentThread().getName(); } - protected static String toHexString(int val) { + protected static String toHexString(final int val) { return "0x" + Integer.toHexString(val); } - protected static String toHexString(long val) { + protected static String toHexString(final long val) { return "0x" + Long.toHexString(val); } @@ -181,7 +181,7 @@ public abstract class GraphicsConfigurationFactory { * * @see #getFactory(Class, Class) */ - public static GraphicsConfigurationFactory getFactory(AbstractGraphicsDevice device, CapabilitiesImmutable caps) { + public static GraphicsConfigurationFactory getFactory(final AbstractGraphicsDevice device, final CapabilitiesImmutable caps) { if (device == null) { throw new IllegalArgumentException("null device"); } @@ -216,7 +216,7 @@ public abstract class GraphicsConfigurationFactory { * @throws IllegalArgumentException if the deviceType does not implement {@link AbstractGraphicsDevice} or * capabilitiesType does not implement {@link CapabilitiesImmutable} */ - public static GraphicsConfigurationFactory getFactory(Class> deviceType, Class> capabilitiesType) + public static GraphicsConfigurationFactory getFactory(final Class> deviceType, final Class> capabilitiesType) throws IllegalArgumentException, NativeWindowException { if (!(defaultDeviceCapsType.deviceType.isAssignableFrom(deviceType))) { @@ -242,7 +242,7 @@ public abstract class GraphicsConfigurationFactory { for(int j=0; j==
produce the same result.
*/
- public static String getNativeWindowType(boolean useCustom) {
+ public static String getNativeWindowType(final boolean useCustom) {
return useCustom?nativeWindowingTypeCustom:nativeWindowingTypePure;
}
@@ -431,7 +433,7 @@ public abstract class NativeWindowFactory {
} */
/** Sets the default NativeWindowFactory. */
- public static void setDefaultFactory(NativeWindowFactory factory) {
+ public static void setDefaultFactory(final NativeWindowFactory factory) {
defaultFactory = factory;
}
@@ -472,7 +474,7 @@ public abstract class NativeWindowFactory {
* own
is true, otherwise no native handle will ever be acquired.
*
*/
- public static AbstractGraphicsDevice createDevice(String displayConnection, boolean own) {
+ public static AbstractGraphicsDevice createDevice(final String displayConnection, final boolean own) {
final String nwt = NativeWindowFactory.getNativeWindowType(true);
if( NativeWindowFactory.TYPE_X11 == nwt ) {
if( own ) {
@@ -679,8 +681,8 @@ public abstract class NativeWindowFactory {
* or a simple dummy instance, see {@link #createDevice(String, boolean)}.
*
*/
- public static NativeWindow createWrappedWindow(AbstractGraphicsScreen aScreen, long surfaceHandle, long windowHandle,
- UpstreamWindowHookMutableSizePos hook) {
+ public static NativeWindow createWrappedWindow(final AbstractGraphicsScreen aScreen, final long surfaceHandle, final long windowHandle,
+ final UpstreamWindowHookMutableSizePos hook) {
final CapabilitiesImmutable caps = new Capabilities();
final AbstractGraphicsConfiguration config = new DefaultGraphicsConfiguration(aScreen, caps, caps);
return new WrappedWindow(config, surfaceHandle, hook, true, windowHandle);
@@ -690,7 +692,7 @@ public abstract class NativeWindowFactory {
* @param nw
* @return top-left client-area position in window units
*/
- public static PointImmutable getLocationOnScreen(NativeWindow nw) {
+ public static PointImmutable getLocationOnScreen(final NativeWindow nw) {
final String nwt = NativeWindowFactory.getNativeWindowType(true);
if( NativeWindowFactory.TYPE_X11 == nwt ) {
return X11Lib.GetRelativeLocation(nw.getDisplayHandle(), nw.getScreenIndex(), nw.getWindowHandle(), 0, 0, 0);
diff --git a/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java b/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
index 4ed79b1dc..e337166d4 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
@@ -51,7 +51,7 @@ public interface VisualIDHolder {
public final int id;
- VIDType(int id){
+ VIDType(final int id){
this.id = id;
}
}
@@ -114,14 +114,14 @@ public interface VisualIDHolder {
/** Comparing {@link VIDType#NATIVE} */
public static class VIDComparator implements Comparatorfmt
.
* If no reversed {@link PixelFormat} is available, returns fmt
.
*/
- public static PixelFormat getReversed(PixelFormat fmt) {
+ public static PixelFormat getReversed(final PixelFormat fmt) {
switch(fmt) {
case LUMINANCE:
return PixelFormat.LUMINANCE;
@@ -106,7 +106,7 @@ public class PixelFormatUtil {
}
}
- public static int getValue32(PixelFormat src_fmt, ByteBuffer src, int srcOff) {
+ public static int getValue32(final PixelFormat src_fmt, final ByteBuffer src, int srcOff) {
switch(src_fmt) {
case LUMINANCE: {
final byte c1 = src.get(srcOff++);
@@ -134,7 +134,7 @@ public class PixelFormatUtil {
}
}
- public static int convertToInt32(PixelFormat dest_fmt, final byte r, final byte g, final byte b, final byte a) {
+ public static int convertToInt32(final PixelFormat dest_fmt, final byte r, final byte g, final byte b, final byte a) {
switch(dest_fmt) {
case LUMINANCE: {
final byte l = ( byte) ( ( ( ( 0xff & r ) + ( 0xff & g ) + ( 0xff & b ) ) / 3 ) );
@@ -157,7 +157,7 @@ public class PixelFormatUtil {
}
}
- public static int convertToInt32(PixelFormat dest_fmt, PixelFormat src_fmt, ByteBuffer src, int srcOff) {
+ public static int convertToInt32(final PixelFormat dest_fmt, final PixelFormat src_fmt, final ByteBuffer src, int srcOff) {
final byte r, g, b, a;
switch(src_fmt) {
case LUMINANCE:
@@ -208,7 +208,7 @@ public class PixelFormatUtil {
return convertToInt32(dest_fmt, r, g, b, a);
}
- public static int convertToInt32(PixelFormat dest_fmt, PixelFormat src_fmt, final int src_pixel) {
+ public static int convertToInt32(final PixelFormat dest_fmt, final PixelFormat src_fmt, final int src_pixel) {
final byte r, g, b, a;
switch(src_fmt) {
case LUMINANCE:
@@ -260,7 +260,7 @@ public class PixelFormatUtil {
}
public static PixelRectangle convert32(final PixelRectangle src,
- final PixelFormat destFmt, int ddestStride, final boolean isGLOriented,
+ final PixelFormat destFmt, final int ddestStride, final boolean isGLOriented,
final boolean destIsDirect) {
final int width = src.getSize().getWidth();
final int height = src.getSize().getHeight();
@@ -281,7 +281,7 @@ public class PixelFormatUtil {
// System.err.println("XXX: DEST fmt "+destFmt+", stride "+destStride+" ("+ddestStride+"), isGL "+isGLOriented+", "+width+"x"+height+", capacity "+capacity+", "+bb);
final PixelFormatUtil.PixelSink32 imgSink = new PixelFormatUtil.PixelSink32() {
- public void store(int x, int y, int pixel) {
+ public void store(final int x, final int y, final int pixel) {
int o = destStride*y+x*bpp;
bb.put(o++, (byte) ( pixel )); // 1
if( 3 <= bpp ) {
@@ -309,7 +309,7 @@ public class PixelFormatUtil {
return new PixelRectangle.GenericPixelRect(destFmt, src.getSize(), destStride, isGLOriented, bb);
}
- public static void convert32(PixelSink32 destInt32, final PixelRectangle src) {
+ public static void convert32(final PixelSink32 destInt32, final PixelRectangle src) {
convert32(destInt32,
src.getPixels(), src.getPixelformat(),
src.isGLOriented(),
@@ -333,7 +333,7 @@ public class PixelFormatUtil {
* Must be >= {@link PixelFormat#bytesPerPixel() src_fmt.bytesPerPixel()} * width.
* @throws IllegalArgumentException if strideInBytes
is invalid
*/
- public static void convert32(PixelSink32 dest32,
+ public static void convert32(final PixelSink32 dest32,
final ByteBuffer src_bb, final PixelFormat src_fmt, final boolean src_glOriented, final int width, final int height, int stride_bytes) {
final int src_bpp = src_fmt.bytesPerPixel();
if( 0 != stride_bytes ) {
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
index e544118d0..3576a7dd0 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
@@ -33,7 +33,7 @@ public class Point implements Cloneable, PointImmutable {
int x;
int y;
- public Point(int x, int y) {
+ public Point(final int x, final int y) {
this.x=x;
this.y=y;
}
@@ -51,7 +51,7 @@ public class Point implements Cloneable, PointImmutable {
public Object clone() {
try {
return super.clone();
- } catch (CloneNotSupportedException ex) {
+ } catch (final CloneNotSupportedException ex) {
throw new InternalError();
}
}
@@ -70,10 +70,10 @@ public class Point implements Cloneable, PointImmutable {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if(this == obj) { return true; }
if (obj instanceof Point) {
- Point p = (Point)obj;
+ final Point p = (Point)obj;
return y == p.y && x == p.x;
}
return false;
@@ -102,9 +102,9 @@ public class Point implements Cloneable, PointImmutable {
return x + " / " + y;
}
- public final void set(int x, int y) { this.x = x; this.y = y; }
- public final void setX(int x) { this.x = x; }
- public final void setY(int y) { this.y = y; }
+ public final void set(final int x, final int y) { this.x = x; this.y = y; }
+ public final void setX(final int x) { this.x = x; }
+ public final void setY(final int y) { this.y = y; }
/**
* Translate this instance's x- and y-components,
@@ -112,7 +112,7 @@ public class Point implements Cloneable, PointImmutable {
* @param pd delta point
* @return this instance for scaling
*/
- public final Point translate(Point pd) {
+ public final Point translate(final Point pd) {
x += pd.x ;
y += pd.y ;
return this;
@@ -125,7 +125,7 @@ public class Point implements Cloneable, PointImmutable {
* @param dy delta for y
* @return this instance for scaling
*/
- public final Point translate(int dx, int dy) {
+ public final Point translate(final int dx, final int dy) {
x += dx ;
y += dy ;
return this;
@@ -138,7 +138,7 @@ public class Point implements Cloneable, PointImmutable {
* @param sy scale factor for y
* @return this instance for scaling
*/
- public final Point scale(int sx, int sy) {
+ public final Point scale(final int sx, final int sy) {
x *= sx ;
y *= sy ;
return this;
@@ -151,7 +151,7 @@ public class Point implements Cloneable, PointImmutable {
* @param sy inverse scale factor for y
* @return this instance for scaling
*/
- public final Point scaleInv(int sx, int sy) {
+ public final Point scaleInv(final int sx, final int sy) {
x /= sx ;
y /= sy ;
return this;
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java b/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
index 57535c26e..acc7b722d 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
@@ -56,7 +56,7 @@ public class Rectangle implements Cloneable, RectangleImmutable {
protected Object clone() {
try {
return super.clone();
- } catch (CloneNotSupportedException ex) {
+ } catch (final CloneNotSupportedException ex) {
throw new InternalError();
}
}
@@ -154,7 +154,7 @@ public class Rectangle implements Cloneable, RectangleImmutable {
* @param sy scale factor for y
* @return this instance for scaling
*/
- public final Rectangle scale(int sx, int sy) {
+ public final Rectangle scale(final int sx, final int sy) {
x *= sx ;
y *= sy ;
width *= sx ;
@@ -169,7 +169,7 @@ public class Rectangle implements Cloneable, RectangleImmutable {
* @param sy inverse scale factor for y
* @return this instance for scaling
*/
- public final Rectangle scaleInv(int sx, int sy) {
+ public final Rectangle scaleInv(final int sx, final int sy) {
x /= sx ;
y /= sy ;
width /= sx ;
@@ -203,10 +203,10 @@ public class Rectangle implements Cloneable, RectangleImmutable {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if(this == obj) { return true; }
if (obj instanceof Rectangle) {
- Rectangle rect = (Rectangle)obj;
+ final Rectangle rect = (Rectangle)obj;
return (y == rect.y) && (x == rect.x) &&
(height == rect.height) && (width == rect.width);
}
@@ -215,11 +215,11 @@ public class Rectangle implements Cloneable, RectangleImmutable {
@Override
public int hashCode() {
- int sum1 = x + height;
- int sum2 = width + y;
- int val1 = sum1 * (sum1 + 1)/2 + x;
- int val2 = sum2 * (sum2 + 1)/2 + y;
- int sum3 = val1 + val2;
+ final int sum1 = x + height;
+ final int sum2 = width + y;
+ final int val1 = sum1 * (sum1 + 1)/2 + x;
+ final int val2 = sum2 * (sum2 + 1)/2 + y;
+ final int sum3 = val1 + val2;
return sum3 * (sum3 + 1)/2 + val2;
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java b/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
index 6b4d2f19c..601e6dd71 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
@@ -40,7 +40,7 @@ public class SurfaceSize implements Comparablefalse
.
*/
@Override
- public final boolean equals(Object obj) {
+ public final boolean equals(final Object obj) {
if(this == obj) { return true; }
if (obj instanceof SurfaceSize) {
- SurfaceSize p = (SurfaceSize)obj;
+ final SurfaceSize p = (SurfaceSize)obj;
return getResolution().equals(p.getResolution()) &&
getBitsPerPixel() == p.getBitsPerPixel();
}
--
cgit v1.2.3