You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by aj...@apache.org on 2006/06/05 16:30:17 UTC
svn commit: r411800 -
/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java
Author: ajith
Date: Mon Jun 5 07:30:17 2006
New Revision: 411800
URL: http://svn.apache.org/viewvc?rev=411800&view=rev
Log:
Slightly improved the code to avoid a possible NPE when the property files are not updated
Modified:
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java?rev=411800&r1=411799&r2=411800&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java Mon Jun 5 07:30:17 2006
@@ -46,7 +46,7 @@
import java.util.Map;
public class CodeGenerationEngine {
- private static final Log log = LogFactory.getLog(CodeGenerationEngine.class);
+ private static final Log log = LogFactory.getLog(CodeGenerationEngine.class);
private List preExtensions = new ArrayList();
private List postExtensions = new ArrayList();
@@ -113,15 +113,20 @@
private void loadExtensions() throws CodeGenerationException {
//load pre extensions
String[] extensions = ConfigPropertyFileLoader.getExtensionClassNames();
- for (int i = 0; i < extensions.length; i++) {
- //load the Extension class
- addPreExtension((CodeGenExtension) getObjectFromClassName(extensions[i]));
+ if (extensions!=null){
+ for (int i = 0; i < extensions.length; i++) {
+ //load the Extension class
+ addPreExtension((CodeGenExtension) getObjectFromClassName(extensions[i]));
+ }
}
+
//load post extensions
String[] postExtensions = ConfigPropertyFileLoader.getPostExtensionClassNames();
- for (int i = 0; i < postExtensions.length; i++) {
- //load the Extension class
- addPostExtension((CodeGenExtension) getObjectFromClassName(postExtensions[i]));
+ if (postExtensions!=null){
+ for (int i = 0; i < postExtensions.length; i++) {
+ //load the Extension class
+ addPostExtension((CodeGenExtension) getObjectFromClassName(postExtensions[i]));
+ }
}
}
@@ -132,17 +137,17 @@
*/
private void addPreExtension(CodeGenExtension ext) {
if(ext != null) {
- preExtensions.add(ext);
+ preExtensions.add(ext);
}
}
- /**
+ /**
* Adds a given extension to the list
* @param ext
*/
private void addPostExtension(CodeGenExtension ext) {
if(ext != null) {
- postExtensions.add(ext);
+ postExtensions.add(ext);
}
}
@@ -227,7 +232,7 @@
baseURI = uri;
} else{
if(file.getParentFile() == null){
- try {
+ try {
baseURI = new File(".").getCanonicalFile().toURI().toString();
} catch (IOException e) {
throw new RuntimeException(e);
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org