mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[groovy] get rid of duplicate code in GrClosureType inheritors
This commit is contained in:
-6
@@ -57,12 +57,6 @@ public class GrClosureType extends GrLiteralClassType {
|
||||
myClosure = closure;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getClassName() {
|
||||
return "Closure";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getParameterCount() {
|
||||
PsiClass resolved = resolve();
|
||||
|
||||
+4
-1
@@ -13,6 +13,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.TypesUtil;
|
||||
|
||||
import static com.intellij.openapi.util.RecursionManager.doPreventingRecursion;
|
||||
import static com.intellij.openapi.util.text.StringUtil.getShortName;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
@@ -105,7 +106,9 @@ public abstract class GrLiteralClassType extends PsiClassType {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public abstract String getClassName() ;
|
||||
public String getClassName() {
|
||||
return getShortName(getJavaClassName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
|
||||
+1
-21
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package org.jetbrains.plugins.groovy.lang.psi.impl;
|
||||
|
||||
@@ -68,12 +54,6 @@ public abstract class GrMapType extends GrLiteralClassType {
|
||||
return GroovyCommonClassNames.JAVA_UTIL_LINKED_HASH_MAP;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getClassName() {
|
||||
return "LinkedHashMap";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public abstract PsiType getTypeByStringKey(String key);
|
||||
|
||||
|
||||
+1
-22
@@ -1,21 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.plugins.groovy.lang.psi.impl;
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
import com.intellij.psi.PsiClass;
|
||||
@@ -68,12 +53,6 @@ public class GrRangeType extends GrLiteralClassType {
|
||||
return myQualifiedName;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getClassName() {
|
||||
return StringUtil.getShortName(myQualifiedName);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiType[] getParameters() {
|
||||
|
||||
+1
-22
@@ -1,24 +1,9 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package org.jetbrains.plugins.groovy.lang.psi.impl;
|
||||
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.VolatileNotNullLazyValue;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.psi.CommonClassNames;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
@@ -68,12 +53,6 @@ public abstract class GrTupleType extends GrLiteralClassType {
|
||||
return CommonClassNames.JAVA_UTIL_LIST;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getClassName() {
|
||||
return StringUtil.getShortName(getJavaClassName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public PsiType[] getParameters() {
|
||||
|
||||
+1
-22
@@ -1,21 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.plugins.groovy.lang.psi.impl;
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
import com.intellij.psi.PsiClassType;
|
||||
@@ -42,12 +27,6 @@ public class LazyFqnClassType extends GrLiteralClassType {
|
||||
return myFqn;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getClassName() {
|
||||
return StringUtil.getShortName(myFqn);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiType[] getParameters() {
|
||||
|
||||
Reference in New Issue
Block a user