Description
First, let me say that I realize that WSDLToJava doesn't support "-suppress" as a command-line option. So this defect is quite obscure.
Consider this code:
WSDLToJava w2j = new WSDLToJava(new String[]
{ "-d", "generatedcode", "http://localhost:9090/CustomerServicePort?wsdl", });
ToolContext context = new ToolContext();
context.put(ToolConstants.CFG_SUPPRESS_GEN, true);
w2j.run(context);
This code works in the sense that it does not build any .java files, however it still creates the "generatedcode" directory. An easy and low-risk fix would be to change WSDLToJavaContainer.validate() to wrap an "if (isSuppressCodeGen())
{...}" around the "if(!dir.exists())
{dir.mkdirs()}" block.