diff --git a/sources/net.sf.j2s.ajax/.classpath b/sources/net.sf.j2s.ajax/.classpath
index 2873aaafd..56136db82 100644
--- a/sources/net.sf.j2s.ajax/.classpath
+++ b/sources/net.sf.j2s.ajax/.classpath
@@ -10,6 +10,6 @@
-
+
diff --git a/sources/net.sf.j2s.ajax/lib/javax.servlet_2.5.0.v200910301333.jar b/sources/net.sf.j2s.ajax/lib/javax.servlet_2.5.0.v200910301333.jar
new file mode 100644
index 000000000..20b5755ec
Binary files /dev/null and b/sources/net.sf.j2s.ajax/lib/javax.servlet_2.5.0.v200910301333.jar differ
diff --git a/sources/net.sf.j2s.core/build.properties b/sources/net.sf.j2s.core/build.properties
index e4a7fc0df..c4b8f6598 100644
--- a/sources/net.sf.j2s.core/build.properties
+++ b/sources/net.sf.j2s.core/build.properties
@@ -6,5 +6,5 @@ bin.includes = META-INF/,\
schema/
src.includes = META-INF/,\
plugin.xml
-javacSource = 1.3
-javacTarget = 1.2
+javacSource = 1.7
+javacTarget = 1.7
diff --git a/sources/net.sf.j2s.core/src/net/sf/j2s/core/CorePlugin.java b/sources/net.sf.j2s.core/src/net/sf/j2s/core/CorePlugin.java
index 685522d9d..4dc6d0ec1 100644
--- a/sources/net.sf.j2s.core/src/net/sf/j2s/core/CorePlugin.java
+++ b/sources/net.sf.j2s.core/src/net/sf/j2s/core/CorePlugin.java
@@ -17,6 +17,7 @@ public class CorePlugin extends Plugin {
* The constructor.
*/
public CorePlugin() {
+ System.out.println("J2S legacy core plugin created");
plugin = this;
}
@@ -25,6 +26,7 @@ public CorePlugin() {
*/
public void start(BundleContext context) throws Exception {
super.start(context);
+ System.out.println("J2S legacy core plugin started");
if (!InnerHotspotServer.isServerStarted()) {
InnerHotspotServer.getSingletonServer().startServer();
}
@@ -36,6 +38,7 @@ public void start(BundleContext context) throws Exception {
public void stop(BundleContext context) throws Exception {
super.stop(context);
plugin = null;
+ System.out.println("J2S legacy core plugin stopped");
if (InnerHotspotServer.isServerStarted()) {
InnerHotspotServer.getSingletonServer().stopServer();
}
diff --git a/sources/net.sf.j2s.core/src/net/sf/j2s/core/astvisitors/DependencyASTVisitor.java b/sources/net.sf.j2s.core/src/net/sf/j2s/core/astvisitors/DependencyASTVisitor.java
index aebc67137..3dd358c73 100644
--- a/sources/net.sf.j2s.core/src/net/sf/j2s/core/astvisitors/DependencyASTVisitor.java
+++ b/sources/net.sf.j2s.core/src/net/sf/j2s/core/astvisitors/DependencyASTVisitor.java
@@ -18,7 +18,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Set;
-
import org.eclipse.jdt.core.dom.ASTNode;
import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
import org.eclipse.jdt.core.dom.Annotation;
diff --git a/sources/net.sf.j2s.core/src/net/sf/j2s/core/builder/AbstractImageBuilder.java b/sources/net.sf.j2s.core/src/net/sf/j2s/core/builder/AbstractImageBuilder.java
index 927fbed65..319914cb4 100644
--- a/sources/net.sf.j2s.core/src/net/sf/j2s/core/builder/AbstractImageBuilder.java
+++ b/sources/net.sf.j2s.core/src/net/sf/j2s/core/builder/AbstractImageBuilder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -57,8 +57,7 @@ public abstract class AbstractImageBuilder implements ICompilerRequestor, ICompi
protected boolean keepStoringProblemMarkers;
protected SimpleSet filesWithAnnotations = null;
-//2000 is best compromise between space used and speed
-public static int MAX_AT_ONCE = Integer.getInteger(JavaModelManager.MAX_COMPILED_UNITS_AT_ONCE, 2000).intValue();
+public static int MAX_AT_ONCE = 2000; // best compromise between space used and speed
public final static String[] JAVA_PROBLEM_MARKER_ATTRIBUTE_NAMES = {
IMarker.MESSAGE,
IMarker.SEVERITY,
@@ -294,7 +293,7 @@ protected void compile(SourceFile[] units) {
}
int unitsLength = units.length;
- this.compiledAllAtOnce = MAX_AT_ONCE == 0 || unitsLength <= MAX_AT_ONCE;
+ this.compiledAllAtOnce = unitsLength <= MAX_AT_ONCE;
if (this.compiledAllAtOnce) {
// do them all now
if (JavaBuilder.DEBUG)
diff --git a/sources/net.sf.j2s.core/src/net/sf/j2s/core/builder/IncrementalImageBuilder.java b/sources/net.sf.j2s.core/src/net/sf/j2s/core/builder/IncrementalImageBuilder.java
index af3b52c70..b47928413 100644
--- a/sources/net.sf.j2s.core/src/net/sf/j2s/core/builder/IncrementalImageBuilder.java
+++ b/sources/net.sf.j2s.core/src/net/sf/j2s/core/builder/IncrementalImageBuilder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -799,7 +799,7 @@ protected void resetCollections() {
protected void updateProblemsFor(SourceFile sourceFile, CompilationResult result) throws CoreException {
if (CharOperation.equals(sourceFile.getMainTypeName(), TypeConstants.PACKAGE_INFO_NAME)) {
IResource pkgResource = sourceFile.resource.getParent();
- pkgResource.deleteMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_ZERO);
+ pkgResource.deleteMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_INFINITE);
}
IMarker[] markers = JavaBuilder.getProblemsFor(sourceFile.resource);
CategorizedProblem[] problems = result.getProblems();
diff --git a/sources/net.sf.j2s.core/src/net/sf/j2s/core/builder/JavaBuilder.java b/sources/net.sf.j2s.core/src/net/sf/j2s/core/builder/JavaBuilder.java
index 6517828ca..d341da1f6 100644
--- a/sources/net.sf.j2s.core/src/net/sf/j2s/core/builder/JavaBuilder.java
+++ b/sources/net.sf.j2s.core/src/net/sf/j2s/core/builder/JavaBuilder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
+
import org.eclipse.jdt.core.*;
import org.eclipse.jdt.core.compiler.*;
import org.eclipse.jdt.internal.compiler.util.SimpleLookupTable;
@@ -20,8 +21,6 @@
import org.eclipse.jdt.internal.core.util.Util;
import java.io.*;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.util.*;
public class JavaBuilder extends IncrementalProjectBuilder {
@@ -158,7 +157,7 @@ protected IProject[] build(int kind, Map ignored, IProgressMonitor monitor) thro
if (this.currentProject == null || !this.currentProject.isAccessible()) return new IProject[0];
if (DEBUG)
- System.out.println("\nJavaBuilder: Starting build of " + this.currentProject.getName() //$NON-NLS-1$
+ System.out.println("\nStarting build of " + this.currentProject.getName() //$NON-NLS-1$
+ " @ " + new Date(System.currentTimeMillis())); //$NON-NLS-1$
this.notifier = new BuildNotifier(monitor, this.currentProject);
this.notifier.begin();
@@ -170,39 +169,39 @@ protected IProject[] build(int kind, Map ignored, IProgressMonitor monitor) thro
if (isWorthBuilding()) {
if (kind == FULL_BUILD) {
if (DEBUG)
- System.out.println("JavaBuilder: Performing full build as requested"); //$NON-NLS-1$
+ System.out.println("Performing full build as requested by user"); //$NON-NLS-1$
buildAll();
} else {
if ((this.lastState = getLastState(this.currentProject)) == null) {
if (DEBUG)
- System.out.println("JavaBuilder: Performing full build since last saved state was not found"); //$NON-NLS-1$
+ System.out.println("Performing full build since last saved state was not found"); //$NON-NLS-1$
buildAll();
} else if (hasClasspathChanged()) {
// if the output location changes, do not delete the binary files from old location
// the user may be trying something
if (DEBUG)
- System.out.println("JavaBuilder: Performing full build since classpath has changed"); //$NON-NLS-1$
+ System.out.println("Performing full build since classpath has changed"); //$NON-NLS-1$
buildAll();
} else if (this.nameEnvironment.sourceLocations.length > 0) {
// if there is no source to compile & no classpath changes then we are done
SimpleLookupTable deltas = findDeltas();
if (deltas == null) {
if (DEBUG)
- System.out.println("JavaBuilder: Performing full build since deltas are missing after incremental request"); //$NON-NLS-1$
+ System.out.println("Performing full build since deltas are missing after incremental request"); //$NON-NLS-1$
buildAll();
} else if (deltas.elementSize > 0) {
buildDeltas(deltas);
} else if (DEBUG) {
- System.out.println("JavaBuilder: Nothing to build since deltas were empty"); //$NON-NLS-1$
+ System.out.println("Nothing to build since deltas were empty"); //$NON-NLS-1$
}
} else {
if (hasStructuralDelta()) { // double check that a jar file didn't get replaced in a binary project
if (DEBUG)
- System.out.println("JavaBuilder: Performing full build since there are structural deltas"); //$NON-NLS-1$
+ System.out.println("Performing full build since there are structural deltas"); //$NON-NLS-1$
buildAll();
} else {
if (DEBUG)
- System.out.println("JavaBuilder: Nothing to build since there are no source folders and no deltas"); //$NON-NLS-1$
+ System.out.println("Nothing to build since there are no source folders and no deltas"); //$NON-NLS-1$
this.lastState.tagAsNoopBuild();
}
}
@@ -240,8 +239,8 @@ protected IProject[] build(int kind, Map ignored, IProgressMonitor monitor) thro
}
IProject[] requiredProjects = getRequiredProjects(true);
if (DEBUG)
- System.out.println("JavaBuilder: Finished build of " + this.currentProject.getName() //$NON-NLS-1$
- + " @ " + new Date(System.currentTimeMillis()) + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ System.out.println("Finished build of " + this.currentProject.getName() //$NON-NLS-1$
+ + " @ " + new Date(System.currentTimeMillis())); //$NON-NLS-1$
return requiredProjects;
}
@@ -249,7 +248,7 @@ private void buildAll() {
this.notifier.checkCancel();
this.notifier.subTask(Messages.bind(Messages.build_preparingBuild, this.currentProject.getName()));
if (DEBUG && this.lastState != null)
- System.out.println("JavaBuilder: Clearing last state : " + this.lastState); //$NON-NLS-1$
+ System.out.println("Clearing last state : " + this.lastState); //$NON-NLS-1$
clearLastState();
BatchImageBuilder imageBuilder = new Java2ScriptBatchImageBuilder(this, true);
imageBuilder.build();
@@ -260,14 +259,14 @@ private void buildDeltas(SimpleLookupTable deltas) {
this.notifier.checkCancel();
this.notifier.subTask(Messages.bind(Messages.build_preparingBuild, this.currentProject.getName()));
if (DEBUG && this.lastState != null)
- System.out.println("JavaBuilder: Clearing last state : " + this.lastState); //$NON-NLS-1$
+ System.out.println("Clearing last state : " + this.lastState); //$NON-NLS-1$
clearLastState(); // clear the previously built state so if the build fails, a full build will occur next time
IncrementalImageBuilder imageBuilder = new Java2ScriptIncrementalImageBuilder(this);
if (imageBuilder.build(deltas)) {
recordNewState(imageBuilder.newState);
} else {
if (DEBUG)
- System.out.println("JavaBuilder: Performing full build since incremental build failed"); //$NON-NLS-1$
+ System.out.println("Performing full build since incremental build failed"); //$NON-NLS-1$
buildAll();
}
}
@@ -277,7 +276,7 @@ protected void clean(IProgressMonitor monitor) throws CoreException {
if (this.currentProject == null || !this.currentProject.isAccessible()) return;
if (DEBUG)
- System.out.println("\nJavaBuilder: Cleaning " + this.currentProject.getName() //$NON-NLS-1$
+ System.out.println("\nCleaning " + this.currentProject.getName() //$NON-NLS-1$
+ " @ " + new Date(System.currentTimeMillis())); //$NON-NLS-1$
this.notifier = new BuildNotifier(monitor, this.currentProject);
this.notifier.begin();
@@ -286,7 +285,7 @@ protected void clean(IProgressMonitor monitor) throws CoreException {
initializeBuilder(CLEAN_BUILD, true);
if (DEBUG)
- System.out.println("JavaBuilder: Clearing last state as part of clean : " + this.lastState); //$NON-NLS-1$
+ System.out.println("Clearing last state as part of clean : " + this.lastState); //$NON-NLS-1$
clearLastState();
removeProblemsAndTasksFor(this.currentProject);
new BatchImageBuilder(this, false).cleanOutputFolders(false);
@@ -298,7 +297,7 @@ protected void clean(IProgressMonitor monitor) throws CoreException {
cleanup();
}
if (DEBUG)
- System.out.println("JavaBuilder: Finished cleaning " + this.currentProject.getName() //$NON-NLS-1$
+ System.out.println("Finished cleaning " + this.currentProject.getName() //$NON-NLS-1$
+ " @ " + new Date(System.currentTimeMillis())); //$NON-NLS-1$
}
@@ -367,12 +366,12 @@ private SimpleLookupTable findDeltas() {
if (delta != null) {
if (delta.getKind() != IResourceDelta.NO_CHANGE) {
if (DEBUG)
- System.out.println("JavaBuilder: Found source delta for: " + this.currentProject.getName()); //$NON-NLS-1$
+ System.out.println("Found source delta for: " + this.currentProject.getName()); //$NON-NLS-1$
deltas.put(this.currentProject, delta);
}
} else {
if (DEBUG)
- System.out.println("JavaBuilder: Missing delta for: " + this.currentProject.getName()); //$NON-NLS-1$
+ System.out.println("Missing delta for: " + this.currentProject.getName()); //$NON-NLS-1$
this.notifier.subTask(""); //$NON-NLS-1$
return null;
}
@@ -402,12 +401,12 @@ private SimpleLookupTable findDeltas() {
if (delta != null) {
if (delta.getKind() != IResourceDelta.NO_CHANGE) {
if (DEBUG)
- System.out.println("JavaBuilder: Found binary delta for: " + p.getName()); //$NON-NLS-1$
+ System.out.println("Found binary delta for: " + p.getName()); //$NON-NLS-1$
deltas.put(p, delta);
}
} else {
if (DEBUG)
- System.out.println("JavaBuilder: Missing delta for: " + p.getName()); //$NON-NLS-1$
+ System.out.println("Missing delta for: " + p.getName()); //$NON-NLS-1$
this.notifier.subTask(""); //$NON-NLS-1$
return null;
}
@@ -515,7 +514,7 @@ private boolean hasClasspathChanged() {
} catch (CoreException ignore) { // skip it
}
if (DEBUG) {
- System.out.println("JavaBuilder: New location: " + newSourceLocations[n] + "\n!= old location: " + oldSourceLocations[o]); //$NON-NLS-1$ //$NON-NLS-2$
+ System.out.println("New location: " + newSourceLocations[n] + "\n!= old location: " + oldSourceLocations[o]); //$NON-NLS-1$ //$NON-NLS-2$
printLocations(newSourceLocations, oldSourceLocations);
}
return true;
@@ -529,7 +528,7 @@ private boolean hasClasspathChanged() {
} catch (CoreException ignore) { // skip it
}
if (DEBUG) {
- System.out.println("JavaBuilder: Added non-empty source folder"); //$NON-NLS-1$
+ System.out.println("Added non-empty source folder"); //$NON-NLS-1$
printLocations(newSourceLocations, oldSourceLocations);
}
return true;
@@ -540,7 +539,7 @@ private boolean hasClasspathChanged() {
continue;
}
if (DEBUG) {
- System.out.println("JavaBuilder: Removed non-empty source folder"); //$NON-NLS-1$
+ System.out.println("Removed non-empty source folder"); //$NON-NLS-1$
printLocations(newSourceLocations, oldSourceLocations);
}
return true;
@@ -553,14 +552,14 @@ private boolean hasClasspathChanged() {
for (n = o = 0; n < newLength && o < oldLength; n++, o++) {
if (newBinaryLocations[n].equals(oldBinaryLocations[o])) continue;
if (DEBUG) {
- System.out.println("JavaBuilder: New location: " + newBinaryLocations[n] + "\n!= old location: " + oldBinaryLocations[o]); //$NON-NLS-1$ //$NON-NLS-2$
+ System.out.println("New location: " + newBinaryLocations[n] + "\n!= old location: " + oldBinaryLocations[o]); //$NON-NLS-1$ //$NON-NLS-2$
printLocations(newBinaryLocations, oldBinaryLocations);
}
return true;
}
if (n < newLength || o < oldLength) {
if (DEBUG) {
- System.out.println("JavaBuilder: Number of binary folders/jar files has changed:"); //$NON-NLS-1$
+ System.out.println("Number of binary folders/jar files has changed:"); //$NON-NLS-1$
printLocations(newBinaryLocations, oldBinaryLocations);
}
return true;
@@ -614,15 +613,7 @@ private int initializeBuilder(int kind, boolean forBuild) throws CoreException {
// Flush the existing external files cache if this is the beginning of a build cycle
String projectName = this.currentProject.getName();
if (builtProjects == null || builtProjects.contains(projectName)) {
- try {
- Method method = JavaModel.class.getMethod("flushExternalFileCache", new Class[] { Void.class });
- if (method != null) {
- method.invoke(JavaModel.class, new Object[0]);
- }
- } catch (Throwable e) {
- e.printStackTrace();
- }
- //JavaModel.flushExternalFileCache();
+ JavaModel.flushExternalFileCache();
builtProjects = new ArrayList();
}
builtProjects.add(projectName);
@@ -677,7 +668,7 @@ private boolean isWorthBuilding() throws CoreException {
// Abort build only if there are classpath errors
if (isClasspathBroken(this.javaProject.getRawClasspath(), this.currentProject)) {
if (DEBUG)
- System.out.println("JavaBuilder: Aborted build because project has classpath errors (incomplete or involved in cycle)"); //$NON-NLS-1$
+ System.out.println("Aborted build because project has classpath errors (incomplete or involved in cycle)"); //$NON-NLS-1$
removeProblemsAndTasksFor(this.currentProject); // remove all compilation problems
@@ -707,18 +698,18 @@ private boolean isWorthBuilding() throws CoreException {
JavaProject prereq = (JavaProject) JavaCore.create(p);
if (prereq.hasCycleMarker() && JavaCore.WARNING.equals(this.javaProject.getOption(JavaCore.CORE_CIRCULAR_CLASSPATH, true))) {
if (DEBUG)
- System.out.println("JavaBuilder: Continued to build even though prereq project " + p.getName() //$NON-NLS-1$
+ System.out.println("Continued to build even though prereq project " + p.getName() //$NON-NLS-1$
+ " was not built since its part of a cycle"); //$NON-NLS-1$
continue;
}
if (!hasJavaBuilder(p)) {
if (DEBUG)
- System.out.println("JavaBuilder: Continued to build even though prereq project " + p.getName() //$NON-NLS-1$
+ System.out.println("Continued to build even though prereq project " + p.getName() //$NON-NLS-1$
+ " is not built by JavaBuilder"); //$NON-NLS-1$
continue;
}
if (DEBUG)
- System.out.println("JavaBuilder: Aborted build because prereq project " + p.getName() //$NON-NLS-1$
+ System.out.println("Aborted build because prereq project " + p.getName() //$NON-NLS-1$
+ " was not built"); //$NON-NLS-1$
removeProblemsAndTasksFor(this.currentProject); // make this the only problem for this project
@@ -755,7 +746,7 @@ void mustPropagateStructuralChanges() {
IProject project = this.workspaceRoot.getProject(participantPath.segment(0));
if (hasBeenBuilt(project)) {
if (DEBUG)
- System.out.println("JavaBuilder: Requesting another build iteration since cycle participant " + project.getName() //$NON-NLS-1$
+ System.out.println("Requesting another build iteration since cycle participant " + project.getName() //$NON-NLS-1$
+ " has not yet seen some structural changes"); //$NON-NLS-1$
needRebuild();
return;
@@ -765,10 +756,10 @@ void mustPropagateStructuralChanges() {
}
private void printLocations(ClasspathLocation[] newLocations, ClasspathLocation[] oldLocations) {
- System.out.println("JavaBuilder: New locations:"); //$NON-NLS-1$
+ System.out.println("New locations:"); //$NON-NLS-1$
for (int i = 0, length = newLocations.length; i < length; i++)
System.out.println(" " + newLocations[i].debugPathString()); //$NON-NLS-1$
- System.out.println("JavaBuilder: Old locations:"); //$NON-NLS-1$
+ System.out.println("Old locations:"); //$NON-NLS-1$
for (int i = 0, length = oldLocations.length; i < length; i++)
System.out.println(" " + oldLocations[i].debugPathString()); //$NON-NLS-1$
}
@@ -799,7 +790,7 @@ private void recordNewState(State state) {
}
if (DEBUG)
- System.out.println("JavaBuilder: Recording new state : " + state); //$NON-NLS-1$
+ System.out.println("Recording new state : " + state); //$NON-NLS-1$
// state.dump();
JavaModelManager.getJavaModelManager().setLastBuiltState(currentProject, newState);
}
diff --git a/sources/net.sf.j2s.core/src/net/sf/j2s/core/builder/NameEnvironment.java b/sources/net.sf.j2s.core/src/net/sf/j2s/core/builder/NameEnvironment.java
index bd778cd8b..def21cd83 100644
--- a/sources/net.sf.j2s.core/src/net/sf/j2s/core/builder/NameEnvironment.java
+++ b/sources/net.sf.j2s.core/src/net/sf/j2s/core/builder/NameEnvironment.java
@@ -10,8 +10,6 @@
* Terry Parker
* - Contribution for https://bugs.eclipse.org/bugs/show_bug.cgi?id=372418
* - Another problem with inner classes referenced from jars or class folders: "The type ... cannot be resolved"
- * Stephan Herrmann - Contribution for
- * Bug 392727 - Cannot compile project when a java file contains $ in its file name
*******************************************************************************/
package net.sf.j2s.core.builder;
@@ -278,18 +276,17 @@ private NameEnvironmentAnswer findClass(String qualifiedTypeName, char[] typeNam
// let the recompile loop fix up dependents when the secondary type Y has been deleted from X.java
// Only enclosing type names are present in the additional units table, so strip off inner class specifications
// when doing the lookup (https://bugs.eclipse.org/372418).
- // Also take care of $ in the name of the class (https://bugs.eclipse.org/377401)
- // and prefer name with '$' if unit exists rather than failing to search for nested class (https://bugs.eclipse.org/392727)
- SourceFile unit = (SourceFile) this.additionalUnits.get(qualifiedTypeName); // doesn't have file extension
- if (unit != null)
- return new NameEnvironmentAnswer(unit, null /*no access restriction*/);
+ // Also take care of $ in the name of the class (https://bugs.eclipse.org/Bug 377401)
int index = qualifiedTypeName.indexOf('$');
if (index > 0) {
String enclosingTypeName = qualifiedTypeName.substring(0, index);
- unit = (SourceFile) this.additionalUnits.get(enclosingTypeName); // doesn't have file extension
+ SourceFile unit = (SourceFile) this.additionalUnits.get(enclosingTypeName); // doesn't have file extension
if (unit != null)
return new NameEnvironmentAnswer(unit, null /*no access restriction*/);
}
+ SourceFile unit = (SourceFile) this.additionalUnits.get(qualifiedTypeName); // doesn't have file extension
+ if (unit != null)
+ return new NameEnvironmentAnswer(unit, null /*no access restriction*/);
}
String qBinaryFileName = qualifiedTypeName + SUFFIX_STRING_class;
diff --git a/sources/net.sf.j2s.core/src/net/sf/j2s/core/compiler/Java2ScriptCompiler.java b/sources/net.sf.j2s.core/src/net/sf/j2s/core/compiler/Java2ScriptCompiler.java
index 2253355bc..ba39d3782 100644
--- a/sources/net.sf.j2s.core/src/net/sf/j2s/core/compiler/Java2ScriptCompiler.java
+++ b/sources/net.sf.j2s.core/src/net/sf/j2s/core/compiler/Java2ScriptCompiler.java
@@ -72,6 +72,7 @@ public void run() {
*/
return ;
}
+ System.out.println("J2S loading file " + file);
Properties props = new Properties();
try {
props.load(new FileInputStream(file));
@@ -117,6 +118,9 @@ public void run() {
if (sourceUnit instanceof SourceFile) {
SourceFile unitSource = (SourceFile) sourceUnit;
String fileName = new String(unitSource.getFileName());
+
+ System.out.println("J2S processing file " + fileName);
+
int idx = fileName.lastIndexOf('/');
String className = fileName.substring(idx + 1, fileName.lastIndexOf('.'));
StringBuffer path = new StringBuffer();
@@ -423,6 +427,7 @@ public static void outputJavaScript(ASTScriptVisitor visitor, DependencyASTVisit
File jsFile = new File(folderPath, elementName + ".js"); //$NON-NLS-1$
try {
FileOutputStream fos = new FileOutputStream(jsFile);
+ System.out.println("J2S creating " + jsFile);
if (addUTF8Header) {
fos.write(new byte[] {(byte) 0xef, (byte) 0xbb, (byte) 0xbf}); // UTF-8 header!
}
diff --git a/sources/net.sf.j2s.ui/src/net/sf/j2s/ui/launching/J2SApplicationRunnable.java b/sources/net.sf.j2s.ui/src/net/sf/j2s/ui/launching/J2SApplicationRunnable.java
index 10e9189a8..dfaa4ac20 100644
--- a/sources/net.sf.j2s.ui/src/net/sf/j2s/ui/launching/J2SApplicationRunnable.java
+++ b/sources/net.sf.j2s.ui/src/net/sf/j2s/ui/launching/J2SApplicationRunnable.java
@@ -12,12 +12,12 @@
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.program.Program;
import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IViewReference;
+//import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
-import org.eclipse.ui.internal.WorkbenchPage;
+//import org.eclipse.ui.internal.WorkbenchPage;
public class J2SApplicationRunnable implements Runnable {
ILaunchConfiguration configuration;
@@ -30,7 +30,7 @@ public J2SApplicationRunnable(ILaunchConfiguration configuration, String url) {
public void run() {
boolean isToViewInConsole = true;
- boolean isViewFast = false;
+// boolean isViewFast = false;
boolean isViewMaximize = false;
try {
IPreferenceStore store = Java2ScriptUIPlugin.getDefault().getPreferenceStore();
@@ -41,8 +41,8 @@ public void run() {
IJ2SLauchingConfiguration.VIEW_IN_INNER_J2S_CONSOLE, preferred);
isViewMaximize = configuration.getAttribute(
IJ2SLauchingConfiguration.MAXIMIZE_J2S_CONSOLE, false);
- isViewFast = configuration.getAttribute(
- IJ2SLauchingConfiguration.FAST_VIEW_J2S_CONSOLE, false);
+// isViewFast = configuration.getAttribute(
+// IJ2SLauchingConfiguration.FAST_VIEW_J2S_CONSOLE, false);
} catch (CoreException e1) {
e1.printStackTrace();
}
@@ -80,9 +80,9 @@ public void run() {
J2SConsoleView j2sConsole = (J2SConsoleView) console;
IWorkbenchPage page = j2sConsole.getViewSite().getWorkbenchWindow()
.getActivePage();
- WorkbenchPage wp = (WorkbenchPage) page;
- IViewReference ref = wp
- .findViewReference("net.sf.j2s.ui.console.J2SConsoleView");
+// WorkbenchPage wp = (WorkbenchPage) page;
+// IViewReference ref = wp
+// .findViewReference("net.sf.j2s.ui.console.J2SConsoleView");
// if (isViewFast && !wp.isFastView(ref)) {
// wp.addFastView(ref);
// }