Author: dkulp
Date: Tue Oct 23 19:50:46 2012
New Revision: 1401418
URL: http://svn.apache.org/viewvc?rev=1401418&view=rev
Log:
Avoid a NPE in the mojo to make sure the "real" error surfaces
Modified:
cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WSDL2JavaMojo.java
Modified:
cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WSDL2JavaMojo.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WSDL2JavaMojo.java?rev=1401418&r1=1401417&r2=1401418&view=diff
==============================================================================
---
cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WSDL2JavaMojo.java
(original)
+++
cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WSDL2JavaMojo.java
Tue Oct 23 19:50:46 2012
@@ -71,12 +71,16 @@ public class WSDL2JavaMojo extends Abstr
errorfiles.add(f);
}
if (f == null) {
- f = new File(file) {
- private static final long serialVersionUID = 1L;
- public String getAbsolutePath() {
- return file;
- }
- };
+ if (file == null) {
+ f = new File("null");
+ } else {
+ f = new File(file) {
+ private static final long serialVersionUID = 1L;
+ public String getAbsolutePath() {
+ return file;
+ }
+ };
+ }
}
buildContext.addMessage(f, line, column, message,
BuildContext.SEVERITY_ERROR, t);
}