Some improvements in the tooling code
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/03987585 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/03987585 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/03987585 Branch: refs/heads/CXF-6882.nio Commit: 03987585902ef5db3c265a353e483f20e31b2c18 Parents: f4252d0 Author: Colm O hEigeartaigh <cohei...@apache.org> Authored: Mon Nov 28 13:56:14 2016 +0000 Committer: Colm O hEigeartaigh <cohei...@apache.org> Committed: Mon Nov 28 13:56:14 2016 +0000 ---------------------------------------------------------------------- .../tools/common/AbstractCXFToolContainer.java | 2 +- .../org/apache/cxf/tools/common/ClassUtils.java | 2 +- .../cxf/tools/common/ToolErrorListener.java | 2 +- .../common/toolspec/AbstractToolContainer.java | 2 +- .../toolspec/parser/CommandLineParser.java | 14 +- .../tools/corba/processors/idl/IDLLexer.java | 130 +++++++++---------- .../tools/corba/common/idltypes/IdlParam.java | 2 +- .../corba/common/idltypes/IdlPrimitive.java | 2 +- .../corba/common/idltypes/IdlScopedName.java | 2 +- .../corba/common/idltypes/IdlStructBase.java | 2 +- .../idlpreprocessor/IdlPreprocessorReader.java | 2 +- .../corba/processors/idl/ArrayVisitor.java | 2 +- .../processors/idl/IDLToWSDLProcessor.java | 23 ++-- .../corba/processors/idl/ScopedNameVisitor.java | 3 +- .../corba/processors/idl/StringVisitor.java | 4 +- .../corba/processors/idl/WSDLSchemaManager.java | 19 ++- .../processors/wsdl/WSDLToCorbaBinding.java | 11 +- .../processors/wsdl/WSDLToCorbaHelper.java | 1 - .../processors/wsdl/WSDLToCorbaProcessor.java | 6 +- .../corba/processors/wsdl/WSDLToIDLAction.java | 8 +- .../databinding/jaxb/JAXBDataBinding.java | 2 +- .../jaxws/customization/JAXWSBindingParser.java | 2 +- .../jaxws/generators/FaultGenerator.java | 6 +- .../misc/processor/WSDLToSoapProcessor.java | 13 +- 24 files changed, 129 insertions(+), 133 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java ---------------------------------------------------------------------- diff --git a/tools/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java b/tools/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java index 96fc51c..c5d68a9 100644 --- a/tools/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java +++ b/tools/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java @@ -160,7 +160,7 @@ public abstract class AbstractCXFToolContainer extends AbstractToolContainer { fileBase = tok.nextToken(); } if (fileBase.endsWith(".wsdl")) { - fileBase = new String(fileBase.substring(0, fileBase.length() - 5)); + fileBase = fileBase.substring(0, fileBase.length() - 5); } return fileBase; } http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java ---------------------------------------------------------------------- diff --git a/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java b/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java index 6085c34..1ac6744 100644 --- a/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java +++ b/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java @@ -82,7 +82,7 @@ public class ClassUtils { dirSet.add(path); File file = new File(path); - if (file.isDirectory()) { + if (file.isDirectory() && file.list() != null) { for (String str : file.list()) { if (str.endsWith("java")) { fileList.add(path + str); http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/common/src/main/java/org/apache/cxf/tools/common/ToolErrorListener.java ---------------------------------------------------------------------- diff --git a/tools/common/src/main/java/org/apache/cxf/tools/common/ToolErrorListener.java b/tools/common/src/main/java/org/apache/cxf/tools/common/ToolErrorListener.java index aff9015..422084f 100644 --- a/tools/common/src/main/java/org/apache/cxf/tools/common/ToolErrorListener.java +++ b/tools/common/src/main/java/org/apache/cxf/tools/common/ToolErrorListener.java @@ -31,7 +31,7 @@ import org.apache.cxf.common.logging.LogUtils; public class ToolErrorListener { private static final Logger LOG = LogUtils.getL7dLogger(ToolErrorListener.class); - class ErrorInfo { + static class ErrorInfo { String file; int line; int col; http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java ---------------------------------------------------------------------- diff --git a/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java b/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java index d26c3ef..9bf3d4f 100644 --- a/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java +++ b/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java @@ -57,7 +57,7 @@ public abstract class AbstractToolContainer implements ToolContainer { private OutputStream outOutputStream; private OutputStream errOutputStream; - public class GenericOutputStream extends OutputStream { + public static class GenericOutputStream extends OutputStream { public void write(int b) throws IOException { } http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java ---------------------------------------------------------------------- diff --git a/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java b/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java index 967f4be..bb757db 100644 --- a/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java +++ b/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java @@ -210,8 +210,8 @@ public class CommandLineParser { public String getUsage() throws TransformerException, IOException { // REVISIT: style usage document into a form more readily output as a // usage message - try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { - InputStream in = getClass().getResourceAsStream("usage.xsl"); + try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); + InputStream in = getClass().getResourceAsStream("usage.xsl")) { toolspec.transform(in, baos); return baos.toString(); @@ -221,16 +221,18 @@ public class CommandLineParser { public String getDetailedUsage() throws TransformerException, IOException { // REVISIT: style usage document into a form more readily output as a // usage message - try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { - toolspec.transform(getClass().getResourceAsStream("detailedUsage.xsl"), baos); + try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); + InputStream is = getClass().getResourceAsStream("detailedUsage.xsl")) { + toolspec.transform(is, baos); return baos.toString(); } } public String getFormattedDetailedUsage() throws TransformerException, IOException { String usage = null; - try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { - toolspec.transform(getClass().getResourceAsStream("detailedUsage.xsl"), baos); + try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); + InputStream is = getClass().getResourceAsStream("detailedUsage.xsl")) { + toolspec.transform(is, baos); usage = baos.toString(); } // we use the following pattern to format usage http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java ---------------------------------------------------------------------- diff --git a/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java b/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java index aab7339..7498df2 100644 --- a/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java +++ b/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java @@ -47,71 +47,71 @@ public IDLLexer(LexerSharedInputState state) { caseSensitiveLiterals = true; setCaseSensitive(true); literals = new Hashtable<ANTLRHashString, Integer>(); - literals.put(new ANTLRHashString("switch", this), new Integer(56)); - literals.put(new ANTLRHashString("typeprefix", this), new Integer(78)); - literals.put(new ANTLRHashString("case", this), new Integer(57)); - literals.put(new ANTLRHashString("finder", this), new Integer(93)); - literals.put(new ANTLRHashString("manages", this), new Integer(91)); - literals.put(new ANTLRHashString("interface", this), new Integer(7)); - literals.put(new ANTLRHashString("provides", this), new Integer(84)); - literals.put(new ANTLRHashString("exception", this), new Integer(67)); - literals.put(new ANTLRHashString("primarykey", this), new Integer(92)); - literals.put(new ANTLRHashString("sequence", this), new Integer(60)); - literals.put(new ANTLRHashString("uses", this), new Integer(85)); - literals.put(new ANTLRHashString("consumes", this), new Integer(89)); - literals.put(new ANTLRHashString("void", this), new Integer(69)); - literals.put(new ANTLRHashString("factory", this), new Integer(22)); - literals.put(new ANTLRHashString("import", this), new Integer(76)); - literals.put(new ANTLRHashString("float", this), new Integer(43)); - literals.put(new ANTLRHashString("publishes", this), new Integer(88)); - literals.put(new ANTLRHashString("private", this), new Integer(21)); - literals.put(new ANTLRHashString("boolean", this), new Integer(50)); - literals.put(new ANTLRHashString("string", this), new Integer(63)); - literals.put(new ANTLRHashString("getraises", this), new Integer(81)); - literals.put(new ANTLRHashString("emits", this), new Integer(87)); - literals.put(new ANTLRHashString("custom", this), new Integer(8)); - literals.put(new ANTLRHashString("component", this), new Integer(83)); - literals.put(new ANTLRHashString("context", this), new Integer(73)); - literals.put(new ANTLRHashString("octet", this), new Integer(51)); - literals.put(new ANTLRHashString("oneway", this), new Integer(68)); - literals.put(new ANTLRHashString("long", this), new Integer(45)); - literals.put(new ANTLRHashString("ValueBase", this), new Integer(75)); - literals.put(new ANTLRHashString("in", this), new Integer(25)); - literals.put(new ANTLRHashString("truncatable", this), new Integer(18)); - literals.put(new ANTLRHashString("FALSE", this), new Integer(40)); - literals.put(new ANTLRHashString("readonly", this), new Integer(79)); - literals.put(new ANTLRHashString("typedef", this), new Integer(41)); - literals.put(new ANTLRHashString("supports", this), new Integer(19)); - literals.put(new ANTLRHashString("short", this), new Integer(46)); - literals.put(new ANTLRHashString("TRUE", this), new Integer(39)); - literals.put(new ANTLRHashString("fixed", this), new Integer(74)); - literals.put(new ANTLRHashString("Object", this), new Integer(53)); - literals.put(new ANTLRHashString("enum", this), new Integer(59)); - literals.put(new ANTLRHashString("home", this), new Integer(90)); - literals.put(new ANTLRHashString("multiple", this), new Integer(86)); - literals.put(new ANTLRHashString("attribute", this), new Integer(80)); - literals.put(new ANTLRHashString("char", this), new Integer(48)); - literals.put(new ANTLRHashString("union", this), new Integer(55)); - literals.put(new ANTLRHashString("local", this), new Integer(6)); - literals.put(new ANTLRHashString("const", this), new Integer(26)); - literals.put(new ANTLRHashString("setraises", this), new Integer(82)); - literals.put(new ANTLRHashString("abstract", this), new Integer(5)); - literals.put(new ANTLRHashString("valuetype", this), new Integer(9)); - literals.put(new ANTLRHashString("inout", this), new Integer(71)); - literals.put(new ANTLRHashString("raises", this), new Integer(72)); - literals.put(new ANTLRHashString("out", this), new Integer(70)); - literals.put(new ANTLRHashString("typeid", this), new Integer(77)); - literals.put(new ANTLRHashString("wchar", this), new Integer(49)); - literals.put(new ANTLRHashString("any", this), new Integer(52)); - literals.put(new ANTLRHashString("double", this), new Integer(44)); - literals.put(new ANTLRHashString("default", this), new Integer(58)); - literals.put(new ANTLRHashString("eventtype", this), new Integer(10)); - literals.put(new ANTLRHashString("wstring", this), new Integer(64)); - literals.put(new ANTLRHashString("unsigned", this), new Integer(47)); - literals.put(new ANTLRHashString("struct", this), new Integer(54)); - literals.put(new ANTLRHashString("public", this), new Integer(20)); - literals.put(new ANTLRHashString("module", this), new Integer(11)); - literals.put(new ANTLRHashString("native", this), new Integer(42)); + literals.put(new ANTLRHashString("switch", this), Integer.valueOf(56)); + literals.put(new ANTLRHashString("typeprefix", this), Integer.valueOf(78)); + literals.put(new ANTLRHashString("case", this), Integer.valueOf(57)); + literals.put(new ANTLRHashString("finder", this), Integer.valueOf(93)); + literals.put(new ANTLRHashString("manages", this), Integer.valueOf(91)); + literals.put(new ANTLRHashString("interface", this), Integer.valueOf(7)); + literals.put(new ANTLRHashString("provides", this), Integer.valueOf(84)); + literals.put(new ANTLRHashString("exception", this), Integer.valueOf(67)); + literals.put(new ANTLRHashString("primarykey", this), Integer.valueOf(92)); + literals.put(new ANTLRHashString("sequence", this), Integer.valueOf(60)); + literals.put(new ANTLRHashString("uses", this), Integer.valueOf(85)); + literals.put(new ANTLRHashString("consumes", this), Integer.valueOf(89)); + literals.put(new ANTLRHashString("void", this), Integer.valueOf(69)); + literals.put(new ANTLRHashString("factory", this), Integer.valueOf(22)); + literals.put(new ANTLRHashString("import", this), Integer.valueOf(76)); + literals.put(new ANTLRHashString("float", this), Integer.valueOf(43)); + literals.put(new ANTLRHashString("publishes", this), Integer.valueOf(88)); + literals.put(new ANTLRHashString("private", this), Integer.valueOf(21)); + literals.put(new ANTLRHashString("boolean", this), Integer.valueOf(50)); + literals.put(new ANTLRHashString("string", this), Integer.valueOf(63)); + literals.put(new ANTLRHashString("getraises", this), Integer.valueOf(81)); + literals.put(new ANTLRHashString("emits", this), Integer.valueOf(87)); + literals.put(new ANTLRHashString("custom", this), Integer.valueOf(8)); + literals.put(new ANTLRHashString("component", this), Integer.valueOf(83)); + literals.put(new ANTLRHashString("context", this), Integer.valueOf(73)); + literals.put(new ANTLRHashString("octet", this), Integer.valueOf(51)); + literals.put(new ANTLRHashString("oneway", this), Integer.valueOf(68)); + literals.put(new ANTLRHashString("long", this), Integer.valueOf(45)); + literals.put(new ANTLRHashString("ValueBase", this), Integer.valueOf(75)); + literals.put(new ANTLRHashString("in", this), Integer.valueOf(25)); + literals.put(new ANTLRHashString("truncatable", this), Integer.valueOf(18)); + literals.put(new ANTLRHashString("FALSE", this), Integer.valueOf(40)); + literals.put(new ANTLRHashString("readonly", this), Integer.valueOf(79)); + literals.put(new ANTLRHashString("typedef", this), Integer.valueOf(41)); + literals.put(new ANTLRHashString("supports", this), Integer.valueOf(19)); + literals.put(new ANTLRHashString("short", this), Integer.valueOf(46)); + literals.put(new ANTLRHashString("TRUE", this), Integer.valueOf(39)); + literals.put(new ANTLRHashString("fixed", this), Integer.valueOf(74)); + literals.put(new ANTLRHashString("Object", this), Integer.valueOf(53)); + literals.put(new ANTLRHashString("enum", this), Integer.valueOf(59)); + literals.put(new ANTLRHashString("home", this), Integer.valueOf(90)); + literals.put(new ANTLRHashString("multiple", this), Integer.valueOf(86)); + literals.put(new ANTLRHashString("attribute", this), Integer.valueOf(80)); + literals.put(new ANTLRHashString("char", this), Integer.valueOf(48)); + literals.put(new ANTLRHashString("union", this), Integer.valueOf(55)); + literals.put(new ANTLRHashString("local", this), Integer.valueOf(6)); + literals.put(new ANTLRHashString("const", this), Integer.valueOf(26)); + literals.put(new ANTLRHashString("setraises", this), Integer.valueOf(82)); + literals.put(new ANTLRHashString("abstract", this), Integer.valueOf(5)); + literals.put(new ANTLRHashString("valuetype", this), Integer.valueOf(9)); + literals.put(new ANTLRHashString("inout", this), Integer.valueOf(71)); + literals.put(new ANTLRHashString("raises", this), Integer.valueOf(72)); + literals.put(new ANTLRHashString("out", this), Integer.valueOf(70)); + literals.put(new ANTLRHashString("typeid", this), Integer.valueOf(77)); + literals.put(new ANTLRHashString("wchar", this), Integer.valueOf(49)); + literals.put(new ANTLRHashString("any", this), Integer.valueOf(52)); + literals.put(new ANTLRHashString("double", this), Integer.valueOf(44)); + literals.put(new ANTLRHashString("default", this), Integer.valueOf(58)); + literals.put(new ANTLRHashString("eventtype", this), Integer.valueOf(10)); + literals.put(new ANTLRHashString("wstring", this), Integer.valueOf(64)); + literals.put(new ANTLRHashString("unsigned", this), Integer.valueOf(47)); + literals.put(new ANTLRHashString("struct", this), Integer.valueOf(54)); + literals.put(new ANTLRHashString("public", this), Integer.valueOf(20)); + literals.put(new ANTLRHashString("module", this), Integer.valueOf(11)); + literals.put(new ANTLRHashString("native", this), Integer.valueOf(42)); } public Token nextToken() throws TokenStreamException { http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlParam.java ---------------------------------------------------------------------- diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlParam.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlParam.java index a4c04df..77f2ef6 100644 --- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlParam.java +++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlParam.java @@ -35,7 +35,7 @@ public final class IdlParam extends IdlDefnImplBase { private IdlParam(IdlOperation parent, String name, IdlType typeType, String modeValue) { super(parent, name); this.type = typeType; - this.mode = new String(modeValue); + this.mode = modeValue; } public static IdlParam create(IdlOperation parent, String name, IdlType type, String mode) { http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlPrimitive.java ---------------------------------------------------------------------- diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlPrimitive.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlPrimitive.java index 4325032..35188e0 100644 --- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlPrimitive.java +++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlPrimitive.java @@ -44,7 +44,7 @@ public final class IdlPrimitive extends IdlDefnImplBase implements IdlType { private IdlPrimitive(IdlScopeBase parent, String name, String wsdlFileName, short typeValue) { super(parent, name); - this.wsdlName = new String(wsdlFileName); + this.wsdlName = wsdlFileName; this.type = typeValue; } http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlScopedName.java ---------------------------------------------------------------------- diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlScopedName.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlScopedName.java index c84926b..88e94ac 100644 --- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlScopedName.java +++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlScopedName.java @@ -28,7 +28,7 @@ public class IdlScopedName { IdlScopedName(IdlScopeBase parent, String name) { if (parent != null) { - fullName = new String(parent.fullName() + ToolCorbaConstants.MODULE_SEPARATOR + name); + fullName = parent.fullName() + ToolCorbaConstants.MODULE_SEPARATOR + name; parentNames = parent.name().parentNames(); } else { fullName = new String(name); http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlStructBase.java ---------------------------------------------------------------------- diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlStructBase.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlStructBase.java index 5dd6d7f..73026fd 100644 --- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlStructBase.java +++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlStructBase.java @@ -29,7 +29,7 @@ public abstract class IdlStructBase extends IdlScopeBase implements IdlType { protected IdlStructBase(IdlScopeBase parent, String name, String type) { super(parent, name); - this.kind = new String(type); + this.kind = type; } void addField(IdlField f) { http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java ---------------------------------------------------------------------- diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java index c4e5a90..d0b1ce7 100644 --- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java +++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java @@ -265,7 +265,7 @@ public final class IdlPreprocessorReader extends Reader { String symbol = line.substring("#if".length()).trim(); boolean notSkip = true; try { - int value = Integer.valueOf(symbol); + int value = Integer.parseInt(symbol); if (value == 0) { notSkip = false; } http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ArrayVisitor.java ---------------------------------------------------------------------- diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ArrayVisitor.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ArrayVisitor.java index 50a120e..5d8fcdd 100644 --- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ArrayVisitor.java +++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ArrayVisitor.java @@ -254,7 +254,7 @@ public class ArrayVisitor extends VisitorBase { return anonarray; } - class Types { + static class Types { private XmlSchemaType schemaType; private CorbaType corbaType; private Scope fullyQualifiedName; http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/IDLToWSDLProcessor.java ---------------------------------------------------------------------- diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/IDLToWSDLProcessor.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/IDLToWSDLProcessor.java index fe33970..d261258 100644 --- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/IDLToWSDLProcessor.java +++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/IDLToWSDLProcessor.java @@ -33,6 +33,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.StringTokenizer; @@ -315,30 +316,26 @@ public class IDLToWSDLProcessor extends IDLProcessor { assert importSchemaWriters.size() == schemas.size(); } - for (java.util.Iterator<File> it = defns.keySet().iterator(); it.hasNext();) { - File file = it.next(); - Definition defn = defns.get(file); + for (Entry<File, Definition> entry : defns.entrySet()) { Writer writer = null; if (importDefnWriters != null) { - writer = getOutputWriter(importDefnWriters.get(defn.getTargetNamespace())); + writer = getOutputWriter(importDefnWriters.get(entry.getValue().getTargetNamespace())); } if (writer == null) { - writer = getOutputWriter(file); + writer = getOutputWriter(entry.getKey()); } - visitor.writeDefinition(defn, writer); + visitor.writeDefinition(entry.getValue(), writer); writer.close(); } - for (java.util.Iterator<File> it = schemas.keySet().iterator(); it.hasNext();) { - File file = it.next(); - XmlSchema schema = schemas.get(file); + for (Entry<File, XmlSchema> entry : schemas.entrySet()) { Writer writer = null; if (importSchemaWriters != null) { - writer = getOutputWriter(importSchemaWriters.get(schema.getTargetNamespace())); + writer = getOutputWriter(importSchemaWriters.get(entry.getValue().getTargetNamespace())); } if (writer == null) { - writer = getOutputWriter(file); + writer = getOutputWriter(entry.getKey()); } - visitor.writeSchema(schema, writer); + visitor.writeSchema(entry.getValue(), writer); writer.close(); } } @@ -427,7 +424,7 @@ public class IDLToWSDLProcessor extends IDLProcessor { fileName = token.nextToken(); } if (fileName.endsWith(".idl")) { - fileName = new String(fileName.substring(0, fileName.length() - 4)); + fileName = fileName.substring(0, fileName.length() - 4); } return fileName; } http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ScopedNameVisitor.java ---------------------------------------------------------------------- diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ScopedNameVisitor.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ScopedNameVisitor.java index a1a2585..6c0d0ac 100644 --- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ScopedNameVisitor.java +++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ScopedNameVisitor.java @@ -601,8 +601,7 @@ public class ScopedNameVisitor extends VisitorBase { populateAliasSchemaType(corbaType, wsdlVisitor, holder); } } else if (((corbaType instanceof Sequence) || (corbaType instanceof Anonsequence)) - && ((corbaType.getType().equals(Constants.XSD_BASE64)) - || (corbaType.getType().equals(Constants.XSD_BASE64)))) { + && ((corbaType.getType().equals(Constants.XSD_BASE64)))) { //special case of sequence of octets result = true; if (holder != null) { http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java ---------------------------------------------------------------------- diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java index 1a06fa0..e7abf03 100644 --- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java +++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java @@ -129,7 +129,7 @@ public class StringVisitor extends VisitorBase { // corba:anonstring Anonstring anonstring = new Anonstring(); anonstring.setQName(new QName(typeMap.getTargetNamespace(), stringScopedName.toString())); - anonstring.setBound(Long.valueOf(boundNode.toString())); + anonstring.setBound(Long.parseLong(boundNode.toString())); anonstring.setType(simpleType.getQName()); anon = anonstring; @@ -138,7 +138,7 @@ public class StringVisitor extends VisitorBase { // corba:anonwstring Anonwstring anonwstring = new Anonwstring(); anonwstring.setQName(new QName(typeMap.getTargetNamespace(), stringScopedName.toString())); - anonwstring.setBound(Long.valueOf(boundNode.toString())); + anonwstring.setBound(Long.parseLong(boundNode.toString())); anonwstring.setType(simpleType.getQName()); anon = anonwstring; http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/WSDLSchemaManager.java ---------------------------------------------------------------------- diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/WSDLSchemaManager.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/WSDLSchemaManager.java index 4379b19..8f2d66f 100644 --- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/WSDLSchemaManager.java +++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/WSDLSchemaManager.java @@ -25,6 +25,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import javax.wsdl.Definition; import javax.wsdl.Import; @@ -60,7 +61,7 @@ public class WSDLSchemaManager { boolean ignoreImports; - class DeferredSchemaAttachment { + static class DeferredSchemaAttachment { Definition defn; XmlSchema schema; boolean isGenerated; @@ -319,22 +320,18 @@ public class WSDLSchemaManager { } public File getImportedWSDLDefinitionFile(String ns) { - for (Iterator<File> it = importedDefns.keySet().iterator(); it.hasNext();) { - File file = it.next(); - Definition defn = importedDefns.get(file); - if (defn.getTargetNamespace().equals(ns)) { - return file; + for (Entry<File, Definition> entry : importedDefns.entrySet()) { + if (entry.getValue().getTargetNamespace().equals(ns)) { + return entry.getKey(); } } return null; } public File getImportedXmlSchemaFile(String ns) { - for (Iterator<File> it = importedSchemas.keySet().iterator(); it.hasNext();) { - File file = it.next(); - XmlSchema schema = importedSchemas.get(file); - if (schema.getTargetNamespace().equals(ns)) { - return file; + for (Entry<File, XmlSchema> entry : importedSchemas.entrySet()) { + if (entry.getValue().getTargetNamespace().equals(ns)) { + return entry.getKey(); } } return null; http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java ---------------------------------------------------------------------- diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java index 3b602d7..7e482e1 100644 --- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java +++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java @@ -28,6 +28,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.logging.Level; import java.util.logging.Logger; @@ -145,11 +146,11 @@ public class WSDLToCorbaBinding { Map<QName, PortType> portTypes = CastUtils.cast(def.getAllPortTypes()); if (portTypes != null) { - for (QName existPortQName : portTypes.keySet()) { - if (!existPortQName.getLocalPart().equals(interfaceName)) { + for (Entry<QName, PortType> entry : portTypes.entrySet()) { + if (!entry.getKey().getLocalPart().equals(interfaceName)) { portType = null; } else { - portType = portTypes.get(existPortQName); + portType = entry.getValue(); break; } } @@ -689,7 +690,7 @@ public class WSDLToCorbaBinding { public void setWsdlFile(String file) { - wsdlFileName = new String(file); + wsdlFileName = file; } public String getWsdlFileName() { @@ -817,7 +818,7 @@ public class WSDLToCorbaBinding { } public void setOutputFile(String file) { - outputFile = new String(file); + outputFile = file; } public void setNamespace(String nameSpaceName) { http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaHelper.java ---------------------------------------------------------------------- diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaHelper.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaHelper.java index 9f2fed0..ebefbd4 100644 --- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaHelper.java +++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaHelper.java @@ -754,7 +754,6 @@ public class WSDLToCorbaHelper { corbaTypeImpl, anonymous); } else if ((corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_BASE64)) || (baseName.equals(W3CConstants.NT_SCHEMA_BASE64)) - || (corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_HBIN)) || (corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_HBIN))) { corbaTypeImpl = WSDLTypes.processBase64Type(corbaTypeImpl, name, maxLength, length); http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaProcessor.java ---------------------------------------------------------------------- diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaProcessor.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaProcessor.java index 7f38f95..6dbd6a5 100644 --- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaProcessor.java +++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaProcessor.java @@ -71,10 +71,10 @@ public class WSDLToCorbaProcessor extends WSDLToProcessor { setOutputFile(); String filename = getFileBase(env.get("wsdlurl").toString()); if ((wsdlOutput == null) && (wsdlToCorbaBinding != null)) { - wsdlOutput = new String(filename + "-corba.wsdl"); + wsdlOutput = filename + "-corba.wsdl"; } if ((idlOutput == null) && (idlAction != null)) { - idlOutput = new String(filename + ".idl"); + idlOutput = filename + ".idl"; } if (wsdlToCorbaBinding != null) { @@ -222,7 +222,7 @@ public class WSDLToCorbaProcessor extends WSDLToProcessor { fileBase = tok.nextToken(); } if (fileBase.endsWith(".wsdl")) { - fileBase = new String(fileBase.substring(0, fileBase.length() - 5)); + fileBase = fileBase.substring(0, fileBase.length() - 5); } return fileBase; } http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToIDLAction.java ---------------------------------------------------------------------- diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToIDLAction.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToIDLAction.java index 502cdf7..efa45b2 100644 --- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToIDLAction.java +++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToIDLAction.java @@ -785,7 +785,7 @@ public class WSDLToIDLAction { String result[] = new String[strtok.countTokens()]; for (int i = 0; strtok.hasMoreTokens(); ++i) { - result[i] = new String(strtok.nextToken()); + result[i] = strtok.nextToken(); } return result; @@ -800,7 +800,7 @@ public class WSDLToIDLAction { } public void setWsdlFile(String file) { - wsdlFileName = new String(file); + wsdlFileName = file; } public void setVerboseOn(boolean verbose) { @@ -811,7 +811,7 @@ public class WSDLToIDLAction { } public void setBindingName(String bindName) { - bindingName = new String(bindName); + bindingName = bindName; } public String getBindingName() { @@ -819,7 +819,7 @@ public class WSDLToIDLAction { } public void setNamespace(String namespaceName) { - namespace = new String(namespaceName); + namespace = namespaceName; } public String getNamespace() { http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java ---------------------------------------------------------------------- diff --git a/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java b/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java index 8cab353..d85ee7d 100644 --- a/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java +++ b/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java @@ -167,7 +167,7 @@ public class JAXBDataBinding implements DataBindingProfile { } } } - public class LocationFilterReader extends StreamReaderDelegate { + public static class LocationFilterReader extends StreamReaderDelegate { boolean isImport; boolean isInclude; int locIdx = -1; http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java ---------------------------------------------------------------------- diff --git a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java index 3ef5af9..a7d5265 100644 --- a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java +++ b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java @@ -232,7 +232,7 @@ public class JAXWSBindingParser { return rnode; } - class ContextImpl implements NamespaceContext { + static class ContextImpl implements NamespaceContext { private Node targetNode; ContextImpl(Node node) { http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java ---------------------------------------------------------------------- diff --git a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java index 47b6536..cc5f325 100644 --- a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java +++ b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java @@ -21,6 +21,7 @@ package org.apache.cxf.tools.wsdlto.frontend.jaxws.generators; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Map; +import java.util.Map.Entry; import javax.xml.namespace.QName; @@ -68,9 +69,8 @@ public class FaultGenerator extends AbstractJAXWSGenerator { Map<String, JavaExceptionClass> exceptionClasses = javaModel .getExceptionClasses(); - for (String expClassName : exceptionClasses.keySet()) { - JavaExceptionClass expClz = - exceptionClasses.get(expClassName); + for (Entry<String, JavaExceptionClass> entry : exceptionClasses.entrySet()) { + JavaExceptionClass expClz = entry.getValue(); clearAttributes(); http://git-wip-us.apache.org/repos/asf/cxf/blob/03987585/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToSoapProcessor.java ---------------------------------------------------------------------- diff --git a/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToSoapProcessor.java b/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToSoapProcessor.java index 08458af..72e78bf 100644 --- a/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToSoapProcessor.java +++ b/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToSoapProcessor.java @@ -24,6 +24,7 @@ import java.io.Writer; import java.util.Collection; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import javax.wsdl.Binding; import javax.wsdl.BindingFault; @@ -116,10 +117,10 @@ public class WSDLToSoapProcessor extends AbstractWSDLToProcessor { if (portTypes == null) { return false; } - for (QName existPortQName : portTypes.keySet()) { - String existPortName = existPortQName.getLocalPart(); + for (Entry<QName, PortType> entry : portTypes.entrySet()) { + String existPortName = entry.getKey().getLocalPart(); if (existPortName.equals(env.get(ToolConstants.CFG_PORTTYPE))) { - portType = portTypes.get(existPortQName); + portType = entry.getValue(); break; } } @@ -131,11 +132,11 @@ public class WSDLToSoapProcessor extends AbstractWSDLToProcessor { if (bindings == null) { return false; } - for (QName existBindingQName : bindings.keySet()) { - String existBindingName = existBindingQName.getLocalPart(); + for (Entry<QName, Binding> entry : bindings.entrySet()) { + String existBindingName = entry.getKey().getLocalPart(); String bindingName = (String)env.get(ToolConstants.CFG_BINDING); if (bindingName.equals(existBindingName)) { - binding = bindings.get(existBindingQName); + binding = entry.getValue(); } } return (binding == null) ? false : true;