Move JVM-specific annotations out of built-ins

Move 'volatile' and 'synchronized' to package 'kotlin' in stdlib. Also delete
'atomic', since its support was never implemented
This commit is contained in:
Alexander Udalov
2014-02-07 19:47:04 +04:00
parent b2d074c5cc
commit b68e47f705
15 changed files with 31 additions and 52 deletions
@@ -32,7 +32,7 @@ public abstract class AbstractBytecodeTextTest extends CodegenTestCase {
private static final Pattern EXPECTED_OCCURRENCES_PATTERN = Pattern.compile("^\\s*//\\s*(\\d+)\\s*(.*)$");
public void doTest(@NotNull String filename) throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.ALL);
loadFileByFullPath(filename);
List<OccurrenceInfo> expected = readExpectedOccurrences(filename);
countAndCompareActualOccurrences(expected);
@@ -24,9 +24,7 @@ import org.jetbrains.jet.lang.psi.JetPsiUtil;
import org.jetbrains.jet.lang.resolve.java.PackageClassUtils;
import java.lang.annotation.*;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.*;
public class AnnotationGenTest extends CodegenTestCase {
@@ -49,6 +47,13 @@ public class AnnotationGenTest extends CodegenTestCase {
return loader.loadClass(PackageCodegen.getPackagePartInternalName(myFiles.getPsiFile()));
}
public void testVolatileProperty() throws Exception {
loadText("abstract class Foo { public volatile var x: String = \"\"; }");
Class<?> aClass = generateClass("Foo");
Field x = aClass.getDeclaredField("x");
assertTrue((x.getModifiers() & Modifier.VOLATILE) != 0);
}
public void testPropField() throws Exception {
ClassLoader loader = loadFileGetClassLoader("[Deprecated] var x = 0");
Class<?> packageClass = getPackageClass(loader);
@@ -159,13 +159,6 @@ public class PropertyGenTest extends CodegenTestCase {
assertNotNull(aClass.getMethod("getX"));
}
public void testVolatileProperty() throws Exception {
loadText("abstract class Foo { public volatile var x: String = \"\"; }");
Class aClass = generateClass("Foo");
Field x = aClass.getDeclaredField("x");
assertTrue((x.getModifiers() & Modifier.VOLATILE) != 0);
}
public void testKt160() throws Exception {
loadText("internal val s = java.lang.Double.toString(1.0)");
Method method = generateFunction("getS");