|
From: <ls...@us...> - 2007-01-07 08:26:38
|
Revision: 3008
http://jnode.svn.sourceforge.net/jnode/?rev=3008&view=rev
Author: lsantha
Date: 2007-01-07 00:26:36 -0800 (Sun, 07 Jan 2007)
Log Message:
-----------
Classpath patches.
Modified Paths:
--------------
trunk/core/src/classpath/tools/gnu/classpath/tools/jar/Creator.java
trunk/core/src/classpath/tools/gnu/classpath/tools/jar/Indexer.java
trunk/core/src/classpath/tools/gnu/classpath/tools/jar/Main.java
trunk/core/src/classpath/tools/gnu/classpath/tools/jar/WorkSet.java
trunk/core/src/classpath/tools/gnu/classpath/tools/jarsigner/Main.java
trunk/core/src/classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java
trunk/core/src/classpath/tools/gnu/classpath/tools/serialver/SerialVer.java
Modified: trunk/core/src/classpath/tools/gnu/classpath/tools/jar/Creator.java
===================================================================
--- trunk/core/src/classpath/tools/gnu/classpath/tools/jar/Creator.java 2007-01-07 08:25:33 UTC (rev 3007)
+++ trunk/core/src/classpath/tools/gnu/classpath/tools/jar/Creator.java 2007-01-07 08:26:36 UTC (rev 3008)
@@ -60,7 +60,7 @@
extends Action
{
JarOutputStream outputStream;
- HashSet writtenItems = new HashSet();
+ HashSet<String> writtenItems = new HashSet<String>();
// The manifest to use, or null if we don't want a manifest.
Manifest manifest;
@@ -142,18 +142,21 @@
throws IOException
{
boolean isDirectory = file.isDirectory();
- InputStream inputStream = null;
if (isDirectory)
{
if (filename.charAt(filename.length() - 1) != '/')
filename += '/';
+ writeFile(isDirectory, null, filename, verbose);
}
else
- inputStream = new FileInputStream(file);
+ {
+ InputStream inputStream = new FileInputStream(file);
writeFile(isDirectory, inputStream, filename, verbose);
+ inputStream.close();
+ }
}
- private void addEntries(ArrayList result, Entry entry)
+ private void addEntries(ArrayList<Entry> result, Entry entry)
{
if (entry.file.isDirectory())
{
@@ -173,10 +176,10 @@
result.add(entry);
}
- private ArrayList getAllEntries(Main parameters)
+ private ArrayList<Entry> getAllEntries(Main parameters)
{
Iterator it = parameters.entries.iterator();
- ArrayList allEntries = new ArrayList();
+ ArrayList<Entry> allEntries = new ArrayList<Entry>();
while (it.hasNext())
{
Entry entry = (Entry) it.next();
Modified: trunk/core/src/classpath/tools/gnu/classpath/tools/jar/Indexer.java
===================================================================
--- trunk/core/src/classpath/tools/gnu/classpath/tools/jar/Indexer.java 2007-01-07 08:25:33 UTC (rev 3007)
+++ trunk/core/src/classpath/tools/gnu/classpath/tools/jar/Indexer.java 2007-01-07 08:26:36 UTC (rev 3008)
@@ -72,7 +72,7 @@
// Index the files in this jar.
// The results look a little better if we keep them
// in insertion order.
- LinkedHashSet entries = new LinkedHashSet();
+ LinkedHashSet<String> entries = new LinkedHashSet<String>();
Enumeration e = jf.entries();
while (e.hasMoreElements())
{
Modified: trunk/core/src/classpath/tools/gnu/classpath/tools/jar/Main.java
===================================================================
--- trunk/core/src/classpath/tools/gnu/classpath/tools/jar/Main.java 2007-01-07 08:25:33 UTC (rev 3007)
+++ trunk/core/src/classpath/tools/gnu/classpath/tools/jar/Main.java 2007-01-07 08:26:36 UTC (rev 3008)
@@ -78,7 +78,7 @@
File manifestFile;
/** A list of Entry objects, each describing a file to write. */
- ArrayList entries = new ArrayList();
+ ArrayList<Entry> entries = new ArrayList<Entry>();
/** Used only while parsing, holds the first argument for -C. */
String changedDirectory;
Modified: trunk/core/src/classpath/tools/gnu/classpath/tools/jar/WorkSet.java
===================================================================
--- trunk/core/src/classpath/tools/gnu/classpath/tools/jar/WorkSet.java 2007-01-07 08:25:33 UTC (rev 3007)
+++ trunk/core/src/classpath/tools/gnu/classpath/tools/jar/WorkSet.java 2007-01-07 08:26:36 UTC (rev 3008)
@@ -44,13 +44,13 @@
public class WorkSet
{
- private HashSet allItems;
+ private HashSet<String> allItems;
private void initSet(ArrayList entries)
{
if (entries == null || entries.isEmpty())
return;
- allItems = new HashSet();
+ allItems = new HashSet<String>();
Iterator it = entries.iterator();
while (it.hasNext())
{
Modified: trunk/core/src/classpath/tools/gnu/classpath/tools/jarsigner/Main.java
===================================================================
--- trunk/core/src/classpath/tools/gnu/classpath/tools/jarsigner/Main.java 2007-01-07 08:25:33 UTC (rev 3007)
+++ trunk/core/src/classpath/tools/gnu/classpath/tools/jarsigner/Main.java 2007-01-07 08:26:36 UTC (rev 3008)
@@ -123,7 +123,7 @@
private CallbackHandler handler;
/** The command line parser. */
private ToolParser cmdLineParser;
- protected ArrayList fileAndAlias = new ArrayList();;
+ protected ArrayList fileAndAlias = new ArrayList();
private Main()
{
Modified: trunk/core/src/classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java
===================================================================
--- trunk/core/src/classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java 2007-01-07 08:25:33 UTC (rev 3007)
+++ trunk/core/src/classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java 2007-01-07 08:26:36 UTC (rev 3008)
@@ -180,6 +180,5 @@
public static void main(String[] args)
{
new Native2ASCII().run(args);
- String encoding = System.getProperty("file.encoding"); //$NON-NLS-1$
}
}
Modified: trunk/core/src/classpath/tools/gnu/classpath/tools/serialver/SerialVer.java
===================================================================
--- trunk/core/src/classpath/tools/gnu/classpath/tools/serialver/SerialVer.java 2007-01-07 08:25:33 UTC (rev 3007)
+++ trunk/core/src/classpath/tools/gnu/classpath/tools/serialver/SerialVer.java 2007-01-07 08:26:36 UTC (rev 3008)
@@ -45,12 +45,12 @@
public class SerialVer
{
// List of classes to load.
- ArrayList classes = new ArrayList();
+ ArrayList<String> classes = new ArrayList<String>();
// The class path to use.
String classpath;
// FIXME: taken from ClassLoader, should share it.
- private static void addFileURL(ArrayList list, String file)
+ private static void addFileURL(ArrayList<URL> list, String file)
{
try
{
@@ -72,7 +72,7 @@
{
StringTokenizer tok = new StringTokenizer(classpath,
File.pathSeparator, true);
- ArrayList list = new ArrayList();
+ ArrayList<URL> list = new ArrayList<URL>();
while (tok.hasMoreTokens())
{
String s = tok.nextToken();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|