Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit de1c41c

Browse files
author
zhourenjian
committed
Support Java 5.0 @j2s* annotations
1 parent 1017737 commit de1c41c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/net/sf/j2s/ui/wizards/Java2ScriptAJAXProjectWizard.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.util.ArrayList;
2020
import java.util.List;
2121

22-
import org.eclipse.core.runtime.IPath;
2322
import org.eclipse.core.runtime.Path;
2423
import org.eclipse.jdt.core.IClasspathEntry;
2524
import org.eclipse.jdt.core.JavaCore;

src/net/sf/j2s/ui/wizards/Java2ScriptProjectWizard.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import java.io.FileOutputStream;
1717
import java.io.IOException;
1818
import java.lang.reflect.InvocationTargetException;
19+
import java.util.ArrayList;
1920
import java.util.Iterator;
2021
import java.util.List;
2122
import java.util.Properties;
@@ -33,6 +34,7 @@
3334
import org.eclipse.core.runtime.IExecutableExtension;
3435
import org.eclipse.core.runtime.IPath;
3536
import org.eclipse.core.runtime.IProgressMonitor;
37+
import org.eclipse.core.runtime.Path;
3638
import org.eclipse.jdt.core.IClasspathEntry;
3739
import org.eclipse.jdt.core.IJavaElement;
3840
import org.eclipse.jdt.core.IJavaProject;
@@ -323,7 +325,12 @@ protected void updateJava2ScriptProject(String prjFolder, String binRelative) {
323325
}
324326

325327
protected IClasspathEntry[] updateJavaLibraries(IClasspathEntry[] defaultEntries) {
326-
return defaultEntries;
328+
List list = new ArrayList();
329+
for (int i = 0; i < defaultEntries.length; i++) {
330+
list.add(i, defaultEntries[i]);
331+
}
332+
list.add(JavaCore.newVariableEntry(new Path("J2S_ANNOTATION"), new Path("J2S_ANNOTATION_SRC"), null));
333+
return (IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]);
327334
}
328335

329336
}

0 commit comments

Comments
 (0)