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 ch...@apache.org on 2006/09/12 12:44:08 UTC
svn commit: r442555 - in /webservices/axis2/trunk/java/modules:
adb-codegen/src/org/apache/axis2/schema/
adb/src/org/apache/axis2/databinding/types/
adb/src/org/apache/axis2/databinding/utils/reader/
integration/src/test/interop/util/ kernel/src/org/ap...
Author: chinthaka
Date: Tue Sep 12 03:44:06 2006
New Revision: 442555
URL: http://svn.apache.org/viewvc?view=rev&rev=442555
Log:
Improving the quality of the code
- Improving if statements
- removing un-necessary semicolons
Modified:
webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/URI.java
webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java
webservices/axis2/trunk/java/modules/integration/src/test/interop/util/XMLComparatorInterop.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/WSDLBasedPolicyProcessor.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSEndpoint.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSVendorAdapter.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JNDIVendorAdapter.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/TopicConnector.java
webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/filters/XPathBasedFilter.java
webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/util/CommonUtil.java
Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java?view=diff&rev=442555&r1=442554&r2=442555
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java Tue Sep 12 03:44:06 2006
@@ -819,9 +819,7 @@
public static boolean isSOAP_ENC(String s) {
if (s.equals(Constants.URI_SOAP11_ENC))
return true;
- if (s.equals(Constants.URI_SOAP12_ENC))
- return true;
- return false;
+ return s.equals(Constants.URI_SOAP12_ENC);
}
/**
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/URI.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/URI.java?view=diff&rev=442555&r1=442554&r2=442555
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/URI.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/URI.java Tue Sep 12 03:44:06 2006
@@ -1942,12 +1942,9 @@
continue;
}
}
- if (isURICharacter(testChar)) {
- continue;
- }
- else {
- return false;
- }
+ if (!isURICharacter(testChar)) {
+ return false;
+ }
}
return true;
}
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java?view=diff&rev=442555&r1=442554&r2=442555
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java Tue Sep 12 03:44:06 2006
@@ -607,11 +607,7 @@
public boolean hasText() {
if (state == DELEGATED_STATE) {
return childReader.hasText();
- } else if (state==TEXT_STATE){
- return true;
- }else{
- return false;
- }
+ } else return state == TEXT_STATE;
}
@@ -670,11 +666,7 @@
//if not we should ask the child reader for it.
if (state == DELEGATED_STATE) {
return childReader.hasName();
- } else if (state!=TEXT_STATE) {
- return true;
- }else{
- return false;
- }
+ } else return state != TEXT_STATE;
}
public String getNamespaceURI() {
Modified: webservices/axis2/trunk/java/modules/integration/src/test/interop/util/XMLComparatorInterop.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/src/test/interop/util/XMLComparatorInterop.java?view=diff&rev=442555&r1=442554&r2=442555
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/src/test/interop/util/XMLComparatorInterop.java (original)
+++ webservices/axis2/trunk/java/modules/integration/src/test/interop/util/XMLComparatorInterop.java Tue Sep 12 03:44:06 2006
@@ -169,11 +169,11 @@
}
}
- if(status == true){
+ if(status){
break;
}
}
- if (status == false) {
+ if (!status) {
return false;
}
} else
@@ -204,17 +204,11 @@
}
- if (elementOneAtribCount != elementTwoAtribCount) {
- return false;
- }
- return true;
+ return elementOneAtribCount == elementTwoAtribCount;
}
private boolean compare(String one, String two) {
- if (!one.equals(two)) {
- return false;
- }
- return true;
+ return one.equals(two);
}
private boolean compare(OMNamespace one,OMNamespace two) {
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/WSDLBasedPolicyProcessor.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/WSDLBasedPolicyProcessor.java?view=diff&rev=442555&r1=442554&r2=442555
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/WSDLBasedPolicyProcessor.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/WSDLBasedPolicyProcessor.java Tue Sep 12 03:44:06 2006
@@ -105,7 +105,6 @@
if (moduleList == null) {
System.err.println("cannot find a module to process "
+ namespace + "type assertions");
- continue;
} else {
for (int i = 0; i < moduleList.size(); i++) {
AxisModule axisModule = (AxisModule) moduleList
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java?view=diff&rev=442555&r1=442554&r2=442555
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java Tue Sep 12 03:44:06 2006
@@ -216,7 +216,7 @@
* @throws AxisFault
*/
protected void setup() throws AxisFault {
- if (setupComplete == true) { // already setup, just do nothing and return
+ if (setupComplete) { // already setup, just do nothing and return
return;
}
try {
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java?view=diff&rev=442555&r1=442554&r2=442555
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java Tue Sep 12 03:44:06 2006
@@ -187,7 +187,7 @@
: null;
}
fileCacheForAttachments = (Constants.VALUE_TRUE
- .equals(cacheAttachmentString)) ? true : false;
+ .equals(cacheAttachmentString));
String attachmentRepoDir = null;
String attachmentSizeThreshold = null;
@@ -243,7 +243,7 @@
* Leaving this out for backword compatibility with 1.0
*/
msgContext.setProperty(MTOMConstants.ATTACHMENTS, attachments);
-
+
/*
* Setting the Attachments map to new SwA API
*/
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSEndpoint.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSEndpoint.java?view=diff&rev=442555&r1=442554&r2=442555
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSEndpoint.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSEndpoint.java Tue Sep 12 03:44:06 2006
@@ -66,11 +66,8 @@
}
public boolean equals(Object object) {
- if ((object == null) || !(object instanceof JMSEndpoint)) {
- return false;
- }
+ return !((object == null) || !(object instanceof JMSEndpoint));
- return true;
}
public int hashCode() {
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSVendorAdapter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSVendorAdapter.java?view=diff&rev=442555&r1=442554&r2=442555
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSVendorAdapter.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSVendorAdapter.java Tue Sep 12 03:44:06 2006
@@ -269,11 +269,8 @@
return false;
}
- if (action == ON_EXCEPTION_ACTION) {
- return false;
- }
+ return action != ON_EXCEPTION_ACTION;
- return true;
}
public void setProperties(Message message, HashMap props) throws JMSException {
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JNDIVendorAdapter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JNDIVendorAdapter.java?view=diff&rev=442555&r1=442554&r2=442555
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JNDIVendorAdapter.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JNDIVendorAdapter.java Tue Sep 12 03:44:06 2006
@@ -143,10 +143,7 @@
String cfJndiName = jmsurl.getPropertyValue(_CONNECTION_FACTORY_JNDI_NAME);
String originalCfJndiName = originalJMSURL.getPropertyValue(_CONNECTION_FACTORY_JNDI_NAME);
- if (cfJndiName.equalsIgnoreCase(originalCfJndiName)) {
- return true;
- }
+ return cfJndiName.equalsIgnoreCase(originalCfJndiName);
- return false;
}
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/TopicConnector.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/TopicConnector.java?view=diff&rev=442555&r1=442554&r2=442555
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/TopicConnector.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/TopicConnector.java Tue Sep 12 03:44:06 2006
@@ -264,11 +264,7 @@
if (isDurable()) {
return other.isDurable() && other.m_subscriptionName.equals(m_subscriptionName);
- } else if (other.isDurable()) {
- return false;
- } else {
- return true;
- }
+ } else return !other.isDurable();
}
public String toString() {
Modified: webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/filters/XPathBasedFilter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/filters/XPathBasedFilter.java?view=diff&rev=442555&r1=442554&r2=442555
==============================================================================
--- webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/filters/XPathBasedFilter.java (original)
+++ webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/filters/XPathBasedFilter.java Tue Sep 12 03:44:06 2006
@@ -74,11 +74,8 @@
try {
AXIOMXPath xpath = new AXIOMXPath (XPathString);
List resultList = xpath.selectNodes(firstChild);
-
- if (resultList.size()>0)
- return true;
- else
- return false;
+
+ return resultList.size() > 0;
} catch (JaxenException e) {
throw new SavanException (e);
}
Modified: webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/util/CommonUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/util/CommonUtil.java?view=diff&rev=442555&r1=442554&r2=442555
==============================================================================
--- webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/util/CommonUtil.java (original)
+++ webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/util/CommonUtil.java Tue Sep 12 03:44:06 2006
@@ -75,11 +75,9 @@
}
public static boolean isDuration (String timeStr) {
- if (timeStr.startsWith("p") || timeStr.startsWith("P") || timeStr.startsWith("-p") || timeStr.startsWith("-P"))
- return true;
-
- return false;
- }
+ return timeStr.startsWith("p") || timeStr.startsWith("P") || timeStr.startsWith("-p") || timeStr.startsWith("-P");
+
+ }
public static SubscriberStore getSubscriberStore (AxisService axisService) {
Parameter parameter = axisService.getParameter(SavanConstants.SUBSCRIBER_STORE);
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org