mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 08:06:56 +07:00
[java-inspections] Extract method recommender: do not include initial comment into the length
Fixes IDEA-354492 "Method can be extracted" includes comments as minimum code length GitOrigin-RevId: 3d4e34e6726f7917fe3b0224653b89f07cd2ae42
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3b45af56a7
commit
e573732e7c
@@ -0,0 +1,18 @@
|
||||
import java.util.*;
|
||||
|
||||
public class ExtractMethodRecommenderComment {
|
||||
void testLongCommentBefore() {
|
||||
// We are creating a new Date object here and set it's to 12 hours
|
||||
// We are creating a new Date object here and set it's to 12 hours
|
||||
// We are creating a new Date object here and set it's to 12 hours
|
||||
Date d = new Date();
|
||||
d.setHours(12);
|
||||
System.out.println(d);
|
||||
System.out.println(d);
|
||||
System.out.println(d);
|
||||
System.out.println(d);
|
||||
System.out.println(d);
|
||||
System.out.println(d);
|
||||
System.out.println(d);
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,14 @@ public class ExtractMethodRecommenderInspectionTest extends LightJavaCodeInsight
|
||||
myFixture.checkHighlighting();
|
||||
}
|
||||
|
||||
public void testExtractMethodRecommenderComment() {
|
||||
ExtractMethodRecommenderInspection inspection = new ExtractMethodRecommenderInspection();
|
||||
inspection.minLength = 100;
|
||||
myFixture.enableInspections(inspection);
|
||||
myFixture.configureByFile(getTestName(false) + ".java");
|
||||
myFixture.checkHighlighting();
|
||||
}
|
||||
|
||||
public void testImplicitClass() {
|
||||
ExtractMethodRecommenderInspection inspection = new ExtractMethodRecommenderInspection();
|
||||
myFixture.enableInspections(inspection);
|
||||
|
||||
Reference in New Issue
Block a user