Browse Source

better reporting of linkage error in checkTaskClass

PR: 26332
Obtained from: Jesse Glick


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275955 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 21 years ago
parent
commit
6356d19ab4
2 changed files with 9 additions and 1 deletions
  1. +4
    -0
      src/main/org/apache/tools/ant/Project.java
  2. +5
    -1
      src/main/org/apache/tools/ant/TaskAdapter.java

+ 4
- 0
src/main/org/apache/tools/ant/Project.java View File

@@ -926,6 +926,10 @@ public class Project {
+ taskClass;
log(message, Project.MSG_ERR);
throw new BuildException(message);
} catch (LinkageError e) {
String message = "Could not load " + taskClass + ": " + e;
log(message, Project.MSG_ERR);
throw new BuildException(message, e);
}
if (!Task.class.isAssignableFrom(taskClass)) {
TaskAdapter.checkTaskClass(taskClass, this);


+ 5
- 1
src/main/org/apache/tools/ant/TaskAdapter.java View File

@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2003 The Apache Software Foundation. All rights
* Copyright (c) 2000-2004 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -106,6 +106,10 @@ public class TaskAdapter extends Task implements TypeAdapter {
final String message = "No public execute() in " + taskClass;
project.log(message, Project.MSG_ERR);
throw new BuildException(message);
} catch (LinkageError e) {
String message = "Could not load " + taskClass + ": " + e;
project.log(message, Project.MSG_ERR);
throw new BuildException(message, e);
}
}



Loading…
Cancel
Save