mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote branch 'origin/master'
This commit is contained in:
@@ -414,7 +414,7 @@ public class JpsServerManager implements ApplicationComponent{
|
||||
|
||||
// debugging
|
||||
cmdLine.addParameter("-XX:+HeapDumpOnOutOfMemoryError");
|
||||
cmdLine.addParameter("-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5008");
|
||||
//cmdLine.addParameter("-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5008");
|
||||
|
||||
// javac's VM should use the same default locale that IDEA uses in order for javac to print messages in 'correct' language
|
||||
final String lang = System.getProperty("user.language");
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.intellij.lang.Language;
|
||||
import com.intellij.lang.StdLanguages;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.refactoring.util.CanonicalTypes;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
@@ -164,12 +165,12 @@ class JavaChangeInfoImpl implements JavaChangeInfo {
|
||||
for(int i = 0; i < newParms.length; i++){
|
||||
ParameterInfoImpl info = newParms[i];
|
||||
if (info.oldParameterIndex < 0 && !info.isVarargType()){
|
||||
if (info.defaultValue == null) continue;
|
||||
if (StringUtil.isEmpty(info.defaultValue)) continue;
|
||||
try{
|
||||
defaultValues[i] = factory.createExpressionFromText(info.defaultValue, method);
|
||||
}
|
||||
catch(IncorrectOperationException e){
|
||||
LOG.error(e);
|
||||
LOG.info(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@ public class DuplicatesFinder {
|
||||
PsiClass contextClass = PsiTreeUtil.getParentOfType(pattern, PsiClass.class);
|
||||
if (candidateQualifier instanceof PsiReferenceExpression) {
|
||||
final PsiElement resolved = ((PsiReferenceExpression)candidateQualifier).resolve();
|
||||
if (resolved instanceof PsiClass && contextClass != null && contextClass.isInheritor((PsiClass)resolved, true)) {
|
||||
if (resolved instanceof PsiClass && contextClass != null && InheritanceUtil.isInheritorOrSelf(contextClass, (PsiClass)resolved, true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -430,7 +430,7 @@ public class DuplicatesFinder {
|
||||
final PsiElement resolved = ((PsiReferenceExpression)patternQualifier).resolve();
|
||||
if (resolved instanceof PsiClass) {
|
||||
final PsiClass classContext = PsiTreeUtil.getParentOfType(candidate, PsiClass.class);
|
||||
if (classContext != null && classContext.isInheritor((PsiClass)resolved, true)) {
|
||||
if (classContext != null && InheritanceUtil.isInheritorOrSelf(classContext, (PsiClass)resolved, true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
class Utilz {
|
||||
static int func(){
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int foo1(){
|
||||
return 2*Utilz.func();
|
||||
}
|
||||
|
||||
static int fo<caret>o2(){
|
||||
return 2*func();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Something {
|
||||
Something(){
|
||||
int x = 2*Utilz.func();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
class Utilz {
|
||||
static int func(){
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int foo1(){
|
||||
return foo2();
|
||||
}
|
||||
|
||||
static int foo2(){
|
||||
return 2*func();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Something {
|
||||
Something(){
|
||||
int x = Utilz.foo2();
|
||||
}
|
||||
}
|
||||
@@ -89,4 +89,8 @@ public class FindMethodDuplicatesMiscTest extends FindMethodDuplicatesBaseTest {
|
||||
public void testSkipNotAccessible() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
public void testQualifiers() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
<orderEntry type="library" name="Groovy" level="project" />
|
||||
<orderEntry type="library" name="Ant" level="project" />
|
||||
<orderEntry type="module" module-name="antlayout" />
|
||||
<orderEntry type="module-library" scope="PROVIDED">
|
||||
<orderEntry type="module-library" exported="" scope="PROVIDED">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/gant-1.9.5_groovy-1.7.10.jar!/" />
|
||||
|
||||
@@ -56,5 +56,12 @@ public class WebReference extends PsiReferenceBase<PsiElement> {
|
||||
public String getPresentableText() {
|
||||
return getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextRange getTextRange() {
|
||||
final TextRange rangeInElement = getRangeInElement();
|
||||
final TextRange elementRange = myElement.getTextRange();
|
||||
return elementRange != null ? rangeInElement.shiftRight(elementRange.getStartOffset()) : rangeInElement;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user