Replace OBJECT$ usages in code and test data
This commit is contained in:
@@ -1908,7 +1908,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
||||
if (descriptor instanceof PropertyDescriptor) {
|
||||
PropertyDescriptor propertyDescriptor = (PropertyDescriptor) descriptor;
|
||||
|
||||
Collection<ExpressionCodegenExtension> codegenExtensions = ExpressionCodegenExtension.OBJECT$.getInstances(state.getProject());
|
||||
Collection<ExpressionCodegenExtension> codegenExtensions = ExpressionCodegenExtension.Companion.getInstances(state.getProject());
|
||||
if (!codegenExtensions.isEmpty() && resolvedCall != null) {
|
||||
ExpressionCodegenExtension.Context context = new ExpressionCodegenExtension.Context(typeMapper, v);
|
||||
JetType returnType = propertyDescriptor.getReturnType();
|
||||
@@ -2348,7 +2348,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
||||
if (!(resolvedCall.getResultingDescriptor() instanceof ConstructorDescriptor)) { // otherwise already
|
||||
receiver = StackValue.receiver(resolvedCall, receiver, this, callableMethod);
|
||||
|
||||
Collection<ExpressionCodegenExtension> codegenExtensions = ExpressionCodegenExtension.OBJECT$.getInstances(state.getProject());
|
||||
Collection<ExpressionCodegenExtension> codegenExtensions = ExpressionCodegenExtension.Companion.getInstances(state.getProject());
|
||||
if (!codegenExtensions.isEmpty()) {
|
||||
ExpressionCodegenExtension.Context context = new ExpressionCodegenExtension.Context(typeMapper, v);
|
||||
for (ExpressionCodegenExtension extension : codegenExtensions) {
|
||||
|
||||
@@ -388,7 +388,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
|
||||
genClosureFields(context.closure, v, typeMapper);
|
||||
|
||||
for (ExpressionCodegenExtension extension : ExpressionCodegenExtension.OBJECT$.getInstances(state.getProject())) {
|
||||
for (ExpressionCodegenExtension extension : ExpressionCodegenExtension.Companion.getInstances(state.getProject())) {
|
||||
extension.generateClassSyntheticParts(v, state, myClass, descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ public abstract class MemberCodegen<T extends JetElement/* TODO: & JetDeclaratio
|
||||
writeInnerClasses();
|
||||
|
||||
if (sourceMapper != null) {
|
||||
SourceMapper.OBJECT$.flushToClassBuilder(sourceMapper, v);
|
||||
SourceMapper.Companion.flushToClassBuilder(sourceMapper, v);
|
||||
}
|
||||
|
||||
v.done();
|
||||
@@ -520,7 +520,7 @@ public abstract class MemberCodegen<T extends JetElement/* TODO: & JetDeclaratio
|
||||
@NotNull
|
||||
public SourceMapper getOrCreateSourceMapper() {
|
||||
if (sourceMapper == null) {
|
||||
sourceMapper = new DefaultSourceMapper(SourceInfo.OBJECT$.createInfo(element, getClassName()), null);
|
||||
sourceMapper = new DefaultSourceMapper(SourceInfo.Companion.createInfo(element, getClassName()), null);
|
||||
}
|
||||
return sourceMapper;
|
||||
}
|
||||
|
||||
+2
-2
@@ -161,7 +161,7 @@ public class AnonymousObjectTransformer {
|
||||
|
||||
if (!inliningContext.isInliningLambda) {
|
||||
if (debugInfo != null && !debugInfo.isEmpty()) {
|
||||
sourceMapper = SourceMapper.OBJECT$.createFromSmap(SMAPParser.parse(debugInfo));
|
||||
sourceMapper = SourceMapper.Companion.createFromSmap(SMAPParser.parse(debugInfo));
|
||||
}
|
||||
else {
|
||||
//seems we can't do any clever mapping cause we don't know any about original class name
|
||||
@@ -195,7 +195,7 @@ public class AnonymousObjectTransformer {
|
||||
|
||||
result.addAllClassesToRemove(constructorResult);
|
||||
|
||||
SourceMapper.OBJECT$.flushToClassBuilder(sourceMapper, classBuilder);
|
||||
SourceMapper.Companion.flushToClassBuilder(sourceMapper, classBuilder);
|
||||
|
||||
classBuilder.done();
|
||||
|
||||
|
||||
@@ -299,8 +299,8 @@ public class JetCoreEnvironment {
|
||||
|
||||
project.registerService(VirtualFileFinderFactory.class, new CliVirtualFileFinderFactory(classPath));
|
||||
|
||||
ExternalDeclarationsProvider.OBJECT$.registerExtensionPoint(project);
|
||||
ExpressionCodegenExtension.OBJECT$.registerExtensionPoint(project);
|
||||
ExternalDeclarationsProvider.Companion.registerExtensionPoint(project);
|
||||
ExpressionCodegenExtension.Companion.registerExtensionPoint(project);
|
||||
|
||||
for (ComponentRegistrar registrar : configuration.getList(ComponentRegistrar.PLUGIN_COMPONENT_REGISTRARS)) {
|
||||
registrar.registerProjectComponents(project, configuration);
|
||||
|
||||
@@ -2,13 +2,13 @@ package test;
|
||||
|
||||
class ClassObject {
|
||||
void accessToClassObject() {
|
||||
WithClassObject.OBJECT$.foo();
|
||||
WithClassObject.OBJECT$.getValue();
|
||||
WithClassObject.OBJECT$.getValueWithGetter();
|
||||
WithClassObject.OBJECT$.getVariable();
|
||||
WithClassObject.OBJECT$.setVariable(0);
|
||||
WithClassObject.OBJECT$.getVariableWithAccessors();
|
||||
WithClassObject.OBJECT$.setVariableWithAccessors(0);
|
||||
WithClassObject.Companion.foo();
|
||||
WithClassObject.Companion.getValue();
|
||||
WithClassObject.Companion.getValueWithGetter();
|
||||
WithClassObject.Companion.getVariable();
|
||||
WithClassObject.Companion.setVariable(0);
|
||||
WithClassObject.Companion.getVariableWithAccessors();
|
||||
WithClassObject.Companion.setVariableWithAccessors(0);
|
||||
}
|
||||
|
||||
void accessToPackageObject() {
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ class TypeKindHighlightingVisitor extends AfterAnalysisHighlightingVisitor {
|
||||
public void visitSimpleNameExpression(@NotNull JetSimpleNameExpression expression) {
|
||||
PsiReference ref = expression.getReference();
|
||||
if (ref == null) return;
|
||||
if (JetPsiChecker.OBJECT$.getNamesHighlightingEnabled()) {
|
||||
if (JetPsiChecker.Companion.getNamesHighlightingEnabled()) {
|
||||
DeclarationDescriptor referenceTarget = bindingContext.get(BindingContext.REFERENCE_TARGET, expression);
|
||||
if (referenceTarget instanceof ConstructorDescriptor) {
|
||||
referenceTarget = referenceTarget.getContainingDeclaration();
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ public class JetPsiCheckerAndHighlightingUpdater extends JetPsiChecker {
|
||||
PsiElement grandParent = parameter.getParent().getParent();
|
||||
if (grandParent instanceof JetNamedFunction) {
|
||||
JetNamedFunction function = (JetNamedFunction) grandParent;
|
||||
return UnusedSymbolInspection.OBJECT$.isEntryPoint(function);
|
||||
return UnusedSymbolInspection.Companion.isEntryPoint(function);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class QuickFixRegistrar {
|
||||
QuickFixes.factories.put(NO_BACKING_FIELD_CUSTOM_ACCESSORS, changeToPropertyNameFactory);
|
||||
QuickFixes.factories.put(INACCESSIBLE_BACKING_FIELD, changeToPropertyNameFactory);
|
||||
|
||||
JetSingleIntentionActionFactory unresolvedReferenceFactory = AutoImportFix.OBJECT$.createFactory();
|
||||
JetSingleIntentionActionFactory unresolvedReferenceFactory = AutoImportFix.Companion.createFactory();
|
||||
QuickFixes.factories.put(UNRESOLVED_REFERENCE, unresolvedReferenceFactory);
|
||||
QuickFixes.factories.put(UNRESOLVED_REFERENCE_WRONG_RECEIVER, unresolvedReferenceFactory);
|
||||
|
||||
|
||||
+1
-1
@@ -263,7 +263,7 @@ public class KotlinIntroduceVariableHandler extends KotlinIntroduceHandlerBase {
|
||||
final JetExpression originalBody = originalDeclaration.getBodyExpression();
|
||||
assert originalBody != null : "Original body is not found: " + originalDeclaration;
|
||||
|
||||
JetDeclarationWithBody newDeclaration = ConvertToBlockBodyAction.OBJECT$.convert(originalDeclaration);
|
||||
JetDeclarationWithBody newDeclaration = ConvertToBlockBodyAction.Companion.convert(originalDeclaration);
|
||||
|
||||
JetBlockExpression newCommonContainer = (JetBlockExpression) newDeclaration.getBodyExpression();
|
||||
assert newCommonContainer != null : "New body is not found: " + newDeclaration;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
class ClassObject {
|
||||
void foo() {
|
||||
WithClassObject.OBJECT$.getValue();
|
||||
WithClassObject.OBJECT$.getValue();
|
||||
WithClassObject.OBJECT$.foo();
|
||||
WithClassObject.OBJECT$.getValueWithGetter();
|
||||
WithClassObject.OBJECT$.getVariable();
|
||||
WithClassObject.OBJECT$.setVariable(0);
|
||||
WithClassObject.OBJECT$.getVariableWithAccessors();
|
||||
WithClassObject.OBJECT$.setVariableWithAccessors(0);
|
||||
WithClassObject.Companion.getValue();
|
||||
WithClassObject.Companion.getValue();
|
||||
WithClassObject.Companion.foo();
|
||||
WithClassObject.Companion.getValueWithGetter();
|
||||
WithClassObject.Companion.getVariable();
|
||||
WithClassObject.Companion.setVariable(0);
|
||||
WithClassObject.Companion.getVariableWithAccessors();
|
||||
WithClassObject.Companion.setVariableWithAccessors(0);
|
||||
}
|
||||
}
|
||||
@@ -38,11 +38,11 @@ public abstract class AbstractJetPsiCheckerTest extends JetLightCodeInsightFixtu
|
||||
//noinspection unchecked
|
||||
myFixture.enableInspections(SpellCheckingInspection.class);
|
||||
|
||||
JetPsiChecker.OBJECT$.setNamesHighlightingEnabled(false);
|
||||
JetPsiChecker.Companion.setNamesHighlightingEnabled(false);
|
||||
checkHighlighting(true, true, false);
|
||||
}
|
||||
finally {
|
||||
JetPsiChecker.OBJECT$.setNamesHighlightingEnabled(true);
|
||||
JetPsiChecker.Companion.setNamesHighlightingEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ public final class AnnotationsUtils {
|
||||
}
|
||||
|
||||
for (DeclarationDescriptor descriptor : descriptors) {
|
||||
for (PredefinedAnnotation annotation : PredefinedAnnotation.OBJECT$.getWITH_CUSTOM_NAME()) {
|
||||
for (PredefinedAnnotation annotation : PredefinedAnnotation.Companion.getWITH_CUSTOM_NAME()) {
|
||||
if (!hasAnnotationOrInsideAnnotatedClass(descriptor, annotation)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user