Browse Source

whitespace

master
Stefan Bodewig 8 years ago
parent
commit
c8a72df591
4 changed files with 69 additions and 69 deletions
  1. +7
    -7
      src/main/org/apache/tools/ant/taskdefs/optional/depend/DirectoryIterator.java
  2. +40
    -40
      src/main/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java
  3. +17
    -17
      src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java
  4. +5
    -5
      src/main/org/apache/tools/ant/types/resources/ResourceList.java

+ 7
- 7
src/main/org/apache/tools/ant/taskdefs/optional/depend/DirectoryIterator.java View File

@@ -134,16 +134,16 @@ public class DirectoryIterator implements ClassFileIterator {
= new FileInputStream(element);

try {
if (element.getName().endsWith(".class")) {
if (element.getName().endsWith(".class")) {

// create a data input stream from the jar
// input stream
ClassFile javaClass = new ClassFile();
// create a data input stream from the jar
// input stream
ClassFile javaClass = new ClassFile();

javaClass.read(inFileStream);
javaClass.read(inFileStream);

nextElement = javaClass;
}
nextElement = javaClass;
}
} finally {
inFileStream.close();
}


+ 40
- 40
src/main/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java View File

@@ -224,52 +224,52 @@ public class jlink {
}
ZipFile zipf = new ZipFile(f);
try {
Enumeration entries = zipf.entries();

while (entries.hasMoreElements()) {
ZipEntry inputEntry = (ZipEntry) entries.nextElement();
//Ignore manifest entries. They're bound to cause conflicts between
//files that are being merged. User should supply their own
//manifest file when doing the merge.
String inputEntryName = inputEntry.getName();
int index = inputEntryName.indexOf("META-INF");

if (index < 0) {
//META-INF not found in the name of the entry. Go ahead and process it.
try {
output.putNextEntry(processEntry(zipf, inputEntry));
} catch (ZipException ex) {
//If we get here, it could be because we are trying to put a
//directory entry that already exists.
//For example, we're trying to write "com", but a previous
//entry from another mergefile was called "com".
//In that case, just ignore the error and go on to the
//next entry.
String mess = ex.getMessage();

if (mess.indexOf("duplicate") >= 0) {
//It was the duplicate entry.
continue;
} else {
// I hate to admit it, but we don't know what happened
// here. Throw the Exception.
throw ex;
Enumeration entries = zipf.entries();

while (entries.hasMoreElements()) {
ZipEntry inputEntry = (ZipEntry) entries.nextElement();
//Ignore manifest entries. They're bound to cause conflicts between
//files that are being merged. User should supply their own
//manifest file when doing the merge.
String inputEntryName = inputEntry.getName();
int index = inputEntryName.indexOf("META-INF");

if (index < 0) {
//META-INF not found in the name of the entry. Go ahead and process it.
try {
output.putNextEntry(processEntry(zipf, inputEntry));
} catch (ZipException ex) {
//If we get here, it could be because we are trying to put a
//directory entry that already exists.
//For example, we're trying to write "com", but a previous
//entry from another mergefile was called "com".
//In that case, just ignore the error and go on to the
//next entry.
String mess = ex.getMessage();

if (mess.indexOf("duplicate") >= 0) {
//It was the duplicate entry.
continue;
} else {
// I hate to admit it, but we don't know what happened
// here. Throw the Exception.
throw ex;
}
}
}

InputStream in = zipf.getInputStream(inputEntry);
int len = buffer.length;
int count = -1;
InputStream in = zipf.getInputStream(inputEntry);
int len = buffer.length;
int count = -1;

while ((count = in.read(buffer, 0, len)) > 0) {
output.write(buffer, 0, count);
while ((count = in.read(buffer, 0, len)) > 0) {
output.write(buffer, 0, count);
}
in.close();
output.closeEntry();
}
in.close();
output.closeEntry();
}
}
} finally {
zipf.close();
zipf.close();
}
}



+ 17
- 17
src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java View File

@@ -117,25 +117,25 @@ public class AntSoundPlayer implements LineListener, BuildListener {
DataLine.Info info = new DataLine.Info(Clip.class, format,
AudioSystem.NOT_SPECIFIED);
try {
try {
audioClip = (Clip) AudioSystem.getLine(info);
audioClip.addLineListener(this);
audioClip.open(audioInputStream);
} catch (LineUnavailableException e) {
project.log("The sound device is currently unavailable");
return;
} catch (IOException e) {
e.printStackTrace();
}
try {
audioClip = (Clip) AudioSystem.getLine(info);
audioClip.addLineListener(this);
audioClip.open(audioInputStream);
} catch (LineUnavailableException e) {
project.log("The sound device is currently unavailable");
return;
} catch (IOException e) {
e.printStackTrace();
}

if (duration != null) {
playClip(audioClip, duration.longValue());
} else {
playClip(audioClip, loops);
}
audioClip.drain();
if (duration != null) {
playClip(audioClip, duration.longValue());
} else {
playClip(audioClip, loops);
}
audioClip.drain();
} finally {
audioClip.close();
audioClip.close();
}
} else {
project.log("Can't get data from file " + file.getName());


+ 5
- 5
src/main/org/apache/tools/ant/types/resources/ResourceList.java View File

@@ -198,12 +198,12 @@ public class ResourceList extends DataType implements ResourceCollection {
Union streamResources = new Union();
BufferedReader reader = new BufferedReader(crh.getAssembledReader());
try {
streamResources.setCache(true);
streamResources.setCache(true);

String line = null;
while ((line = reader.readLine()) != null) {
streamResources.add(parse(line));
}
String line = null;
while ((line = reader.readLine()) != null) {
streamResources.add(parse(line));
}
} finally {
reader.close();
}


Loading…
Cancel
Save