You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "LalithMaringanti (via GitHub)" <gi...@apache.org> on 2023/04/07 01:09:41 UTC
[GitHub] [commons-validator] LalithMaringanti opened a new pull request, #130: Applied refactoring techniques
LalithMaringanti opened a new pull request, #130:
URL: https://github.com/apache/commons-validator/pull/130
Refactoring technique: Push down method
Class/method: org.apache.commons.validator.routines.AbstractNumberValidator.determineScale()
Description: AbstractNumberValidator class has a method named as determineScale() which is used only once in another method of the child class of AbstractNumberValidator which is BigDecimalValidator class. Therefore, removed determineScale() method from the parent class AbstractNumberValidator and placed it in the child class BigDecimalValidator class. This is done to increase cohesiveness and code readability.
Refactoring technique: Extract class
Class/Method: org.apache.commons.validator.ValidatorAction
Description: ValidatorAction consists of methods such as isValid(), handleIndexedField(), getValidationClassInstance() along with methods which are related to validation of only javascript file/functions. For instance readJavaScriptFile(), javaScriptAlreadyLoaded(), formatJavaScriptFileName() etc. Removed all these methods and placed them in a newly created class ValidatorActionUtils to make ValidatorAction more cohesive.
Refactoring technique: Replace conditional with polymorphism
Class/Method: org.apache.commons.validator.ValidatorResources.getParent()
Description: removed if else conditional statements and created abstract class FormSetHierarchy which consists of abstract method getParent which returns FormSet object. For each if condition, a new class is created which extends the FormSetHierarchy class and implements different getParent method.
Refactoring technique: Extract Method
Class/Method: org.apache.commons.validator.routines.DomainValidator.unicodeToASCII()
Description: Extracted all the statements which converts given input string to ascii string and created a new method called toAsciiCode() method and statements responsible for adding trailing dots are moved into addTrailingDotIfMissing() method
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-validator] garydgregory commented on pull request #130: Applied refactoring techniques
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #130:
URL: https://github.com/apache/commons-validator/pull/130#issuecomment-1509441380
Closing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-validator] garydgregory commented on pull request #130: Applied refactoring techniques
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #130:
URL: https://github.com/apache/commons-validator/pull/130#issuecomment-1502285115
No reply, will close soon.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-validator] garydgregory closed pull request #130: Applied refactoring techniques
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory closed pull request #130: Applied refactoring techniques
URL: https://github.com/apache/commons-validator/pull/130
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-validator] aherbert commented on pull request #130: Applied refactoring techniques
Posted by "aherbert (via GitHub)" <gi...@apache.org>.
aherbert commented on PR #130:
URL: https://github.com/apache/commons-validator/pull/130#issuecomment-1500033533
Removing the protected method `protected int determineScale(final NumberFormat format)` from `AbstractNumberValidator` would be a breaking change for binary compatibility. Try this locally:
```
mvn clean package japicmp:cmp
```
You also have many other files in the PR that are unrelated to this change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-validator] garydgregory commented on pull request #130: Applied refactoring techniques
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #130:
URL: https://github.com/apache/commons-validator/pull/130#issuecomment-1500299562
You can also run the default Maven goal by running `mvn` from the command line which will run all checks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org