Author: jkaputin
Date: Fri Nov 10 21:33:59 2006
New Revision: 473644
URL: http://svn.apache.org/viewvc?view=rev&rev=473644
Log:
WODEN-69 When checking uniqueness assertions eliminate
null values that may occur if the WSDL is invalid.
This also fixes some NPEs.
Modified:
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/validation/WSDLComponentValidator.java
Modified:
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/validation/WSDLComponentValidator.java
URL:
http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/validation/WSDLComponentValidator.java?view=diff&rev=473644&r1=473643&r2=473644
==============================================================================
---
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/validation/WSDLComponentValidator.java
(original)
+++
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/validation/WSDLComponentValidator.java
Fri Nov 10 21:33:59 2006
@@ -203,7 +203,7 @@
validateBindingOperations(binding.getBindingOperations(),
desc, errorReporter);
- validateBindingFault(binding.getBindingFaults(), desc,
errorReporter);
+ validateBindingFaults(binding.getBindingFaults(), desc,
errorReporter);
validateFeatures(binding.getFeatures(), errorReporter);
validateProperties(binding.getProperties(), desc,
errorReporter);
@@ -289,7 +289,7 @@
* @param errorReporter An error reporter to be used for reporting errors.
* @throws WSDLException A WSDLException is thrown if a problem occurs while
validating the binding fault components.
*/
- protected void validateBindingFault(BindingFault[] bindingFaults,
Description desc, ErrorReporter errorReporter) throws WSDLException
+ protected void validateBindingFaults(BindingFault[] bindingFaults,
Description desc, ErrorReporter errorReporter) throws WSDLException
{
testAssertionBindingFault0058(bindingFaults, errorReporter);
@@ -454,6 +454,8 @@
for(int i = 0; i < numInterfaces; i++)
{
QName name = interfaces[i].getName();
+ if(name == null)
+ continue;
if(names.contains(name))
{
errorReporter.reportError(new ErrorLocatorImpl(),
"Interface-0030", new Object[]{name}, ErrorReporter.SEVERITY_ERROR);
@@ -521,6 +523,8 @@
for(int i = 0; i < numInterfaces; i++)
{
QName name = interfaceOperations[i].getName();
+ if(name == null)
+ continue;
if(names.contains(name))
{
errorReporter.reportError(new ErrorLocatorImpl(),
"InterfaceOperation-0035", new Object[]{name}, ErrorReporter.SEVERITY_ERROR);
@@ -550,6 +554,8 @@
for(int i = 0; i < numInterfaceFaults; i++)
{
QName name = interfaceFaults[i].getName();
+ if(name == null)
+ continue;
if(names.contains(name))
{
errorReporter.reportError(new ErrorLocatorImpl(),
"InterfaceFault-0032", new Object[]{name}, ErrorReporter.SEVERITY_ERROR);
@@ -621,6 +627,8 @@
for(int i = 0; i < numMessageReferences; i++)
{
NCName messageLabel = messageReferences[i].getMessageLabel();
+ if(messageLabel == null)
+ continue;
if(messageLabels.contains(messageLabel))
{
errorReporter.reportError(new ErrorLocatorImpl(),
"InterfaceMessageReference-0042", new Object[]{messageLabel},
ErrorReporter.SEVERITY_ERROR);
@@ -979,6 +987,8 @@
for(int i = 0; i < numBindings; i++)
{
QName name = bindings[i].getName();
+ if(name == null)
+ continue;
if(names.contains(name))
{
errorReporter.reportError(new ErrorLocatorImpl(),
"Binding-0057", new Object[]{name}, ErrorReporter.SEVERITY_ERROR);
@@ -1010,6 +1020,8 @@
for(int i = 0; i < numBindingFaults; i++)
{
InterfaceFault interfaceFault = bindingFaults[i].getInterfaceFault();
+ if(interfaceFault == null)
+ continue;
if(usedInterfaceFaults.contains(interfaceFault))
{
errorReporter.reportError(new ErrorLocatorImpl(),
"BindingFault-0058", new Object[]{}, ErrorReporter.SEVERITY_ERROR);
@@ -1041,6 +1053,8 @@
for(int i = 0; i < numBindingOperations; i++)
{
InterfaceOperation interfaceOperation =
bindingOperations[i].getInterfaceOperation();
+ if(interfaceOperation == null)
+ continue;
if(specifiedInterfaceOperations.contains(interfaceOperation))
{
errorReporter.reportError(new ErrorLocatorImpl(),
"BindingOperation-0059", new Object[]{interfaceOperation.getName()},
ErrorReporter.SEVERITY_ERROR);
@@ -1073,6 +1087,8 @@
for(int i = 0; i < numBindingMessageReferences; i++)
{
InterfaceMessageReference interfaceMessageReference =
bindingMessageReferences[i].getInterfaceMessageReference();
+ if(interfaceMessageReference == null)
+ continue;
if(specifiedInterfaceMessageReferences.contains(interfaceMessageReference))
{
errorReporter.reportError(new ErrorLocatorImpl(),
"BindingMessageReference-0060", new
Object[]{interfaceMessageReference.getMessageLabel()},
ErrorReporter.SEVERITY_ERROR);
@@ -1104,6 +1120,8 @@
for(int i = 0; i < numBindingFaultReferences; i++)
{
InterfaceFaultReference interfaceFaultReference =
bindingFaultReferences[i].getInterfaceFaultReference();
+ if(interfaceFaultReference == null)
+ continue;
if(specifiedInterfaceFaultReferences.contains(interfaceFaultReference))
{
errorReporter.reportError(new ErrorLocatorImpl(),
"BindingFaultReference-0061", new
Object[]{interfaceFaultReference.getMessageLabel()},
ErrorReporter.SEVERITY_ERROR);
@@ -1156,6 +1174,8 @@
for(int i = 0; i < numServices; i++)
{
QName name = services[i].getName();
+ if(name == null)
+ continue;
if(names.contains(name))
{
errorReporter.reportError(new ErrorLocatorImpl(),
"Service-0063", new Object[]{name}, ErrorReporter.SEVERITY_ERROR);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]