Minor: formatting and warnings

This commit is contained in:
Nikolay Krasko
2014-01-17 17:23:40 +04:00
parent 7546a6dc41
commit 9a6ac60a5f
4 changed files with 8 additions and 11 deletions
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2013 JetBrains s.r.o. * Copyright 2010-2014 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -116,8 +116,7 @@ public abstract class ClassBodyCodegen extends MemberCodegen {
genFunctionOrProperty(context, (JetTypeParameterListOwner) declaration, v); genFunctionOrProperty(context, (JetTypeParameterListOwner) declaration, v);
} }
else if (declaration instanceof JetClassOrObject) { else if (declaration instanceof JetClassOrObject) {
if (declaration instanceof JetEnumEntry && !enumEntryNeedSubclass( if (declaration instanceof JetEnumEntry && !enumEntryNeedSubclass(state.getBindingContext(), (JetEnumEntry) declaration)) {
state.getBindingContext(), (JetEnumEntry) declaration)) {
return; return;
} }
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2013 JetBrains s.r.o. * Copyright 2010-2014 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -324,10 +324,7 @@ public class CodegenBinding {
return closure != null && closure.getCaptureThis() != null; return closure != null && closure.getCaptureThis() != null;
} }
private static JetDelegatorToSuperCall findSuperCall( private static JetDelegatorToSuperCall findSuperCall(BindingContext bindingContext, JetElement classOrObject) {
BindingContext bindingContext,
JetElement classOrObject
) {
if (!(classOrObject instanceof JetClassOrObject)) { if (!(classOrObject instanceof JetClassOrObject)) {
return null; return null;
} }
@@ -335,6 +332,7 @@ public class CodegenBinding {
if (classOrObject instanceof JetClass && ((JetClass) classOrObject).isTrait()) { if (classOrObject instanceof JetClass && ((JetClass) classOrObject).isTrait()) {
return null; return null;
} }
for (JetDelegationSpecifier specifier : ((JetClassOrObject) classOrObject).getDelegationSpecifiers()) { for (JetDelegationSpecifier specifier : ((JetClassOrObject) classOrObject).getDelegationSpecifiers()) {
if (specifier instanceof JetDelegatorToSuperCall) { if (specifier instanceof JetDelegatorToSuperCall) {
JetTypeReference typeReference = specifier.getTypeReference(); JetTypeReference typeReference = specifier.getTypeReference();
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2013 JetBrains s.r.o. * Copyright 2010-2014 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -209,7 +209,7 @@ public class CliLightClassGenerationSupport extends LightClassGenerationSupport
@Nullable @Nullable
@Override @Override
public PsiClass getPsiClass(@NotNull JetClassOrObject classOrObject) { public PsiClass getPsiClass(@NotNull JetClassOrObject classOrObject) {
return KotlinLightClassForExplicitDeclaration.create(classOrObject.getManager(), classOrObject); return KotlinLightClassForExplicitDeclaration.create(classOrObject.getManager(), classOrObject);
} }
public static class BindingTraceContextWithoutScopeRecording extends BindingTraceContext { public static class BindingTraceContextWithoutScopeRecording extends BindingTraceContext {
@@ -387,7 +387,7 @@ public class KotlinLightClassForExplicitDeclaration extends KotlinWrappingLightC
@Override @Override
public PsiModifierList getModifierList() { public PsiModifierList getModifierList() {
if (modifierList == null) { if (modifierList == null) {
modifierList = new KotlinLightModifierList(KotlinLightClassForExplicitDeclaration.this.computeModifiers()); modifierList = new KotlinLightModifierList(computeModifiers());
} }
return modifierList; return modifierList;
} }