Merge branch 'master' of github.com:JetBrains/kotlin
This commit is contained in:
Generated
-8
@@ -10,14 +10,6 @@
|
||||
<maximumStackSize value="2" />
|
||||
<properties />
|
||||
</buildFile>
|
||||
<buildFile url="file://$PROJECT_DIR$/confluence/buildConfluenceLexer.xml">
|
||||
<additionalClassPath />
|
||||
<antReference projectDefault="true" />
|
||||
<customJdkName value="" />
|
||||
<maximumHeapSize value="128" />
|
||||
<maximumStackSize value="2" />
|
||||
<properties />
|
||||
</buildFile>
|
||||
<buildFile url="file://$PROJECT_DIR$/compiler/frontend/buildLexer.xml">
|
||||
<additionalClassPath />
|
||||
<antReference projectDefault="true" />
|
||||
|
||||
@@ -18,9 +18,7 @@ package org.jetbrains.jet.buildtools.core;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.compiler.CompileEnvironment;
|
||||
import org.jetbrains.jet.compiler.CompileEnvironmentException;
|
||||
import org.jetbrains.jet.compiler.CompilerPlugin;
|
||||
import org.jetbrains.jet.compiler.*;
|
||||
import org.jetbrains.jet.compiler.messages.MessageCollector;
|
||||
import org.jetbrains.jet.lang.resolve.java.CompilerDependencies;
|
||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
||||
@@ -42,26 +40,29 @@ public class BytecodeCompiler {
|
||||
|
||||
|
||||
/**
|
||||
* Creates new instance of {@link CompileEnvironment} instance using the arguments specified.
|
||||
* Creates new instance of {@link org.jetbrains.jet.compiler.CompileEnvironmentConfiguration} instance using the arguments specified.
|
||||
*
|
||||
* @param stdlib path to "kotlin-runtime.jar", only used if not null and not empty
|
||||
* @param classpath compilation classpath, only used if not null and not empty
|
||||
*
|
||||
* @return compile environment instance
|
||||
*/
|
||||
private CompileEnvironment env( String stdlib, String[] classpath ) {
|
||||
CompileEnvironment env = new CompileEnvironment(MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR, CompilerDependencies.compilerDependenciesForProduction(CompilerSpecialMode.REGULAR));
|
||||
private CompileEnvironmentConfiguration env( String stdlib, String[] classpath ) {
|
||||
CompilerDependencies dependencies = CompilerDependencies.compilerDependenciesForProduction(CompilerSpecialMode.REGULAR);
|
||||
JetCoreEnvironment environment = new JetCoreEnvironment(CompileEnvironmentUtil.createMockDisposable(), dependencies);
|
||||
CompileEnvironmentConfiguration env = new CompileEnvironmentConfiguration(environment, dependencies, MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR);
|
||||
|
||||
if (( stdlib != null ) && ( stdlib.trim().length() > 0 )) {
|
||||
env.setStdlib( stdlib );
|
||||
File file = new File(stdlib);
|
||||
CompileEnvironmentUtil.addToClasspath(env.getEnvironment(), file);
|
||||
}
|
||||
|
||||
if (( classpath != null ) && ( classpath.length > 0 )) {
|
||||
env.addToClasspath( classpath );
|
||||
CompileEnvironmentUtil.addToClasspath(env.getEnvironment(), classpath);
|
||||
}
|
||||
|
||||
// lets register any compiler plugins
|
||||
env.getEnvironment().getCompilerPlugins().addAll(getCompilerPlugins());
|
||||
env.getCompilerPlugins().addAll(getCompilerPlugins());
|
||||
|
||||
return env;
|
||||
}
|
||||
@@ -92,7 +93,8 @@ public class BytecodeCompiler {
|
||||
*/
|
||||
public void sourcesToDir ( @NotNull String src, @NotNull String output, @Nullable String stdlib, @Nullable String[] classpath ) {
|
||||
try {
|
||||
boolean success = env( stdlib, classpath ).compileBunchOfSources( src, null, output, true /* Last arg is ignored anyway */ );
|
||||
boolean success = KotlinToJVMBytecodeCompiler.compileBunchOfSources(env(stdlib, classpath), src, null, output, true
|
||||
/* Last arg is ignored anyway */);
|
||||
if ( ! success ) {
|
||||
throw new CompileEnvironmentException( errorMessage( src, false ));
|
||||
}
|
||||
@@ -114,7 +116,7 @@ public class BytecodeCompiler {
|
||||
*/
|
||||
public void sourcesToJar ( @NotNull String src, @NotNull String jar, boolean includeRuntime, @Nullable String stdlib, @Nullable String[] classpath ) {
|
||||
try {
|
||||
boolean success = env( stdlib, classpath ).compileBunchOfSources( src, jar, null, includeRuntime );
|
||||
boolean success = KotlinToJVMBytecodeCompiler.compileBunchOfSources(env(stdlib, classpath), src, jar, null, includeRuntime);
|
||||
if ( ! success ) {
|
||||
throw new CompileEnvironmentException( errorMessage( src, false ));
|
||||
}
|
||||
@@ -136,7 +138,8 @@ public class BytecodeCompiler {
|
||||
*/
|
||||
public void moduleToJar ( @NotNull String module, @NotNull String jar, boolean includeRuntime, @Nullable String stdlib, @Nullable String[] classpath ) {
|
||||
try {
|
||||
boolean success = env( stdlib, classpath ).compileModuleScript( module, jar, null, includeRuntime);
|
||||
CompileEnvironmentConfiguration env = env(stdlib, classpath);
|
||||
boolean success = KotlinToJVMBytecodeCompiler.compileModuleScript(env, module, jar, null, includeRuntime);
|
||||
if ( ! success ) {
|
||||
throw new CompileEnvironmentException( errorMessage( module, false ));
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.jetbrains.jet.codegen;
|
||||
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.PropertyDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
@@ -148,7 +147,7 @@ public abstract class ClassBodyCodegen {
|
||||
private void generateStaticInitializer() {
|
||||
if (staticInitializerChunks.size() > 0) {
|
||||
final MethodVisitor mv = v.newMethod(null, ACC_PUBLIC | Opcodes.ACC_STATIC,"<clinit>", "()V", null, null);
|
||||
if (v.generateCode() == ClassBuilder.Mode.FULL) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
mv.visitCode();
|
||||
|
||||
InstructionAdapter v = new InstructionAdapter(mv);
|
||||
|
||||
@@ -21,27 +21,24 @@ package org.jetbrains.jet.codegen;
|
||||
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.objectweb.asm.*;
|
||||
import org.objectweb.asm.AnnotationVisitor;
|
||||
import org.objectweb.asm.ClassVisitor;
|
||||
import org.objectweb.asm.FieldVisitor;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
public abstract class ClassBuilder {
|
||||
public static class Concrete extends ClassBuilder {
|
||||
private final ClassVisitor v;
|
||||
private final boolean stubs;
|
||||
|
||||
public Concrete(ClassVisitor v, boolean stubs) {
|
||||
public Concrete(ClassVisitor v) {
|
||||
this.v = v;
|
||||
this.stubs = stubs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassVisitor getVisitor() {
|
||||
return v;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mode generateCode() {
|
||||
return stubs ? Mode.STUBS : Mode.FULL;
|
||||
}
|
||||
}
|
||||
public FieldVisitor newField(@Nullable PsiElement origin,
|
||||
int access,
|
||||
@@ -88,15 +85,4 @@ public abstract class ClassBuilder {
|
||||
public void visitInnerClass(String name, String outerName, String innerName, int access) {
|
||||
getVisitor().visitInnerClass(name, outerName, innerName, access);
|
||||
}
|
||||
|
||||
public enum Mode {
|
||||
/** Full function bodies */
|
||||
FULL,
|
||||
/** Only function signatures */
|
||||
SIGNATURES,
|
||||
/** Function with stub bodies: just throw exception */
|
||||
STUBS,
|
||||
}
|
||||
|
||||
public abstract Mode generateCode();
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.jet.codegen;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.util.TraceClassVisitor;
|
||||
|
||||
@@ -28,9 +29,15 @@ import java.io.StringWriter;
|
||||
public class ClassBuilderFactories {
|
||||
|
||||
public static ClassBuilderFactory TEXT = new ClassBuilderFactory() {
|
||||
@NotNull
|
||||
@Override
|
||||
public ClassBuilderMode getClassBuilderMode() {
|
||||
return ClassBuilderMode.FULL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassBuilder newClassBuilder() {
|
||||
return new ClassBuilder.Concrete(new TraceClassVisitor(new PrintWriter(new StringWriter())), false);
|
||||
return new ClassBuilder.Concrete(new TraceClassVisitor(new PrintWriter(new StringWriter())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -51,6 +58,12 @@ public class ClassBuilderFactories {
|
||||
|
||||
public static ClassBuilderFactory binaries(final boolean stubs) {
|
||||
return new ClassBuilderFactory() {
|
||||
@NotNull
|
||||
@Override
|
||||
public ClassBuilderMode getClassBuilderMode() {
|
||||
return stubs ? ClassBuilderMode.STUBS : ClassBuilderMode.FULL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassBuilder newClassBuilder() {
|
||||
return new ClassBuilder.Concrete(new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS){
|
||||
@@ -64,7 +77,7 @@ public class ClassBuilderFactories {
|
||||
return "java/lang/Object";
|
||||
}
|
||||
}
|
||||
}, stubs);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.jet.codegen;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.util.TraceClassVisitor;
|
||||
|
||||
@@ -26,6 +27,8 @@ import java.io.StringWriter;
|
||||
* @author max
|
||||
*/
|
||||
public interface ClassBuilderFactory {
|
||||
@NotNull
|
||||
ClassBuilderMode getClassBuilderMode();
|
||||
ClassBuilder newClassBuilder();
|
||||
String asText(ClassBuilder builder);
|
||||
byte[] asBytes(ClassBuilder builder);
|
||||
|
||||
+10
-4
@@ -14,10 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.intellij.lexer;
|
||||
package org.jetbrains.jet.codegen;
|
||||
|
||||
/**
|
||||
* @author abreslav
|
||||
*/
|
||||
public class Foo {
|
||||
* @author Stepan Koltsov
|
||||
*/
|
||||
public enum ClassBuilderMode {
|
||||
/** Full function bodies */
|
||||
FULL,
|
||||
/** Only function signatures */
|
||||
SIGNATURES,
|
||||
/** Function with stub bodies: just throw exception */
|
||||
STUBS,
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class ClassCodegen {
|
||||
|
||||
final CodegenContext contextForInners = context.intoClass(descriptor, OwnerKind.IMPLEMENTATION, state.getInjector().getJetTypeMapper());
|
||||
|
||||
if (classBuilder.generateCode() == ClassBuilder.Mode.SIGNATURES) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.SIGNATURES) {
|
||||
// Outer class implementation must happen prior inner classes so we get proper scoping tree in JetLightClass's delegate
|
||||
generateImplementation(context, aClass, OwnerKind.IMPLEMENTATION, contextForInners.accessors, classBuilder);
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class ClassCodegen {
|
||||
}
|
||||
}
|
||||
|
||||
if (classBuilder.generateCode() != ClassBuilder.Mode.SIGNATURES) {
|
||||
if (state.getClassBuilderMode() != ClassBuilderMode.SIGNATURES) {
|
||||
generateImplementation(context, aClass, OwnerKind.IMPLEMENTATION, contextForInners.accessors, classBuilder);
|
||||
}
|
||||
|
||||
|
||||
@@ -170,10 +170,10 @@ public class ClosureCodegen extends ObjectOrClosureCodegen {
|
||||
cv.newField(fun, ACC_PRIVATE | ACC_STATIC | ACC_FINAL, "$instance", classDescr, null, null);
|
||||
|
||||
MethodVisitor mv = cv.newMethod(fun, ACC_PUBLIC | ACC_STATIC, "$getInstance", "()" + classDescr, null, new String[0]);
|
||||
if (cv.generateCode() == ClassBuilder.Mode.STUBS) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) {
|
||||
StubCodegen.generateStubCode(mv);
|
||||
}
|
||||
else if (cv.generateCode() == ClassBuilder.Mode.FULL) {
|
||||
else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
mv.visitCode();
|
||||
mv.visitFieldInsn(GETSTATIC, name, "$instance", classDescr);
|
||||
mv.visitInsn(DUP);
|
||||
@@ -211,10 +211,10 @@ public class ClosureCodegen extends ObjectOrClosureCodegen {
|
||||
return;
|
||||
|
||||
final MethodVisitor mv = cv.newMethod(fun, ACC_PUBLIC, "invoke", bridge.getAsmMethod().getDescriptor(), null, new String[0]);
|
||||
if (cv.generateCode() == ClassBuilder.Mode.STUBS) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) {
|
||||
StubCodegen.generateStubCode(mv);
|
||||
}
|
||||
if (cv.generateCode() == ClassBuilder.Mode.FULL) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
mv.visitCode();
|
||||
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
@@ -296,10 +296,10 @@ public class ClosureCodegen extends ObjectOrClosureCodegen {
|
||||
|
||||
final Method constructor = new Method("<init>", Type.VOID_TYPE, argTypes);
|
||||
final MethodVisitor mv = cv.newMethod(fun, ACC_PUBLIC, "<init>", constructor.getDescriptor(), null, new String[0]);
|
||||
if (cv.generateCode() == ClassBuilder.Mode.STUBS) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) {
|
||||
StubCodegen.generateStubCode(mv);
|
||||
}
|
||||
else if (cv.generateCode() == ClassBuilder.Mode.FULL) {
|
||||
else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
mv.visitCode();
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ public class FunctionCodegen {
|
||||
|
||||
final MethodVisitor mv = v.newMethod(fun, flags, jvmSignature.getAsmMethod().getName(), jvmSignature.getAsmMethod().getDescriptor(), jvmSignature.getGenericsSignature(), null);
|
||||
AnnotationCodegen.forMethod(mv, state.getInjector().getJetTypeMapper()).genAnnotations(functionDescriptor);
|
||||
if(v.generateCode() != ClassBuilder.Mode.SIGNATURES) {
|
||||
if(state.getClassBuilderMode() != ClassBuilderMode.SIGNATURES) {
|
||||
int start = 0;
|
||||
if (needJetAnnotations) {
|
||||
if (functionDescriptor instanceof PropertyAccessorDescriptor) {
|
||||
@@ -169,12 +169,12 @@ public class FunctionCodegen {
|
||||
}
|
||||
}
|
||||
|
||||
if (!isAbstract && v.generateCode() == ClassBuilder.Mode.STUBS) {
|
||||
if (!isAbstract && state.getClassBuilderMode() == ClassBuilderMode.STUBS) {
|
||||
StubCodegen.generateStubCode(mv);
|
||||
}
|
||||
|
||||
|
||||
if (!isAbstract && v.generateCode() == ClassBuilder.Mode.FULL) {
|
||||
if (!isAbstract && state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
mv.visitCode();
|
||||
|
||||
Label methodBegin = new Label();
|
||||
@@ -345,10 +345,10 @@ public class FunctionCodegen {
|
||||
descriptor = descriptor.replace("(","(L" + ownerInternalName + ";");
|
||||
final MethodVisitor mv = v.newMethod(null, flags | (isConstructor ? 0 : ACC_STATIC), isConstructor ? "<init>" : jvmSignature.getName() + JvmAbi.DEFAULT_PARAMS_IMPL_SUFFIX, descriptor, null, null);
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
if (v.generateCode() == ClassBuilder.Mode.STUBS) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) {
|
||||
StubCodegen.generateStubCode(mv);
|
||||
}
|
||||
else if (v.generateCode() == ClassBuilder.Mode.FULL) {
|
||||
else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
mv.visitCode();
|
||||
|
||||
FrameMap frameMap = owner.prepareFrame(state.getInjector().getJetTypeMapper());
|
||||
@@ -474,10 +474,10 @@ public class FunctionCodegen {
|
||||
int flags = ACC_PUBLIC | ACC_BRIDGE; // TODO.
|
||||
|
||||
final MethodVisitor mv = v.newMethod(null, flags, jvmSignature.getName(), overriden.getDescriptor(), null, null);
|
||||
if (v.generateCode() == ClassBuilder.Mode.STUBS) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) {
|
||||
StubCodegen.generateStubCode(mv);
|
||||
}
|
||||
else if (v.generateCode() == ClassBuilder.Mode.FULL) {
|
||||
else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
mv.visitCode();
|
||||
|
||||
Type[] argTypes = overriden.getArgumentTypes();
|
||||
@@ -515,10 +515,10 @@ public class FunctionCodegen {
|
||||
int flags = ACC_PUBLIC | ACC_SYNTHETIC; // TODO.
|
||||
|
||||
final MethodVisitor mv = v.newMethod(null, flags, method.getName(), method.getDescriptor(), null, null);
|
||||
if (v.generateCode() == ClassBuilder.Mode.STUBS) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) {
|
||||
StubCodegen.generateStubCode(mv);
|
||||
}
|
||||
else if (v.generateCode() == ClassBuilder.Mode.FULL) {
|
||||
else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
mv.visitCode();
|
||||
|
||||
Type[] argTypes = method.getArgumentTypes();
|
||||
|
||||
@@ -49,6 +49,8 @@ public class GenerationState {
|
||||
private final List<JetFile> files;
|
||||
@NotNull
|
||||
private final InjectorForJvmCodegen injector;
|
||||
@NotNull
|
||||
private final ClassBuilderMode classBuilderMode;
|
||||
|
||||
|
||||
public GenerationState(Project project, ClassBuilderFactory builderFactory, AnalyzeExhaust analyzeExhaust, List<JetFile> files) {
|
||||
@@ -61,9 +63,10 @@ public class GenerationState {
|
||||
this.progress = progress;
|
||||
this.analyzeExhaust = exhaust;
|
||||
this.files = files;
|
||||
this.classBuilderMode = builderFactory.getClassBuilderMode();
|
||||
this.injector = new InjectorForJvmCodegen(
|
||||
analyzeExhaust.getStandardLibrary(), analyzeExhaust.getBindingContext(),
|
||||
this.files, project, compilerSpecialMode, this, builderFactory);
|
||||
this.files, project, compilerSpecialMode, builderFactory.getClassBuilderMode(), this, builderFactory);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -83,6 +86,11 @@ public class GenerationState {
|
||||
return analyzeExhaust.getBindingContext();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ClassBuilderMode getClassBuilderMode() {
|
||||
return classBuilderMode;
|
||||
}
|
||||
|
||||
public ClassCodegen forClass() {
|
||||
return new ClassCodegen(this);
|
||||
}
|
||||
|
||||
@@ -296,10 +296,10 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
Type[] argTypes = method.getArgumentTypes();
|
||||
|
||||
MethodVisitor mv = v.newMethod(null, ACC_PUBLIC| ACC_BRIDGE| ACC_FINAL, bridge.getName(), method.getDescriptor(), null, null);
|
||||
if (v.generateCode() == ClassBuilder.Mode.STUBS) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) {
|
||||
StubCodegen.generateStubCode(mv);
|
||||
}
|
||||
else if (v.generateCode() == ClassBuilder.Mode.FULL) {
|
||||
else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
mv.visitCode();
|
||||
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
@@ -327,10 +327,10 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
Method originalMethod = originalSignature.getJvmMethodSignature().getAsmMethod();
|
||||
MethodVisitor mv = v.newMethod(null, ACC_PUBLIC | ACC_BRIDGE | ACC_FINAL, method.getName(), method.getDescriptor(), null, null);
|
||||
PropertyCodegen.generateJetPropertyAnnotation(mv, originalSignature.getPropertyTypeKotlinSignature(), originalSignature.getJvmMethodSignature().getKotlinTypeParameter());
|
||||
if (v.generateCode() == ClassBuilder.Mode.STUBS) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) {
|
||||
StubCodegen.generateStubCode(mv);
|
||||
}
|
||||
else if (v.generateCode() == ClassBuilder.Mode.FULL) {
|
||||
else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
mv.visitCode();
|
||||
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
@@ -353,10 +353,10 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
Method originalMethod = originalSignature2.getJvmMethodSignature().getAsmMethod();
|
||||
MethodVisitor mv = v.newMethod(null, ACC_PUBLIC | ACC_BRIDGE | ACC_FINAL, method.getName(), method.getDescriptor(), null, null);
|
||||
PropertyCodegen.generateJetPropertyAnnotation(mv, originalSignature2.getPropertyTypeKotlinSignature(), originalSignature2.getJvmMethodSignature().getKotlinTypeParameter());
|
||||
if (v.generateCode() == ClassBuilder.Mode.STUBS) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) {
|
||||
StubCodegen.generateStubCode(mv);
|
||||
}
|
||||
else if (v.generateCode() == ClassBuilder.Mode.FULL) {
|
||||
else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
mv.visitCode();
|
||||
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
@@ -531,7 +531,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
|
||||
int flags = ACC_PUBLIC; // TODO
|
||||
final MethodVisitor mv = v.newMethod(myClass, flags, constructorMethod.getName(), constructorMethod.getAsmMethod().getDescriptor(), constructorMethod.getGenericsSignature(), null);
|
||||
if (v.generateCode() == ClassBuilder.Mode.SIGNATURES) return;
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.SIGNATURES) return;
|
||||
|
||||
AnnotationVisitor jetConstructorVisitor = mv.visitAnnotation(JvmStdlibNames.JET_CONSTRUCTOR.getDescriptor(), true);
|
||||
if (constructorDescriptor == null) {
|
||||
@@ -558,7 +558,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
}
|
||||
}
|
||||
|
||||
if (v.generateCode() == ClassBuilder.Mode.STUBS) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) {
|
||||
StubCodegen.generateStubCode(mv);
|
||||
return;
|
||||
}
|
||||
@@ -733,10 +733,10 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
Method functionOriginal = typeMapper.mapSignature(fun.getName(), fun.getOriginal()).getAsmMethod();
|
||||
|
||||
final MethodVisitor mv = v.newMethod(myClass, flags, function.getName(), function.getDescriptor(), null, null);
|
||||
if (v.generateCode() == ClassBuilder.Mode.STUBS) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) {
|
||||
StubCodegen.generateStubCode(mv);
|
||||
}
|
||||
else if (v.generateCode() == ClassBuilder.Mode.FULL) {
|
||||
else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
mv.visitCode();
|
||||
|
||||
codegen.generateThisOrOuter(descriptor);
|
||||
@@ -872,10 +872,10 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
CallableMethod method = typeMapper.mapToCallableMethod(constructorDescriptor, kind, typeMapper.hasThis0(constructorDescriptor.getContainingDeclaration()));
|
||||
int flags = ACC_PUBLIC; // TODO
|
||||
final MethodVisitor mv = v.newMethod(constructor, flags, "<init>", method.getSignature().getAsmMethod().getDescriptor(), null, null);
|
||||
if (v.generateCode() == ClassBuilder.Mode.STUBS) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) {
|
||||
StubCodegen.generateStubCode(mv);
|
||||
}
|
||||
else if (v.generateCode() == ClassBuilder.Mode.FULL) {
|
||||
else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
mv.visitCode();
|
||||
|
||||
ConstructorFrameMap frameMap = new ConstructorFrameMap(method, constructorDescriptor, typeMapper.hasThis0(constructorDescriptor.getContainingDeclaration()));
|
||||
|
||||
@@ -65,6 +65,7 @@ public class JetTypeMapper {
|
||||
public BindingContext bindingContext;
|
||||
private ClosureAnnotator closureAnnotator;
|
||||
private CompilerSpecialMode compilerSpecialMode;
|
||||
private ClassBuilderMode classBuilderMode;
|
||||
|
||||
|
||||
@Inject
|
||||
@@ -87,6 +88,11 @@ public class JetTypeMapper {
|
||||
this.compilerSpecialMode = compilerSpecialMode;
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void setClassBuilderMode(ClassBuilderMode classBuilderMode) {
|
||||
this.classBuilderMode = classBuilderMode;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
initKnownTypes();
|
||||
@@ -335,6 +341,9 @@ public class JetTypeMapper {
|
||||
DeclarationDescriptor descriptor = jetType.getConstructor().getDeclarationDescriptor();
|
||||
|
||||
if (ErrorUtils.isError(descriptor)) {
|
||||
if (classBuilderMode != ClassBuilderMode.SIGNATURES) {
|
||||
throw new IllegalStateException("error types are not allowed when classBuilderMode = " + classBuilderMode);
|
||||
}
|
||||
Type asmType = Type.getObjectType("error/NonExistentClass");
|
||||
if (signatureVisitor != null) {
|
||||
visitAsmType(signatureVisitor, asmType, true);
|
||||
|
||||
@@ -92,7 +92,7 @@ public class NamespaceCodegen {
|
||||
|
||||
private void generateStaticInitializers(JetFile namespace) {
|
||||
MethodVisitor mv = v.newMethod(namespace, ACC_PUBLIC | ACC_STATIC, "<clinit>", "()V", null, null);
|
||||
if (v.generateCode() == ClassBuilder.Mode.FULL) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
mv.visitCode();
|
||||
|
||||
FrameMap frameMap = new FrameMap();
|
||||
|
||||
@@ -182,10 +182,10 @@ public class PropertyCodegen {
|
||||
AnnotationCodegen.forMethod(mv, state.getInjector().getJetTypeMapper()).genAnnotations(propertyDescriptor.getGetter());
|
||||
}
|
||||
|
||||
if (v.generateCode() != ClassBuilder.Mode.SIGNATURES && (!isTrait || kind instanceof OwnerKind.DelegateKind)) {
|
||||
if (state.getClassBuilderMode() != ClassBuilderMode.SIGNATURES && (!isTrait || kind instanceof OwnerKind.DelegateKind)) {
|
||||
if(propertyDescriptor.getModality() != Modality.ABSTRACT) {
|
||||
mv.visitCode();
|
||||
if (v.generateCode() == ClassBuilder.Mode.STUBS) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) {
|
||||
StubCodegen.generateStubThrow(mv);
|
||||
}
|
||||
else {
|
||||
@@ -266,10 +266,10 @@ public class PropertyCodegen {
|
||||
AnnotationCodegen.forMethod(mv, state.getInjector().getJetTypeMapper()).genAnnotations(propertyDescriptor.getSetter());
|
||||
}
|
||||
|
||||
if (v.generateCode() != ClassBuilder.Mode.SIGNATURES && (!isTrait || kind instanceof OwnerKind.DelegateKind)) {
|
||||
if (state.getClassBuilderMode() != ClassBuilderMode.SIGNATURES && (!isTrait || kind instanceof OwnerKind.DelegateKind)) {
|
||||
if(propertyDescriptor.getModality() != Modality.ABSTRACT) {
|
||||
mv.visitCode();
|
||||
if (v.generateCode() == ClassBuilder.Mode.STUBS) {
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) {
|
||||
StubCodegen.generateStubThrow(mv);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.List;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.codegen.JetTypeMapper;
|
||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
||||
import org.jetbrains.jet.codegen.ClassBuilderMode;
|
||||
import org.jetbrains.jet.codegen.ClosureAnnotator;
|
||||
import org.jetbrains.jet.lang.types.lang.JetStandardLibrary;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
@@ -42,9 +43,11 @@ public class InjectorForJetTypeMapper {
|
||||
) {
|
||||
this.jetTypeMapper = new JetTypeMapper();
|
||||
CompilerSpecialMode compilerSpecialMode = CompilerSpecialMode.REGULAR;
|
||||
ClassBuilderMode classBuilderMode = ClassBuilderMode.FULL;
|
||||
ClosureAnnotator closureAnnotator = new ClosureAnnotator();
|
||||
|
||||
this.jetTypeMapper.setBindingContext(bindingContext);
|
||||
this.jetTypeMapper.setClassBuilderMode(classBuilderMode);
|
||||
this.jetTypeMapper.setClosureAnnotator(closureAnnotator);
|
||||
this.jetTypeMapper.setCompilerSpecialMode(compilerSpecialMode);
|
||||
this.jetTypeMapper.setStandardLibrary(jetStandardLibrary);
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.List;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
||||
import org.jetbrains.jet.codegen.ClassBuilderMode;
|
||||
import org.jetbrains.jet.codegen.GenerationState;
|
||||
import org.jetbrains.jet.codegen.ClassBuilderFactory;
|
||||
import org.jetbrains.jet.codegen.JetTypeMapper;
|
||||
@@ -35,6 +36,7 @@ import java.util.List;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
||||
import org.jetbrains.jet.codegen.ClassBuilderMode;
|
||||
import org.jetbrains.jet.codegen.GenerationState;
|
||||
import org.jetbrains.jet.codegen.ClassBuilderFactory;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -54,6 +56,7 @@ public class InjectorForJvmCodegen {
|
||||
@NotNull List<JetFile> listOfJetFile,
|
||||
@NotNull Project project,
|
||||
@NotNull CompilerSpecialMode compilerSpecialMode,
|
||||
@NotNull ClassBuilderMode classBuilderMode,
|
||||
@NotNull GenerationState generationState,
|
||||
@NotNull ClassBuilderFactory classBuilderFactory
|
||||
) {
|
||||
@@ -65,6 +68,7 @@ public class InjectorForJvmCodegen {
|
||||
ClosureAnnotator closureAnnotator = new ClosureAnnotator();
|
||||
|
||||
this.jetTypeMapper.setBindingContext(bindingContext);
|
||||
this.jetTypeMapper.setClassBuilderMode(classBuilderMode);
|
||||
this.jetTypeMapper.setClosureAnnotator(closureAnnotator);
|
||||
this.jetTypeMapper.setCompilerSpecialMode(compilerSpecialMode);
|
||||
this.jetTypeMapper.setStandardLibrary(jetStandardLibrary);
|
||||
|
||||
@@ -20,11 +20,11 @@ import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.LinkedHashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.sampullara.cli.Args;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.compiler.CompileEnvironment;
|
||||
import org.jetbrains.jet.compiler.CompileEnvironmentException;
|
||||
import org.jetbrains.jet.compiler.CompilerPlugin;
|
||||
import org.jetbrains.jet.compiler.*;
|
||||
import org.jetbrains.jet.compiler.messages.CompilerMessageLocation;
|
||||
import org.jetbrains.jet.compiler.messages.CompilerMessageSeverity;
|
||||
import org.jetbrains.jet.compiler.messages.MessageCollector;
|
||||
@@ -135,23 +135,30 @@ public class KotlinCompiler {
|
||||
runtimeJar = null;
|
||||
}
|
||||
|
||||
CompilerDependencies dependencies = new CompilerDependencies(mode, jdkHeadersJar,runtimeJar);
|
||||
CompilerDependencies dependencies = new CompilerDependencies(mode, jdkHeadersJar, runtimeJar);
|
||||
PrintingMessageCollector messageCollector = new PrintingMessageCollector(errStream, messageRenderer, arguments.verbose);
|
||||
CompileEnvironment environment = new CompileEnvironment(messageCollector, dependencies);
|
||||
Disposable rootDisposable = CompileEnvironmentUtil.createMockDisposable();
|
||||
|
||||
JetCoreEnvironment environment = new JetCoreEnvironment(rootDisposable, dependencies);
|
||||
CompileEnvironmentConfiguration configuration = new CompileEnvironmentConfiguration(environment, dependencies, messageCollector);
|
||||
try {
|
||||
configureEnvironment(environment, arguments);
|
||||
configureEnvironment(configuration, arguments);
|
||||
|
||||
boolean noErrors;
|
||||
if (arguments.module != null) {
|
||||
noErrors = environment.compileModuleScript(arguments.module, arguments.jar, arguments.outputDir, arguments.includeRuntime);
|
||||
noErrors = KotlinToJVMBytecodeCompiler.compileModuleScript(configuration,
|
||||
arguments.module, arguments.jar, arguments.outputDir,
|
||||
arguments.includeRuntime);
|
||||
}
|
||||
else {
|
||||
// TODO ideally we'd unify to just having a single field that supports multiple files/dirs
|
||||
if (arguments.getSourceDirs() != null) {
|
||||
noErrors = environment.compileBunchOfSourceDirectories(arguments.getSourceDirs(), arguments.jar, arguments.outputDir, arguments.includeRuntime);
|
||||
noErrors = KotlinToJVMBytecodeCompiler.compileBunchOfSourceDirectories(configuration,
|
||||
arguments.getSourceDirs(), arguments.jar, arguments.outputDir, arguments.includeRuntime);
|
||||
}
|
||||
else {
|
||||
noErrors = environment.compileBunchOfSources(arguments.src, arguments.jar, arguments.outputDir, arguments.includeRuntime);
|
||||
noErrors = KotlinToJVMBytecodeCompiler.compileBunchOfSources(configuration,
|
||||
arguments.src, arguments.jar, arguments.outputDir, arguments.includeRuntime);
|
||||
}
|
||||
}
|
||||
return noErrors ? OK : COMPILATION_ERROR;
|
||||
@@ -161,7 +168,7 @@ public class KotlinCompiler {
|
||||
return INTERNAL_ERROR;
|
||||
}
|
||||
finally {
|
||||
environment.dispose();
|
||||
Disposer.dispose(rootDisposable);
|
||||
messageCollector.printToErrStream();
|
||||
}
|
||||
}
|
||||
@@ -228,20 +235,20 @@ public class KotlinCompiler {
|
||||
* Strategy method to configure the environment, allowing compiler
|
||||
* based tools to customise their own plugins
|
||||
*/
|
||||
protected void configureEnvironment(CompileEnvironment environment, CompilerArguments arguments) {
|
||||
protected void configureEnvironment(CompileEnvironmentConfiguration configuration, CompilerArguments arguments) {
|
||||
// install any compiler plugins
|
||||
List<CompilerPlugin> plugins = arguments.getCompilerPlugins();
|
||||
if (plugins != null) {
|
||||
environment.getEnvironment().getCompilerPlugins().addAll(plugins);
|
||||
configuration.getCompilerPlugins().addAll(plugins);
|
||||
}
|
||||
|
||||
if (environment.getCompilerDependencies().getRuntimeJar() != null) {
|
||||
environment.addToClasspath(environment.getCompilerDependencies().getRuntimeJar());
|
||||
if (configuration.getCompilerDependencies().getRuntimeJar() != null) {
|
||||
CompileEnvironmentUtil.addToClasspath(configuration.getEnvironment(), configuration.getCompilerDependencies().getRuntimeJar());
|
||||
}
|
||||
|
||||
if (arguments.classpath != null) {
|
||||
final Iterable<String> classpath = Splitter.on(File.pathSeparatorChar).split(arguments.classpath);
|
||||
environment.addToClasspath(Iterables.toArray(classpath, String.class));
|
||||
CompileEnvironmentUtil.addToClasspath(configuration.getEnvironment(), Iterables.toArray(classpath, String.class));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,243 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2012 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.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.compiler;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.testFramework.LightVirtualFile;
|
||||
import com.intellij.util.LocalTimeCounter;
|
||||
import jet.modules.Module;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.codegen.ClassFileFactory;
|
||||
import org.jetbrains.jet.codegen.GeneratedClassLoader;
|
||||
import org.jetbrains.jet.codegen.GenerationState;
|
||||
import org.jetbrains.jet.compiler.messages.MessageCollector;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.psi.JetPsiUtil;
|
||||
import org.jetbrains.jet.lang.resolve.FqName;
|
||||
import org.jetbrains.jet.lang.resolve.java.CompilerDependencies;
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmAbi;
|
||||
import org.jetbrains.jet.plugin.JetLanguage;
|
||||
import org.jetbrains.jet.plugin.JetMainDetector;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The environment for compiling a bunch of source files or
|
||||
*
|
||||
* @author yole
|
||||
*/
|
||||
public class CompileEnvironment {
|
||||
private final Disposable rootDisposable;
|
||||
private JetCoreEnvironment environment;
|
||||
|
||||
private final MessageCollector messageCollector;
|
||||
|
||||
@NotNull
|
||||
private final CompilerDependencies compilerDependencies;
|
||||
|
||||
/**
|
||||
* NOTE: It's very important to call dispose for every object of this class or there will be memory leaks.
|
||||
* @see Disposer
|
||||
*/
|
||||
public CompileEnvironment(@NotNull MessageCollector messageCollector, @NotNull CompilerDependencies compilerDependencies) {
|
||||
this.messageCollector = messageCollector;
|
||||
this.compilerDependencies = compilerDependencies;
|
||||
this.rootDisposable = new Disposable() {
|
||||
@Override
|
||||
public void dispose() {
|
||||
}
|
||||
};
|
||||
this.environment = new JetCoreEnvironment(rootDisposable, compilerDependencies);
|
||||
}
|
||||
|
||||
|
||||
public void dispose() {
|
||||
Disposer.dispose(rootDisposable);
|
||||
}
|
||||
|
||||
public boolean compileModuleScript(String moduleScriptFile, @Nullable String jarPath, @Nullable String outputDir, boolean jarRuntime) {
|
||||
List<Module> modules = CompileEnvironmentUtil.loadModuleScript(moduleScriptFile, messageCollector);
|
||||
|
||||
if (modules == null) {
|
||||
throw new CompileEnvironmentException("Module script " + moduleScriptFile + " compilation failed");
|
||||
}
|
||||
|
||||
if (modules.isEmpty()) {
|
||||
throw new CompileEnvironmentException("No modules where defined by " + moduleScriptFile);
|
||||
}
|
||||
|
||||
final String directory = new File(moduleScriptFile).getParent();
|
||||
for (Module moduleBuilder : modules) {
|
||||
if (compilerDependencies.getRuntimeJar() != null) {
|
||||
addToClasspath(compilerDependencies.getRuntimeJar());
|
||||
}
|
||||
ClassFileFactory moduleFactory = compileModule(moduleBuilder, directory);
|
||||
if (moduleFactory == null) {
|
||||
return false;
|
||||
}
|
||||
if (outputDir != null) {
|
||||
CompileEnvironmentUtil.writeToOutputDirectory(moduleFactory, outputDir);
|
||||
}
|
||||
else {
|
||||
String path = jarPath != null ? jarPath : new File(directory, moduleBuilder.getModuleName() + ".jar").getPath();
|
||||
try {
|
||||
CompileEnvironmentUtil.writeToJar(moduleFactory, new FileOutputStream(path), null, jarRuntime);
|
||||
}
|
||||
catch (FileNotFoundException e) {
|
||||
throw new CompileEnvironmentException("Invalid jar path " + path, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public ClassFileFactory compileModule(Module moduleBuilder, String directory) {
|
||||
if (moduleBuilder.getSourceFiles().isEmpty()) {
|
||||
throw new CompileEnvironmentException("No source files where defined");
|
||||
}
|
||||
|
||||
for (String sourceFile : moduleBuilder.getSourceFiles()) {
|
||||
File source = new File(sourceFile);
|
||||
if (!source.isAbsolute()) {
|
||||
source = new File(directory, sourceFile);
|
||||
}
|
||||
|
||||
if (!source.exists()) {
|
||||
throw new CompileEnvironmentException("'" + source + "' does not exist");
|
||||
}
|
||||
|
||||
environment.addSources(source.getPath());
|
||||
}
|
||||
for (String classpathRoot : moduleBuilder.getClasspathRoots()) {
|
||||
environment.addToClasspath(new File(classpathRoot));
|
||||
}
|
||||
|
||||
CompileEnvironmentUtil.ensureRuntime(environment, compilerDependencies);
|
||||
|
||||
return analyze();
|
||||
}
|
||||
|
||||
public ClassLoader compileText(String code) {
|
||||
environment.addSources(new LightVirtualFile("script" + LocalTimeCounter.currentTime() + ".kt", JetLanguage.INSTANCE, code));
|
||||
|
||||
ClassFileFactory factory = analyze();
|
||||
if (factory == null) {
|
||||
return null;
|
||||
}
|
||||
return new GeneratedClassLoader(factory);
|
||||
}
|
||||
|
||||
public boolean compileBunchOfSources(String sourceFileOrDir, String jar, String outputDir, boolean includeRuntime) {
|
||||
environment.addSources(sourceFileOrDir);
|
||||
|
||||
return compileBunchOfSources(jar, outputDir, includeRuntime);
|
||||
}
|
||||
|
||||
public boolean compileBunchOfSourceDirectories(List<String> sources, String jar, String outputDir, boolean includeRuntime) {
|
||||
for (String source : sources) {
|
||||
environment.addSources(source);
|
||||
}
|
||||
|
||||
return compileBunchOfSources(jar, outputDir, includeRuntime);
|
||||
}
|
||||
|
||||
private boolean compileBunchOfSources(String jar, String outputDir, boolean includeRuntime) {
|
||||
FqName mainClass = null;
|
||||
for (JetFile file : environment.getSourceFiles()) {
|
||||
if (JetMainDetector.hasMain(file.getDeclarations())) {
|
||||
FqName fqName = JetPsiUtil.getFQName(file);
|
||||
mainClass = fqName.child(JvmAbi.PACKAGE_CLASS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
CompileEnvironmentUtil.ensureRuntime(environment, compilerDependencies);
|
||||
|
||||
ClassFileFactory factory = analyze();
|
||||
if (factory == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (jar != null) {
|
||||
try {
|
||||
CompileEnvironmentUtil.writeToJar(factory, new FileOutputStream(jar), mainClass, includeRuntime);
|
||||
} catch (FileNotFoundException e) {
|
||||
throw new CompileEnvironmentException("Invalid jar path " + jar, e);
|
||||
}
|
||||
}
|
||||
else if (outputDir != null) {
|
||||
CompileEnvironmentUtil.writeToOutputDirectory(factory, outputDir);
|
||||
}
|
||||
else {
|
||||
throw new CompileEnvironmentException("Output directory or jar file is not specified - no files will be saved to the disk");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private ClassFileFactory analyze() {
|
||||
boolean stubs = compilerDependencies.getCompilerSpecialMode().isStubs();
|
||||
GenerationState generationState =
|
||||
KotlinToJVMBytecodeCompiler
|
||||
.analyzeAndGenerate(environment, compilerDependencies, messageCollector, stubs);
|
||||
if (generationState == null) {
|
||||
return null;
|
||||
}
|
||||
return generationState.getFactory();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add path specified to the compilation environment.
|
||||
* @param paths paths to add
|
||||
*/
|
||||
public void addToClasspath(File ... paths) {
|
||||
for (File path : paths) {
|
||||
if (!path.exists()) {
|
||||
throw new CompileEnvironmentException("'" + path + "' does not exist");
|
||||
}
|
||||
environment.addToClasspath(path);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add path specified to the compilation environment.
|
||||
* @param paths paths to add
|
||||
*/
|
||||
public void addToClasspath(String ... paths) {
|
||||
for (String path : paths) {
|
||||
addToClasspath( new File(path));
|
||||
}
|
||||
}
|
||||
|
||||
public void setStdlib(String stdlib) {
|
||||
File file = new File(stdlib);
|
||||
addToClasspath(file);
|
||||
}
|
||||
|
||||
public JetCoreEnvironment getEnvironment() {
|
||||
return environment;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public CompilerDependencies getCompilerDependencies() {
|
||||
return compilerDependencies;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright 2010-2012 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.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.compiler;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.compiler.messages.MessageCollector;
|
||||
import org.jetbrains.jet.lang.resolve.java.CompilerDependencies;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author abreslav
|
||||
*/
|
||||
public class CompileEnvironmentConfiguration {
|
||||
private final JetCoreEnvironment environment;
|
||||
private final CompilerDependencies compilerDependencies;
|
||||
private final MessageCollector messageCollector;
|
||||
|
||||
private List<CompilerPlugin> compilerPlugins = Lists.newArrayList();
|
||||
|
||||
/**
|
||||
* NOTE: It's very important to call dispose for every object of this class or there will be memory leaks.
|
||||
* @see Disposer
|
||||
*/
|
||||
public CompileEnvironmentConfiguration(@NotNull JetCoreEnvironment environment,
|
||||
@NotNull CompilerDependencies compilerDependencies, @NotNull MessageCollector messageCollector) {
|
||||
this.messageCollector = messageCollector;
|
||||
this.compilerDependencies = compilerDependencies;
|
||||
this.environment = environment;
|
||||
}
|
||||
|
||||
public JetCoreEnvironment getEnvironment() {
|
||||
return environment;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public CompilerDependencies getCompilerDependencies() {
|
||||
return compilerDependencies;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public MessageCollector getMessageCollector() {
|
||||
return messageCollector;
|
||||
}
|
||||
|
||||
public List<CompilerPlugin> getCompilerPlugins() {
|
||||
return compilerPlugins;
|
||||
}
|
||||
}
|
||||
@@ -51,9 +51,17 @@ import java.util.jar.*;
|
||||
* @author abreslav
|
||||
*/
|
||||
public class CompileEnvironmentUtil {
|
||||
public static Disposable createMockDisposable() {
|
||||
return new Disposable() {
|
||||
@Override
|
||||
public void dispose() {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static File getUnpackedRuntimePath() {
|
||||
URL url = CompileEnvironment.class.getClassLoader().getResource("jet/JetObject.class");
|
||||
URL url = CompileEnvironmentConfiguration.class.getClassLoader().getResource("jet/JetObject.class");
|
||||
if (url != null && url.getProtocol().equals("file")) {
|
||||
return new File(url.getPath()).getParentFile().getParentFile();
|
||||
}
|
||||
@@ -62,7 +70,7 @@ public class CompileEnvironmentUtil {
|
||||
|
||||
@Nullable
|
||||
public static File getRuntimeJarPath() {
|
||||
URL url = CompileEnvironment.class.getClassLoader().getResource("jet/JetObject.class");
|
||||
URL url = CompileEnvironmentConfiguration.class.getClassLoader().getResource("jet/JetObject.class");
|
||||
if (url != null && url.getProtocol().equals("jar")) {
|
||||
String path = url.getPath();
|
||||
return new File(path.substring(path.indexOf(":") + 1, path.indexOf("!/")));
|
||||
@@ -165,7 +173,7 @@ public class CompileEnvironmentUtil {
|
||||
scriptEnvironment.addSources(moduleFile);
|
||||
|
||||
GenerationState generationState = KotlinToJVMBytecodeCompiler
|
||||
.analyzeAndGenerate(scriptEnvironment, dependencies, messageCollector, false);
|
||||
.analyzeAndGenerate(new CompileEnvironmentConfiguration(scriptEnvironment, dependencies, messageCollector), false);
|
||||
if (generationState == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -187,7 +195,7 @@ public class CompileEnvironmentUtil {
|
||||
}
|
||||
}
|
||||
else {
|
||||
loader = new GeneratedClassLoader(factory, CompileEnvironment.class.getClassLoader());
|
||||
loader = new GeneratedClassLoader(factory, CompileEnvironmentConfiguration.class.getClassLoader());
|
||||
}
|
||||
try {
|
||||
Class namespaceClass = loader.loadClass(JvmAbi.PACKAGE_CLASS);
|
||||
@@ -301,4 +309,29 @@ public class CompileEnvironmentUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add path specified to the compilation environment.
|
||||
* @param environment compilation environment to add to
|
||||
* @param paths paths to add
|
||||
*/
|
||||
public static void addToClasspath(JetCoreEnvironment environment, File ... paths) {
|
||||
for (File path : paths) {
|
||||
if (!path.exists()) {
|
||||
throw new CompileEnvironmentException("'" + path + "' does not exist");
|
||||
}
|
||||
environment.addToClasspath(path);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add path specified to the compilation environment.
|
||||
* @param environment compilation environment to add to
|
||||
* @param paths paths to add
|
||||
*/
|
||||
public static void addToClasspath(JetCoreEnvironment environment, String ... paths) {
|
||||
for (String path : paths) {
|
||||
addToClasspath(environment, new File(path));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ import java.util.List;
|
||||
*/
|
||||
public class JetCoreEnvironment extends JavaCoreEnvironment {
|
||||
private final List<JetFile> sourceFiles = new ArrayList<JetFile>();
|
||||
private List<CompilerPlugin> compilerPlugins = new ArrayList<CompilerPlugin>();
|
||||
|
||||
public JetCoreEnvironment(Disposable parentDisposable, @NotNull CompilerDependencies compilerDependencies) {
|
||||
super(parentDisposable);
|
||||
@@ -138,14 +137,6 @@ public class JetCoreEnvironment extends JavaCoreEnvironment {
|
||||
return sourceFiles;
|
||||
}
|
||||
|
||||
public List<CompilerPlugin> getCompilerPlugins() {
|
||||
return compilerPlugins;
|
||||
}
|
||||
|
||||
public void setCompilerPlugins(List<CompilerPlugin> compilerPlugins) {
|
||||
this.compilerPlugins = compilerPlugins;
|
||||
}
|
||||
|
||||
public void addToClasspathFromClassLoader(ClassLoader loader) {
|
||||
ClassLoader parent = loader.getParent();
|
||||
if(parent != null)
|
||||
|
||||
@@ -25,12 +25,13 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiErrorElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiRecursiveElementWalkingVisitor;
|
||||
import com.intellij.testFramework.LightVirtualFile;
|
||||
import com.intellij.util.LocalTimeCounter;
|
||||
import jet.modules.Module;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.analyzer.AnalyzeExhaust;
|
||||
import org.jetbrains.jet.codegen.ClassBuilderFactories;
|
||||
import org.jetbrains.jet.codegen.CompilationErrorHandler;
|
||||
import org.jetbrains.jet.codegen.GenerationState;
|
||||
import org.jetbrains.jet.codegen.*;
|
||||
import org.jetbrains.jet.compiler.messages.CompilerMessageLocation;
|
||||
import org.jetbrains.jet.compiler.messages.CompilerMessageSeverity;
|
||||
import org.jetbrains.jet.compiler.messages.MessageCollector;
|
||||
@@ -41,12 +42,19 @@ import org.jetbrains.jet.lang.diagnostics.DiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.DiagnosticUtils;
|
||||
import org.jetbrains.jet.lang.diagnostics.Severity;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.psi.JetPsiUtil;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||
import org.jetbrains.jet.lang.resolve.FqName;
|
||||
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
|
||||
import org.jetbrains.jet.lang.resolve.java.CompilerDependencies;
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmAbi;
|
||||
import org.jetbrains.jet.plugin.JetLanguage;
|
||||
import org.jetbrains.jet.plugin.JetMainDetector;
|
||||
import org.jetbrains.jet.utils.Progress;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -57,15 +65,169 @@ import java.util.List;
|
||||
public class KotlinToJVMBytecodeCompiler {
|
||||
|
||||
@Nullable
|
||||
public static GenerationState analyzeAndGenerate(
|
||||
JetCoreEnvironment environment,
|
||||
CompilerDependencies dependencies,
|
||||
public static ClassFileFactory compileModule(
|
||||
CompileEnvironmentConfiguration configuration,
|
||||
Module moduleBuilder,
|
||||
String directory
|
||||
) {
|
||||
if (moduleBuilder.getSourceFiles().isEmpty()) {
|
||||
throw new CompileEnvironmentException("No source files where defined");
|
||||
}
|
||||
|
||||
final MessageCollector messageCollector,
|
||||
for (String sourceFile : moduleBuilder.getSourceFiles()) {
|
||||
File source = new File(sourceFile);
|
||||
if (!source.isAbsolute()) {
|
||||
source = new File(directory, sourceFile);
|
||||
}
|
||||
|
||||
if (!source.exists()) {
|
||||
throw new CompileEnvironmentException("'" + source + "' does not exist");
|
||||
}
|
||||
|
||||
configuration.getEnvironment().addSources(source.getPath());
|
||||
}
|
||||
for (String classpathRoot : moduleBuilder.getClasspathRoots()) {
|
||||
configuration.getEnvironment().addToClasspath(new File(classpathRoot));
|
||||
}
|
||||
|
||||
CompileEnvironmentUtil.ensureRuntime(configuration.getEnvironment(), configuration.getCompilerDependencies());
|
||||
|
||||
GenerationState generationState = analyzeAndGenerate(configuration);
|
||||
if (generationState == null) {
|
||||
return null;
|
||||
}
|
||||
return generationState.getFactory();
|
||||
}
|
||||
|
||||
public static boolean compileModuleScript(
|
||||
CompileEnvironmentConfiguration configuration,
|
||||
|
||||
@NotNull String moduleScriptFile,
|
||||
@Nullable String jarPath,
|
||||
@Nullable String outputDir,
|
||||
boolean jarRuntime) {
|
||||
List<Module> modules = CompileEnvironmentUtil.loadModuleScript(moduleScriptFile, configuration.getMessageCollector());
|
||||
|
||||
if (modules == null) {
|
||||
throw new CompileEnvironmentException("Module script " + moduleScriptFile + " compilation failed");
|
||||
}
|
||||
|
||||
if (modules.isEmpty()) {
|
||||
throw new CompileEnvironmentException("No modules where defined by " + moduleScriptFile);
|
||||
}
|
||||
|
||||
final String directory = new File(moduleScriptFile).getParent();
|
||||
for (Module moduleBuilder : modules) {
|
||||
// TODO: this should be done only once for the environment
|
||||
if (configuration.getCompilerDependencies().getRuntimeJar() != null) {
|
||||
CompileEnvironmentUtil.addToClasspath(configuration.getEnvironment(), configuration.getCompilerDependencies().getRuntimeJar());
|
||||
}
|
||||
ClassFileFactory moduleFactory = KotlinToJVMBytecodeCompiler.compileModule(configuration, moduleBuilder, directory);
|
||||
if (moduleFactory == null) {
|
||||
return false;
|
||||
}
|
||||
if (outputDir != null) {
|
||||
CompileEnvironmentUtil.writeToOutputDirectory(moduleFactory, outputDir);
|
||||
}
|
||||
else {
|
||||
String path = jarPath != null ? jarPath : new File(directory, moduleBuilder.getModuleName() + ".jar").getPath();
|
||||
try {
|
||||
CompileEnvironmentUtil.writeToJar(moduleFactory, new FileOutputStream(path), null, jarRuntime);
|
||||
}
|
||||
catch (FileNotFoundException e) {
|
||||
throw new CompileEnvironmentException("Invalid jar path " + path, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean compileBunchOfSources(
|
||||
CompileEnvironmentConfiguration configuration,
|
||||
|
||||
String jar,
|
||||
String outputDir,
|
||||
boolean includeRuntime
|
||||
) {
|
||||
FqName mainClass = null;
|
||||
for (JetFile file : configuration.getEnvironment().getSourceFiles()) {
|
||||
if (JetMainDetector.hasMain(file.getDeclarations())) {
|
||||
FqName fqName = JetPsiUtil.getFQName(file);
|
||||
mainClass = fqName.child(JvmAbi.PACKAGE_CLASS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
CompileEnvironmentUtil.ensureRuntime(configuration.getEnvironment(), configuration.getCompilerDependencies());
|
||||
|
||||
GenerationState generationState = analyzeAndGenerate(configuration);
|
||||
if (generationState == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ClassFileFactory factory = generationState.getFactory();
|
||||
if (jar != null) {
|
||||
try {
|
||||
CompileEnvironmentUtil.writeToJar(factory, new FileOutputStream(jar), mainClass, includeRuntime);
|
||||
} catch (FileNotFoundException e) {
|
||||
throw new CompileEnvironmentException("Invalid jar path " + jar, e);
|
||||
}
|
||||
}
|
||||
else if (outputDir != null) {
|
||||
CompileEnvironmentUtil.writeToOutputDirectory(factory, outputDir);
|
||||
}
|
||||
else {
|
||||
throw new CompileEnvironmentException("Output directory or jar file is not specified - no files will be saved to the disk");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean compileBunchOfSources(
|
||||
CompileEnvironmentConfiguration configuration,
|
||||
|
||||
String sourceFileOrDir, String jar, String outputDir, boolean includeRuntime) {
|
||||
configuration.getEnvironment().addSources(sourceFileOrDir);
|
||||
|
||||
return compileBunchOfSources(configuration, jar, outputDir, includeRuntime);
|
||||
}
|
||||
|
||||
public static boolean compileBunchOfSourceDirectories(
|
||||
CompileEnvironmentConfiguration configuration,
|
||||
|
||||
List<String> sources, String jar, String outputDir, boolean includeRuntime) {
|
||||
for (String source : sources) {
|
||||
configuration.getEnvironment().addSources(source);
|
||||
}
|
||||
|
||||
return compileBunchOfSources(configuration, jar, outputDir, includeRuntime);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ClassLoader compileText(
|
||||
CompileEnvironmentConfiguration configuration,
|
||||
|
||||
String code) {
|
||||
configuration.getEnvironment().addSources(new LightVirtualFile("script" + LocalTimeCounter.currentTime() + ".kt", JetLanguage.INSTANCE, code));
|
||||
|
||||
GenerationState generationState = analyzeAndGenerate(configuration);
|
||||
if (generationState == null) {
|
||||
return null;
|
||||
}
|
||||
return new GeneratedClassLoader(generationState.getFactory());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static GenerationState analyzeAndGenerate(CompileEnvironmentConfiguration configuration) {
|
||||
return analyzeAndGenerate(configuration, configuration.getCompilerDependencies().getCompilerSpecialMode().isStubs());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static GenerationState analyzeAndGenerate(
|
||||
CompileEnvironmentConfiguration configuration,
|
||||
|
||||
boolean stubs
|
||||
) {
|
||||
AnalyzeExhaust exhaust = analyze(environment, dependencies, messageCollector, stubs);
|
||||
AnalyzeExhaust exhaust = analyze(configuration, stubs);
|
||||
|
||||
if (exhaust == null) {
|
||||
return null;
|
||||
@@ -73,14 +235,13 @@ public class KotlinToJVMBytecodeCompiler {
|
||||
|
||||
exhaust.throwIfError();
|
||||
|
||||
return generate(environment, dependencies, messageCollector, exhaust, stubs);
|
||||
return generate(configuration, exhaust, stubs);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static AnalyzeExhaust analyze(
|
||||
JetCoreEnvironment environment,
|
||||
CompilerDependencies dependencies,
|
||||
final MessageCollector messageCollector,
|
||||
final CompileEnvironmentConfiguration configuration,
|
||||
|
||||
boolean stubs) {
|
||||
final Ref<Boolean> hasErrors = new Ref<Boolean>(false);
|
||||
final MessageCollector messageCollectorWrapper = new MessageCollector() {
|
||||
@@ -92,10 +253,12 @@ public class KotlinToJVMBytecodeCompiler {
|
||||
if (CompilerMessageSeverity.ERRORS.contains(severity)) {
|
||||
hasErrors.set(true);
|
||||
}
|
||||
messageCollector.report(severity, message, location);
|
||||
configuration.getMessageCollector().report(severity, message, location);
|
||||
}
|
||||
};
|
||||
|
||||
JetCoreEnvironment environment = configuration.getEnvironment();
|
||||
|
||||
// Report syntax errors
|
||||
for (JetFile file : environment.getSourceFiles()) {
|
||||
file.accept(new PsiRecursiveElementWalkingVisitor() {
|
||||
@@ -114,7 +277,7 @@ public class KotlinToJVMBytecodeCompiler {
|
||||
stubs ? Predicates.<PsiFile>alwaysFalse() : Predicates.<PsiFile>alwaysTrue();
|
||||
AnalyzeExhaust exhaust = AnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(
|
||||
environment.getProject(), environment.getSourceFiles(), filesToAnalyzeCompletely, JetControlFlowDataTraceFactory.EMPTY,
|
||||
dependencies);
|
||||
configuration.getCompilerDependencies());
|
||||
|
||||
for (Diagnostic diagnostic : exhaust.getBindingContext().getDiagnostics()) {
|
||||
reportDiagnostic(messageCollectorWrapper, diagnostic);
|
||||
@@ -127,26 +290,24 @@ public class KotlinToJVMBytecodeCompiler {
|
||||
|
||||
@NotNull
|
||||
private static GenerationState generate(
|
||||
JetCoreEnvironment environment,
|
||||
CompilerDependencies dependencies,
|
||||
|
||||
final MessageCollector messageCollector,
|
||||
final CompileEnvironmentConfiguration configuration,
|
||||
|
||||
AnalyzeExhaust exhaust,
|
||||
|
||||
boolean stubs) {
|
||||
JetCoreEnvironment environment = configuration.getEnvironment();
|
||||
Project project = environment.getProject();
|
||||
Progress backendProgress = new Progress() {
|
||||
@Override
|
||||
public void log(String message) {
|
||||
messageCollector.report(CompilerMessageSeverity.LOGGING, message, CompilerMessageLocation.NO_LOCATION);
|
||||
configuration.getMessageCollector().report(CompilerMessageSeverity.LOGGING, message, CompilerMessageLocation.NO_LOCATION);
|
||||
}
|
||||
};
|
||||
GenerationState generationState = new GenerationState(project, ClassBuilderFactories.binaries(stubs), backendProgress,
|
||||
exhaust, environment.getSourceFiles(), dependencies.getCompilerSpecialMode());
|
||||
exhaust, environment.getSourceFiles(), configuration.getCompilerDependencies().getCompilerSpecialMode());
|
||||
generationState.compileCorrectFiles(CompilationErrorHandler.THROW_EXCEPTION);
|
||||
|
||||
List<CompilerPlugin> plugins = environment.getCompilerPlugins();
|
||||
List<CompilerPlugin> plugins = configuration.getCompilerPlugins();
|
||||
if (plugins != null) {
|
||||
CompilerPluginContext context = new CompilerPluginContext(project, exhaust.getBindingContext(), environment.getSourceFiles());
|
||||
for (CompilerPlugin plugin : plugins) {
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2010-2012 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.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.lang.resolve.calls;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.CallableDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.Call;
|
||||
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
||||
|
||||
/**
|
||||
* @author svtk
|
||||
*/
|
||||
public final class CallResolutionContext<D extends CallableDescriptor> extends ResolutionContext {
|
||||
/*package*/ final ResolvedCallImpl<D> candidateCall;
|
||||
/*package*/ final TracingStrategy tracing;
|
||||
|
||||
public CallResolutionContext(@NotNull ResolvedCallImpl<D> candidateCall, @NotNull ResolutionTask<D> task, @NotNull BindingTrace trace, @NotNull TracingStrategy tracing, @NotNull Call call) {
|
||||
super(trace, task.scope, call, task.expectedType, task.dataFlowInfo);
|
||||
this.candidateCall = candidateCall;
|
||||
this.tracing = tracing;
|
||||
}
|
||||
|
||||
public CallResolutionContext(@NotNull ResolvedCallImpl<D> candidateCall, @NotNull ResolutionTask<D> task, @NotNull BindingTrace trace, @NotNull TracingStrategy tracing) {
|
||||
this(candidateCall, task, trace, tracing, task.call);
|
||||
}
|
||||
}
|
||||
@@ -102,16 +102,16 @@ public class CallResolver {
|
||||
if (referencedName == null) {
|
||||
return OverloadResolutionResultsImpl.nameNotFound();
|
||||
}
|
||||
TaskPrioritizer<VariableDescriptor> task_prioritizer;
|
||||
List<MemberPrioritizer<VariableDescriptor>> memberPrioritizers = Lists.newArrayList();
|
||||
if (nameExpression.getReferencedNameElementType() == JetTokens.FIELD_IDENTIFIER) {
|
||||
referencedName = referencedName.substring(1);
|
||||
task_prioritizer = TaskPrioritizers.PROPERTY_TASK_PRIORITIZER;
|
||||
memberPrioritizers.add(MemberPrioritizers.PROPERTY_TASK_PRIORITIZER);
|
||||
}
|
||||
else {
|
||||
task_prioritizer = TaskPrioritizers.VARIABLE_TASK_PRIORITIZER;
|
||||
memberPrioritizers.add(MemberPrioritizers.VARIABLE_TASK_PRIORITIZER);
|
||||
}
|
||||
List<ResolutionTask<VariableDescriptor>> prioritizedTasks = task_prioritizer.computePrioritizedTasks(context, referencedName, nameExpression);
|
||||
return doResolveCall(context, prioritizedTasks, nameExpression);
|
||||
List<ResolutionTask<VariableDescriptor>> prioritizedTasks = TaskPrioritizer.computePrioritizedTasks(context, referencedName, nameExpression, memberPrioritizers);
|
||||
return doResolveCall(context, prioritizedTasks, CallTransformationStrategy.PROPERTY_CALL_TRANSFORMATION_STRATEGY, nameExpression);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -119,9 +119,9 @@ public class CallResolver {
|
||||
@NotNull BasicResolutionContext context,
|
||||
@NotNull final JetReferenceExpression functionReference,
|
||||
@NotNull String name) {
|
||||
List<ResolutionTask<FunctionDescriptor>> tasks = TaskPrioritizers.FUNCTION_TASK_PRIORITIZER.computePrioritizedTasks(
|
||||
context, name, functionReference);
|
||||
return doResolveCall(context, tasks, functionReference);
|
||||
List<ResolutionTask<FunctionDescriptor>> tasks = TaskPrioritizer.computePrioritizedTasks(
|
||||
context, name, functionReference, Collections.singletonList(MemberPrioritizers.FUNCTION_TASK_PRIORITIZER));
|
||||
return doResolveCall(context, tasks, CallTransformationStrategy.FUNCTION_CALL_TRANSFORMATION_STRATEGY, functionReference);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -142,7 +142,7 @@ public class CallResolver {
|
||||
String name = expression.getReferencedName();
|
||||
if (name == null) return checkArgumentTypesAndFail(context);
|
||||
|
||||
prioritizedTasks = TaskPrioritizers.FUNCTION_TASK_PRIORITIZER.computePrioritizedTasks(context, name, functionReference);
|
||||
prioritizedTasks = TaskPrioritizer.computePrioritizedTasks(context, name, functionReference, Collections.singletonList(MemberPrioritizers.FUNCTION_TASK_PRIORITIZER));
|
||||
ResolutionTask.DescriptorCheckStrategy abstractConstructorCheck = new ResolutionTask.DescriptorCheckStrategy() {
|
||||
@Override
|
||||
public <D extends CallableDescriptor> boolean performAdvancedChecks(D descriptor, BindingTrace trace, TracingStrategy tracing) {
|
||||
@@ -184,7 +184,7 @@ public class CallResolver {
|
||||
context.trace.report(NO_CONSTRUCTOR.on(reportAbsenceOn));
|
||||
return checkArgumentTypesAndFail(context);
|
||||
}
|
||||
Collection<ResolvedCallImpl<FunctionDescriptor>> candidates = TaskPrioritizer.<FunctionDescriptor>convertWithImpliedThis(context.scope, Collections.<ReceiverDescriptor>singletonList(NO_RECEIVER), constructors);
|
||||
Collection<ResolutionCandidate<FunctionDescriptor>> candidates = TaskPrioritizer.<FunctionDescriptor>convertWithImpliedThis(context.scope, Collections.<ReceiverDescriptor>singletonList(NO_RECEIVER), constructors);
|
||||
prioritizedTasks.add(new ResolutionTask<FunctionDescriptor>(candidates, functionReference, context)); // !! DataFlowInfo.EMPTY
|
||||
}
|
||||
else {
|
||||
@@ -206,7 +206,7 @@ public class CallResolver {
|
||||
context.trace.report(NO_CONSTRUCTOR.on(reportAbsenceOn));
|
||||
return checkArgumentTypesAndFail(context);
|
||||
}
|
||||
List<ResolvedCallImpl<FunctionDescriptor>> candidates = ResolvedCallImpl.<FunctionDescriptor>convertCollection(constructors);
|
||||
List<ResolutionCandidate<FunctionDescriptor>> candidates = ResolutionCandidate.<FunctionDescriptor>convertCollection(constructors);
|
||||
prioritizedTasks = Collections.singletonList(new ResolutionTask<FunctionDescriptor>(candidates, functionReference, context)); // !! DataFlowInfo.EMPTY
|
||||
}
|
||||
else if (calleeExpression != null) {
|
||||
@@ -223,15 +223,15 @@ public class CallResolver {
|
||||
|
||||
FunctionDescriptorImpl functionDescriptor = new ExpressionAsFunctionDescriptor(context.scope.getContainingDeclaration(), "[for expression " + calleeExpression.getText() + "]");
|
||||
FunctionDescriptorUtil.initializeFromFunctionType(functionDescriptor, calleeType, NO_RECEIVER);
|
||||
ResolvedCallImpl<FunctionDescriptor> resolvedCall = ResolvedCallImpl.<FunctionDescriptor>create(functionDescriptor);
|
||||
resolvedCall.setReceiverArgument(context.call.getExplicitReceiver());
|
||||
ResolutionCandidate<FunctionDescriptor> resolutionCandidate = ResolutionCandidate.<FunctionDescriptor>create(functionDescriptor);
|
||||
resolutionCandidate.setReceiverArgument(context.call.getExplicitReceiver());
|
||||
|
||||
// strictly speaking, this is a hack:
|
||||
// we need to pass a reference, but there's no reference in the PSI,
|
||||
// so we wrap what we have into a fake reference and pass it on (unwrap on the other end)
|
||||
functionReference = new JetFakeReference(calleeExpression);
|
||||
|
||||
prioritizedTasks = Collections.singletonList(new ResolutionTask<FunctionDescriptor>(Collections.singleton(resolvedCall), functionReference, context));
|
||||
prioritizedTasks = Collections.singletonList(new ResolutionTask<FunctionDescriptor>(Collections.singleton(resolutionCandidate), functionReference, context));
|
||||
}
|
||||
else {
|
||||
// checkTypesWithNoCallee(trace, scope, call);
|
||||
@@ -239,7 +239,7 @@ public class CallResolver {
|
||||
}
|
||||
}
|
||||
|
||||
return doResolveCall(context, prioritizedTasks, functionReference);
|
||||
return doResolveCall(context, prioritizedTasks, CallTransformationStrategy.FUNCTION_CALL_TRANSFORMATION_STRATEGY, functionReference);
|
||||
}
|
||||
|
||||
private <D extends CallableDescriptor> OverloadResolutionResults<D> checkArgumentTypesAndFail(BasicResolutionContext context) {
|
||||
@@ -251,6 +251,7 @@ public class CallResolver {
|
||||
private <D extends CallableDescriptor> OverloadResolutionResults<D> doResolveCall(
|
||||
@NotNull final BasicResolutionContext context,
|
||||
@NotNull final List<ResolutionTask<D>> prioritizedTasks, // high to low priority
|
||||
@NotNull CallTransformationStrategy<D, D> callTransformationStrategy,
|
||||
@NotNull final JetReferenceExpression reference) {
|
||||
|
||||
ResolutionDebugInfo.Data debugInfo = ResolutionDebugInfo.create();
|
||||
@@ -267,7 +268,7 @@ public class CallResolver {
|
||||
OverloadResolutionResultsImpl<D> resultsForFirstNonemptyCandidateSet = null;
|
||||
for (ResolutionTask<D> task : prioritizedTasks) {
|
||||
TemporaryBindingTrace temporaryTrace = TemporaryBindingTrace.create(context.trace);
|
||||
OverloadResolutionResultsImpl<D> results = performResolutionGuardedForExtraFunctionLiteralArguments(task.withTrace(temporaryTrace));
|
||||
OverloadResolutionResultsImpl<D> results = performResolutionGuardedForExtraFunctionLiteralArguments(task.withTrace(temporaryTrace), callTransformationStrategy);
|
||||
if (results.isSuccess() || results.isAmbiguity()) {
|
||||
temporaryTrace.commit();
|
||||
|
||||
@@ -299,8 +300,9 @@ public class CallResolver {
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@NotNull
|
||||
private <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> performResolutionGuardedForExtraFunctionLiteralArguments(ResolutionTask<D> task) {
|
||||
OverloadResolutionResultsImpl<D> results = performResolution(task);
|
||||
private <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> performResolutionGuardedForExtraFunctionLiteralArguments(@NotNull ResolutionTask<D> task,
|
||||
@NotNull CallTransformationStrategy<D, D> callTransformationStrategy) {
|
||||
OverloadResolutionResultsImpl<D> results = performResolution(task, callTransformationStrategy);
|
||||
|
||||
// If resolution fails, we should check for some of the following situations:
|
||||
// class A {
|
||||
@@ -323,9 +325,9 @@ public class CallResolver {
|
||||
// We have some candidates that failed for some reason
|
||||
// And we have a suspect: the function literal argument
|
||||
// Now, we try to remove this argument and see if it helps
|
||||
Collection<ResolvedCallImpl<D>> newCandidates = Lists.newArrayList();
|
||||
for (ResolvedCallImpl<D> candidate : task.getCandidates()) {
|
||||
newCandidates.add(ResolvedCallImpl.create(candidate.getCandidateDescriptor()));
|
||||
Collection<ResolutionCandidate<D>> newCandidates = Lists.newArrayList();
|
||||
for (ResolutionCandidate<D> candidate : task.getCandidates()) {
|
||||
newCandidates.add(ResolutionCandidate.create(candidate.getDescriptor()));
|
||||
}
|
||||
ResolutionTask<D> newContext = new ResolutionTask<D>(newCandidates, task.reference, TemporaryBindingTrace.create(task.trace), task.scope, new DelegatingCall(task.call) {
|
||||
@NotNull
|
||||
@@ -334,7 +336,7 @@ public class CallResolver {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}, task.expectedType, task.dataFlowInfo);
|
||||
OverloadResolutionResultsImpl<D> resultsWithFunctionLiteralsStripped = performResolution(newContext);
|
||||
OverloadResolutionResultsImpl<D> resultsWithFunctionLiteralsStripped = performResolution(newContext, callTransformationStrategy);
|
||||
if (resultsWithFunctionLiteralsStripped.isSuccess() || resultsWithFunctionLiteralsStripped.isAmbiguity()) {
|
||||
task.tracing.danglingFunctionLiteralArgumentSuspected(task.trace, task.call.getFunctionLiteralArguments());
|
||||
}
|
||||
@@ -344,101 +346,23 @@ public class CallResolver {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> performResolution(ResolutionTask<D> task) {
|
||||
for (ResolvedCallImpl<D> candidateCall : task.getCandidates()) {
|
||||
D candidate = candidateCall.getCandidateDescriptor();
|
||||
private <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> performResolution(@NotNull ResolutionTask<D> task,
|
||||
@NotNull CallTransformationStrategy<D, D> callTransformationStrategy) {
|
||||
|
||||
for (ResolutionCandidate<D> resolutionCandidate : task.getCandidates()) {
|
||||
TemporaryBindingTrace temporaryTrace = TemporaryBindingTrace.create(task.trace);
|
||||
candidateCall.setTrace(temporaryTrace);
|
||||
CallResolutionContext<D> context = callTransformationStrategy.createCallContext(resolutionCandidate, task, temporaryTrace, task.tracing);
|
||||
performResolutionForCandidateCall(context, task, temporaryTrace);
|
||||
|
||||
CallResolutionContext<D> context = new CallResolutionContext<D>(candidateCall, task, temporaryTrace, task.tracing);
|
||||
|
||||
context.tracing.bindReference(context.trace, candidateCall);
|
||||
|
||||
if (ErrorUtils.isError(candidate)) {
|
||||
candidateCall.setStatus(SUCCESS);
|
||||
checkTypesWithNoCallee(context.toBasic());
|
||||
continue;
|
||||
Collection<ResolvedCallImpl<D>> calls = callTransformationStrategy.transformResultCall(context, this, task);
|
||||
for (ResolvedCallImpl<D> call : calls) {
|
||||
task.getResolvedCallMap().put(resolutionCandidate, call);
|
||||
}
|
||||
|
||||
if (!Visibilities.isVisible(candidate, context.scope.getContainingDeclaration())) {
|
||||
candidateCall.setStatus(OTHER_ERROR);
|
||||
context.tracing.invisibleMember(context.trace, candidate);
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean errorInArgumentMapping = ValueArgumentsToParametersMapper.mapValueArgumentsToParameters(context.call, context.tracing, candidateCall);
|
||||
if (errorInArgumentMapping) {
|
||||
candidateCall.setStatus(OTHER_ERROR);
|
||||
checkTypesWithNoCallee(context.toBasic());
|
||||
continue;
|
||||
}
|
||||
|
||||
List<JetTypeProjection> jetTypeArguments = context.call.getTypeArguments();
|
||||
if (jetTypeArguments.isEmpty()) {
|
||||
if (!candidate.getTypeParameters().isEmpty()) {
|
||||
candidateCall.setStatus(inferTypeArguments(context));
|
||||
}
|
||||
else {
|
||||
candidateCall.setStatus(checkAllValueArguments(context));
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Explicit type arguments passed
|
||||
|
||||
List<JetType> typeArguments = new ArrayList<JetType>();
|
||||
for (JetTypeProjection projection : jetTypeArguments) {
|
||||
if (projection.getProjectionKind() != JetProjectionKind.NONE) {
|
||||
context.trace.report(PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT.on(projection));
|
||||
}
|
||||
JetTypeReference typeReference = projection.getTypeReference();
|
||||
if (typeReference != null) {
|
||||
typeArguments.add(typeResolver.resolveType(context.scope, typeReference, context.trace, true));
|
||||
}
|
||||
else {
|
||||
typeArguments.add(ErrorUtils.createErrorType("Star projection in a call"));
|
||||
}
|
||||
}
|
||||
int expectedTypeArgumentCount = candidate.getTypeParameters().size();
|
||||
if (expectedTypeArgumentCount == jetTypeArguments.size()) {
|
||||
|
||||
checkGenericBoundsInAFunctionCall(jetTypeArguments, typeArguments, candidate, context.trace);
|
||||
|
||||
Map<TypeConstructor, TypeProjection> substitutionContext = FunctionDescriptorUtil.createSubstitutionContext((FunctionDescriptor) candidate, typeArguments);
|
||||
D substitutedDescriptor = (D) candidate.substitute(TypeSubstitutor.create(substitutionContext));
|
||||
|
||||
candidateCall.setResultingDescriptor(substitutedDescriptor);
|
||||
replaceValueParametersWithSubstitutedOnes(candidateCall, substitutedDescriptor);
|
||||
|
||||
List<TypeParameterDescriptor> typeParameters = candidateCall.getCandidateDescriptor().getTypeParameters();
|
||||
for (int i = 0; i < typeParameters.size(); i++) {
|
||||
TypeParameterDescriptor typeParameterDescriptor = typeParameters.get(i);
|
||||
candidateCall.recordTypeArgument(typeParameterDescriptor, typeArguments.get(i));
|
||||
}
|
||||
candidateCall.setStatus(checkAllValueArguments(context));
|
||||
}
|
||||
else {
|
||||
candidateCall.setStatus(OTHER_ERROR);
|
||||
context.tracing.wrongNumberOfTypeArguments(context.trace, expectedTypeArgumentCount);
|
||||
}
|
||||
}
|
||||
|
||||
task.performAdvancedChecks(candidate, context.trace, context.tracing);
|
||||
|
||||
// 'super' cannot be passed as an argument, for receiver arguments expression typer does not track this
|
||||
// See TaskPrioritizer for more
|
||||
JetSuperExpression superExpression = TaskPrioritizer.getReceiverSuper(candidateCall.getReceiverArgument());
|
||||
if (superExpression != null) {
|
||||
context.trace.report(SUPER_IS_NOT_AN_EXPRESSION.on(superExpression, superExpression.getText()));
|
||||
candidateCall.setStatus(OTHER_ERROR);
|
||||
}
|
||||
|
||||
recordAutoCastIfNecessary(candidateCall.getReceiverArgument(), candidateCall.getTrace());
|
||||
recordAutoCastIfNecessary(candidateCall.getThisObject(), candidateCall.getTrace());
|
||||
}
|
||||
|
||||
Set<ResolvedCallImpl<D>> successfulCandidates = Sets.newLinkedHashSet();
|
||||
Set<ResolvedCallImpl<D>> failedCandidates = Sets.newLinkedHashSet();
|
||||
for (ResolvedCallImpl<D> candidateCall : task.getCandidates()) {
|
||||
for (ResolvedCallImpl<D> candidateCall : task.getResolvedCallMap().values()) {
|
||||
ResolutionStatus status = candidateCall.getStatus();
|
||||
if (status.isSuccess()) {
|
||||
successfulCandidates.add(candidateCall);
|
||||
@@ -456,6 +380,103 @@ public class CallResolver {
|
||||
return results;
|
||||
}
|
||||
|
||||
private <D extends CallableDescriptor> void performResolutionForCandidateCall(@NotNull CallResolutionContext<D> context,
|
||||
@NotNull ResolutionTask<D> task,
|
||||
@NotNull TemporaryBindingTrace temporaryTrace) {
|
||||
ResolvedCallImpl<D> candidateCall = context.candidateCall;
|
||||
|
||||
candidateCall.setTrace(temporaryTrace);
|
||||
D candidate = candidateCall.getCandidateDescriptor();
|
||||
|
||||
context.tracing.bindReference(context.trace, candidateCall);
|
||||
|
||||
if (ErrorUtils.isError(candidate)) {
|
||||
candidateCall.addStatus(SUCCESS);
|
||||
checkTypesWithNoCallee(context.toBasic());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Visibilities.isVisible(candidate, context.scope.getContainingDeclaration())) {
|
||||
candidateCall.addStatus(OTHER_ERROR);
|
||||
context.tracing.invisibleMember(context.trace, candidate);
|
||||
return;
|
||||
}
|
||||
|
||||
ValueArgumentsToParametersMapper.Status
|
||||
argumentMappingStatus = ValueArgumentsToParametersMapper.mapValueArgumentsToParameters(context.call, context.tracing,
|
||||
candidateCall);
|
||||
if (!argumentMappingStatus.isSuccess()) {
|
||||
candidateCall.addStatus(OTHER_ERROR);
|
||||
if (argumentMappingStatus == ValueArgumentsToParametersMapper.Status.ERROR) {
|
||||
checkTypesWithNoCallee(context.toBasic());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
List<JetTypeProjection> jetTypeArguments = context.call.getTypeArguments();
|
||||
if (jetTypeArguments.isEmpty()) {
|
||||
if (!candidate.getTypeParameters().isEmpty()) {
|
||||
candidateCall.addStatus(inferTypeArguments(context));
|
||||
}
|
||||
else {
|
||||
candidateCall.addStatus(checkAllValueArguments(context));
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Explicit type arguments passed
|
||||
|
||||
List<JetType> typeArguments = new ArrayList<JetType>();
|
||||
for (JetTypeProjection projection : jetTypeArguments) {
|
||||
if (projection.getProjectionKind() != JetProjectionKind.NONE) {
|
||||
context.trace.report(PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT.on(projection));
|
||||
}
|
||||
JetTypeReference typeReference = projection.getTypeReference();
|
||||
if (typeReference != null) {
|
||||
typeArguments.add(typeResolver.resolveType(context.scope, typeReference, context.trace, true));
|
||||
}
|
||||
else {
|
||||
typeArguments.add(ErrorUtils.createErrorType("Star projection in a call"));
|
||||
}
|
||||
}
|
||||
int expectedTypeArgumentCount = candidate.getTypeParameters().size();
|
||||
if (expectedTypeArgumentCount == jetTypeArguments.size()) {
|
||||
|
||||
checkGenericBoundsInAFunctionCall(jetTypeArguments, typeArguments, candidate, context.trace);
|
||||
|
||||
Map<TypeConstructor, TypeProjection>
|
||||
substitutionContext = FunctionDescriptorUtil.createSubstitutionContext((FunctionDescriptor)candidate, typeArguments);
|
||||
D substitutedDescriptor = (D) candidate.substitute(TypeSubstitutor.create(substitutionContext));
|
||||
|
||||
candidateCall.setResultingDescriptor(substitutedDescriptor);
|
||||
replaceValueParametersWithSubstitutedOnes(candidateCall, substitutedDescriptor);
|
||||
|
||||
List<TypeParameterDescriptor> typeParameters = candidateCall.getCandidateDescriptor().getTypeParameters();
|
||||
for (int i = 0; i < typeParameters.size(); i++) {
|
||||
TypeParameterDescriptor typeParameterDescriptor = typeParameters.get(i);
|
||||
candidateCall.recordTypeArgument(typeParameterDescriptor, typeArguments.get(i));
|
||||
}
|
||||
candidateCall.addStatus(checkAllValueArguments(context));
|
||||
}
|
||||
else {
|
||||
candidateCall.addStatus(OTHER_ERROR);
|
||||
context.tracing.wrongNumberOfTypeArguments(context.trace, expectedTypeArgumentCount);
|
||||
}
|
||||
}
|
||||
|
||||
task.performAdvancedChecks(candidate, context.trace, context.tracing);
|
||||
|
||||
// 'super' cannot be passed as an argument, for receiver arguments expression typer does not track this
|
||||
// See TaskPrioritizer for more
|
||||
JetSuperExpression superExpression = TaskPrioritizer.getReceiverSuper(candidateCall.getReceiverArgument());
|
||||
if (superExpression != null) {
|
||||
context.trace.report(SUPER_IS_NOT_AN_EXPRESSION.on(superExpression, superExpression.getText()));
|
||||
candidateCall.addStatus(OTHER_ERROR);
|
||||
}
|
||||
|
||||
recordAutoCastIfNecessary(candidateCall.getReceiverArgument(), candidateCall.getTrace());
|
||||
recordAutoCastIfNecessary(candidateCall.getThisObject(), candidateCall.getTrace());
|
||||
}
|
||||
|
||||
private <D extends CallableDescriptor> ResolutionStatus inferTypeArguments(CallResolutionContext<D> context) {
|
||||
ResolvedCallImpl<D> candidateCall = context.candidateCall;
|
||||
D candidate = candidateCall.getCandidateDescriptor();
|
||||
@@ -843,25 +864,26 @@ public class CallResolver {
|
||||
|
||||
@NotNull
|
||||
public OverloadResolutionResults<FunctionDescriptor> resolveExactSignature(@NotNull JetScope scope, @NotNull ReceiverDescriptor receiver, @NotNull String name, @NotNull List<JetType> parameterTypes) {
|
||||
List<ResolvedCallImpl<FunctionDescriptor>> result = findCandidatesByExactSignature(scope, receiver, name, parameterTypes);
|
||||
List<ResolutionCandidate<FunctionDescriptor>> candidates = findCandidatesByExactSignature(scope, receiver, name, parameterTypes);
|
||||
|
||||
BindingTraceContext trace = new BindingTraceContext();
|
||||
TemporaryBindingTrace temporaryBindingTrace = TemporaryBindingTrace.create(trace);
|
||||
Set<ResolvedCallImpl<FunctionDescriptor>> candidates = Sets.newLinkedHashSet();
|
||||
for (ResolvedCallImpl<FunctionDescriptor> call : result) {
|
||||
Set<ResolvedCallImpl<FunctionDescriptor>> calls = Sets.newLinkedHashSet();
|
||||
for (ResolutionCandidate<FunctionDescriptor> candidate : candidates) {
|
||||
ResolvedCallImpl<FunctionDescriptor> call = ResolvedCallImpl.create(candidate);
|
||||
call.setTrace(temporaryBindingTrace);
|
||||
candidates.add(call);
|
||||
calls.add(call);
|
||||
}
|
||||
return computeResultAndReportErrors(trace, TracingStrategy.EMPTY, candidates, Collections.<ResolvedCallImpl<FunctionDescriptor>>emptySet());
|
||||
return computeResultAndReportErrors(trace, TracingStrategy.EMPTY, calls, Collections.<ResolvedCallImpl<FunctionDescriptor>>emptySet());
|
||||
}
|
||||
|
||||
private List<ResolvedCallImpl<FunctionDescriptor>> findCandidatesByExactSignature(JetScope scope, ReceiverDescriptor receiver,
|
||||
private List<ResolutionCandidate<FunctionDescriptor>> findCandidatesByExactSignature(JetScope scope, ReceiverDescriptor receiver,
|
||||
String name, List<JetType> parameterTypes) {
|
||||
List<ResolvedCallImpl<FunctionDescriptor>> result = Lists.newArrayList();
|
||||
List<ResolutionCandidate<FunctionDescriptor>> result = Lists.newArrayList();
|
||||
if (receiver.exists()) {
|
||||
Collection<ResolvedCallImpl<FunctionDescriptor>> extensionFunctionDescriptors = ResolvedCallImpl.convertCollection(scope.getFunctions(name));
|
||||
List<ResolvedCallImpl<FunctionDescriptor>> nonlocal = Lists.newArrayList();
|
||||
List<ResolvedCallImpl<FunctionDescriptor>> local = Lists.newArrayList();
|
||||
Collection<ResolutionCandidate<FunctionDescriptor>> extensionFunctionDescriptors = ResolutionCandidate.convertCollection(scope.getFunctions(name));
|
||||
List<ResolutionCandidate<FunctionDescriptor>> nonlocal = Lists.newArrayList();
|
||||
List<ResolutionCandidate<FunctionDescriptor>> local = Lists.newArrayList();
|
||||
TaskPrioritizer.splitLexicallyLocalDescriptors(extensionFunctionDescriptors, scope.getContainingDeclaration(), local, nonlocal);
|
||||
|
||||
|
||||
@@ -869,7 +891,7 @@ public class CallResolver {
|
||||
return result;
|
||||
}
|
||||
|
||||
Collection<ResolvedCallImpl<FunctionDescriptor>> functionDescriptors = ResolvedCallImpl.convertCollection(receiver.getType().getMemberScope().getFunctions(name));
|
||||
Collection<ResolutionCandidate<FunctionDescriptor>> functionDescriptors = ResolutionCandidate.convertCollection(receiver.getType().getMemberScope().getFunctions(name));
|
||||
if (lookupExactSignature(functionDescriptors, parameterTypes, result)) {
|
||||
return result;
|
||||
|
||||
@@ -878,16 +900,16 @@ public class CallResolver {
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
lookupExactSignature(ResolvedCallImpl.convertCollection(scope.getFunctions(name)), parameterTypes, result);
|
||||
lookupExactSignature(ResolutionCandidate.convertCollection(scope.getFunctions(name)), parameterTypes, result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean lookupExactSignature(Collection<ResolvedCallImpl<FunctionDescriptor>> candidates, List<JetType> parameterTypes,
|
||||
List<ResolvedCallImpl<FunctionDescriptor>> result) {
|
||||
private static boolean lookupExactSignature(Collection<ResolutionCandidate<FunctionDescriptor>> candidates, List<JetType> parameterTypes,
|
||||
List<ResolutionCandidate<FunctionDescriptor>> result) {
|
||||
boolean found = false;
|
||||
for (ResolvedCallImpl<FunctionDescriptor> resolvedCall : candidates) {
|
||||
FunctionDescriptor functionDescriptor = resolvedCall.getResultingDescriptor();
|
||||
for (ResolutionCandidate<FunctionDescriptor> resolvedCall : candidates) {
|
||||
FunctionDescriptor functionDescriptor = resolvedCall.getDescriptor();
|
||||
if (functionDescriptor.getReceiverParameter().exists()) continue;
|
||||
if (!functionDescriptor.getTypeParameters().isEmpty()) continue;
|
||||
if (!checkValueParameters(functionDescriptor, parameterTypes)) continue;
|
||||
@@ -897,17 +919,17 @@ public class CallResolver {
|
||||
return found;
|
||||
}
|
||||
|
||||
private boolean findExtensionFunctions(Collection<ResolvedCallImpl<FunctionDescriptor>> candidates, ReceiverDescriptor receiver,
|
||||
List<JetType> parameterTypes, List<ResolvedCallImpl<FunctionDescriptor>> result) {
|
||||
private boolean findExtensionFunctions(Collection<ResolutionCandidate<FunctionDescriptor>> candidates, ReceiverDescriptor receiver,
|
||||
List<JetType> parameterTypes, List<ResolutionCandidate<FunctionDescriptor>> result) {
|
||||
boolean found = false;
|
||||
for (ResolvedCallImpl<FunctionDescriptor> resolvedCall : candidates) {
|
||||
FunctionDescriptor functionDescriptor = resolvedCall.getResultingDescriptor();
|
||||
for (ResolutionCandidate<FunctionDescriptor> candidate : candidates) {
|
||||
FunctionDescriptor functionDescriptor = candidate.getDescriptor();
|
||||
ReceiverDescriptor functionReceiver = functionDescriptor.getReceiverParameter();
|
||||
if (!functionReceiver.exists()) continue;
|
||||
if (!functionDescriptor.getTypeParameters().isEmpty()) continue;
|
||||
if (!typeChecker.isSubtypeOf(receiver.getType(), functionReceiver.getType())) continue;
|
||||
if (!checkValueParameters(functionDescriptor, parameterTypes))continue;
|
||||
result.add(resolvedCall);
|
||||
result.add(candidate);
|
||||
found = true;
|
||||
}
|
||||
return found;
|
||||
@@ -923,15 +945,4 @@ public class CallResolver {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static final class CallResolutionContext<D extends CallableDescriptor> extends ResolutionContext {
|
||||
/*package*/ final ResolvedCallImpl<D> candidateCall;
|
||||
/*package*/ final TracingStrategy tracing;
|
||||
|
||||
public CallResolutionContext(ResolvedCallImpl<D> candidateCall, ResolutionTask<D> task, BindingTrace trace, TracingStrategy tracing) {
|
||||
super(trace, task.scope, task.call, task.expectedType, task.dataFlowInfo);
|
||||
this.candidateCall = candidateCall;
|
||||
this.tracing = tracing;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Copyright 2010-2012 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.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.lang.resolve.calls;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.CallableDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.FunctionDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.VariableDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author svtk
|
||||
*/
|
||||
public interface CallTransformationStrategy<D extends CallableDescriptor, R extends D> {
|
||||
|
||||
@NotNull
|
||||
CallResolutionContext<D> createCallContext(@NotNull ResolutionCandidate<D> candidate,
|
||||
@NotNull ResolutionTask<D> task,
|
||||
@NotNull BindingTrace trace,
|
||||
@NotNull TracingStrategy tracing);
|
||||
|
||||
@NotNull
|
||||
Collection<ResolvedCallImpl<R>> transformResultCall(@NotNull CallResolutionContext<D> callResolutionContext,
|
||||
@NotNull CallResolver callResolver,
|
||||
@NotNull ResolutionTask<D> task);
|
||||
|
||||
CallTransformationStrategy<VariableDescriptor, VariableDescriptor>
|
||||
PROPERTY_CALL_TRANSFORMATION_STRATEGY = new CallTransformationStrategy<VariableDescriptor, VariableDescriptor>() {
|
||||
@NotNull
|
||||
@Override
|
||||
public CallResolutionContext<VariableDescriptor> createCallContext(@NotNull ResolutionCandidate<VariableDescriptor> candidate,
|
||||
@NotNull ResolutionTask<VariableDescriptor> task, @NotNull BindingTrace trace, @NotNull TracingStrategy tracing) {
|
||||
ResolvedCallImpl<VariableDescriptor> candidateCall = ResolvedCallImpl.create(candidate);
|
||||
return new CallResolutionContext<VariableDescriptor>(candidateCall, task, trace, tracing);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<ResolvedCallImpl<VariableDescriptor>> transformResultCall(@NotNull CallResolutionContext<VariableDescriptor> context,
|
||||
@NotNull CallResolver callResolver, @NotNull ResolutionTask<VariableDescriptor> task) {
|
||||
return Collections.singleton(context.candidateCall);
|
||||
}
|
||||
};
|
||||
|
||||
CallTransformationStrategy<FunctionDescriptor, FunctionDescriptor>
|
||||
FUNCTION_CALL_TRANSFORMATION_STRATEGY = new CallTransformationStrategy<FunctionDescriptor, FunctionDescriptor>() {
|
||||
@NotNull
|
||||
@Override
|
||||
public CallResolutionContext<FunctionDescriptor> createCallContext(@NotNull ResolutionCandidate<FunctionDescriptor> candidate,
|
||||
@NotNull ResolutionTask<FunctionDescriptor> task,
|
||||
@NotNull BindingTrace trace,
|
||||
@NotNull TracingStrategy tracing) {
|
||||
if (candidate.getDescriptor() instanceof FunctionDescriptor) {
|
||||
return new CallResolutionContext<FunctionDescriptor>(ResolvedCallImpl.create(candidate), task, trace, tracing);
|
||||
}
|
||||
assert candidate.getDescriptor() instanceof VariableDescriptor;
|
||||
Call propertyCall = new DelegatingCall(task.call) {
|
||||
@Override
|
||||
public JetValueArgumentList getValueArgumentList() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<JetExpression> getFunctionLiteralArguments() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<JetTypeProjection> getTypeArguments() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public JetTypeArgumentList getTypeArgumentList() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
return new CallResolutionContext<FunctionDescriptor>(ResolvedCallImpl.create(candidate), task, trace, tracing, propertyCall);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<ResolvedCallImpl<FunctionDescriptor>> transformResultCall(@NotNull CallResolutionContext<FunctionDescriptor> context,
|
||||
@NotNull CallResolver callResolver, @NotNull ResolutionTask<FunctionDescriptor> task) {
|
||||
FunctionDescriptor descriptor = context.candidateCall.getCandidateDescriptor();
|
||||
if (descriptor instanceof FunctionDescriptor) {
|
||||
return Collections.singleton(context.candidateCall);
|
||||
}
|
||||
assert descriptor instanceof VariableDescriptor;
|
||||
BasicResolutionContext basicResolutionContext =
|
||||
BasicResolutionContext.create(context.trace, context.scope, task.call, context.expectedType, context.dataFlowInfo);
|
||||
OverloadResolutionResults<FunctionDescriptor> results =
|
||||
callResolver.resolveCallWithGivenName(basicResolutionContext, task.reference, "invoke");
|
||||
return ((OverloadResolutionResultsImpl<FunctionDescriptor>)results).getResultingCalls();
|
||||
}
|
||||
};
|
||||
}
|
||||
+15
-17
@@ -14,27 +14,25 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.intellij.psi.tree;
|
||||
package org.jetbrains.jet.lang.resolve.calls;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.CallableDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author abreslav
|
||||
* @author svtk
|
||||
*/
|
||||
public class TokenSet {
|
||||
public static TokenSet create(IElementType... tokens) {
|
||||
return new TokenSet(tokens);
|
||||
}
|
||||
public interface MemberPrioritizer<D extends CallableDescriptor> {
|
||||
@NotNull
|
||||
Collection<D> getNonExtensionsByName(JetScope scope, String name);
|
||||
|
||||
private final Set<IElementType> tokens = new HashSet<IElementType>();
|
||||
@NotNull
|
||||
Collection<D> getMembersByName(@NotNull JetType receiver, String name);
|
||||
|
||||
public TokenSet(IElementType... tokens) {
|
||||
this.tokens.addAll(Arrays.asList(tokens));
|
||||
}
|
||||
|
||||
public Set<IElementType> asSet() {
|
||||
return tokens;
|
||||
}
|
||||
@NotNull
|
||||
Collection<D> getExtensionsByName(JetScope scope, String name);
|
||||
}
|
||||
+14
-13
@@ -34,14 +34,15 @@ import java.util.*;
|
||||
/**
|
||||
* @author abreslav
|
||||
*/
|
||||
public class TaskPrioritizers {
|
||||
public class MemberPrioritizers {
|
||||
|
||||
|
||||
/*package*/ static TaskPrioritizer<FunctionDescriptor> FUNCTION_TASK_PRIORITIZER = new TaskPrioritizer<FunctionDescriptor>() {
|
||||
/*package*/ static MemberPrioritizer<FunctionDescriptor> FUNCTION_TASK_PRIORITIZER = new MemberPrioritizer<FunctionDescriptor>() {
|
||||
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Collection<FunctionDescriptor> getNonExtensionsByName(JetScope scope, String name) {
|
||||
public Collection<FunctionDescriptor> getNonExtensionsByName(JetScope scope, String name) {
|
||||
Set<FunctionDescriptor> functions = Sets.newLinkedHashSet(scope.getFunctions(name));
|
||||
for (Iterator<FunctionDescriptor> iterator = functions.iterator(); iterator.hasNext(); ) {
|
||||
FunctionDescriptor functionDescriptor = iterator.next();
|
||||
@@ -57,7 +58,7 @@ public class TaskPrioritizers {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Collection<FunctionDescriptor> getMembersByName(@NotNull JetType receiverType, String name) {
|
||||
public Collection<FunctionDescriptor> getMembersByName(@NotNull JetType receiverType, String name) {
|
||||
JetScope receiverScope = receiverType.getMemberScope();
|
||||
Set<FunctionDescriptor> members = Sets.newHashSet(receiverScope.getFunctions(name));
|
||||
addConstructors(receiverScope, name, members);
|
||||
@@ -67,7 +68,7 @@ public class TaskPrioritizers {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Collection<FunctionDescriptor> getExtensionsByName(JetScope scope, String name) {
|
||||
public Collection<FunctionDescriptor> getExtensionsByName(JetScope scope, String name) {
|
||||
Set<FunctionDescriptor> extensionFunctions = Sets.newHashSet(scope.getFunctions(name));
|
||||
for (Iterator<FunctionDescriptor> iterator = extensionFunctions.iterator(); iterator.hasNext(); ) {
|
||||
FunctionDescriptor descriptor = iterator.next();
|
||||
@@ -104,11 +105,11 @@ public class TaskPrioritizers {
|
||||
}
|
||||
};
|
||||
|
||||
/*package*/ static TaskPrioritizer<VariableDescriptor> VARIABLE_TASK_PRIORITIZER = new TaskPrioritizer<VariableDescriptor>() {
|
||||
/*package*/ static MemberPrioritizer<VariableDescriptor> VARIABLE_TASK_PRIORITIZER = new MemberPrioritizer<VariableDescriptor>() {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Collection<VariableDescriptor> getNonExtensionsByName(JetScope scope, String name) {
|
||||
public Collection<VariableDescriptor> getNonExtensionsByName(JetScope scope, String name) {
|
||||
VariableDescriptor descriptor = scope.getLocalVariable(name);
|
||||
if (descriptor == null) {
|
||||
descriptor = DescriptorUtils.filterNonExtensionProperty(scope.getProperties(name));
|
||||
@@ -119,13 +120,13 @@ public class TaskPrioritizers {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Collection<VariableDescriptor> getMembersByName(@NotNull JetType receiverType, String name) {
|
||||
public Collection<VariableDescriptor> getMembersByName(@NotNull JetType receiverType, String name) {
|
||||
return receiverType.getMemberScope().getProperties(name);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Collection<VariableDescriptor> getExtensionsByName(JetScope scope, String name) {
|
||||
public Collection<VariableDescriptor> getExtensionsByName(JetScope scope, String name) {
|
||||
return Collections2.filter(scope.getProperties(name), new Predicate<VariableDescriptor>() {
|
||||
@Override
|
||||
public boolean apply(@Nullable VariableDescriptor variableDescriptor) {
|
||||
@@ -135,7 +136,7 @@ public class TaskPrioritizers {
|
||||
}
|
||||
};
|
||||
|
||||
/*package*/ static TaskPrioritizer<VariableDescriptor> PROPERTY_TASK_PRIORITIZER = new TaskPrioritizer<VariableDescriptor>() {
|
||||
/*package*/ static MemberPrioritizer<VariableDescriptor> PROPERTY_TASK_PRIORITIZER = new MemberPrioritizer<VariableDescriptor>() {
|
||||
private Collection<VariableDescriptor> filterProperties(Collection<? extends VariableDescriptor> variableDescriptors) {
|
||||
ArrayList<VariableDescriptor> properties = Lists.newArrayList();
|
||||
for (VariableDescriptor descriptor : variableDescriptors) {
|
||||
@@ -148,19 +149,19 @@ public class TaskPrioritizers {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Collection<VariableDescriptor> getNonExtensionsByName(JetScope scope, String name) {
|
||||
public Collection<VariableDescriptor> getNonExtensionsByName(JetScope scope, String name) {
|
||||
return filterProperties(VARIABLE_TASK_PRIORITIZER.getNonExtensionsByName(scope, name));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Collection<VariableDescriptor> getMembersByName(@NotNull JetType receiver, String name) {
|
||||
public Collection<VariableDescriptor> getMembersByName(@NotNull JetType receiver, String name) {
|
||||
return filterProperties(VARIABLE_TASK_PRIORITIZER.getMembersByName(receiver, name));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Collection<VariableDescriptor> getExtensionsByName(JetScope scope, String name) {
|
||||
public Collection<VariableDescriptor> getExtensionsByName(JetScope scope, String name) {
|
||||
return filterProperties(VARIABLE_TASK_PRIORITIZER.getExtensionsByName(scope, name));
|
||||
}
|
||||
};
|
||||
+70
-21
@@ -25,10 +25,10 @@ import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||
import org.jetbrains.jet.lang.resolve.OverridingUtil;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor;
|
||||
import org.jetbrains.jet.lang.types.checker.JetTypeChecker;
|
||||
import org.jetbrains.jet.lang.types.lang.JetStandardLibrary;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.jet.lang.types.TypeUtils;
|
||||
import org.jetbrains.jet.lang.types.checker.JetTypeChecker;
|
||||
import org.jetbrains.jet.lang.types.lang.JetStandardLibrary;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -95,29 +95,73 @@ public class OverloadingConflictResolver {
|
||||
|
||||
int fSize = fParams.size();
|
||||
int gSize = gParams.size();
|
||||
if (fSize > gSize) return false;
|
||||
for (int i = 0; i < gSize; i++) {
|
||||
ValueParameterDescriptor gParam = gParams.get(i);
|
||||
JetType gParamType = gParam.getType();
|
||||
|
||||
if (i >= fSize) {
|
||||
// f() has fewer parameters than g()
|
||||
// The point is: g() may have a last vararg that doesn't get any arguments
|
||||
// In this case f() is more specific, because one can explicitly pass
|
||||
// an empty array to g() and make it preferred
|
||||
if (i != gSize - 1 || gParam.getVarargElementType() == null) {
|
||||
boolean fIsVararg = isVariableArity(fParams);
|
||||
boolean gIsVararg = isVariableArity(gParams);
|
||||
|
||||
if (!fIsVararg && gIsVararg) return true;
|
||||
if (fIsVararg && !gIsVararg) return false;
|
||||
|
||||
if (!fIsVararg && !gIsVararg) {
|
||||
if (fSize != gSize) return false;
|
||||
|
||||
for (int i = 0; i < fSize; i++) {
|
||||
ValueParameterDescriptor fParam = fParams.get(i);
|
||||
ValueParameterDescriptor gParam = gParams.get(i);
|
||||
|
||||
JetType fParamType = fParam.getType();
|
||||
JetType gParamType = gParam.getType();
|
||||
|
||||
if (!typeMoreSpecific(fParamType, gParamType)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
JetType fParamType = fParams.get(i).getType();
|
||||
|
||||
if (!typeMoreSpecific(fParamType, gParamType)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (fIsVararg && gIsVararg) {
|
||||
// Check matching parameters
|
||||
int minSize = Math.min(fSize, gSize);
|
||||
for (int i = 0; i < minSize - 1; i++) {
|
||||
ValueParameterDescriptor fParam = fParams.get(i);
|
||||
ValueParameterDescriptor gParam = gParams.get(i);
|
||||
|
||||
JetType fParamType = fParam.getType();
|
||||
JetType gParamType = gParam.getType();
|
||||
|
||||
if (!typeMoreSpecific(fParamType, gParamType)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check the non-matching parameters of one function against the vararg parameter of the other funciton
|
||||
// Example:
|
||||
// f(a : A, vararg vf : T)
|
||||
// g(vararg vg : T)
|
||||
// here we check that typeof(a) < typeof(vg) and elementTypeOf(vf) < elementTypeOf(vg)
|
||||
if (fSize < gSize) {
|
||||
ValueParameterDescriptor fParam = fParams.get(fSize - 1);
|
||||
JetType fParamType = fParam.getVarargElementType();
|
||||
assert fParamType != null : "fIsVararg guarantees this";
|
||||
for (int i = fSize - 1; i < gSize; i++) {
|
||||
ValueParameterDescriptor gParam = gParams.get(i);
|
||||
if (!typeMoreSpecific(fParamType, gParam.getType())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
ValueParameterDescriptor gParam = gParams.get(gSize - 1);
|
||||
JetType gParamType = gParam.getVarargElementType();
|
||||
assert gParamType != null : "gIsVararg guarantees this";
|
||||
for (int i = gSize - 1; i < fSize; i++) {
|
||||
ValueParameterDescriptor fParam = fParams.get(i);
|
||||
if (!typeMoreSpecific(fParam.getType(), gParamType)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (discriminateGenericDescriptors && isGeneric(f)) {
|
||||
if (!isGeneric(g)) {
|
||||
return false;
|
||||
@@ -130,7 +174,12 @@ public class OverloadingConflictResolver {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private boolean isVariableArity(List<ValueParameterDescriptor> fParams) {
|
||||
int fSize = fParams.size();
|
||||
return fSize > 0 && fParams.get(fSize - 1).getVarargElementType() != null;
|
||||
}
|
||||
|
||||
private boolean isGeneric(CallableDescriptor f) {
|
||||
return !f.getOriginal().getTypeParameters().isEmpty();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright 2010-2012 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.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.lang.resolve.calls;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.CallableDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor.NO_RECEIVER;
|
||||
|
||||
/**
|
||||
* @author svtk
|
||||
*/
|
||||
public class ResolutionCandidate<D extends CallableDescriptor> {
|
||||
private final D candidateDescriptor;
|
||||
private ReceiverDescriptor thisObject = NO_RECEIVER; // receiver object of a method
|
||||
private ReceiverDescriptor receiverArgument = NO_RECEIVER; // receiver of an extension function
|
||||
|
||||
private ResolutionCandidate(@NotNull D descriptor) {
|
||||
candidateDescriptor = descriptor;
|
||||
}
|
||||
|
||||
public static <D extends CallableDescriptor> ResolutionCandidate<D> create(@NotNull D descriptor) {
|
||||
return new ResolutionCandidate<D>(descriptor);
|
||||
}
|
||||
|
||||
public void setThisObject(@NotNull ReceiverDescriptor thisObject) {
|
||||
this.thisObject = thisObject;
|
||||
}
|
||||
|
||||
public void setReceiverArgument(@NotNull ReceiverDescriptor receiverArgument) {
|
||||
this.receiverArgument = receiverArgument;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public D getDescriptor() {
|
||||
return candidateDescriptor;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ReceiverDescriptor getThisObject() {
|
||||
return thisObject;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ReceiverDescriptor getReceiverArgument() {
|
||||
return receiverArgument;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static <D extends CallableDescriptor> List<ResolutionCandidate<D>> convertCollection(@NotNull Collection<? extends D> descriptors) {
|
||||
List<ResolutionCandidate<D>> result = Lists.newArrayList();
|
||||
for (D descriptor : descriptors) {
|
||||
result.add(create(descriptor));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public enum ResolutionStatus {
|
||||
}
|
||||
|
||||
public ResolutionStatus combine(ResolutionStatus other) {
|
||||
if (this.isSuccess()) return other;
|
||||
if (this == UNKNOWN_STATUS || this.isSuccess()) return other;
|
||||
if (!other.isSuccess() && this.getSeverityIndex() < other.getSeverityIndex()) return other;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.jetbrains.jet.lang.resolve.calls;
|
||||
|
||||
import com.google.common.collect.LinkedHashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.PsiElement;
|
||||
@@ -39,10 +41,7 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.lang.diagnostics.Errors.*;
|
||||
import static org.jetbrains.jet.lang.diagnostics.Errors.DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED;
|
||||
import static org.jetbrains.jet.lang.resolve.BindingContext.AMBIGUOUS_REFERENCE_TARGET;
|
||||
import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET;
|
||||
import static org.jetbrains.jet.lang.resolve.BindingContext.RESOLVED_CALL;
|
||||
import static org.jetbrains.jet.lang.resolve.BindingContext.*;
|
||||
|
||||
/**
|
||||
* Stores candidates for call resolution.
|
||||
@@ -50,26 +49,32 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.RESOLVED_CALL;
|
||||
* @author abreslav
|
||||
*/
|
||||
public class ResolutionTask<D extends CallableDescriptor> extends ResolutionContext {
|
||||
private final Collection<ResolvedCallImpl<D>> candidates;
|
||||
private final Collection<ResolutionCandidate<D>> candidates;
|
||||
private final Multimap<ResolutionCandidate<D>, ResolvedCallImpl<D>> resolvedCallMap = LinkedHashMultimap.create();
|
||||
/*package*/ final JetReferenceExpression reference;
|
||||
private DescriptorCheckStrategy checkingStrategy;
|
||||
|
||||
public ResolutionTask(@NotNull Collection<ResolvedCallImpl<D>> candidates, @NotNull JetReferenceExpression reference,
|
||||
public ResolutionTask(@NotNull Collection<ResolutionCandidate<D>> candidates, @NotNull JetReferenceExpression reference,
|
||||
BindingTrace trace, JetScope scope, Call call, JetType expectedType, DataFlowInfo dataFlowInfo) {
|
||||
super(trace, scope, call, expectedType, dataFlowInfo);
|
||||
this.candidates = candidates;
|
||||
this.reference = reference;
|
||||
}
|
||||
|
||||
public ResolutionTask(@NotNull Collection<ResolvedCallImpl<D>> candidates, @NotNull JetReferenceExpression reference, @NotNull BasicResolutionContext context) {
|
||||
public ResolutionTask(@NotNull Collection<ResolutionCandidate<D>> candidates, @NotNull JetReferenceExpression reference, @NotNull BasicResolutionContext context) {
|
||||
this(candidates, reference, context.trace, context.scope, context.call, context.expectedType, context.dataFlowInfo);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Collection<ResolvedCallImpl<D>> getCandidates() {
|
||||
public Collection<ResolutionCandidate<D>> getCandidates() {
|
||||
return candidates;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Multimap<ResolutionCandidate<D>, ResolvedCallImpl<D>> getResolvedCallMap() {
|
||||
return resolvedCallMap;
|
||||
}
|
||||
|
||||
public void setCheckingStrategy(DescriptorCheckStrategy strategy) {
|
||||
checkingStrategy = strategy;
|
||||
}
|
||||
|
||||
+12
-12
@@ -34,35 +34,35 @@ import java.util.List;
|
||||
public class ResolutionTaskHolder<D extends CallableDescriptor> {
|
||||
private final JetReferenceExpression reference;
|
||||
private final BasicResolutionContext basicResolutionContext;
|
||||
private final Predicate<ResolvedCallImpl<D>> visibleStrategy;
|
||||
private final Predicate<ResolutionCandidate<D>> visibleStrategy;
|
||||
|
||||
private final Collection<Collection<ResolvedCallImpl<D>>> localExtensions = Sets.newLinkedHashSet();
|
||||
private final Collection<Collection<ResolvedCallImpl<D>>> members = Sets.newLinkedHashSet();
|
||||
private final Collection<Collection<ResolvedCallImpl<D>>> nonLocalExtensions = Sets.newLinkedHashSet();
|
||||
private final Collection<Collection<ResolutionCandidate<D>>> localExtensions = Sets.newLinkedHashSet();
|
||||
private final Collection<Collection<ResolutionCandidate<D>>> members = Sets.newLinkedHashSet();
|
||||
private final Collection<Collection<ResolutionCandidate<D>>> nonLocalExtensions = Sets.newLinkedHashSet();
|
||||
|
||||
private List<ResolutionTask<D>> tasks = null;
|
||||
|
||||
public ResolutionTaskHolder(@NotNull JetReferenceExpression reference,
|
||||
@NotNull BasicResolutionContext basicResolutionContext,
|
||||
@NotNull Predicate<ResolvedCallImpl<D>> visibleStrategy) {
|
||||
@NotNull Predicate<ResolutionCandidate<D>> visibleStrategy) {
|
||||
this.reference = reference;
|
||||
this.basicResolutionContext = basicResolutionContext;
|
||||
this.visibleStrategy = visibleStrategy;
|
||||
}
|
||||
|
||||
public void addLocalExtensions(@NotNull Collection<ResolvedCallImpl<D>> candidates) {
|
||||
public void addLocalExtensions(@NotNull Collection<ResolutionCandidate<D>> candidates) {
|
||||
if (!candidates.isEmpty()) {
|
||||
localExtensions.add(candidates);
|
||||
}
|
||||
}
|
||||
|
||||
public void addMembers(@NotNull Collection<ResolvedCallImpl<D>> candidates) {
|
||||
public void addMembers(@NotNull Collection<ResolutionCandidate<D>> candidates) {
|
||||
if (!candidates.isEmpty()) {
|
||||
members.add(candidates);
|
||||
}
|
||||
}
|
||||
|
||||
public void addNonLocalExtensions(@NotNull Collection<ResolvedCallImpl<D>> candidates) {
|
||||
public void addNonLocalExtensions(@NotNull Collection<ResolutionCandidate<D>> candidates) {
|
||||
if (!candidates.isEmpty()) {
|
||||
nonLocalExtensions.add(candidates);
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class ResolutionTaskHolder<D extends CallableDescriptor> {
|
||||
public List<ResolutionTask<D>> getTasks() {
|
||||
if (tasks == null) {
|
||||
tasks = Lists.newArrayList();
|
||||
List<Collection<ResolvedCallImpl<D>>> candidateList = Lists.newArrayList();
|
||||
List<Collection<ResolutionCandidate<D>>> candidateList = Lists.newArrayList();
|
||||
// If the call is of the form super.foo(), it can actually be only a member
|
||||
// But if there's no appropriate member, we would like to report that super cannot be a receiver for an extension
|
||||
// Thus, put members first
|
||||
@@ -85,9 +85,9 @@ public class ResolutionTaskHolder<D extends CallableDescriptor> {
|
||||
}
|
||||
candidateList.addAll(nonLocalExtensions);
|
||||
|
||||
for (Predicate<ResolvedCallImpl<D>> visibilityStrategy : Lists.newArrayList(visibleStrategy, Predicates.not(visibleStrategy))) {
|
||||
for (Collection<ResolvedCallImpl<D>> candidates : candidateList) {
|
||||
Collection<ResolvedCallImpl<D>> filteredCandidates = Collections2.filter(candidates, visibilityStrategy);
|
||||
for (Predicate<ResolutionCandidate<D>> visibilityStrategy : Lists.newArrayList(visibleStrategy, Predicates.not(visibleStrategy))) {
|
||||
for (Collection<ResolutionCandidate<D>> candidates : candidateList) {
|
||||
Collection<ResolutionCandidate<D>> filteredCandidates = Collections2.filter(candidates, visibilityStrategy);
|
||||
if (!filteredCandidates.isEmpty()) {
|
||||
tasks.add(new ResolutionTask<D>(filteredCandidates, reference, basicResolutionContext));
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.jetbrains.jet.lang.resolve.calls.ResolutionStatus.UNKNOWN_STATUS;
|
||||
import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor.NO_RECEIVER;
|
||||
|
||||
/**
|
||||
* @author abreslav
|
||||
@@ -55,23 +54,14 @@ public class ResolvedCallImpl<D extends CallableDescriptor> implements ResolvedC
|
||||
};
|
||||
|
||||
@NotNull
|
||||
public static <D extends CallableDescriptor> ResolvedCallImpl<D> create(@NotNull D descriptor) {
|
||||
return new ResolvedCallImpl<D>(descriptor);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static <D extends CallableDescriptor> List<ResolvedCallImpl<D>> convertCollection(@NotNull Collection<? extends D> descriptors) {
|
||||
List<ResolvedCallImpl<D>> result = Lists.newArrayList();
|
||||
for (D descriptor : descriptors) {
|
||||
result.add(create(descriptor));
|
||||
}
|
||||
return result;
|
||||
public static <D extends CallableDescriptor> ResolvedCallImpl<D> create(@NotNull ResolutionCandidate<D> candidate) {
|
||||
return new ResolvedCallImpl<D>(candidate.getDescriptor(), candidate.getThisObject(), candidate.getReceiverArgument());
|
||||
}
|
||||
|
||||
private final D candidateDescriptor;
|
||||
private D resultingDescriptor; // Probably substituted
|
||||
private ReceiverDescriptor thisObject = NO_RECEIVER; // receiver object of a method
|
||||
private ReceiverDescriptor receiverArgument = NO_RECEIVER; // receiver of an extension function
|
||||
private final ReceiverDescriptor thisObject; // receiver object of a method
|
||||
private final ReceiverDescriptor receiverArgument; // receiver of an extension function
|
||||
|
||||
private final Map<TypeParameterDescriptor, JetType> typeArguments = Maps.newLinkedHashMap();
|
||||
private final Map<ValueParameterDescriptor, JetType> autoCasts = Maps.newHashMap();
|
||||
@@ -80,8 +70,10 @@ public class ResolvedCallImpl<D extends CallableDescriptor> implements ResolvedC
|
||||
private TemporaryBindingTrace trace;
|
||||
private ResolutionStatus status = UNKNOWN_STATUS;
|
||||
|
||||
private ResolvedCallImpl(@NotNull D candidateDescriptor) {
|
||||
private ResolvedCallImpl(@NotNull D candidateDescriptor, @NotNull ReceiverDescriptor thisObject, @NotNull ReceiverDescriptor receiverArgument) {
|
||||
this.candidateDescriptor = candidateDescriptor;
|
||||
this.thisObject = thisObject;
|
||||
this.receiverArgument = receiverArgument;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -89,8 +81,8 @@ public class ResolvedCallImpl<D extends CallableDescriptor> implements ResolvedC
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(@NotNull ResolutionStatus status) {
|
||||
this.status = status;
|
||||
public void addStatus(@NotNull ResolutionStatus status) {
|
||||
this.status = this.status.combine(status);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -140,20 +132,12 @@ public class ResolvedCallImpl<D extends CallableDescriptor> implements ResolvedC
|
||||
return receiverArgument;
|
||||
}
|
||||
|
||||
public void setReceiverArgument(@NotNull ReceiverDescriptor receiverParameter) {
|
||||
this.receiverArgument = receiverParameter;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ReceiverDescriptor getThisObject() {
|
||||
return thisObject;
|
||||
}
|
||||
|
||||
public void setThisObject(@NotNull ReceiverDescriptor thisObject) {
|
||||
this.thisObject = thisObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Map<ValueParameterDescriptor, ResolvedValueArgument> getValueArguments() {
|
||||
|
||||
@@ -31,7 +31,6 @@ import org.jetbrains.jet.lang.resolve.scopes.receivers.ClassReceiver;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ExpressionReceiver;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor;
|
||||
import org.jetbrains.jet.lang.types.ErrorUtils;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.jet.lang.types.NamespaceType;
|
||||
import org.jetbrains.jet.lang.types.checker.JetTypeChecker;
|
||||
|
||||
@@ -44,16 +43,16 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor
|
||||
/**
|
||||
* @author abreslav
|
||||
*/
|
||||
/*package*/ abstract class TaskPrioritizer<D extends CallableDescriptor> {
|
||||
/*package*/ abstract class TaskPrioritizer {
|
||||
|
||||
public static <D extends CallableDescriptor> void splitLexicallyLocalDescriptors(
|
||||
@NotNull Collection<ResolvedCallImpl<D>> allDescriptors,
|
||||
@NotNull Collection<ResolutionCandidate<D>> allDescriptors,
|
||||
@NotNull DeclarationDescriptor containerOfTheCurrentLocality,
|
||||
@NotNull Collection<ResolvedCallImpl<D>> local,
|
||||
@NotNull Collection<ResolvedCallImpl<D>> nonlocal
|
||||
@NotNull Collection<ResolutionCandidate<D>> local,
|
||||
@NotNull Collection<ResolutionCandidate<D>> nonlocal
|
||||
) {
|
||||
for (ResolvedCallImpl<D> resolvedCall : allDescriptors) {
|
||||
if (DescriptorUtils.isLocal(containerOfTheCurrentLocality, resolvedCall.getCandidateDescriptor())) {
|
||||
for (ResolutionCandidate<D> resolvedCall : allDescriptors) {
|
||||
if (DescriptorUtils.isLocal(containerOfTheCurrentLocality, resolvedCall.getDescriptor())) {
|
||||
local.add(resolvedCall);
|
||||
}
|
||||
else {
|
||||
@@ -75,8 +74,8 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public List<ResolutionTask<D>> computePrioritizedTasks(@NotNull BasicResolutionContext context, @NotNull String name,
|
||||
@NotNull JetReferenceExpression functionReference) {
|
||||
public static <D extends CallableDescriptor> List<ResolutionTask<D>> computePrioritizedTasks(@NotNull BasicResolutionContext context, @NotNull String name,
|
||||
@NotNull JetReferenceExpression functionReference, @NotNull List<MemberPrioritizer<D>> memberPrioritizers) {
|
||||
ReceiverDescriptor explicitReceiver = context.call.getExplicitReceiver();
|
||||
final JetScope scope;
|
||||
if (explicitReceiver.exists() && explicitReceiver.getType() instanceof NamespaceType) {
|
||||
@@ -87,40 +86,41 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor
|
||||
else {
|
||||
scope = context.scope;
|
||||
}
|
||||
final Predicate<ResolvedCallImpl<D>> visibleStrategy = new Predicate<ResolvedCallImpl<D>>() {
|
||||
final Predicate<ResolutionCandidate<D>> visibleStrategy = new Predicate<ResolutionCandidate<D>>() {
|
||||
@Override
|
||||
public boolean apply(@Nullable ResolvedCallImpl<D> call) {
|
||||
public boolean apply(@Nullable ResolutionCandidate<D> call) {
|
||||
if (call == null) return false;
|
||||
D candidateDescriptor = call.getCandidateDescriptor();
|
||||
D candidateDescriptor = call.getDescriptor();
|
||||
if (ErrorUtils.isError(candidateDescriptor)) return true;
|
||||
return Visibilities.isVisible(candidateDescriptor, scope.getContainingDeclaration());
|
||||
}
|
||||
};
|
||||
|
||||
ResolutionTaskHolder<D> result = new ResolutionTaskHolder<D>(functionReference, context, visibleStrategy );
|
||||
doComputeTasks(scope, explicitReceiver, name, result, context);
|
||||
doComputeTasks(scope, explicitReceiver, name, result, context, memberPrioritizers);
|
||||
|
||||
return result.getTasks();
|
||||
}
|
||||
|
||||
private void doComputeTasks(@NotNull JetScope scope, @NotNull ReceiverDescriptor receiver,
|
||||
private static <D extends CallableDescriptor> void doComputeTasks(@NotNull JetScope scope, @NotNull ReceiverDescriptor receiver,
|
||||
@NotNull String name, @NotNull ResolutionTaskHolder<D> result,
|
||||
@NotNull BasicResolutionContext context) {
|
||||
@NotNull BasicResolutionContext context, @NotNull List<MemberPrioritizer<D>> memberPrioritizers) {
|
||||
MemberPrioritizer<D> memberPrioritizer = memberPrioritizers.get(0);
|
||||
AutoCastServiceImpl autoCastService = new AutoCastServiceImpl(context.dataFlowInfo, context.trace.getBindingContext());
|
||||
List<ReceiverDescriptor> implicitReceivers = Lists.newArrayList();
|
||||
scope.getImplicitReceiversHierarchy(implicitReceivers);
|
||||
if (receiver.exists()) {
|
||||
List<ReceiverDescriptor> variantsForExplicitReceiver = autoCastService.getVariantsForReceiver(receiver);
|
||||
|
||||
Collection<ResolvedCallImpl<D>> extensionFunctions = convertWithImpliedThis(scope, variantsForExplicitReceiver, getExtensionsByName(scope, name));
|
||||
List<ResolvedCallImpl<D>> nonlocals = Lists.newArrayList();
|
||||
List<ResolvedCallImpl<D>> locals = Lists.newArrayList();
|
||||
Collection<ResolutionCandidate<D>> extensionFunctions = convertWithImpliedThis(scope, variantsForExplicitReceiver, memberPrioritizer.getExtensionsByName(scope, name));
|
||||
List<ResolutionCandidate<D>> nonlocals = Lists.newArrayList();
|
||||
List<ResolutionCandidate<D>> locals = Lists.newArrayList();
|
||||
//noinspection unchecked,RedundantTypeArguments
|
||||
TaskPrioritizer.<D>splitLexicallyLocalDescriptors(extensionFunctions, scope.getContainingDeclaration(), locals, nonlocals);
|
||||
|
||||
Collection<ResolvedCallImpl<D>> members = Lists.newArrayList();
|
||||
Collection<ResolutionCandidate<D>> members = Lists.newArrayList();
|
||||
for (ReceiverDescriptor variant : variantsForExplicitReceiver) {
|
||||
Collection<D> membersForThisVariant = getMembersByName(variant.getType(), name);
|
||||
Collection<D> membersForThisVariant = memberPrioritizer.getMembersByName(variant.getType(), name);
|
||||
convertWithReceivers(membersForThisVariant, Collections.singletonList(variant), Collections.singletonList(NO_RECEIVER), members);
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor
|
||||
result.addMembers(members);
|
||||
|
||||
for (ReceiverDescriptor implicitReceiver : implicitReceivers) {
|
||||
Collection<D> memberExtensions = getExtensionsByName(implicitReceiver.getType().getMemberScope(), name);
|
||||
Collection<D> memberExtensions = memberPrioritizer.getExtensionsByName(implicitReceiver.getType().getMemberScope(), name);
|
||||
List<ReceiverDescriptor> variantsForImplicitReceiver = autoCastService.getVariantsForReceiver(implicitReceiver);
|
||||
result.addNonLocalExtensions(convertWithReceivers(memberExtensions, variantsForImplicitReceiver, variantsForExplicitReceiver));
|
||||
}
|
||||
@@ -136,10 +136,10 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor
|
||||
result.addNonLocalExtensions(nonlocals);
|
||||
}
|
||||
else {
|
||||
Collection<ResolvedCallImpl<D>> functions = convertWithImpliedThis(scope, Collections.singletonList(receiver), getNonExtensionsByName(scope, name));
|
||||
Collection<ResolutionCandidate<D>> functions = convertWithImpliedThis(scope, Collections.singletonList(receiver), memberPrioritizer.getNonExtensionsByName(scope, name));
|
||||
|
||||
List<ResolvedCallImpl<D>> nonlocals = Lists.newArrayList();
|
||||
List<ResolvedCallImpl<D>> locals = Lists.newArrayList();
|
||||
List<ResolutionCandidate<D>> nonlocals = Lists.newArrayList();
|
||||
List<ResolutionCandidate<D>> locals = Lists.newArrayList();
|
||||
//noinspection unchecked,RedundantTypeArguments
|
||||
TaskPrioritizer.<D>splitLexicallyLocalDescriptors(functions, scope.getContainingDeclaration(), locals, nonlocals);
|
||||
|
||||
@@ -147,22 +147,22 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor
|
||||
result.addNonLocalExtensions(nonlocals);
|
||||
|
||||
for (ReceiverDescriptor implicitReceiver : implicitReceivers) {
|
||||
doComputeTasks(scope, implicitReceiver, name, result, context);
|
||||
doComputeTasks(scope, implicitReceiver, name, result, context, memberPrioritizers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Collection<ResolvedCallImpl<D>> convertWithReceivers(Collection<D> descriptors, Iterable<ReceiverDescriptor> thisObjects, Iterable<ReceiverDescriptor> receiverParameters) {
|
||||
Collection<ResolvedCallImpl<D>> result = Lists.newArrayList();
|
||||
private static <D extends CallableDescriptor> Collection<ResolutionCandidate<D>> convertWithReceivers(Collection<D> descriptors, Iterable<ReceiverDescriptor> thisObjects, Iterable<ReceiverDescriptor> receiverParameters) {
|
||||
Collection<ResolutionCandidate<D>> result = Lists.newArrayList();
|
||||
convertWithReceivers(descriptors, thisObjects, receiverParameters, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
private void convertWithReceivers(Collection<D> descriptors, Iterable<ReceiverDescriptor> thisObjects, Iterable<ReceiverDescriptor> receiverParameters, Collection<ResolvedCallImpl<D>> result) {
|
||||
private static <D extends CallableDescriptor> void convertWithReceivers(Collection<D> descriptors, Iterable<ReceiverDescriptor> thisObjects, Iterable<ReceiverDescriptor> receiverParameters, Collection<ResolutionCandidate<D>> result) {
|
||||
for (ReceiverDescriptor thisObject : thisObjects) {
|
||||
for (ReceiverDescriptor receiverParameter : receiverParameters) {
|
||||
for (D extension : descriptors) {
|
||||
ResolvedCallImpl<D> resolvedCall = ResolvedCallImpl.create(extension);
|
||||
ResolutionCandidate<D> resolvedCall = ResolutionCandidate.create(extension);
|
||||
resolvedCall.setThisObject(thisObject);
|
||||
resolvedCall.setReceiverArgument(receiverParameter);
|
||||
result.add(resolvedCall);
|
||||
@@ -171,11 +171,11 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor
|
||||
}
|
||||
}
|
||||
|
||||
public static <D extends CallableDescriptor> Collection<ResolvedCallImpl<D>> convertWithImpliedThis(JetScope scope, Iterable<ReceiverDescriptor> receiverParameters, Collection<? extends D> descriptors) {
|
||||
Collection<ResolvedCallImpl<D>> result = Lists.newArrayList();
|
||||
public static <D extends CallableDescriptor> Collection<ResolutionCandidate<D>> convertWithImpliedThis(JetScope scope, Iterable<ReceiverDescriptor> receiverParameters, Collection<? extends D> descriptors) {
|
||||
Collection<ResolutionCandidate<D>> result = Lists.newArrayList();
|
||||
for (ReceiverDescriptor receiverParameter : receiverParameters) {
|
||||
for (D descriptor : descriptors) {
|
||||
ResolvedCallImpl<D> resolvedCall = ResolvedCallImpl.create(descriptor);
|
||||
ResolutionCandidate<D> resolvedCall = ResolutionCandidate.create(descriptor);
|
||||
resolvedCall.setReceiverArgument(receiverParameter);
|
||||
if (setImpliedThis(scope, resolvedCall)) {
|
||||
result.add(resolvedCall);
|
||||
@@ -190,7 +190,7 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor
|
||||
containingDeclaration = containingDeclaration.getContainingDeclaration();
|
||||
}
|
||||
if (containingDeclaration instanceof ClassDescriptor && ((ClassDescriptor) containingDeclaration).getKind() == ClassKind.OBJECT) {
|
||||
ResolvedCallImpl<D> resolvedCall = ResolvedCallImpl.create(descriptor);
|
||||
ResolutionCandidate<D> resolvedCall = ResolutionCandidate.create(descriptor);
|
||||
resolvedCall.setThisObject(new ClassReceiver((ClassDescriptor) containingDeclaration));
|
||||
result.add(resolvedCall);
|
||||
}
|
||||
@@ -199,8 +199,8 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor
|
||||
return result;
|
||||
}
|
||||
|
||||
private static <D extends CallableDescriptor> boolean setImpliedThis(@NotNull JetScope scope, ResolvedCallImpl<D> resolvedCall) {
|
||||
ReceiverDescriptor expectedThisObject = resolvedCall.getCandidateDescriptor().getExpectedThisObject();
|
||||
private static <D extends CallableDescriptor> boolean setImpliedThis(@NotNull JetScope scope, ResolutionCandidate<D> resolvedCall) {
|
||||
ReceiverDescriptor expectedThisObject = resolvedCall.getDescriptor().getExpectedThisObject();
|
||||
if (!expectedThisObject.exists()) return true;
|
||||
List<ReceiverDescriptor> receivers = Lists.newArrayList();
|
||||
scope.getImplicitReceiversHierarchy(receivers);
|
||||
@@ -213,13 +213,4 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected abstract Collection<D> getNonExtensionsByName(JetScope scope, String name);
|
||||
|
||||
@NotNull
|
||||
protected abstract Collection<D> getMembersByName(@NotNull JetType receiver, String name);
|
||||
|
||||
@NotNull
|
||||
protected abstract Collection<D> getExtensionsByName(JetScope scope, String name);
|
||||
}
|
||||
|
||||
+57
-22
@@ -33,17 +33,49 @@ import java.util.Set;
|
||||
|
||||
import static org.jetbrains.jet.lang.diagnostics.Errors.*;
|
||||
import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.ValueArgumentsToParametersMapper.Status.ERROR;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.ValueArgumentsToParametersMapper.Status.OK;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.ValueArgumentsToParametersMapper.Status.WEAK_ERROR;
|
||||
|
||||
/**
|
||||
* @author abreslav
|
||||
*/
|
||||
/*package*/ class ValueArgumentsToParametersMapper {
|
||||
public static <D extends CallableDescriptor> boolean mapValueArgumentsToParameters(
|
||||
|
||||
public enum Status {
|
||||
ERROR(false),
|
||||
WEAK_ERROR(false),
|
||||
OK(true);
|
||||
|
||||
private final boolean success;
|
||||
|
||||
private Status(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public Status compose(Status other) {
|
||||
switch (other) {
|
||||
case ERROR:
|
||||
return ERROR;
|
||||
case WEAK_ERROR:
|
||||
if (this != ERROR) {
|
||||
return WEAK_ERROR;
|
||||
}
|
||||
default:
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static <D extends CallableDescriptor> Status mapValueArgumentsToParameters(
|
||||
@NotNull Call call,
|
||||
@NotNull TracingStrategy tracing,
|
||||
@NotNull ResolvedCallImpl<D> candidateCall
|
||||
) {
|
||||
|
||||
TemporaryBindingTrace temporaryTrace = candidateCall.getTrace();
|
||||
Map<ValueParameterDescriptor, VarargValueArgument> varargs = Maps.newHashMap();
|
||||
Set<ValueParameterDescriptor> usedParameters = Sets.newHashSet();
|
||||
@@ -61,7 +93,7 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET;
|
||||
|
||||
List<? extends ValueArgument> valueArguments = call.getValueArguments();
|
||||
|
||||
boolean error = false;
|
||||
Status status = OK;
|
||||
boolean someNamed = false;
|
||||
boolean somePositioned = false;
|
||||
for (int i = 0; i < valueArguments.size(); i++) {
|
||||
@@ -72,47 +104,47 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET;
|
||||
ValueParameterDescriptor valueParameterDescriptor = parameterByName.get(nameReference.getReferencedName());
|
||||
if (valueParameterDescriptor == null) {
|
||||
temporaryTrace.report(NAMED_PARAMETER_NOT_FOUND.on(nameReference));
|
||||
error = true;
|
||||
status = ERROR;
|
||||
}
|
||||
else {
|
||||
if (!usedParameters.add(valueParameterDescriptor)) {
|
||||
temporaryTrace.report(ARGUMENT_PASSED_TWICE.on(nameReference));
|
||||
}
|
||||
temporaryTrace.record(REFERENCE_TARGET, nameReference, valueParameterDescriptor);
|
||||
put(candidateCall, valueParameterDescriptor, valueArgument, varargs);
|
||||
status = status.compose(put(candidateCall, valueParameterDescriptor, valueArgument, varargs));
|
||||
}
|
||||
if (somePositioned) {
|
||||
temporaryTrace.report(MIXING_NAMED_AND_POSITIONED_ARGUMENTS.on(nameReference));
|
||||
error = true;
|
||||
status = ERROR;
|
||||
}
|
||||
}
|
||||
else {
|
||||
somePositioned = true;
|
||||
if (someNamed) {
|
||||
temporaryTrace.report(MIXING_NAMED_AND_POSITIONED_ARGUMENTS.on(valueArgument.asElement()));
|
||||
error = true;
|
||||
status = ERROR;
|
||||
}
|
||||
else {
|
||||
int parameterCount = valueParameters.size();
|
||||
if (i < parameterCount) {
|
||||
ValueParameterDescriptor valueParameterDescriptor = valueParameters.get(i);
|
||||
usedParameters.add(valueParameterDescriptor);
|
||||
put(candidateCall, valueParameterDescriptor, valueArgument, varargs);
|
||||
status = status.compose(put(candidateCall, valueParameterDescriptor, valueArgument, varargs));
|
||||
}
|
||||
else if (!valueParameters.isEmpty()) {
|
||||
ValueParameterDescriptor valueParameterDescriptor = valueParameters.get(valueParameters.size() - 1);
|
||||
if (valueParameterDescriptor.getVarargElementType() != null) {
|
||||
put(candidateCall, valueParameterDescriptor, valueArgument, varargs);
|
||||
status = status.compose(put(candidateCall, valueParameterDescriptor, valueArgument, varargs));
|
||||
usedParameters.add(valueParameterDescriptor);
|
||||
}
|
||||
else {
|
||||
temporaryTrace.report(TOO_MANY_ARGUMENTS.on(valueArgument.asElement(), candidate));
|
||||
error = true;
|
||||
status = ERROR;
|
||||
}
|
||||
}
|
||||
else {
|
||||
temporaryTrace.report(TOO_MANY_ARGUMENTS.on(valueArgument.asElement(), candidate));
|
||||
error = true;
|
||||
status = ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,7 +156,7 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET;
|
||||
|
||||
if (valueParameters.isEmpty()) {
|
||||
temporaryTrace.report(TOO_MANY_ARGUMENTS.on(possiblyLabeledFunctionLiteral, candidate));
|
||||
error = true;
|
||||
status = ERROR;
|
||||
}
|
||||
else {
|
||||
JetFunctionLiteralExpression functionLiteral;
|
||||
@@ -139,15 +171,15 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET;
|
||||
ValueParameterDescriptor valueParameterDescriptor = valueParameters.get(valueParameters.size() - 1);
|
||||
if (valueParameterDescriptor.getVarargElementType() != null) {
|
||||
temporaryTrace.report(VARARG_OUTSIDE_PARENTHESES.on(possiblyLabeledFunctionLiteral));
|
||||
error = true;
|
||||
status = ERROR;
|
||||
}
|
||||
else {
|
||||
if (!usedParameters.add(valueParameterDescriptor)) {
|
||||
temporaryTrace.report(TOO_MANY_ARGUMENTS.on(possiblyLabeledFunctionLiteral, candidate));
|
||||
error = true;
|
||||
status = ERROR;
|
||||
}
|
||||
else {
|
||||
put(candidateCall, valueParameterDescriptor, CallMaker.makeValueArgument(functionLiteral), varargs);
|
||||
status = status.compose(put(candidateCall, valueParameterDescriptor, CallMaker.makeValueArgument(functionLiteral), varargs));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -155,7 +187,7 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET;
|
||||
for (int i = 1; i < functionLiteralArguments.size(); i++) {
|
||||
JetExpression argument = functionLiteralArguments.get(i);
|
||||
temporaryTrace.report(MANY_FUNCTION_LITERAL_ARGUMENTS.on(argument));
|
||||
error = true;
|
||||
status = ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +203,7 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET;
|
||||
else {
|
||||
// tracing.reportWrongValueArguments(temporaryTrace, "No value passed for parameter " + valueParameter.getName());
|
||||
tracing.noValueForParameter(temporaryTrace, valueParameter);
|
||||
error = true;
|
||||
status = ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -180,21 +212,22 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET;
|
||||
ReceiverDescriptor receiverArgument = candidateCall.getReceiverArgument();
|
||||
if (receiverParameter.exists() &&!receiverArgument.exists()) {
|
||||
tracing.missingReceiver(temporaryTrace, receiverParameter);
|
||||
error = true;
|
||||
status = ERROR;
|
||||
}
|
||||
if (!receiverParameter.exists() && receiverArgument.exists()) {
|
||||
tracing.noReceiverAllowed(temporaryTrace);
|
||||
error = true;
|
||||
status = ERROR;
|
||||
}
|
||||
|
||||
if (candidateCall.getThisObject().exists() != candidateCall.getResultingDescriptor().getExpectedThisObject().exists()) {
|
||||
assert false : "Shouldn't happen because of TaskPrioritizer: " + candidateCall.getCandidateDescriptor();
|
||||
}
|
||||
|
||||
return error;
|
||||
return status;
|
||||
}
|
||||
|
||||
private static <D extends CallableDescriptor> void put(ResolvedCallImpl<D> candidateCall, ValueParameterDescriptor valueParameterDescriptor, ValueArgument valueArgument, Map<ValueParameterDescriptor, VarargValueArgument> varargs) {
|
||||
private static <D extends CallableDescriptor> Status put(ResolvedCallImpl<D> candidateCall, ValueParameterDescriptor valueParameterDescriptor, ValueArgument valueArgument, Map<ValueParameterDescriptor, VarargValueArgument> varargs) {
|
||||
Status error = OK;
|
||||
if (valueParameterDescriptor.getVarargElementType() != null) {
|
||||
VarargValueArgument vararg = varargs.get(valueParameterDescriptor);
|
||||
if (vararg == null) {
|
||||
@@ -207,11 +240,13 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET;
|
||||
else {
|
||||
LeafPsiElement spread = valueArgument.getSpreadElement();
|
||||
if (spread != null) {
|
||||
candidateCall.getTrace().report(NON_VARARG_SPREAD.on(spread));
|
||||
candidateCall.getTrace().report(NON_VARARG_SPREAD.on(spread));
|
||||
error = WEAK_ERROR;
|
||||
}
|
||||
ResolvedValueArgument argument = new ExpressionValueArgument(valueArgument);
|
||||
candidateCall.recordValueArgument(valueParameterDescriptor, argument);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,6 +44,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.analyzer.AnalyzeExhaust;
|
||||
import org.jetbrains.jet.codegen.ClassBuilder;
|
||||
import org.jetbrains.jet.codegen.ClassBuilderFactory;
|
||||
import org.jetbrains.jet.codegen.ClassBuilderMode;
|
||||
import org.jetbrains.jet.codegen.CompilationErrorHandler;
|
||||
import org.jetbrains.jet.codegen.GenerationState;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
@@ -141,6 +142,12 @@ public class JetLightClass extends AbstractLightClass implements JetJavaMirrorMa
|
||||
final Stack<StubElement> stubStack = new Stack<StubElement>();
|
||||
|
||||
final ClassBuilderFactory builderFactory = new ClassBuilderFactory() {
|
||||
@NotNull
|
||||
@Override
|
||||
public ClassBuilderMode getClassBuilderMode() {
|
||||
return ClassBuilderMode.SIGNATURES;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassBuilder newClassBuilder() {
|
||||
return new StubClassBuilder(stubStack);
|
||||
|
||||
@@ -107,9 +107,4 @@ public class StubClassBuilder extends ClassBuilder {
|
||||
}
|
||||
super.done();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mode generateCode() {
|
||||
return Mode.SIGNATURES;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
fun main(d : D) {
|
||||
d.from("")
|
||||
d.from(1)
|
||||
}
|
||||
|
||||
class D {
|
||||
fun from(vararg <!UNUSED_PARAMETER!>a<!> : Any){}
|
||||
fun from(vararg <!UNUSED_PARAMETER!>a<!> : String){}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// FILE: kotlin.kt
|
||||
fun main(j : C, s : Array<String?>) {
|
||||
j.from()
|
||||
j.from("")
|
||||
j.from("", "")
|
||||
j.<!OVERLOAD_RESOLUTION_AMBIGUITY!>from("", "", "")<!>
|
||||
|
||||
j.<!OVERLOAD_RESOLUTION_AMBIGUITY!>from("", *s)<!> // This should not be an ambiguity, see KT-1842
|
||||
j.from(*s)
|
||||
}
|
||||
|
||||
// FILE: C.java
|
||||
public class C {
|
||||
void from() {}
|
||||
void from(String s) {}
|
||||
void from(String s, String s1) {}
|
||||
void from(String... s) {}
|
||||
void from(String s1, String... s) {}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// FILE: JavaClass.java
|
||||
public class JavaClass {
|
||||
void from(String s) {}
|
||||
void from(String... s) {}
|
||||
}
|
||||
|
||||
// FILE: kotlin.kt
|
||||
fun main(args : Array<String>) {
|
||||
JavaClass().from()
|
||||
JavaClass().from("")
|
||||
JavaClass().from("", "")
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fun main(d : D) {
|
||||
d.`str`from("")
|
||||
d.`any`from(1)
|
||||
}
|
||||
|
||||
class D {
|
||||
~any~fun from(vararg a : Any){}
|
||||
~str~fun from(vararg a : String){}
|
||||
}
|
||||
@@ -17,8 +17,12 @@
|
||||
package org.jetbrains.jet.codegen;
|
||||
|
||||
import org.jetbrains.jet.CompileCompilerDependenciesTest;
|
||||
import org.jetbrains.jet.compiler.CompileEnvironment;
|
||||
import org.jetbrains.jet.compiler.CompileEnvironmentConfiguration;
|
||||
import org.jetbrains.jet.compiler.CompileEnvironmentUtil;
|
||||
import org.jetbrains.jet.compiler.JetCoreEnvironment;
|
||||
import org.jetbrains.jet.compiler.KotlinToJVMBytecodeCompiler;
|
||||
import org.jetbrains.jet.compiler.messages.MessageCollector;
|
||||
import org.jetbrains.jet.lang.resolve.java.CompilerDependencies;
|
||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
@@ -27,9 +31,11 @@ import java.lang.reflect.Method;
|
||||
public class CompileTextTest extends CodegenTestCase {
|
||||
public void testMe() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
|
||||
String text = "import org.jetbrains.jet.codegen.CompileTextTest; fun x() = CompileTextTest()";
|
||||
CompileEnvironment compileEnvironment = new CompileEnvironment(MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR, CompileCompilerDependenciesTest.compilerDependenciesForTests(CompilerSpecialMode.REGULAR));
|
||||
compileEnvironment.getEnvironment().addToClasspathFromClassLoader(getClass().getClassLoader());
|
||||
ClassLoader classLoader = compileEnvironment.compileText(text);
|
||||
CompilerDependencies dependencies = CompileCompilerDependenciesTest.compilerDependenciesForTests(CompilerSpecialMode.REGULAR);
|
||||
JetCoreEnvironment environment = new JetCoreEnvironment(CompileEnvironmentUtil.createMockDisposable(), dependencies);
|
||||
CompileEnvironmentConfiguration configuration = new CompileEnvironmentConfiguration(environment, dependencies, MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR);
|
||||
configuration.getEnvironment().addToClasspathFromClassLoader(getClass().getClassLoader());
|
||||
ClassLoader classLoader = KotlinToJVMBytecodeCompiler.compileText(configuration, text);
|
||||
Class<?> namespace = classLoader.loadClass("namespace");
|
||||
Method x = namespace.getDeclaredMethod("x");
|
||||
Object invoke = x.invoke(null);
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
package org.jetbrains.jet.codegen;
|
||||
|
||||
import org.jetbrains.jet.codegen.forTestCompile.ForTestCompileRuntime;
|
||||
import org.jetbrains.jet.compiler.CompileEnvironment;
|
||||
import org.jetbrains.jet.lang.psi.JetPsiUtil;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.annotation.*;
|
||||
@@ -28,8 +28,6 @@ import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author alex.tkachman
|
||||
*/
|
||||
|
||||
@@ -23,6 +23,7 @@ import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
import org.jetbrains.jet.CompileCompilerDependenciesTest;
|
||||
import org.jetbrains.jet.codegen.forTestCompile.ForTestCompileRuntime;
|
||||
import org.jetbrains.jet.compiler.CompileEnvironmentConfiguration;
|
||||
import org.jetbrains.jet.compiler.KotlinToJVMBytecodeCompiler;
|
||||
import org.jetbrains.jet.compiler.messages.MessageCollector;
|
||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||
@@ -37,7 +38,6 @@ import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.jet.parsing.JetParsingTest;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.PrintStream;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.net.URL;
|
||||
@@ -75,7 +75,6 @@ public class TestlibTest extends CodegenTestCase {
|
||||
|
||||
private TestSuite doBuildSuite() {
|
||||
try {
|
||||
PrintStream err = System.err;
|
||||
CompilerDependencies compilerDependencies = CompileCompilerDependenciesTest.compilerDependenciesForTests(CompilerSpecialMode.REGULAR);
|
||||
File junitJar = new File("libraries/lib/junit-4.9.jar");
|
||||
|
||||
@@ -92,7 +91,7 @@ public class TestlibTest extends CodegenTestCase {
|
||||
myEnvironment.addSources(localFileSystem.findFileByPath(JetParsingTest.getTestDataDir() + "/../../libraries/kunit/src"));
|
||||
|
||||
GenerationState generationState = KotlinToJVMBytecodeCompiler
|
||||
.analyzeAndGenerate(myEnvironment, compilerDependencies, MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR, false);
|
||||
.analyzeAndGenerate(new CompileEnvironmentConfiguration(myEnvironment, compilerDependencies, MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR), false);
|
||||
|
||||
if (generationState == null) {
|
||||
throw new RuntimeException("There were compilation errors");
|
||||
|
||||
Generated
-1
@@ -1 +0,0 @@
|
||||
confluence
|
||||
Generated
-15
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AntConfiguration">
|
||||
<defaultAnt bundledAnt="true" />
|
||||
<buildFile url="file://$PROJECT_DIR$/buildConfluenceLexer.xml">
|
||||
<additionalClassPath />
|
||||
<antReference projectDefault="true" />
|
||||
<customJdkName value="" />
|
||||
<maximumHeapSize value="128" />
|
||||
<maximumStackSize value="2" />
|
||||
<properties />
|
||||
</buildFile>
|
||||
</component>
|
||||
</project>
|
||||
|
||||
Generated
-24
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<option name="DEFAULT_COMPILER" value="Javac" />
|
||||
<resourceExtensions />
|
||||
<wildcardResourcePatterns>
|
||||
<entry name="?*.properties" />
|
||||
<entry name="?*.xml" />
|
||||
<entry name="?*.gif" />
|
||||
<entry name="?*.png" />
|
||||
<entry name="?*.jpeg" />
|
||||
<entry name="?*.jpg" />
|
||||
<entry name="?*.html" />
|
||||
<entry name="?*.dtd" />
|
||||
<entry name="?*.tld" />
|
||||
<entry name="?*.ftl" />
|
||||
</wildcardResourcePatterns>
|
||||
<annotationProcessing enabled="false" useClasspath="true" />
|
||||
</component>
|
||||
<component name="JavacSettings">
|
||||
<option name="ADDITIONAL_OPTIONS_STRING" value="-target 1.6" />
|
||||
</component>
|
||||
</project>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<component name="CopyrightManager">
|
||||
<settings default="">
|
||||
<module2copyright />
|
||||
</settings>
|
||||
</component>
|
||||
Generated
-5
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
|
||||
</project>
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: aopalliance:aopalliance:1.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/aopalliance/aopalliance/1.0/aopalliance-1.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/aopalliance/aopalliance/1.0/aopalliance-1.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/aopalliance/aopalliance/1.0/aopalliance-1.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: asm:asm:1.5.3">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/asm/asm/1.5.3/asm-1.5.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/asm/asm/1.5.3/asm-1.5.3-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/asm/asm/1.5.3/asm-1.5.3-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: axis:axis:1.2.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/axis/axis/1.2.1/axis-1.2.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/axis/axis/1.2.1/axis-1.2.1-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/axis/axis/1.2.1/axis-1.2.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: axis:axis-jaxrpc:1.2.1-noqname">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/axis/axis-jaxrpc/1.2.1-noqname/axis-jaxrpc-1.2.1-noqname.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/axis/axis-jaxrpc/1.2.1-noqname/axis-jaxrpc-1.2.1-noqname-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/axis/axis-jaxrpc/1.2.1-noqname/axis-jaxrpc-1.2.1-noqname-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: axis:axis-saaj:1.2.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/axis/axis-saaj/1.2.1/axis-saaj-1.2.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/axis/axis-saaj/1.2.1/axis-saaj-1.2.1-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/axis/axis-saaj/1.2.1/axis-saaj-1.2.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: batik:batik-all:1.6">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/batik/batik-all/1.6/batik-all-1.6.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/batik/batik-all/1.6/batik-all-1.6-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/batik/batik-all/1.6/batik-all-1.6-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: biz.aQute:bndlib:0.0.255">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/biz/aQute/bndlib/0.0.255/bndlib-0.0.255.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/biz/aQute/bndlib/0.0.255/bndlib-0.0.255-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/biz/aQute/bndlib/0.0.255/bndlib-0.0.255-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: c3p0:c3p0:0.9.1.2">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/c3p0/c3p0/0.9.1.2/c3p0-0.9.1.2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/c3p0/c3p0/0.9.1.2/c3p0-0.9.1.2-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/c3p0/c3p0/0.9.1.2/c3p0-0.9.1.2-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: cglib:cglib:2.1_3">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/cglib/cglib/2.1_3/cglib-2.1_3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/cglib/cglib/2.1_3/cglib-2.1_3-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/cglib/cglib/2.1_3/cglib-2.1_3-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.applinks:applinks-api:3.3">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/applinks/applinks-api/3.3/applinks-api-3.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/applinks/applinks-api/3.3/applinks-api-3.3-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/applinks/applinks-api/3.3/applinks-api-3.3-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.applinks:applinks-host:3.3">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/applinks/applinks-host/3.3/applinks-host-3.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/applinks/applinks-host/3.3/applinks-host-3.3-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/applinks/applinks-host/3.3/applinks-host-3.3-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.applinks:applinks-spi:3.3">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/applinks/applinks-spi/3.3/applinks-spi-3.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/applinks/applinks-spi/3.3/applinks-spi-3.3-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/applinks/applinks-spi/3.3/applinks-spi-3.3-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.bandana:atlassian-bandana:3.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/bandana/atlassian-bandana/3.1/atlassian-bandana-3.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/bandana/atlassian-bandana/3.1/atlassian-bandana-3.1-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/bandana/atlassian-bandana/3.1/atlassian-bandana-3.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.bonnie:atlassian-bonnie:4.0-beta3">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/bonnie/atlassian-bonnie/4.0-beta3/atlassian-bonnie-4.0-beta3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/bonnie/atlassian-bonnie/4.0-beta3/atlassian-bonnie-4.0-beta3-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/bonnie/atlassian-bonnie/4.0-beta3/atlassian-bonnie-4.0-beta3-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.cache:atlassian-cache-api:0.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/cache/atlassian-cache-api/0.1/atlassian-cache-api-0.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/cache/atlassian-cache-api/0.1/atlassian-cache-api-0.1-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/cache/atlassian-cache-api/0.1/atlassian-cache-api-0.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.cache:atlassian-cache-memory:0.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/cache/atlassian-cache-memory/0.1/atlassian-cache-memory-0.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/cache/atlassian-cache-memory/0.1/atlassian-cache-memory-0.1-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/cache/atlassian-cache-memory/0.1/atlassian-cache-memory-0.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.config:atlassian-config:0.13.2">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/config/atlassian-config/0.13.2/atlassian-config-0.13.2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/config/atlassian-config/0.13.2/atlassian-config-0.13.2-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/config/atlassian-config/0.13.2/atlassian-config-0.13.2-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.confluence:confluence:3.5.2">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/confluence/confluence/3.5.2/confluence-3.5.2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/confluence/confluence/3.5.2/confluence-3.5.2-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/confluence/confluence/3.5.2/confluence-3.5.2-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.confluence:confluence-bucket:3.5.2">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/confluence/confluence-bucket/3.5.2/confluence-bucket-3.5.2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/confluence/confluence-bucket/3.5.2/confluence-bucket-3.5.2-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/confluence/confluence-bucket/3.5.2/confluence-bucket-3.5.2-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.confluence:confluence-upgrade:3.5.2">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/confluence/confluence-upgrade/3.5.2/confluence-upgrade-3.5.2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/confluence/confluence-upgrade/3.5.2/confluence-upgrade-3.5.2-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/confluence/confluence-upgrade/3.5.2/confluence-upgrade-3.5.2-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.confluence.plugin:func-test:2.3">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/confluence/plugin/func-test/2.3/func-test-2.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/confluence/plugin/func-test/2.3/func-test-2.3-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/confluence/plugin/func-test/2.3/func-test-2.3-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.core:atlassian-core:4.5.8">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/core/atlassian-core/4.5.8/atlassian-core-4.5.8.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/core/atlassian-core/4.5.8/atlassian-core-4.5.8-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/core/atlassian-core/4.5.8/atlassian-core-4.5.8-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.crowd:atlassian-embedded-crowd-atlassian-user:1.2.4">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/atlassian-embedded-crowd-atlassian-user/1.2.4/atlassian-embedded-crowd-atlassian-user-1.2.4.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/atlassian-embedded-crowd-atlassian-user/1.2.4/atlassian-embedded-crowd-atlassian-user-1.2.4-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/atlassian-embedded-crowd-atlassian-user/1.2.4/atlassian-embedded-crowd-atlassian-user-1.2.4-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
Generated
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.crowd:atlassian-embedded-crowd-hibernate2:1.2.4">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/atlassian-embedded-crowd-hibernate2/1.2.4/atlassian-embedded-crowd-hibernate2-1.2.4.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/atlassian-embedded-crowd-hibernate2/1.2.4/atlassian-embedded-crowd-hibernate2-1.2.4-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/atlassian-embedded-crowd-hibernate2/1.2.4/atlassian-embedded-crowd-hibernate2-1.2.4-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.crowd:crowd-api:2.2.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-api/2.2.5/crowd-api-2.2.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-api/2.2.5/crowd-api-2.2.5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-api/2.2.5/crowd-api-2.2.5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.crowd:crowd-core:2.2.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-core/2.2.5/crowd-core-2.2.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-core/2.2.5/crowd-core-2.2.5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-core/2.2.5/crowd-core-2.2.5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.crowd:crowd-events:2.2.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-events/2.2.5/crowd-events-2.2.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-events/2.2.5/crowd-events-2.2.5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-events/2.2.5/crowd-events-2.2.5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.crowd:crowd-integration-api:2.2.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-integration-api/2.2.5/crowd-integration-api-2.2.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-integration-api/2.2.5/crowd-integration-api-2.2.5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-integration-api/2.2.5/crowd-integration-api-2.2.5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
Generated
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.crowd:crowd-integration-client-common:2.2.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-integration-client-common/2.2.5/crowd-integration-client-common-2.2.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-integration-client-common/2.2.5/crowd-integration-client-common-2.2.5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-integration-client-common/2.2.5/crowd-integration-client-common-2.2.5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
Generated
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.crowd:crowd-integration-client-rest:2.2.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-integration-client-rest/2.2.5/crowd-integration-client-rest-2.2.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-integration-client-rest/2.2.5/crowd-integration-client-rest-2.2.5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-integration-client-rest/2.2.5/crowd-integration-client-rest-2.2.5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
Generated
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.crowd:crowd-integration-seraph22:2.2.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-integration-seraph22/2.2.5/crowd-integration-seraph22-2.2.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-integration-seraph22/2.2.5/crowd-integration-seraph22-2.2.5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-integration-seraph22/2.2.5/crowd-integration-seraph22-2.2.5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.crowd:crowd-ldap:2.2.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-ldap/2.2.5/crowd-ldap-2.2.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-ldap/2.2.5/crowd-ldap-2.2.5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-ldap/2.2.5/crowd-ldap-2.2.5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.crowd:crowd-password-encoders:2.2.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-password-encoders/2.2.5/crowd-password-encoders-2.2.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-password-encoders/2.2.5/crowd-password-encoders-2.2.5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-password-encoders/2.2.5/crowd-password-encoders-2.2.5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.crowd:crowd-persistence:2.2.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-persistence/2.2.5/crowd-persistence-2.2.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-persistence/2.2.5/crowd-persistence-2.2.5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-persistence/2.2.5/crowd-persistence-2.2.5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.crowd:crowd-remote:2.2.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-remote/2.2.5/crowd-remote-2.2.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-remote/2.2.5/crowd-remote-2.2.5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/crowd-remote/2.2.5/crowd-remote-2.2.5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.crowd:embedded-crowd-api:2.2.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/embedded-crowd-api/2.2.5/embedded-crowd-api-2.2.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/embedded-crowd-api/2.2.5/embedded-crowd-api-2.2.5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/embedded-crowd-api/2.2.5/embedded-crowd-api-2.2.5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.crowd:embedded-crowd-core:2.2.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/embedded-crowd-core/2.2.5/embedded-crowd-core-2.2.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/embedded-crowd-core/2.2.5/embedded-crowd-core-2.2.5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/embedded-crowd-core/2.2.5/embedded-crowd-core-2.2.5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.crowd:embedded-crowd-spi:2.2.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/embedded-crowd-spi/2.2.5/embedded-crowd-spi-2.2.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/embedded-crowd-spi/2.2.5/embedded-crowd-spi-2.2.5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/crowd/embedded-crowd-spi/2.2.5/embedded-crowd-spi-2.2.5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.event:atlassian-event:2.0.6">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/event/atlassian-event/2.0.6/atlassian-event-2.0.6.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/event/atlassian-event/2.0.6/atlassian-event-2.0.6-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/event/atlassian-event/2.0.6/atlassian-event-2.0.6-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.extras:atlassian-extras:2.4">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/extras/atlassian-extras/2.4/atlassian-extras-2.4.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/extras/atlassian-extras/2.4/atlassian-extras-2.4-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/extras/atlassian-extras/2.4/atlassian-extras-2.4-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.gzipfilter:atlassian-gzipfilter:1.9">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/gzipfilter/atlassian-gzipfilter/1.9/atlassian-gzipfilter-1.9.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/gzipfilter/atlassian-gzipfilter/1.9/atlassian-gzipfilter-1.9-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/gzipfilter/atlassian-gzipfilter/1.9/atlassian-gzipfilter-1.9-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
Generated
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.jdk.utilities:atlassian-jdk-utilities:0.4">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/jdk/utilities/atlassian-jdk-utilities/0.4/atlassian-jdk-utilities-0.4.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/jdk/utilities/atlassian-jdk-utilities/0.4/atlassian-jdk-utilities-0.4-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/jdk/utilities/atlassian-jdk-utilities/0.4/atlassian-jdk-utilities-0.4-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.johnson:atlassian-johnson:0.10">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/johnson/atlassian-johnson/0.10/atlassian-johnson-0.10.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/johnson/atlassian-johnson/0.10/atlassian-johnson-0.10-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/johnson/atlassian-johnson/0.10/atlassian-johnson-0.10-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.mail:atlassian-mail:1.16">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/mail/atlassian-mail/1.16/atlassian-mail-1.16.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/mail/atlassian-mail/1.16/atlassian-mail-1.16-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/mail/atlassian-mail/1.16/atlassian-mail-1.16-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.modzdetector:modz-detector:0.8">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/modzdetector/modz-detector/0.8/modz-detector-0.8.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/modzdetector/modz-detector/0.8/modz-detector-0.8-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/modzdetector/modz-detector/0.8/modz-detector-0.8-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.multitenant:multitenant-core:1.0-m14">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/multitenant/multitenant-core/1.0-m14/multitenant-core-1.0-m14.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/multitenant/multitenant-core/1.0-m14/multitenant-core-1.0-m14-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/multitenant/multitenant-core/1.0-m14/multitenant-core-1.0-m14-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.paddle:atlassian-paddle:5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/paddle/atlassian-paddle/5/atlassian-paddle-5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/paddle/atlassian-paddle/5/atlassian-paddle-5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/paddle/atlassian-paddle/5/atlassian-paddle-5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.plugins:atlassian-plugins-core:2.7.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/plugins/atlassian-plugins-core/2.7.5/atlassian-plugins-core-2.7.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/plugins/atlassian-plugins-core/2.7.5/atlassian-plugins-core-2.7.5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/plugins/atlassian-plugins-core/2.7.5/atlassian-plugins-core-2.7.5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.plugins:atlassian-plugins-osgi:2.7.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/plugins/atlassian-plugins-osgi/2.7.5/atlassian-plugins-osgi-2.7.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/plugins/atlassian-plugins-osgi/2.7.5/atlassian-plugins-osgi-2.7.5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/plugins/atlassian-plugins-osgi/2.7.5/atlassian-plugins-osgi-2.7.5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
Generated
-13
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.atlassian.plugins:atlassian-plugins-osgi-events:2.7.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/plugins/atlassian-plugins-osgi-events/2.7.5/atlassian-plugins-osgi-events-2.7.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/plugins/atlassian-plugins-osgi-events/2.7.5/atlassian-plugins-osgi-events-2.7.5-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/atlassian/plugins/atlassian-plugins-osgi-events/2.7.5/atlassian-plugins-osgi-events-2.7.5-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user