You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Lucene/Solr QA (JIRA)" <ji...@apache.org> on 2018/09/05 20:46:00 UTC

[jira] [Commented] (LUCENE-8486) Code Refactoring in Field

    [ https://issues.apache.org/jira/browse/LUCENE-8486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16604919#comment-16604919 ] 

Lucene/Solr QA commented on LUCENE-8486:
----------------------------------------

| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
|| || || || {color:brown} Prechecks {color} ||
| {color:red}-1{color} | {color:red} test4tests {color} | {color:red}  0m  0s{color} | {color:red} The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. {color} |
|| || || || {color:brown} master Compile Tests {color} ||
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  0m 21s{color} | {color:green} master passed {color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  0m 18s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green}  0m 18s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} Release audit (RAT) {color} | {color:green}  0m 18s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} Check forbidden APIs {color} | {color:green}  0m 18s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} Validate source patterns {color} | {color:green}  0m 18s{color} | {color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:green}+1{color} | {color:green} unit {color} | {color:green} 11m 18s{color} | {color:green} core in the patch passed. {color} |
| {color:black}{color} | {color:black} {color} | {color:black} 13m 32s{color} | {color:black} {color} |
\\
\\
|| Subsystem || Report/Notes ||
| JIRA Issue | LUCENE-8486 |
| JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12938504/LUCENE-8486.patch |
| Optional Tests |  compile  javac  unit  ratsources  checkforbiddenapis  validatesourcepatterns  |
| uname | Linux lucene1-us-west 4.4.0-130-generic #156~14.04.1-Ubuntu SMP Thu Jun 14 13:51:47 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | ant |
| Personality | /home/jenkins/jenkins-slave/workspace/PreCommit-LUCENE-Build/sourcedir/dev-tools/test-patch/lucene-solr-yetus-personality.sh |
| git revision | master / b4a1548 |
| ant | version: Apache Ant(TM) version 1.9.3 compiled on July 24 2018 |
| Default Java | 1.8.0_172 |
|  Test Results | https://builds.apache.org/job/PreCommit-LUCENE-Build/85/testReport/ |
| modules | C: lucene/core U: lucene/core |
| Console output | https://builds.apache.org/job/PreCommit-LUCENE-Build/85/console |
| Powered by | Apache Yetus 0.7.0   http://yetus.apache.org |


This message was automatically generated.



> Code Refactoring in Field
> -------------------------
>
>                 Key: LUCENE-8486
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8486
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/other
>            Reporter: Namgyu Kim
>            Priority: Minor
>              Labels: refactoring
>         Attachments: LUCENE-8486.patch
>
>
> 1) Remove Unnecessary Boxing
> As I know, Explicit manual boxing is unnecessary after Java 5.
>  It can be safely removed.
>  
> Before :
> {code:java}
> // After Line 352
> public void setByteValue(byte value) {
>   ...
>   fieldsData = Byte.valueOf(value);
> }
> public void setShortValue(short value) {
>   ...
>   fieldsData = Short.valueOf(value);
> }
> public void setIntValue(int value) {
>   ...
>   fieldsData = Integer.valueOf(value);
> }
> public void setLongValue(long value) {
>   ...
>   fieldsData = Long.valueOf(value);
> }
> public void setFloatValue(float value) {
>   ...
>   fieldsData = Float.valueOf(value);
> }
> public void setDoubleValue(double value) {
>   ...
>   fieldsData = Double.valueOf(value);
> }
> {code}
>  
> After :
> {code:java}
> // After Line 352
> public void setByteValue(byte value) {
>   ...
>   fieldsData = value;
> }
> public void setShortValue(short value) {
>   ...
>   fieldsData = value;
> }
> public void setIntValue(int value) {
>   ...
>   fieldsData = value;
> }
> public void setLongValue(long value) {
>   ...
>   fieldsData = value;
> }
> public void setFloatValue(float value) {
>   ...
>   fieldsData = value;
> }
> public void setDoubleValue(double value) {
>   ...
>   fieldsData = value;
> }{code}
>  
> 2) Unnecessary static deletion in Store enum
> According to [https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.9],
>  "A nested enum type is implicitly {{static}}. It is permitted for the declaration of a nested enum type to redundantly specify the {{static}} modifier."
> So I made the following changes.
>  
> Before:
> {code:java}
> // Line 600 method
> public static enum Store {
>   YES,
>   NO
> }
> {code}
>  
> After:
> {code:java}
> // Line 600 method
> public enum Store {
>   YES,
>   NO
> }{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org