Fixed static calculator full obfuscation after introduction o Exported annotation
1.1 --- a/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/PageProcessor.java Fri Apr 12 18:48:48 2013 +0200
1.2 +++ b/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/PageProcessor.java Mon Apr 15 15:30:53 2013 +0200
1.3 @@ -192,6 +192,7 @@
1.4 w.append("package " + pkg + ";\n");
1.5 w.append("import org.apidesign.bck2brwsr.htmlpage.api.*;\n");
1.6 w.append("import org.apidesign.bck2brwsr.htmlpage.KOList;\n");
1.7 + w.append("import org.apidesign.bck2brwsr.core.Exported;\n");
1.8 w.append("import org.apidesign.bck2brwsr.core.JavaScriptOnly;\n");
1.9 w.append("final class ").append(className).append(" implements Cloneable {\n");
1.10 w.append(" private boolean locked;\n");
1.11 @@ -343,6 +344,7 @@
1.12 w.append("package " + pkg + ";\n");
1.13 w.append("import org.apidesign.bck2brwsr.htmlpage.api.*;\n");
1.14 w.append("import org.apidesign.bck2brwsr.htmlpage.KOList;\n");
1.15 + w.append("import org.apidesign.bck2brwsr.core.Exported;\n");
1.16 w.append("final class ").append(className).append(" {\n");
1.17 w.append(" private boolean locked;\n");
1.18 if (!initializeOnClick(className, (TypeElement) e, w, pp)) {
1.19 @@ -553,7 +555,8 @@
1.20 w.write("}})");
1.21 }
1.22 w.write(";\n");
1.23 -
1.24 +
1.25 + w.write("@Exported\n");
1.26 w.write("public java.util.List<" + tn + "> " + gs[0] + "() {\n");
1.27 w.write(" if (locked) throw new IllegalStateException();\n");
1.28 w.write(" prop_" + p.name() + ".assign(ko);\n");
1.29 @@ -561,10 +564,12 @@
1.30 w.write("}\n");
1.31 } else {
1.32 w.write("private " + tn + " prop_" + p.name() + ";\n");
1.33 + w.write("@Exported\n");
1.34 w.write("public " + tn + " " + gs[0] + "() {\n");
1.35 w.write(" if (locked) throw new IllegalStateException();\n");
1.36 w.write(" return prop_" + p.name() + ";\n");
1.37 w.write("}\n");
1.38 + w.write("@Exported\n");
1.39 w.write("public void " + gs[1] + "(" + tn + " v) {\n");
1.40 w.write(" if (locked) throw new IllegalStateException();\n");
1.41 w.write(" prop_" + p.name() + " = v;\n");
1.42 @@ -619,7 +624,8 @@
1.43
1.44 final String sn = ee.getSimpleName().toString();
1.45 String[] gs = toGetSet(sn, tn, array);
1.46 -
1.47 +
1.48 + w.write("@Exported\n");
1.49 w.write("public " + tn + " " + gs[0] + "() {\n");
1.50 w.write(" if (locked) throw new IllegalStateException();\n");
1.51 int arg = 0;
1.52 @@ -795,6 +801,7 @@
1.53 return false;
1.54 }
1.55 String n = e.getSimpleName().toString();
1.56 + body.append("@Exported\n");
1.57 body.append("private void ").append(n).append("(Object data, Object ev) {\n");
1.58 body.append(" ").append(clazz.getSimpleName()).append(".").append(n).append("(");
1.59 body.append(wrapParams(e, null, className, "ev", "data"));
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/javaquery/demo-calculator/src/main/java/org/apidesign/bck2brwsr/demo/calc/staticcompilation/package-info.java Mon Apr 15 15:30:53 2013 +0200
2.3 @@ -0,0 +1,21 @@
2.4 +/**
2.5 + * Back 2 Browser Bytecode Translator
2.6 + * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
2.7 + *
2.8 + * This program is free software: you can redistribute it and/or modify
2.9 + * it under the terms of the GNU General Public License as published by
2.10 + * the Free Software Foundation, version 2 of the License.
2.11 + *
2.12 + * This program is distributed in the hope that it will be useful,
2.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.15 + * GNU General Public License for more details.
2.16 + *
2.17 + * You should have received a copy of the GNU General Public License
2.18 + * along with this program. Look for COPYING file in the top folder.
2.19 + * If not, see http://opensource.org/licenses/GPL-2.0.
2.20 + */
2.21 +@Exported
2.22 +package org.apidesign.bck2brwsr.demo.calc.staticcompilation;
2.23 +
2.24 +import org.apidesign.bck2brwsr.core.Exported;
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/rt/emul/mini/src/main/java/java/io/package-info.java Mon Apr 15 15:30:53 2013 +0200
3.3 @@ -0,0 +1,21 @@
3.4 +/**
3.5 + * Back 2 Browser Bytecode Translator
3.6 + * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
3.7 + *
3.8 + * This program is free software: you can redistribute it and/or modify
3.9 + * it under the terms of the GNU General Public License as published by
3.10 + * the Free Software Foundation, version 2 of the License.
3.11 + *
3.12 + * This program is distributed in the hope that it will be useful,
3.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3.15 + * GNU General Public License for more details.
3.16 + *
3.17 + * You should have received a copy of the GNU General Public License
3.18 + * along with this program. Look for COPYING file in the top folder.
3.19 + * If not, see http://opensource.org/licenses/GPL-2.0.
3.20 + */
3.21 +@Exported
3.22 +package java.io;
3.23 +
3.24 +import org.apidesign.bck2brwsr.core.Exported;
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/rt/emul/mini/src/main/java/java/lang/UnsupportedOperationException.java Mon Apr 15 15:30:53 2013 +0200
4.3 @@ -0,0 +1,94 @@
4.4 +/*
4.5 + * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
4.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4.7 + *
4.8 + * This code is free software; you can redistribute it and/or modify it
4.9 + * under the terms of the GNU General Public License version 2 only, as
4.10 + * published by the Free Software Foundation. Oracle designates this
4.11 + * particular file as subject to the "Classpath" exception as provided
4.12 + * by Oracle in the LICENSE file that accompanied this code.
4.13 + *
4.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
4.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4.17 + * version 2 for more details (a copy is included in the LICENSE file that
4.18 + * accompanied this code).
4.19 + *
4.20 + * You should have received a copy of the GNU General Public License version
4.21 + * 2 along with this work; if not, write to the Free Software Foundation,
4.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4.23 + *
4.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4.25 + * or visit www.oracle.com if you need additional information or have any
4.26 + * questions.
4.27 + */
4.28 +
4.29 +package java.lang;
4.30 +
4.31 +/**
4.32 + * Thrown to indicate that the requested operation is not supported.<p>
4.33 + *
4.34 + * This class is a member of the
4.35 + * <a href="{@docRoot}/../technotes/guides/collections/index.html">
4.36 + * Java Collections Framework</a>.
4.37 + *
4.38 + * @author Josh Bloch
4.39 + * @since 1.2
4.40 + */
4.41 +public class UnsupportedOperationException extends RuntimeException {
4.42 + /**
4.43 + * Constructs an UnsupportedOperationException with no detail message.
4.44 + */
4.45 + public UnsupportedOperationException() {
4.46 + }
4.47 +
4.48 + /**
4.49 + * Constructs an UnsupportedOperationException with the specified
4.50 + * detail message.
4.51 + *
4.52 + * @param message the detail message
4.53 + */
4.54 + public UnsupportedOperationException(String message) {
4.55 + super(message);
4.56 + }
4.57 +
4.58 + /**
4.59 + * Constructs a new exception with the specified detail message and
4.60 + * cause.
4.61 + *
4.62 + * <p>Note that the detail message associated with <code>cause</code> is
4.63 + * <i>not</i> automatically incorporated in this exception's detail
4.64 + * message.
4.65 + *
4.66 + * @param message the detail message (which is saved for later retrieval
4.67 + * by the {@link Throwable#getMessage()} method).
4.68 + * @param cause the cause (which is saved for later retrieval by the
4.69 + * {@link Throwable#getCause()} method). (A <tt>null</tt> value
4.70 + * is permitted, and indicates that the cause is nonexistent or
4.71 + * unknown.)
4.72 + * @since 1.5
4.73 + */
4.74 + public UnsupportedOperationException(String message, Throwable cause) {
4.75 + super(message, cause);
4.76 + }
4.77 +
4.78 + /**
4.79 + * Constructs a new exception with the specified cause and a detail
4.80 + * message of <tt>(cause==null ? null : cause.toString())</tt> (which
4.81 + * typically contains the class and detail message of <tt>cause</tt>).
4.82 + * This constructor is useful for exceptions that are little more than
4.83 + * wrappers for other throwables (for example, {@link
4.84 + * java.security.PrivilegedActionException}).
4.85 + *
4.86 + * @param cause the cause (which is saved for later retrieval by the
4.87 + * {@link Throwable#getCause()} method). (A <tt>null</tt> value is
4.88 + * permitted, and indicates that the cause is nonexistent or
4.89 + * unknown.)
4.90 + * @since 1.5
4.91 + */
4.92 + public UnsupportedOperationException(Throwable cause) {
4.93 + super(cause);
4.94 + }
4.95 +
4.96 + static final long serialVersionUID = -1242599979055084673L;
4.97 +}
5.1 --- a/rt/emul/mini/src/main/java/java/lang/annotation/UnsupportedOperationException.java Fri Apr 12 18:48:48 2013 +0200
5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
5.3 @@ -1,94 +0,0 @@
5.4 -/*
5.5 - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
5.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5.7 - *
5.8 - * This code is free software; you can redistribute it and/or modify it
5.9 - * under the terms of the GNU General Public License version 2 only, as
5.10 - * published by the Free Software Foundation. Oracle designates this
5.11 - * particular file as subject to the "Classpath" exception as provided
5.12 - * by Oracle in the LICENSE file that accompanied this code.
5.13 - *
5.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
5.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5.17 - * version 2 for more details (a copy is included in the LICENSE file that
5.18 - * accompanied this code).
5.19 - *
5.20 - * You should have received a copy of the GNU General Public License version
5.21 - * 2 along with this work; if not, write to the Free Software Foundation,
5.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5.23 - *
5.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5.25 - * or visit www.oracle.com if you need additional information or have any
5.26 - * questions.
5.27 - */
5.28 -
5.29 -package java.lang;
5.30 -
5.31 -/**
5.32 - * Thrown to indicate that the requested operation is not supported.<p>
5.33 - *
5.34 - * This class is a member of the
5.35 - * <a href="{@docRoot}/../technotes/guides/collections/index.html">
5.36 - * Java Collections Framework</a>.
5.37 - *
5.38 - * @author Josh Bloch
5.39 - * @since 1.2
5.40 - */
5.41 -public class UnsupportedOperationException extends RuntimeException {
5.42 - /**
5.43 - * Constructs an UnsupportedOperationException with no detail message.
5.44 - */
5.45 - public UnsupportedOperationException() {
5.46 - }
5.47 -
5.48 - /**
5.49 - * Constructs an UnsupportedOperationException with the specified
5.50 - * detail message.
5.51 - *
5.52 - * @param message the detail message
5.53 - */
5.54 - public UnsupportedOperationException(String message) {
5.55 - super(message);
5.56 - }
5.57 -
5.58 - /**
5.59 - * Constructs a new exception with the specified detail message and
5.60 - * cause.
5.61 - *
5.62 - * <p>Note that the detail message associated with <code>cause</code> is
5.63 - * <i>not</i> automatically incorporated in this exception's detail
5.64 - * message.
5.65 - *
5.66 - * @param message the detail message (which is saved for later retrieval
5.67 - * by the {@link Throwable#getMessage()} method).
5.68 - * @param cause the cause (which is saved for later retrieval by the
5.69 - * {@link Throwable#getCause()} method). (A <tt>null</tt> value
5.70 - * is permitted, and indicates that the cause is nonexistent or
5.71 - * unknown.)
5.72 - * @since 1.5
5.73 - */
5.74 - public UnsupportedOperationException(String message, Throwable cause) {
5.75 - super(message, cause);
5.76 - }
5.77 -
5.78 - /**
5.79 - * Constructs a new exception with the specified cause and a detail
5.80 - * message of <tt>(cause==null ? null : cause.toString())</tt> (which
5.81 - * typically contains the class and detail message of <tt>cause</tt>).
5.82 - * This constructor is useful for exceptions that are little more than
5.83 - * wrappers for other throwables (for example, {@link
5.84 - * java.security.PrivilegedActionException}).
5.85 - *
5.86 - * @param cause the cause (which is saved for later retrieval by the
5.87 - * {@link Throwable#getCause()} method). (A <tt>null</tt> value is
5.88 - * permitted, and indicates that the cause is nonexistent or
5.89 - * unknown.)
5.90 - * @since 1.5
5.91 - */
5.92 - public UnsupportedOperationException(Throwable cause) {
5.93 - super(cause);
5.94 - }
5.95 -
5.96 - static final long serialVersionUID = -1242599979055084673L;
5.97 -}
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/rt/emul/mini/src/main/java/java/lang/annotation/package-info.java Mon Apr 15 15:30:53 2013 +0200
6.3 @@ -0,0 +1,21 @@
6.4 +/**
6.5 + * Back 2 Browser Bytecode Translator
6.6 + * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
6.7 + *
6.8 + * This program is free software: you can redistribute it and/or modify
6.9 + * it under the terms of the GNU General Public License as published by
6.10 + * the Free Software Foundation, version 2 of the License.
6.11 + *
6.12 + * This program is distributed in the hope that it will be useful,
6.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
6.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6.15 + * GNU General Public License for more details.
6.16 + *
6.17 + * You should have received a copy of the GNU General Public License
6.18 + * along with this program. Look for COPYING file in the top folder.
6.19 + * If not, see http://opensource.org/licenses/GPL-2.0.
6.20 + */
6.21 +@Exported
6.22 +package java.lang.annotation;
6.23 +
6.24 +import org.apidesign.bck2brwsr.core.Exported;
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/rt/emul/mini/src/main/java/java/lang/package-info.java Mon Apr 15 15:30:53 2013 +0200
7.3 @@ -0,0 +1,21 @@
7.4 +/**
7.5 + * Back 2 Browser Bytecode Translator
7.6 + * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
7.7 + *
7.8 + * This program is free software: you can redistribute it and/or modify
7.9 + * it under the terms of the GNU General Public License as published by
7.10 + * the Free Software Foundation, version 2 of the License.
7.11 + *
7.12 + * This program is distributed in the hope that it will be useful,
7.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
7.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7.15 + * GNU General Public License for more details.
7.16 + *
7.17 + * You should have received a copy of the GNU General Public License
7.18 + * along with this program. Look for COPYING file in the top folder.
7.19 + * If not, see http://opensource.org/licenses/GPL-2.0.
7.20 + */
7.21 +@Exported
7.22 +package java.lang;
7.23 +
7.24 +import org.apidesign.bck2brwsr.core.Exported;
8.1 --- a/rt/emul/mini/src/main/java/java/lang/reflect/package-info.java Fri Apr 12 18:48:48 2013 +0200
8.2 +++ b/rt/emul/mini/src/main/java/java/lang/reflect/package-info.java Mon Apr 15 15:30:53 2013 +0200
8.3 @@ -46,4 +46,7 @@
8.4 *
8.5 * @since JDK1.1
8.6 */
8.7 +@Exported
8.8 package java.lang.reflect;
8.9 +
8.10 +import org.apidesign.bck2brwsr.core.Exported;
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/rt/emul/mini/src/main/java/java/net/package-info.java Mon Apr 15 15:30:53 2013 +0200
9.3 @@ -0,0 +1,21 @@
9.4 +/**
9.5 + * Back 2 Browser Bytecode Translator
9.6 + * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
9.7 + *
9.8 + * This program is free software: you can redistribute it and/or modify
9.9 + * it under the terms of the GNU General Public License as published by
9.10 + * the Free Software Foundation, version 2 of the License.
9.11 + *
9.12 + * This program is distributed in the hope that it will be useful,
9.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
9.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9.15 + * GNU General Public License for more details.
9.16 + *
9.17 + * You should have received a copy of the GNU General Public License
9.18 + * along with this program. Look for COPYING file in the top folder.
9.19 + * If not, see http://opensource.org/licenses/GPL-2.0.
9.20 + */
9.21 +@Exported
9.22 +package java.net;
9.23 +
9.24 +import org.apidesign.bck2brwsr.core.Exported;
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/rt/emul/mini/src/main/java/java/util/package-info.java Mon Apr 15 15:30:53 2013 +0200
10.3 @@ -0,0 +1,21 @@
10.4 +/**
10.5 + * Back 2 Browser Bytecode Translator
10.6 + * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
10.7 + *
10.8 + * This program is free software: you can redistribute it and/or modify
10.9 + * it under the terms of the GNU General Public License as published by
10.10 + * the Free Software Foundation, version 2 of the License.
10.11 + *
10.12 + * This program is distributed in the hope that it will be useful,
10.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
10.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10.15 + * GNU General Public License for more details.
10.16 + *
10.17 + * You should have received a copy of the GNU General Public License
10.18 + * along with this program. Look for COPYING file in the top folder.
10.19 + * If not, see http://opensource.org/licenses/GPL-2.0.
10.20 + */
10.21 +@Exported
10.22 +package java.util;
10.23 +
10.24 +import org.apidesign.bck2brwsr.core.Exported;
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/rt/emul/mini/src/main/java/java/util/zip/package-info.java Mon Apr 15 15:30:53 2013 +0200
11.3 @@ -0,0 +1,21 @@
11.4 +/**
11.5 + * Back 2 Browser Bytecode Translator
11.6 + * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
11.7 + *
11.8 + * This program is free software: you can redistribute it and/or modify
11.9 + * it under the terms of the GNU General Public License as published by
11.10 + * the Free Software Foundation, version 2 of the License.
11.11 + *
11.12 + * This program is distributed in the hope that it will be useful,
11.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
11.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11.15 + * GNU General Public License for more details.
11.16 + *
11.17 + * You should have received a copy of the GNU General Public License
11.18 + * along with this program. Look for COPYING file in the top folder.
11.19 + * If not, see http://opensource.org/licenses/GPL-2.0.
11.20 + */
11.21 +@Exported
11.22 +package java.util.zip;
11.23 +
11.24 +import org.apidesign.bck2brwsr.core.Exported;
12.1 --- a/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/Java2JavaScript.java Fri Apr 12 18:48:48 2013 +0200
12.2 +++ b/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/Java2JavaScript.java Mon Apr 15 15:30:53 2013 +0200
12.3 @@ -112,7 +112,9 @@
12.4 return newest;
12.5 } else if (toCheck.getName().endsWith(".class")) {
12.6 final String cls = prefix.substring(0, prefix.length() - 7);
12.7 - arr.add(cls);
12.8 + if (!cls.endsWith("package-info")) {
12.9 + arr.add(cls);
12.10 + }
12.11 return toCheck.lastModified();
12.12 } else {
12.13 return 0L;