Browse Source

Merge branch '1.9.x' closes #46

master
Stefan Bodewig 7 years ago
parent
commit
5f70336124
3 changed files with 11 additions and 18 deletions
  1. +4
    -15
      src/main/org/apache/tools/ant/AntTypeDefinition.java
  2. +6
    -2
      src/main/org/apache/tools/ant/Diagnostics.java
  3. +1
    -1
      src/main/org/apache/tools/ant/dispatch/DispatchUtils.java

+ 4
- 15
src/main/org/apache/tools/ant/AntTypeDefinition.java View File

@@ -217,19 +217,12 @@ public class AntTypeDefinition {
return null;
}
Object o = createAndSet(project, c);
if (o == null || adapterClass == null) {
if (adapterClass == null
|| (adaptToClass != null && adaptToClass.isAssignableFrom(o.getClass()))) {
return o;
}
if (adaptToClass != null) {
if (adaptToClass.isAssignableFrom(o.getClass())) {
return o;
}
}
TypeAdapter adapterObject = (TypeAdapter) createAndSet(
project, adapterClass);
if (adapterObject == null) {
return null;
}
adapterObject.setProxy(o);
return adapterObject;
}
@@ -257,9 +250,6 @@ public class AntTypeDefinition {
|| !adaptToClass.isAssignableFrom(clazz))) {
TypeAdapter adapter = (TypeAdapter) createAndSet(
project, adapterClass);
if (adapter == null) {
throw new BuildException("Unable to create adapter object");
}
adapter.checkProxyClass(clazz);
}
}
@@ -267,12 +257,11 @@ public class AntTypeDefinition {
/**
* Get the constructor of the definition
* and invoke it.
* @return the instantiated <code>Object</code>.
* @return the instantiated <code>Object</code>, will never be null.
*/
private Object createAndSet(Project project, Class<?> c) {
try {
Object o = innerCreateAndSet(c, project);
return o;
return innerCreateAndSet(c, project);
} catch (InvocationTargetException ex) {
Throwable t = ex.getTargetException();
throw new BuildException(


+ 6
- 2
src/main/org/apache/tools/ant/Diagnostics.java View File

@@ -185,8 +185,12 @@ public final class Diagnostics {
* @return parser or null for trouble
*/
private static SAXParser getSAXParser() {
SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
if (saxParserFactory == null) {
SAXParserFactory saxParserFactory = null;
try {
saxParserFactory = SAXParserFactory.newInstance();
} catch (Exception e) {
// ignore
ignoreThrowable(e);
return null;
}
SAXParser saxParser = null;


+ 1
- 1
src/main/org/apache/tools/ant/dispatch/DispatchUtils.java View File

@@ -64,7 +64,7 @@ public class DispatchUtils {
final Object o = actionM.invoke(dispatchable, (Object[]) null);
if (o != null) {
final String s = o.toString();
if (s != null && s.trim().length() > 0) {
if (s.trim().length() > 0) {
methodName = s.trim();
Method executeM = null;
executeM = dispatchable.getClass().getMethod(


Loading…
Cancel
Save