Browse Source

Fix up audit violations

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271250 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 23 years ago
parent
commit
ea31a2b83a
7 changed files with 36 additions and 29 deletions
  1. +0
    -4
      proposal/myrmidon/src/java/org/apache/aut/manifest/Attribute.java
  2. +2
    -2
      proposal/myrmidon/src/java/org/apache/aut/vfs/NameScope.java
  3. +7
    -4
      proposal/myrmidon/src/java/org/apache/aut/vfs/impl/DefaultFileSystemManager.java
  4. +5
    -3
      proposal/myrmidon/src/java/org/apache/aut/vfs/provider/AbstractFileObject.java
  5. +3
    -2
      proposal/myrmidon/src/java/org/apache/aut/vfs/provider/AbstractFileSystemProvider.java
  6. +10
    -8
      proposal/myrmidon/src/java/org/apache/aut/vfs/provider/DefaultFileContent.java
  7. +9
    -6
      proposal/myrmidon/src/java/org/apache/aut/vfs/provider/UriParser.java

+ 0
- 4
proposal/myrmidon/src/java/org/apache/aut/manifest/Attribute.java View File

@@ -7,10 +7,6 @@
*/
package org.apache.aut.manifest;

import java.io.PrintWriter;
import java.io.IOException;
import java.util.jar.Attributes;

/**
* Class to hold manifest attributes
*


+ 2
- 2
proposal/myrmidon/src/java/org/apache/aut/vfs/NameScope.java View File

@@ -22,7 +22,7 @@ public final class NameScope
* not be empty, or <code>.</code>, or <code>..</code>, or contain any
* separator characters.
*/
public static final NameScope CHILD = new NameScope( "child" );
public final static NameScope CHILD = new NameScope( "child" );

/**
* Resolve against files in the same file system as the base file.
@@ -39,7 +39,7 @@ public final class NameScope
* <p>A path is considered absolute if it starts with a separator character,
* and relative if it does not.
*/
public static final NameScope FILE_SYSTEM = new NameScope( "filesystem" );
public final static NameScope FILE_SYSTEM = new NameScope( "filesystem" );

private String m_name;



+ 7
- 4
proposal/myrmidon/src/java/org/apache/aut/vfs/impl/DefaultFileSystemManager.java View File

@@ -27,9 +27,10 @@ import org.apache.avalon.excalibur.i18n.Resources;
*
* @author Adam Murdoch
*/
public class DefaultFileSystemManager implements FileSystemManager
public class DefaultFileSystemManager
implements FileSystemManager
{
private static final Resources REZ
private final static Resources REZ
= ResourceManager.getPackageResources( DefaultFileSystemManager.class );

/** The default provider. */
@@ -90,7 +91,8 @@ public class DefaultFileSystemManager implements FileSystemManager
* Creates a provider instance, returns null if the provider class is
* not found.
*/
private FileSystemProvider createProvider( final String className ) throws Exception
private FileSystemProvider createProvider( final String className )
throws Exception
{
try
{
@@ -186,7 +188,8 @@ public class DefaultFileSystemManager implements FileSystemManager
/**
* A provider context implementation.
*/
private final class ProviderContextImpl implements FileSystemProviderContext
private final class ProviderContextImpl
implements FileSystemProviderContext
{
/**
* Locates a cached file system by root URI.


+ 5
- 3
proposal/myrmidon/src/java/org/apache/aut/vfs/provider/AbstractFileObject.java View File

@@ -27,16 +27,18 @@ import org.apache.avalon.excalibur.i18n.Resources;
*
* @author Adam Murdoch
*/
public abstract class AbstractFileObject implements FileObject
public abstract class AbstractFileObject
implements FileObject
{
private static final Resources REZ =
private final static Resources REZ =
ResourceManager.getPackageResources( AbstractFileObject.class );

private final static FileObject[] EMPTY_FILE_ARRAY = {};

private FileName m_name;
private AbstractFileSystem m_fs;
private DefaultFileContent m_content;

private static final FileObject[] EMPTY_FILE_ARRAY = {};

// Cached info
private boolean m_attached;


+ 3
- 2
proposal/myrmidon/src/java/org/apache/aut/vfs/provider/AbstractFileSystemProvider.java View File

@@ -17,9 +17,10 @@ import org.apache.avalon.excalibur.i18n.Resources;
*
* @author Adam Murdoch
*/
public abstract class AbstractFileSystemProvider implements FileSystemProvider
public abstract class AbstractFileSystemProvider
implements FileSystemProvider
{
private static final Resources REZ
private final static Resources REZ
= ResourceManager.getPackageResources( AbstractFileSystemProvider.class );

protected FileSystemProviderContext m_context;


+ 10
- 8
proposal/myrmidon/src/java/org/apache/aut/vfs/provider/DefaultFileContent.java View File

@@ -23,20 +23,21 @@ import org.apache.avalon.excalibur.i18n.Resources;
*
* @author Adam Murdoch
*/
public class DefaultFileContent implements FileContent
public class DefaultFileContent
implements FileContent
{
private static final Resources REZ
= ResourceManager.getPackageResources( DefaultFileContent.class );
private final static Resources REZ =
ResourceManager.getPackageResources( DefaultFileContent.class );

private final static int STATE_NONE = 0;
private final static int STATE_READING = 1;
private final static int STATE_WRITING = 2;

private AbstractFileObject m_file;
private int _state = STATE_NONE;
private FileContentInputStream m_instr;
private FileContentOutputStream m_outstr;

private static final int STATE_NONE = 0;
private static final int STATE_READING = 1;
private static final int STATE_WRITING = 2;

public DefaultFileContent( AbstractFileObject file )
{
m_file = file;
@@ -332,7 +333,8 @@ public class DefaultFileContent implements FileContent
/**
* An output stream for writing content.
*/
private final class FileContentOutputStream extends BufferedOutputStream
private final class FileContentOutputStream
extends BufferedOutputStream
{
FileContentOutputStream( OutputStream outstr )
{


+ 9
- 6
proposal/myrmidon/src/java/org/apache/aut/vfs/provider/UriParser.java View File

@@ -20,8 +20,8 @@ import org.apache.avalon.excalibur.i18n.Resources;
*/
public class UriParser
{
private static final Resources REZ
= ResourceManager.getPackageResources( UriParser.class );
private final static Resources REZ =
ResourceManager.getPackageResources( UriParser.class );

/** The normalised separator to use. */
private char m_separatorChar;
@@ -495,16 +495,19 @@ public class UriParser
maxlen = path.length();
continue;
}
if( elemLen == 2
&& path.charAt( startElem ) == '.'
&& path.charAt( startElem + 1 ) == '.' )
if( elemLen == 2 &&
path.charAt( startElem ) == '.' &&
path.charAt( startElem + 1 ) == '.' )
{
// A '..' element - remove the previous element
if( startElem > startFirstElem )
{
int pos = startElem - 2;
for( ; path.charAt( pos ) != m_separatorChar; pos-- )
char ch = path.charAt( pos );
while( ch != m_separatorChar )
{
pos--;
ch = path.charAt( pos );
}
startElem = pos + 1;
}


Loading…
Cancel
Save