-

   rss_rss_hh_new

 - e-mail

 

 -

 LiveInternet.ru:
: 17.03.2011
:
:
: 51

:


[ ] . ?

, 08 2017 . 15:57 +

, , , , . .


, , . Spring. Java 8, IDE IntelliJ IDEA 2017.1 Duplicate Detector 1.1.



?


, . , , . , , , . , , .


:


  • API

?


, . , - . , .


, , , . , . "Redundancy vs dependencies: which is worse?".







, , , . , , . .


, . , , .



: PMD, CCFinder, Deckard, CloneDR, Duplicate finder (maven plugin), .


, . . , , , . , IntelliJ IDEA (PMD Duplicate Detector).


. , . , Duplicate Detector, . , , 3-4 , IntelliJ IDEA.


Duplicate Detector:


  • ( )
  • ( )
  • Java Kotlin

?
  • legacy
  • code review
  • ,
  • , , XP


, . , . , . , , - .


Spring. IntelliJ IDEA Duplicate Detector.



IntelliJ IDEA Duplicate Detector , . , Refactor (Alt + Enter ).






1. .





. 4 9, . . , . , , .


. 1.
void setVariableNameOrType(String name, Consumer setName, Consumer> setType) {
    if (isVariableName(name)) {
        setName.accept(name);
    }
    else {
        try {
            setType.accept(ClassUtils.forName(name, getAspectClassLoader()));
        }
        catch (Throwable ex) {
            throw new IllegalArgumentException("Class name '" + name  +
                    "' is neither a valid argument name nor the fully-qualified " +
                    "name of a Java type on the classpath. Root cause: " + ex);
        }
    }
}

void setThrowingNameNoCheck(String name) {
    setVariableNameOrType(name, variableName -> this.throwingName = name, type -> this.discoveredThrowingType = type);
}

. , else . , , .


. 2.
Class

https://habrahabr.ru/post/335172/

:  

: [1] []
 

:
: 

: ( )

:

  URL