View | Details | Raw Unified | Return to bug 138999
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/WorkingCopyOwnerTests.java (+13 lines)
Lines 984-989 Link Here
984
		this.workingCopy.commitWorkingCopy(true, null);
984
		this.workingCopy.commitWorkingCopy(true, null);
985
		assertFalse("Should not have unsaved changes", this.workingCopy.hasUnsavedChanges());
985
		assertFalse("Should not have unsaved changes", this.workingCopy.hasUnsavedChanges());
986
	}
986
	}
987
	
988
	/*
989
	 * Ensures that a Java project named " " doesn't exist if a working copy with no resource is created.
990
	 * (regression test for bug 138999 Regression: Fix for 128258 introduces regression in JavaProject.exists())
991
	 */
992
	public void testNewWorkingCopy09() throws CoreException {
993
		this.workingCopy = newExternalWorkingCopy(
994
			"X.java",
995
			"public class X {\n" +
996
			"}"
997
		);
998
		assertFalse("Java project named \" \" should not exist", getJavaProject(ExternalJavaProject.EXTERNAL_PROJECT_NAME).exists());
999
	}
987
1000
988
	/**
1001
	/**
989
	 * Ensures that creating a DOM AST and computing the bindings takes the owner's working copies into account.
1002
	 * Ensures that creating a DOM AST and computing the bindings takes the owner's working copies into account.
(-)model/org/eclipse/jdt/internal/core/JavaProject.java (-1 / +6 lines)
Lines 1009-1015 Link Here
1009
	}
1009
	}
1010
1010
1011
	public boolean exists() {
1011
	public boolean exists() {
1012
		return hasJavaNature(this.project);
1012
		try {
1013
			return this.project.hasNature(JavaCore.NATURE_ID);
1014
		} catch (CoreException e) {
1015
			// project does not exist or is not open
1016
		}
1017
		return false;
1013
	}	
1018
	}	
1014
1019
1015
	/**
1020
	/**

Return to bug 138999