Example usage for org.eclipse.jdt.internal.core.util Messages build_readingDelta

List of usage examples for org.eclipse.jdt.internal.core.util Messages build_readingDelta

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core.util Messages build_readingDelta.

Prototype

String build_readingDelta

To view the source code for org.eclipse.jdt.internal.core.util Messages build_readingDelta.

Click Source Link

Usage

From source file:net.sf.j2s.core.builder.JavaBuilder.java

License:Open Source License

private SimpleLookupTable findDeltas() {
    this.notifier.subTask(Messages.bind(Messages.build_readingDelta, this.currentProject.getName()));
    IResourceDelta delta = getDelta(this.currentProject);
    SimpleLookupTable deltas = new SimpleLookupTable(3);
    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$
            deltas.put(this.currentProject, delta);
        }//  ww  w .j  a v  a2s .com
    } else {
        if (DEBUG)
            System.out.println("JavaBuilder: Missing delta for: " + this.currentProject.getName()); //$NON-NLS-1$
        this.notifier.subTask(""); //$NON-NLS-1$
        return null;
    }

    Object[] keyTable = this.binaryLocationsPerProject.keyTable;
    Object[] valueTable = this.binaryLocationsPerProject.valueTable;
    nextProject: for (int i = 0, l = keyTable.length; i < l; i++) {
        IProject p = (IProject) keyTable[i];
        if (p != null && p != this.currentProject) {
            State s = getLastState(p);
            if (!this.lastState.wasStructurallyChanged(p, s)) { // see if we can skip its delta
                if (s.wasNoopBuild())
                    continue nextProject; // project has no source folders and can be skipped
                ClasspathLocation[] classFoldersAndJars = (ClasspathLocation[]) valueTable[i];
                boolean canSkip = true;
                for (int j = 0, m = classFoldersAndJars.length; j < m; j++) {
                    if (classFoldersAndJars[j].isOutputFolder())
                        classFoldersAndJars[j] = null; // can ignore output folder since project was not structurally changed
                    else
                        canSkip = false;
                }
                if (canSkip)
                    continue nextProject; // project has no structural changes in its output folders
            }

            this.notifier.subTask(Messages.bind(Messages.build_readingDelta, p.getName()));
            delta = getDelta(p);
            if (delta != null) {
                if (delta.getKind() != IResourceDelta.NO_CHANGE) {
                    if (DEBUG)
                        System.out.println("JavaBuilder: 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$
                this.notifier.subTask(""); //$NON-NLS-1$
                return null;
            }
        }
    }
    this.notifier.subTask(""); //$NON-NLS-1$
    return deltas;
}