You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2008/09/17 22:17:04 UTC
svn commit: r696430 - in
/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io:
ObjectInputStream.java ObjectOutputStream.java
Author: tellison
Date: Wed Sep 17 13:17:04 2008
New Revision: 696430
URL: http://svn.apache.org/viewvc?rev=696430&view=rev
Log:
Code tidy-up including avoiding auto-boxing/unboxing.
Modified:
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectInputStream.java
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectOutputStream.java
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectInputStream.java?rev=696430&r1=696429&r2=696430&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectInputStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectInputStream.java Wed Sep 17 13:17:04 2008
@@ -495,13 +495,13 @@
}
/**
- * Return the next <code>int</code> handle to be used to indicate cyclic
+ * Return the next <code>Integer</code> handle to be used to indicate cyclic
* references being loaded from the stream.
*
* @return the next handle to represent the next cyclic reference
*/
- private int nextHandle() {
- return this.currentHandle++;
+ private Integer nextHandle() {
+ return Integer.valueOf(this.currentHandle++);
}
/**
@@ -1121,7 +1121,7 @@
byte srcByte = input.readByte();
if (fieldID != ObjectStreamField.FIELD_IS_ABSENT) {
accessor.setByte(obj, fieldID, srcByte);
- };
+ }
break;
case 'C':
char srcChar = input.readChar();
@@ -1457,7 +1457,6 @@
*
* @deprecated Use BufferedReader
*/
- @SuppressWarnings("deprecation")
@Deprecated
public String readLine() throws IOException {
return primitiveTypes.readLine();
@@ -1626,7 +1625,7 @@
ObjectStreamClass classDesc;
primitiveData = input;
Integer oldHandle = descriptorHandle;
- descriptorHandle = Integer.valueOf(nextHandle());
+ descriptorHandle = nextHandle();
classDesc = readClassDescriptor();
registerObjectRead(classDesc, descriptorHandle, false);
descriptorHandle = oldHandle;
@@ -1660,7 +1659,7 @@
ClassNotFoundException, IOException {
// read classdesc for Enum first
ObjectStreamClass classDesc = readEnumDesc();
- int newHandle = nextHandle();
+ Integer newHandle = nextHandle();
// read name after class desc
String name;
byte tc = nextTC();
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectOutputStream.java?rev=696430&r1=696429&r2=696430&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectOutputStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectOutputStream.java Wed Sep 17 13:17:04 2008
@@ -428,13 +428,13 @@
/**
- * Return the next <code>int</code> handle to be used to indicate cyclic
+ * Return the next <code>Integer</code> handle to be used to indicate cyclic
* references being saved to the stream.
*
- * @return int, the next handle to represent the next cyclic reference
+ * @return the next handle to represent the next cyclic reference
*/
- private int nextHandle() {
- return this.currentHandle++;
+ private Integer nextHandle() {
+ return Integer.valueOf(this.currentHandle++);
}
/**
@@ -473,8 +473,8 @@
*
* @see #nextHandle
*/
- private int registerObjectWritten(Object obj) {
- int handle = nextHandle();
+ private Integer registerObjectWritten(Object obj) {
+ Integer handle = nextHandle();
objectsWritten.put(obj, handle);
return handle;
}
@@ -1168,7 +1168,7 @@
output.writeByte(TC_ARRAY);
writeClassDesc(arrayClDesc, false);
- int handle = nextHandle();
+ Integer handle = nextHandle();
if (!unshared) {
objectsWritten.put(array, handle);
@@ -1279,7 +1279,7 @@
writeClassDesc(clDesc, unshared);
}
- int handle = nextHandle();
+ Integer handle = nextHandle();
if (!unshared) {
objectsWritten.put(object, handle);
@@ -1415,7 +1415,7 @@
if (unshared) {
previousHandle = objectsWritten.get(object);
}
- int handle = nextHandle();
+ Integer handle = nextHandle();
objectsWritten.put(object, handle);
// This is how we know what to do in defaultWriteObject. And it is also
@@ -1487,7 +1487,7 @@
}
output.writeUTFBytes(object, count);
- int handle = nextHandle();
+ Integer handle = nextHandle();
if (!unshared) {
objectsWritten.put(object, handle);
@@ -1791,7 +1791,7 @@
if (unshared) {
previousHandle = objectsWritten.get(object);
}
- int handle = nextHandle();
+ Integer handle = nextHandle();
objectsWritten.put(object, handle);
ObjectStreamField[] fields = classDesc.getSuperclass().fields();