The class org.apache.axis2.uitl.Builder can be refactored to improve usability, 
improve object orientation and slightly improve performance
-------------------------------------------------------------------------------------------------------------------------------------------

                 Key: AXIS2-2159
                 URL: https://issues.apache.org/jira/browse/AXIS2-2159
             Project: Axis 2.0 (Axis2)
          Issue Type: Improvement
          Components: kernel
         Environment: NA
            Reporter: Sanjaya Karunasena


The method "public static OMBuilder getBuilder(InputStream inStream, String 
charSetEnc, String soapNamespaceURI)" in the class 
org.apache.axis2.uitl.Builder takes three parameters, but when you look at the 
code last two parameters are optional. A more object oriented way of handling 
this would be to have this method overloaded to handle the difference scenarios.

Right now this method has two null checks which get executed every time due to 
this. When I navigate through the calling stack I realize every time the caller 
is well aware of whether the optional parameters are available or not and he is 
passing null in such scenarios since there is no overloaded method. At the 
external interfaces where a parameter is really required implementors are 
passing a default value making the null check redundant.

Also there is one overloaded method which takes a parameter of type Reader 
which provides the same functionality. IMO this method is again redundant since 
the only difference is how you handle the input, which should be the 
responsibility of the caller, not the utility class like this.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to