diff --git a/teavm-classlib/pom.xml b/teavm-classlib/pom.xml index 409012dec..ce5449982 100644 --- a/teavm-classlib/pom.xml +++ b/teavm-classlib/pom.xml @@ -82,40 +82,10 @@ java.util.logging java.util.concurrent -output - ${project.build.directory}/jcl-report/jcl-comparision.json + ${project.build.directory}/jcl-report - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.teavm - teavm-maven-plugin - [0.0.1-SNAPSHOT,) - - build-test-javascript - - - - - - - - - - - - \ No newline at end of file diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLClass.java b/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLClass.java new file mode 100644 index 000000000..a77f5d789 --- /dev/null +++ b/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLClass.java @@ -0,0 +1,33 @@ +/* + * Copyright 2014 Alexey Andreev. + * + * 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.teavm.classlib.impl; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Alexey Andreev + */ +class JCLClass { + public final String name; + public JCLStatus status; + public final List items = new ArrayList<>(); + + public JCLClass(String name) { + this.name = name; + } +} diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLComparisonBuilder.java b/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLComparisonBuilder.java index a997a64e0..d87005972 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLComparisonBuilder.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLComparisonBuilder.java @@ -17,10 +17,10 @@ package org.teavm.classlib.impl; import java.io.*; import java.net.URL; -import java.util.HashSet; -import java.util.Set; +import java.util.*; import java.util.jar.JarEntry; import java.util.jar.JarInputStream; +import org.apache.commons.io.IOUtils; import org.objectweb.asm.ClassReader; import org.teavm.parsing.ClasspathClassHolderSource; @@ -32,10 +32,11 @@ public class JCLComparisonBuilder { private static final String JAR_PREFIX = "jar:file:"; private static final String JAR_SUFFIX = "!/java/lang/Object.class"; private static final String CLASS_SUFFIX = ".class"; + private static final String TEMPLATE_PLACEHOLDER = "${CONTENT}"; private Set packages = new HashSet<>(); private ClassLoader classLoader = JCLComparisonBuilder.class.getClassLoader(); private JCLComparisonVisitor visitor; - private String outputFile; + private String outputDirectory; public ClassLoader getClassLoader() { return classLoader; @@ -49,24 +50,24 @@ public class JCLComparisonBuilder { return packages; } - public String getOutputFile() { - return outputFile; + public String getOutputDirectory() { + return outputDirectory; } - public void setOutputFile(String outputFile) { - this.outputFile = outputFile; + public void setOutputDirectory(String outputDirectory) { + this.outputDirectory = outputDirectory; } public static void main(String[] args) throws IOException { if (args.length == 0) { - System.err.println("Usage: package.name [package.name2 ...]"); + System.err.println("Usage: package.name [package.name2 ...] [-output directory]"); System.exit(1); } JCLComparisonBuilder builder = new JCLComparisonBuilder(); for (int i = 0; i < args.length; ++i) { if (args[i].equals("-output")) { - builder.setOutputFile(args[++i]); + builder.setOutputDirectory(args[++i]); } else { builder.getPackages().add(args[i].replace('.', '/')); } @@ -76,6 +77,24 @@ public class JCLComparisonBuilder { } public void buildComparisonReport() throws IOException { + List packages = buildModel(); + processModel(packages); + new File(outputDirectory).mkdirs(); + copyResource("html/class_obj.png"); + copyResource("html/field_protected_obj.png"); + copyResource("html/field_public_obj.png"); + copyResource("html/jcl.css"); + copyResource("html/methpro_obj.png"); + copyResource("html/methpub_obj.png"); + copyResource("html/package_obj.png"); + try (Writer out = new OutputStreamWriter(new FileOutputStream(new File( + outputDirectory, "jcl.html")), "UTF-8")) { + generateHtml(out, packages); + } + } + + private List buildModel() throws IOException { + Map packageMap = new HashMap<>(); URL url = classLoader.getResource("java/lang/Object" + CLASS_SUFFIX); String path = url.toString(); if (!path.startsWith(JAR_PREFIX) || !path.endsWith(JAR_SUFFIX)) { @@ -83,14 +102,12 @@ public class JCLComparisonBuilder { } ClasspathClassHolderSource classSource = new ClasspathClassHolderSource(classLoader); path = path.substring(JAR_PREFIX.length(), path.length() - JAR_SUFFIX.length()); - File outDir = new File(outputFile).getParentFile(); + File outDir = new File(outputDirectory).getParentFile(); if (!outDir.exists()) { outDir.mkdirs(); } - try (JarInputStream jar = new JarInputStream(new FileInputStream(path)); - PrintStream out = new PrintStream(new FileOutputStream(outputFile))) { - out.println("{"); - visitor = new JCLComparisonVisitor(classSource, out); + try (JarInputStream jar = new JarInputStream(new FileInputStream(path))) { + visitor = new JCLComparisonVisitor(classSource, packageMap); while (true) { JarEntry entry = jar.getNextJarEntry(); if (entry == null) { @@ -101,8 +118,22 @@ public class JCLComparisonBuilder { } jar.closeEntry(); } - out.println(); - out.println("}"); + } + return new ArrayList<>(packageMap.values()); + } + + private void processModel(List packages) { + Collections.sort(packages, new Comparator() { + @Override public int compare(JCLPackage o1, JCLPackage o2) { + return o1.name.compareTo(o2.name); + } + }); + for (JCLPackage pkg : packages) { + Collections.sort(pkg.classes, new Comparator() { + @Override public int compare(JCLClass o1, JCLClass o2) { + return o1.name.compareTo(o2.name); + } + }); } } @@ -115,7 +146,121 @@ public class JCLComparisonBuilder { } private void compareClass(InputStream input) throws IOException { - ClassReader reader = new ClassReader(input); + byte[] buffer = IOUtils.toByteArray(input); + ClassReader reader = new ClassReader(buffer); reader.accept(visitor, 0); } + + private void copyResource(String name) throws IOException { + String simpleName = name.substring(name.lastIndexOf('/') + 1); + try (InputStream input = classLoader.getResourceAsStream(name); + OutputStream output = new FileOutputStream(new File(outputDirectory, simpleName))) { + IOUtils.copy(input, output); + } + } + + private void generateHtml(Writer out, List packages) throws IOException { + String template; + try (Reader reader = new InputStreamReader(classLoader.getResourceAsStream("html/jcl.html"), "UTF-8")) { + template = IOUtils.toString(reader); + } + int placeholderIndex = template.indexOf(TEMPLATE_PLACEHOLDER); + String header = template.substring(0, placeholderIndex); + String footer = template.substring(placeholderIndex + TEMPLATE_PLACEHOLDER.length()); + out.write(header); + for (JCLPackage pkg : packages) { + int totalClasses = pkg.classes.size(); + int fullClasses = 0; + int partialClasses = 0; + for (JCLClass cls : pkg.classes) { + switch (cls.status) { + case FOUND: + fullClasses++; + partialClasses++; + break; + case PARTIAL: + partialClasses++; + break; + default: + break; + } + } + writeRow(out, "package", pkg.status, pkg.name, + totalClasses > 0 ? fullClasses * 100 / totalClasses : null, + totalClasses > 0 ? partialClasses * 100 / totalClasses : null); + for (JCLClass cls : pkg.classes) { + int implemented = 0; + for (JCLItem item : cls.items) { + if (item.status != JCLStatus.MISSING) { + ++implemented; + } + } + writeRow(out, "class", cls.status, cls.name, + !cls.items.isEmpty() ? implemented * 100 / cls.items.size() : null, null); + for (JCLItem item : cls.items) { + String type; + switch (item.type) { + case FIELD: + type = "field"; + break; + case METHOD: + type = "method"; + break; + default: + type = ""; + break; + } + writeRow(out, type, item.status, item.name, null, null); + } + } + } + out.write(footer); + } + + private void writeRow(Writer out, String type, JCLStatus status, String name, Integer percent, + Integer partialPercent) throws IOException { + out.write("\n"); + out.write("
"); + out.write(escape(name)); + out.write("
\n"); + out.write("" + (partialPercent != null ? partialPercent.toString() : "") + ""); + out.write("" + (percent != null ? percent.toString() : "") + ""); + out.write("\n"); + } + + private String escape(String string) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < string.length(); ++i) { + char ch = string.charAt(i); + switch (ch) { + case '<': + sb.append("<"); + break; + case '>': + sb.append(">"); + break; + case '"': + sb.append("""); + break; + default: + sb.append(ch); + break; + } + } + return sb.toString(); + } } diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLComparisonVisitor.java b/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLComparisonVisitor.java index ea412d88a..09b218461 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLComparisonVisitor.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLComparisonVisitor.java @@ -15,7 +15,7 @@ */ package org.teavm.classlib.impl; -import java.io.PrintStream; +import java.util.Map; import org.objectweb.asm.*; import org.teavm.model.*; import org.teavm.model.ClassReader; @@ -25,84 +25,103 @@ import org.teavm.model.ClassReader; * @author Alexey Andreev */ class JCLComparisonVisitor implements ClassVisitor { - private PrintStream out; + private Map packageMap; private ClassReaderSource classSource; - private boolean first = true; - private boolean firstItem; - private boolean pass; - private boolean ended; private ClassReader classReader; + private JCLPackage jclPackage; + private JCLClass jclClass; - public JCLComparisonVisitor(ClassReaderSource classSource, PrintStream out) { + public JCLComparisonVisitor(ClassReaderSource classSource, Map packageMap) { this.classSource = classSource; - this.out = out; + this.packageMap = packageMap; } @Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { - if ((access & Opcodes.ACC_PUBLIC) == 0) { + if ((access & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED)) == 0) { + jclClass = null; + classReader = null; return; } String javaName = name.replace('/', '.'); - if (!first) { - out.println(","); + int dotIndex = javaName.lastIndexOf('.'); + String packageName = javaName.substring(0, dotIndex); + String simpleName = javaName.substring(dotIndex + 1); + jclPackage = packageMap.get(packageName); + if (jclPackage == null) { + jclPackage = new JCLPackage(packageName); + jclPackage.status = JCLStatus.FOUND; + packageMap.put(packageName, jclPackage); } - first = false; - out.println(" \"" + javaName + "\" : {"); classReader = classSource.get(javaName); - if (classReader == null) { - out.println(" \"implemented\" : false"); - pass = true; - } else { - out.println(" \"implemented\" : true,"); - out.println(" \"items\" : ["); - pass = false; - } - ended = false; - firstItem = true; + jclClass = new JCLClass(simpleName); + jclClass.status = classReader != null ? JCLStatus.FOUND : JCLStatus.MISSING; + jclPackage.classes.add(jclClass); } @Override public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { - if (pass) { + if (classReader == null || (access & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED)) == 0) { return null; } - if ((access & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED)) == 0) { - return null; - } - if (!firstItem) { - out.println(","); - } - firstItem = false; - out.println(" {"); - out.println(" \"type\" : \"field\","); - out.println(" \"name\" : \"" + name + "\","); - out.println(" \"descriptor\" : \"" + desc + "\","); + JCLItem item = new JCLItem(JCLItemType.FIELD, name + " : " + desc); FieldReader field = classReader.getField(name); - out.println(" \"implemented\" : \"" + (field != null ? "true" : "false") + "\","); - out.print(" }"); + item.status = field != null ? JCLStatus.FOUND : JCLStatus.MISSING; + jclClass.items.add(item); + if (item.status == JCLStatus.MISSING) { + jclClass.status = JCLStatus.PARTIAL; + } return null; } @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { - if (pass) { + if (classReader == null || (access & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED)) == 0) { return null; } - if ((access & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED)) == 0) { - return null; + + JCLItem item = new JCLItem(JCLItemType.METHOD, name + desc); + MethodReader method = findMethod(classReader, MethodDescriptor.parse(name + desc)); + if (method == null) { + item.status = JCLStatus.MISSING; + } else { + if ((access & Opcodes.ACC_ABSTRACT) == 0 && method.hasModifier(ElementModifier.ABSTRACT)) { + item.status = JCLStatus.MISSING; + } else { + item.status = method.getOwnerName().equals(classReader.getName()) ? + JCLStatus.FOUND : JCLStatus.PARTIAL; + } } - if (!firstItem) { - out.println(","); + jclClass.items.add(item); + if (item.status == JCLStatus.MISSING) { + jclClass.status = JCLStatus.PARTIAL; + } + return null; + } + + private MethodReader findMethod(ClassReader cls, MethodDescriptor desc) { + MethodReader method = cls.getMethod(desc); + if (method != null) { + return method; + } + if (cls.getParent() != null) { + ClassReader parent = classSource.get(cls.getParent()); + if (parent != null) { + method = findMethod(parent, desc); + if (method != null) { + return method; + } + } + } + for (String ifaceName : cls.getInterfaces()) { + ClassReader iface = classSource.get(ifaceName); + if (iface != null) { + method = findMethod(iface, desc); + if (method != null) { + return method; + } + } } - firstItem = false; - out.println(" {"); - out.println(" \"type\" : \"method\","); - out.println(" \"name\" : \"" + name + "\","); - out.println(" \"descriptor\" : \"" + desc + "\","); - MethodReader method = classReader.getMethod(MethodDescriptor.parse(name + desc)); - out.println(" \"implemented\" : \"" + (method != null ? "true" : "false") + "\","); - out.print(" }"); return null; } @@ -129,15 +148,8 @@ class JCLComparisonVisitor implements ClassVisitor { @Override public void visitEnd() { - if (!ended) { - if (!pass) { - if (!firstItem) { - out.println(); - } - out.println(" ]"); - } - out.print(" }"); - ended = true; + if (jclClass == null || jclClass.status != JCLStatus.FOUND) { + jclPackage.status = JCLStatus.PARTIAL; } } } diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLItem.java b/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLItem.java new file mode 100644 index 000000000..8fa689343 --- /dev/null +++ b/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLItem.java @@ -0,0 +1,31 @@ +/* + * Copyright 2014 Alexey Andreev. + * + * 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.teavm.classlib.impl; + +/** + * + * @author Alexey Andreev + */ +class JCLItem { + public final JCLItemType type; + public final String name; + public JCLStatus status; + + public JCLItem(JCLItemType type, String name) { + this.type = type; + this.name = name; + } +} diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLItemType.java b/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLItemType.java new file mode 100644 index 000000000..5bd66c172 --- /dev/null +++ b/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLItemType.java @@ -0,0 +1,25 @@ +/* + * Copyright 2014 Alexey Andreev. + * + * 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.teavm.classlib.impl; + +/** + * + * @author Alexey Andreev + */ +enum JCLItemType { + FIELD, + METHOD +} diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLPackage.java b/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLPackage.java new file mode 100644 index 000000000..e527931fd --- /dev/null +++ b/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLPackage.java @@ -0,0 +1,33 @@ +/* + * Copyright 2014 Alexey Andreev. + * + * 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.teavm.classlib.impl; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Alexey Andreev + */ +class JCLPackage { + public final String name; + public JCLStatus status; + public final List classes = new ArrayList<>(); + + public JCLPackage(String name) { + this.name = name; + } +} diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLStatus.java b/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLStatus.java new file mode 100644 index 000000000..c951f4b38 --- /dev/null +++ b/teavm-classlib/src/main/java/org/teavm/classlib/impl/JCLStatus.java @@ -0,0 +1,26 @@ +/* + * Copyright 2014 Alexey Andreev. + * + * 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.teavm.classlib.impl; + +/** + * + * @author Alexey Andreev + */ +enum JCLStatus { + FOUND, + MISSING, + PARTIAL +} diff --git a/teavm-classlib/src/main/resources/html/class_obj.png b/teavm-classlib/src/main/resources/html/class_obj.png new file mode 100644 index 000000000..c57c2d00f Binary files /dev/null and b/teavm-classlib/src/main/resources/html/class_obj.png differ diff --git a/teavm-classlib/src/main/resources/html/field_protected_obj.png b/teavm-classlib/src/main/resources/html/field_protected_obj.png new file mode 100644 index 000000000..dc80489bc Binary files /dev/null and b/teavm-classlib/src/main/resources/html/field_protected_obj.png differ diff --git a/teavm-classlib/src/main/resources/html/field_public_obj.png b/teavm-classlib/src/main/resources/html/field_public_obj.png new file mode 100644 index 000000000..40a5ef1c8 Binary files /dev/null and b/teavm-classlib/src/main/resources/html/field_public_obj.png differ diff --git a/teavm-classlib/src/main/resources/html/jcl-test.html b/teavm-classlib/src/main/resources/html/jcl-test.html new file mode 100644 index 000000000..715af11f5 --- /dev/null +++ b/teavm-classlib/src/main/resources/html/jcl-test.html @@ -0,0 +1,46 @@ + + + + JCL emulation information + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Item% of partially implemented% of fully implemented
java.lang
100%0%
Object
50%
$id
clone()
getClass()
+ + \ No newline at end of file diff --git a/teavm-classlib/src/main/resources/html/jcl.css b/teavm-classlib/src/main/resources/html/jcl.css new file mode 100644 index 000000000..3106bc5a0 --- /dev/null +++ b/teavm-classlib/src/main/resources/html/jcl.css @@ -0,0 +1,74 @@ +* { + font-family: sans-serif; + font-size: 14pt; + line-height: 125%; +} + +table { + border-collapse: collapse; + margin: 1em; + border-color: rgb(160,160,160); + border-style: solid; + border-width: 1px; +} +th { + padding-left: 1em; + padding-right: 1em; + padding-top: 0.25em; + padding-bottom: 0.25em; + border-width: 1px; + border-color: rgb(160,160,160); + border-top-style: solid; + border-bottom-style: solid; + background-color: rgb(220,220,220); +} + +.full { + background-color: rgb(200,255,200); +} +.missing { + background-color: rgb(255,200,200); +} +.partial { + background-color: rgb(255,255,200); +} +.percent { + text-align: right; +} + +.package, .class, .protected-class, .field, .protected-field, .method, .protected-method { + background-repeat: no-repeat; + padding-right: 6px; +} + +.package { + padding-left: 35px; + background-position: 16px 50%; +} +.class { + padding-left: 51px; + background-position: 32px 50%; +} +.field, .protected-field, .method, .protected-method { + padding-left: 67px; + background-position: 48px 50%; +} + +.package { + background-image: url(package_obj.png); +} +.class { + background-image: url(class_obj.png); +} +.field { + background-image: url(field_public_obj.png); +} +.protected-field { + background-image: url(field_protected_obj.png); +} +.method { + background-image: url(methpub_obj.png); +} +.protected-method { + background-image: url(methpro_obj.png); +} \ No newline at end of file diff --git a/teavm-classlib/src/main/resources/html/jcl.html b/teavm-classlib/src/main/resources/html/jcl.html new file mode 100644 index 000000000..a8add2679 --- /dev/null +++ b/teavm-classlib/src/main/resources/html/jcl.html @@ -0,0 +1,22 @@ + + + + JCL emulation information + + + + + + + + + + + + + + ${CONTENT} + +
Item% of partially implemented% of fully implemented
+ + \ No newline at end of file diff --git a/teavm-classlib/src/main/resources/html/methpro_obj.png b/teavm-classlib/src/main/resources/html/methpro_obj.png new file mode 100644 index 000000000..3e4c0d785 Binary files /dev/null and b/teavm-classlib/src/main/resources/html/methpro_obj.png differ diff --git a/teavm-classlib/src/main/resources/html/methpub_obj.png b/teavm-classlib/src/main/resources/html/methpub_obj.png new file mode 100644 index 000000000..300419528 Binary files /dev/null and b/teavm-classlib/src/main/resources/html/methpub_obj.png differ diff --git a/teavm-classlib/src/main/resources/html/package_obj.png b/teavm-classlib/src/main/resources/html/package_obj.png new file mode 100644 index 000000000..0afea5b86 Binary files /dev/null and b/teavm-classlib/src/main/resources/html/package_obj.png differ diff --git a/teavm-core/src/main/java/org/teavm/parsing/ClassRefsRenamer.java b/teavm-core/src/main/java/org/teavm/parsing/ClassRefsRenamer.java index 8ba12f15a..872d4584d 100644 --- a/teavm-core/src/main/java/org/teavm/parsing/ClassRefsRenamer.java +++ b/teavm-core/src/main/java/org/teavm/parsing/ClassRefsRenamer.java @@ -62,7 +62,10 @@ class ClassRefsRenamer implements InstructionVisitor { } rename(cls.getAnnotations(), renamedCls.getAnnotations()); for (String iface : cls.getInterfaces()) { - renamedCls.getInterfaces().add(classNameMapper.map(iface)); + String mappedIfaceName = classNameMapper.map(iface); + if (!mappedIfaceName.equals(renamedCls.getName())) { + renamedCls.getInterfaces().add(mappedIfaceName); + } } return renamedCls; } diff --git a/teavm-html4j/pom.xml b/teavm-html4j/pom.xml index fa69043b5..7032dad72 100644 --- a/teavm-html4j/pom.xml +++ b/teavm-html4j/pom.xml @@ -114,31 +114,6 @@ true - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.teavm - teavm-maven-plugin - [0.0.1-SNAPSHOT,) - - build-test-javascript - - - - - - - - - -