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 to...@apache.org on 2003/02/06 16:22:04 UTC
cvs commit: xml-axis/java/src/org/apache/axis/wsdl/toJava Utils.java
tomj 2003/02/06 07:22:04
Modified: java/src/org/apache/axis/wsdl/toJava Utils.java
Log:
Bug 16843: replace periods with underscores when making package names.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16843
Revision Changes Path
1.69 +12 -1 xml-axis/java/src/org/apache/axis/wsdl/toJava/Utils.java
Index: Utils.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/Utils.java,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- Utils.java 31 Jan 2003 01:30:57 -0000 1.68
+++ Utils.java 6 Feb 2003 15:22:04 -0000 1.69
@@ -466,9 +466,20 @@
if( ! firstWord )
sb.append('.');
- // convert digits to underscores
+ // prefix digits with underscores
if( Character.isDigit(word.charAt(0)) )
sb.append('_');
+
+ // replace periods with underscores
+ if (word.indexOf('.') != -1) {
+ char[] buf = word.toCharArray();
+ for (int i=0; i < word.length(); i++) {
+ if (buf[i] == '.') {
+ buf[i] = '_';
+ }
+ }
+ word = new String(buf);
+ }
sb.append( word );
}