Explicitly enumerating the classes we want to compile against javac
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Sat, 28 Sep 2013 20:54:50 +0200
branchjavac
changeset 13235d2341f16b4f
parent 1322 1bf52dbf783e
child 1328 1d1d70f6828b
Explicitly enumerating the classes we want to compile against
rt/emul/mini/pom.xml
rt/emul/mini/src/main/java/java/lang/String.java
     1.1 --- a/rt/emul/mini/pom.xml	Sat Sep 28 13:08:41 2013 +0200
     1.2 +++ b/rt/emul/mini/pom.xml	Sat Sep 28 20:54:50 2013 +0200
     1.3 @@ -31,19 +31,49 @@
     1.4    <build>
     1.5        <plugins>
     1.6            <plugin>
     1.7 +              <artifactId>maven-antrun-plugin</artifactId>
     1.8 +              <version>1.7</version>
     1.9 +              <executions>
    1.10 +                  <execution>
    1.11 +                      <phase>generate-sources</phase>
    1.12 +                      <configuration>
    1.13 +                          <target>
    1.14 +                              <mkdir dir="${project.build.directory}/bootcp"/>
    1.15 +                              <copy todir="${project.build.directory}/bootcp">
    1.16 +                                  <resources>
    1.17 +                                      <!-- copy all resources that are in
    1.18 +                                        compact profile, but are referenced from
    1.19 +                                        the mini profile
    1.20 +                                      -->
    1.21 +                                      <javaresource name="java/net/URI.class"/>
    1.22 +                                      <javaresource name="java/net/URISyntaxException.class"/>
    1.23 +                                      <javaresource name="java/util/Locale.class"/>
    1.24 +                                      <javaresource name="java/io/OutputStream.class"/>
    1.25 +                                      <javaresource name="java/io/FilterOutputStream.class"/>
    1.26 +                                      <javaresource name="java/io/PrintStream.class"/>
    1.27 +                                      <javaresource name="java/io/PrintWriter.class"/>
    1.28 +                                      <javaresource name="java/io/Writer.class"/>
    1.29 +                                  </resources>
    1.30 +                              </copy>
    1.31 +                          </target>
    1.32 +                      </configuration>
    1.33 +                      <goals>
    1.34 +                          <goal>run</goal>
    1.35 +                      </goals>
    1.36 +                  </execution>
    1.37 +              </executions>
    1.38 +          </plugin>
    1.39 +          <plugin>
    1.40                <groupId>org.apache.maven.plugins</groupId>
    1.41                <artifactId>maven-compiler-plugin</artifactId>
    1.42                <version>2.5.1</version>
    1.43                <configuration>
    1.44 -                  <!-- XXX: Need because Throwable references PrintWriter, but
    1.45 -                     dangerous! We could easy compile against APIs that don't
    1.46 -                     exist. Should be replaced by ahead of compilation copying
    1.47 -                     of files that should really be visible on the classpath...
    1.48 -                     
    1.49                    <compilerArguments>
    1.50 -                      <bootclasspath>netbeans.ignore.jdk.bootsclasspath</bootclasspath>
    1.51 +                      <!--
    1.52 +                        <bootclasspath>netbeans.ignore.jdk.bootsclasspath</bootclasspath>
    1.53 +                      -->
    1.54 +                      <bootclasspath>${project.build.directory}/bootcp/</bootclasspath>
    1.55                    </compilerArguments>
    1.56 -                  -->
    1.57                   <source>1.7</source>
    1.58                   <target>1.7</target>
    1.59                </configuration>
     2.1 --- a/rt/emul/mini/src/main/java/java/lang/String.java	Sat Sep 28 13:08:41 2013 +0200
     2.2 +++ b/rt/emul/mini/src/main/java/java/lang/String.java	Sat Sep 28 20:54:50 2013 +0200
     2.3 @@ -28,7 +28,6 @@
     2.4  import java.io.UnsupportedEncodingException;
     2.5  import java.util.Comparator;
     2.6  import java.util.Locale;
     2.7 -import java.util.Objects;
     2.8  import org.apidesign.bck2brwsr.core.ExtraJavaScript;
     2.9  import org.apidesign.bck2brwsr.core.JavaScriptBody;
    2.10  import org.apidesign.bck2brwsr.core.JavaScriptOnly;
    2.11 @@ -2898,7 +2897,8 @@
    2.12      public static String format(Locale l, String format, Object ... args) {
    2.13          String p = format;
    2.14          for (int i = 0; i < args.length; i++) {
    2.15 -            p = p.replaceFirst("%s", Objects.toString(args[i]));
    2.16 +            String v = args[i] == null ? "null" : args[i].toString();
    2.17 +            p = p.replaceFirst("%s", v);
    2.18          }
    2.19          return p;
    2.20          // return new Formatter(l).format(format, args).toString();