Permalink
Browse files

We require now Java 7; removed traces of Java 6 compatibility

  • Loading branch information...
1 parent 7ee147e commit da26fa99cdd4e981ab2dfceb096de60f1c06f7f8 @orfjackal committed Dec 25, 2012
View
@@ -10,13 +10,13 @@
<directory url="file://$PROJECT_DIR$/dimdwarf-aop/target/generated-test-sources/test-annotations" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/dimdwarf-api/target/generated-test-sources/test-annotations" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/dimdwarf-core/target/generated-test-sources/test-annotations" includeSubdirectories="true" />
- <directory url="file://$PROJECT_DIR$/dimdwarf-api-internal/target/generated-sources/annotations" includeSubdirectories="true" />
- <directory url="file://$PROJECT_DIR$/test-utils/target/generated-sources/annotations" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/dimdwarf-core/target/generated-sources/annotations" includeSubdirectories="true" />
- <directory url="file://$PROJECT_DIR$/dist/launcher/target/generated-sources/annotations" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/dimdwarf-aop/target/generated-sources/annotations" includeSubdirectories="true" />
- <directory url="file://$PROJECT_DIR$/end-to-end-tests/target/generated-sources/annotations" includeSubdirectories="true" />
+ <directory url="file://$PROJECT_DIR$/test-utils/target/generated-sources/annotations" includeSubdirectories="true" />
+ <directory url="file://$PROJECT_DIR$/dist/launcher/target/generated-sources/annotations" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/dimdwarf-api/target/generated-sources/annotations" includeSubdirectories="true" />
+ <directory url="file://$PROJECT_DIR$/dimdwarf-api-internal/target/generated-sources/annotations" includeSubdirectories="true" />
+ <directory url="file://$PROJECT_DIR$/end-to-end-tests/target/generated-sources/annotations" includeSubdirectories="true" />
</excludeFromCompile>
<resourceExtensions>
<entry name=".+\.(properties|xml|html|dtd|tld)" />
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ScalaProjectSettings">
+ <option name="importsWithPrefix">
+ <array>
+ <option value="exclude:scala.collection.mutable.ArrayBuffer" />
+ <option value="exclude:scala.collection.mutable.ListBuffer" />
+ <option value="java.util.AbstractCollection" />
+ <option value="java.util.AbstractList" />
+ <option value="java.util.AbstractMap" />
+ <option value="java.util.AbstractQueue" />
+ <option value="java.util.AbstractSequentialList" />
+ <option value="java.util.AbstractSet" />
+ <option value="java.util.ArrayDeque" />
+ <option value="java.util.ArrayList" />
+ <option value="java.util.Arrays" />
+ <option value="java.util.BitSet" />
+ <option value="java.util.Collection" />
+ <option value="java.util.Deque" />
+ <option value="java.util.EnumMap" />
+ <option value="java.util.EnumSet" />
+ <option value="java.util.Enumeration" />
+ <option value="java.util.Hahtable" />
+ <option value="java.util.HashMap" />
+ <option value="java.util.HashSet" />
+ <option value="java.util.IdentityHashMap" />
+ <option value="java.util.Iterator" />
+ <option value="java.util.LikedHashSet" />
+ <option value="java.util.LinkedHashMap" />
+ <option value="java.util.LinkedList" />
+ <option value="java.util.List" />
+ <option value="java.util.ListIterator" />
+ <option value="java.util.Map" />
+ <option value="java.util.NavigableMap" />
+ <option value="java.util.NavigableSet" />
+ <option value="java.util.Queue" />
+ <option value="java.util.Set" />
+ <option value="java.util.SortedMap" />
+ <option value="java.util.SortedSet" />
+ <option value="java.util.Stack" />
+ <option value="java.util.SubList" />
+ <option value="java.util.TreeMap" />
+ <option value="java.util.TreeSet" />
+ <option value="java.util.Vector" />
+ <option value="java.util.WeakHashMap" />
+ <option value="org.scalatest.fixture._" />
+ <option value="org.scalatest.path._" />
+ <option value="scala.collection.mutable._" />
+ </array>
+ </option>
+ </component>
+</project>
+
View
@@ -1,7 +1,7 @@
Requirements:
Maven 2 (http://maven.apache.org/)
- Java SE 6 JDK (http://java.sun.com/javase/downloads/index.jsp)
+ Java SE 7 JDK (http://www.oracle.com/technetwork/java/javase/downloads/index.html)
Run all unit tests:
@@ -6,6 +6,7 @@
<option name="compilerLibraryLevel" value="Project" />
<option name="compilerLibraryName" value="Maven: org.scala-lang:scala-compiler-bundle:2.9.1" />
<option name="fsc" value="true" />
+ <option name="languageLevel" value="Scala 2.9" />
<option name="vmOptions" value="" />
</configuration>
</facet>
@@ -1,40 +0,0 @@
-// Copyright © 2008-2010 Esko Luontola <www.orfjackal.net>
-// This software is released under the Apache License 2.0.
-// The license text is at http://dimdwarf.sourceforge.net/LICENSE
-
-package net.orfjackal.dimdwarf.server;
-
-import java.net.URLClassLoader;
-
-public class JRE {
-
- public static boolean isJava7() {
- try {
- URLClassLoader.class.getMethod("close");
- return true;
- } catch (NoSuchMethodException e) {
- return false;
- }
- }
-
- /**
- * URLClassLoader locks any JARs from which it loads resources, which
- * will prevent removing the JAR file until the ClassLoader is garbage collected.
- * The {@link java.net.URLClassLoader#close()} method was added in Java 7 to
- * solve this problem.
- * <p/>
- * Related issues and some workarounds:
- * http://bugs.sun.com/view_bug.do?bug_id=4950148
- * http://bugs.sun.com/view_bug.do?bug_id=4167874
- * http://download.oracle.com/javase/7/docs/technotes/guides/net/ClassLoader.html
- *
- * @see java.net.URLClassLoader#close()
- */
- public static void closeClassLoader(URLClassLoader cl) {
- try {
- URLClassLoader.class.getMethod("close").invoke(cl);
- } catch (Exception e) {
- throw new RuntimeException("Cannot invoke URLClassLoader.close()", e);
- }
- }
-}
@@ -30,13 +30,13 @@ class ApplicationLoadingSpec extends ScalaSpecsy {
writeJarToLibDir("sample.jar", Map("file-in-jar.txt" -> "file content 2"))
val loader = new ApplicationLoader(applicationDir)
- defer {worksOnlyOnJava7 {JRE.closeClassLoader(loader.getClassLoader)}}
+ defer {loader.getClassLoader.close()}
"Adds to classpath the /classes directory" >> {
val content = readContent("file-in-classes-dir.txt", loader.getClassLoader)
assertThat(content, is("file content 1"))
}
- "Adds to classpath all JARs in the /lib directory" >> worksOnlyOnJava7 {
+ "Adds to classpath all JARs in the /lib directory" >> {
val content = readContent("file-in-jar.txt", loader.getClassLoader)
assertThat(content, is("file content 2"))
}
@@ -140,14 +140,6 @@ class ApplicationLoadingSpec extends ScalaSpecsy {
}
}
}
-
- // other utility methods
-
- private def worksOnlyOnJava7(closure: => Unit) {
- if (JRE.isJava7) {
- closure
- }
- }
}
class MyApp extends AbstractModule {
@@ -6,6 +6,7 @@
<option name="compilerLibraryLevel" value="Project" />
<option name="compilerLibraryName" value="Maven: org.scala-lang:scala-compiler-bundle:2.9.1" />
<option name="fsc" value="true" />
+ <option name="languageLevel" value="Scala 2.9" />
<option name="vmOptions" value="" />
</configuration>
</facet>
View
@@ -3,7 +3,7 @@
<component name="FacetManager">
<facet type="JRUBY" name="JRuby">
<configuration>
- <JRUBY_FACET_CONFIG_ID NAME="JRUBY_SDK_NAME" VALUE="" />
+ <JRUBY_FACET_CONFIG_ID NAME="JRUBY_SDK_NAME" VALUE="jruby-1.6.7.2-p312" />
<LOAD_PATH number="0" />
<I18N_FOLDERS number="0" />
</configuration>
@@ -17,7 +17,7 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" scope="PROVIDED" name="jruby-1.6.2-p330 facet library" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="jruby-1.6.7.2-p312 facet library" level="application" />
</component>
</module>

0 comments on commit da26fa9

Please sign in to comment.