You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2008/05/26 04:01:38 UTC
svn commit: r660071 -
/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/ShortListImpl.java
Author: mrglavas
Date: Sun May 25 19:01:37 2008
New Revision: 660071
URL: http://svn.apache.org/viewvc?rev=660071&view=rev
Log:
Making every field of this class final.
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/ShortListImpl.java
Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/ShortListImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/ShortListImpl.java?rev=660071&r1=660070&r2=660071&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/ShortListImpl.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/ShortListImpl.java Sun May 25 19:01:37 2008
@@ -29,7 +29,7 @@
*
* @version $Id$
*/
-public class ShortListImpl implements ShortList {
+public final class ShortListImpl implements ShortList {
/**
* An immutable empty list.
@@ -47,9 +47,9 @@
};
// The array to hold all data
- private short[] fArray = null;
+ private final short[] fArray;
// Number of elements in this list
- private int fLength = 0;
+ private final int fLength;
/**
* Construct an XSObjectList implementation
@@ -80,15 +80,17 @@
*/
public boolean contains(short item) {
for (int i = 0; i < fLength; i++) {
- if (fArray[i] == item)
+ if (fArray[i] == item) {
return true;
+ }
}
return false;
}
public short item(int index) throws XSException {
- if (index < 0 || index >= fLength)
+ if (index < 0 || index >= fLength) {
throw new XSException(XSException.INDEX_SIZE_ERR, null);
+ }
return fArray[index];
}
@@ -101,7 +103,6 @@
if (fLength != rhs.getLength()) {
return false;
}
-
for (int i = 0;i < fLength; ++i) {
if (fArray[i] != rhs.item(i)) {
return false;
@@ -110,4 +111,4 @@
return true;
}
-} // class XSParticle
+} // class ShortListImpl
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org