Browse Source

don't need reflection anymore for Properties#loadFromXML

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1330091 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 13 years ago
parent
commit
36787ae6b8
1 changed files with 1 additions and 13 deletions
  1. +1
    -13
      src/main/org/apache/tools/ant/taskdefs/Property.java

+ 1
- 13
src/main/org/apache/tools/ant/taskdefs/Property.java View File

@@ -21,7 +21,6 @@ import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.lang.reflect.Method;
import java.net.URL; import java.net.URL;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.HashMap; import java.util.HashMap;
@@ -563,18 +562,7 @@ public class Property extends Task {
Properties props, InputStream is, boolean isXml) throws IOException { Properties props, InputStream is, boolean isXml) throws IOException {
if (isXml) { if (isXml) {
// load the xml based property definition // load the xml based property definition
// use reflection because of bwc to Java 1.4
try {
Method loadXmlMethod = props.getClass().getMethod("loadFromXML",
new Class[] {InputStream.class});
loadXmlMethod.invoke(props, new Object[] {is});
} catch (NoSuchMethodException e) {
e.printStackTrace();
log("Can not load xml based property definition on Java < 5");
} catch (Exception e) {
// no-op
e.printStackTrace();
}
props.loadFromXML(is);
} else { } else {
// load ".properties" format // load ".properties" format
props.load(is); props.load(is);


Loading…
Cancel
Save