donaldp 02/03/24 01:48:29
Modified: zip/src/java/org/apache/avalon/excalibur/zip
ZipExtraField.java ZipEntry.java
UnrecognizedExtraField.java ExtraFieldUtils.java
AsiExtraField.java
naming/src/java/org/apache/avalon/excalibur/naming/rmi/server
Main.java
zip/src/test/org/apache/avalon/excalibur/zip/test
ExtraFieldUtilsTestCase.java
AsiExtraFieldTestCase.java
Log:
Audit fixes
Revision Changes Path
1.2 +1 -1
jakarta-avalon-excalibur/zip/src/java/org/apache/avalon/excalibur/zip/ZipExtraField.java
Index: ZipExtraField.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/zip/src/java/org/apache/avalon/excalibur/zip/ZipExtraField.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ZipExtraField.java 22 Mar 2002 12:16:11 -0000 1.1
+++ ZipExtraField.java 24 Mar 2002 09:48:28 -0000 1.2
@@ -18,7 +18,7 @@
* will only use the local file data in both places.</p>
*
* @author <a href="[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public interface ZipExtraField
{
@@ -28,7 +28,7 @@
* @return The HeaderId value
* @since 1.1
*/
- ZipShort getHeaderId();
+ ZipShort getHeaderID();
/**
* Length of the extra field in the local file data - without Header-ID
or
1.2 +13 -11
jakarta-avalon-excalibur/zip/src/java/org/apache/avalon/excalibur/zip/ZipEntry.java
Index: ZipEntry.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/zip/src/java/org/apache/avalon/excalibur/zip/ZipEntry.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ZipEntry.java 22 Mar 2002 12:16:11 -0000 1.1
+++ ZipEntry.java 24 Mar 2002 09:48:28 -0000 1.2
@@ -17,7 +17,7 @@
* the internal and external file attributes.
*
* @author <a href="[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class ZipEntry
extends java.util.zip.ZipEntry
@@ -360,12 +360,12 @@
*/
public void addExtraField( final ZipExtraField extraField )
{
- final ZipShort type = extraField.getHeaderId();
+ final ZipShort type = extraField.getHeaderID();
boolean done = false;
for( int i = 0; !done && i < m_extraFields.size(); i++ )
{
final ZipExtraField other = (ZipExtraField)m_extraFields.get( i
);
- if( other.getHeaderId().equals( type ) )
+ if( other.getHeaderID().equals( type ) )
{
m_extraFields.set( i, extraField );
done = true;
@@ -386,20 +386,22 @@
*/
public Object clone()
{
- ZipEntry e = null;
+ ZipEntry entry = null;
try
{
- e = new ZipEntry( (java.util.zip.ZipEntry)super.clone() );
+ entry = new ZipEntry( (java.util.zip.ZipEntry)super.clone() );
}
- catch( Exception ex )
+ catch( final Exception e )
{
// impossible as extra data is in correct format
- ex.printStackTrace();
+ e.printStackTrace();
+ return null;
}
- e.setInternalAttributes( getInternalAttributes() );
- e.setExternalAttributes( getExternalAttributes() );
- e.setExtraFields( getExtraFields() );
- return e;
+
+ entry.setInternalAttributes( getInternalAttributes() );
+ entry.setExternalAttributes( getExternalAttributes() );
+ entry.setExtraFields( getExtraFields() );
+ return entry;
}
/**
@@ -413,7 +415,7 @@
boolean done = false;
for( int i = 0; !done && i < m_extraFields.size(); i++ )
{
- if( ( (ZipExtraField)m_extraFields.get( i )
).getHeaderId().equals( type ) )
+ if( ( (ZipExtraField)m_extraFields.get( i )
).getHeaderID().equals( type ) )
{
m_extraFields.remove( i );
done = true;
1.2 +1 -1
jakarta-avalon-excalibur/zip/src/java/org/apache/avalon/excalibur/zip/UnrecognizedExtraField.java
Index: UnrecognizedExtraField.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/zip/src/java/org/apache/avalon/excalibur/zip/UnrecognizedExtraField.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- UnrecognizedExtraField.java 22 Mar 2002 12:16:11 -0000 1.1
+++ UnrecognizedExtraField.java 24 Mar 2002 09:48:28 -0000 1.2
@@ -14,7 +14,7 @@
* told the opposite.</p>
*
* @author <a href="[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class UnrecognizedExtraField
implements ZipExtraField
@@ -119,7 +119,7 @@
* @deprecated Use getHeaderID() instead
* @see #getHeaderID()
*/
- public ZipShort getHeaderId()
+ public ZipShort getHeaderID()
{
return m_headerID;
}
1.2 +3 -3
jakarta-avalon-excalibur/zip/src/java/org/apache/avalon/excalibur/zip/ExtraFieldUtils.java
Index: ExtraFieldUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/zip/src/java/org/apache/avalon/excalibur/zip/ExtraFieldUtils.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ExtraFieldUtils.java 22 Mar 2002 12:16:11 -0000 1.1
+++ ExtraFieldUtils.java 24 Mar 2002 09:48:28 -0000 1.2
@@ -15,7 +15,7 @@
* ZipExtraField related methods
*
* @author <a href="[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class ExtraFieldUtils
{
@@ -76,7 +76,7 @@
int start = 0;
for( int i = 0; i < data.length; i++ )
{
- System.arraycopy( data[ i ].getHeaderId().getBytes(),
+ System.arraycopy( data[ i ].getHeaderID().getBytes(),
0, result, start, 2 );
System.arraycopy( data[ i
].getCentralDirectoryLength().getBytes(),
0, result, start + 2, 2 );
@@ -105,7 +105,7 @@
int start = 0;
for( int i = 0; i < data.length; i++ )
{
- System.arraycopy( data[ i ].getHeaderId().getBytes(),
+ System.arraycopy( data[ i ].getHeaderID().getBytes(),
0, result, start, 2 );
System.arraycopy( data[ i ].getLocalFileDataLength().getBytes(),
0, result, start + 2, 2 );
@@ -176,7 +176,7 @@
try
{
ZipExtraField ze = (ZipExtraField)clazz.newInstance();
- c_implementations.put( ze.getHeaderId(), clazz );
+ c_implementations.put( ze.getHeaderID(), clazz );
}
catch( ClassCastException cc )
{
1.3 +17 -4
jakarta-avalon-excalibur/zip/src/java/org/apache/avalon/excalibur/zip/AsiExtraField.java
Index: AsiExtraField.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/zip/src/java/org/apache/avalon/excalibur/zip/AsiExtraField.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AsiExtraField.java 24 Mar 2002 07:43:23 -0000 1.2
+++ AsiExtraField.java 24 Mar 2002 09:48:28 -0000 1.3
@@ -33,7 +33,7 @@
* device numbers are currently not supported.</p>
*
* @author <a href="[EMAIL PROTECTED]">Stefan Bodewig</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class AsiExtraField
implements ZipExtraField, UnixStat, Cloneable
@@ -182,6 +182,19 @@
* @return The GroupId value
* @since 1.1
*/
+ public int getGroupID()
+ {
+ return m_gid;
+ }
+
+ /**
+ * Get the group id.
+ *
+ * @return The GroupId value
+ * @since 1.1
+ * @deprecated Use getGroupID() instead
+ * @see #getGroupID()
+ */
public int getGroupId()
{
return m_gid;
@@ -193,7 +206,7 @@
* @return The HeaderId value
* @since 1.1
*/
- public ZipShort getHeaderId()
+ public ZipShort getHeaderID()
{
return HEADER_ID;
}
@@ -227,9 +240,9 @@
System.arraycopy( ( new ZipLong( linkArray.length ) ).getBytes(),
0, data, 2, 4 );
- System.arraycopy( ( new ZipShort( getUserId() ) ).getBytes(),
+ System.arraycopy( ( new ZipShort( getUserID() ) ).getBytes(),
0, data, 6, 2 );
- System.arraycopy( ( new ZipShort( getGroupId() ) ).getBytes(),
+ System.arraycopy( ( new ZipShort( getGroupID() ) ).getBytes(),
0, data, 8, 2 );
System.arraycopy( linkArray, 0, data, 10, linkArray.length );
1.7 +1 -1
jakarta-avalon-excalibur/naming/src/java/org/apache/avalon/excalibur/naming/rmi/server/Main.java
Index: Main.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/naming/src/java/org/apache/avalon/excalibur/naming/rmi/server/Main.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Main.java 16 Mar 2002 00:03:53 -0000 1.6
+++ Main.java 24 Mar 2002 09:48:28 -0000 1.7
@@ -148,7 +148,7 @@
}
catch( final IOException ioe )
{
- if( false == m_running ) break;
+ if( !m_running ) break;
ioe.printStackTrace();
}
}
1.2 +2 -2
jakarta-avalon-excalibur/zip/src/test/org/apache/avalon/excalibur/zip/test/ExtraFieldUtilsTestCase.java
Index: ExtraFieldUtilsTestCase.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/zip/src/test/org/apache/avalon/excalibur/zip/test/ExtraFieldUtilsTestCase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ExtraFieldUtilsTestCase.java 22 Mar 2002 12:16:11 -0000 1.1
+++ ExtraFieldUtilsTestCase.java 24 Mar 2002 09:48:29 -0000 1.2
@@ -47,10 +47,10 @@
m_local = m_field.getLocalFileDataData();
final byte[] dummyLocal = m_dummy.getLocalFileDataData();
m_data = new byte[ 4 + m_local.length + 4 + dummyLocal.length ];
- System.arraycopy( m_field.getHeaderId().getBytes(), 0, m_data, 0, 2
);
+ System.arraycopy( m_field.getHeaderID().getBytes(), 0, m_data, 0, 2
);
System.arraycopy( m_field.getLocalFileDataLength().getBytes(), 0,
m_data, 2, 2 );
System.arraycopy( m_local, 0, m_data, 4, m_local.length );
- System.arraycopy( m_dummy.getHeaderId().getBytes(), 0, m_data,
+ System.arraycopy( m_dummy.getHeaderID().getBytes(), 0, m_data,
4 + m_local.length, 2 );
System.arraycopy( m_dummy.getLocalFileDataLength().getBytes(), 0,
m_data,
4 + m_local.length + 2, 2 );
1.2 +3 -3
jakarta-avalon-excalibur/zip/src/test/org/apache/avalon/excalibur/zip/test/AsiExtraFieldTestCase.java
Index: AsiExtraFieldTestCase.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/zip/src/test/org/apache/avalon/excalibur/zip/test/AsiExtraFieldTestCase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AsiExtraFieldTestCase.java 22 Mar 2002 12:16:11 -0000 1.1
+++ AsiExtraFieldTestCase.java 24 Mar 2002 09:48:29 -0000 1.2
@@ -104,7 +104,7 @@
assertTrue( "plain file, no dir", !field.isDirectory() );
assertEquals( "mode plain file", FILE_FLAG | 0123, field.getMode() );
assertEquals( "uid plain file", 5, field.getUserId() );
- assertEquals( "gid plain file", 6, field.getGroupId() );
+ assertEquals( "gid plain file", 6, field.getGroupID() );
}
public void testReparse2()
@@ -123,7 +123,7 @@
assertTrue( "link, no dir", !field.isDirectory() );
assertEquals( "mode link", LINK_FLAG | 0123, field.getMode() );
assertEquals( "uid link", 5, field.getUserId() );
- assertEquals( "gid link", 6, field.getGroupId() );
+ assertEquals( "gid link", 6, field.getGroupID() );
assertEquals( "test", field.getLinkedFile() );
}
@@ -142,7 +142,7 @@
assertTrue( "dir, is dir", field.isDirectory() );
assertEquals( "mode dir", DIR_FLAG | 0123, field.getMode() );
assertEquals( "uid dir", 5, field.getUserId() );
- assertEquals( "gid dir", 6, field.getGroupId() );
+ assertEquals( "gid dir", 6, field.getGroupID() );
}
public void testReparse4()
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>