Bug 34315 Refactoring lost source folder property on Java Project [refactoring]
RC2 In the process of "just working'. Renaming Java projects and contained java packages and classes I eventually go an error that a particular "path" could not be found and a bunch of stuff in my .log file. After all this the source folder in the refactored Java project is no longer a source folder. I will work on steps to reproduce but can not get to it until after I to the copyright updating. For now I will give you the general flavour of what I was doing and I will attach my .log file. 1) I had a Java project that was orignally created with the New Project Plugin Development - > Plug-in Project wizard (plug-in with a popup menu). 2) Several days development in this project under an older (pre RC2 build. Probably RC1). 3) Delete everything in Eclipse directory except Workspace 4) Unzip RC2. 5) Do more work in project 6) Refactor project doing the following: a) Refactor-Rename project (Noticed oddnesss is a Meta-Inf folder was created in new place 7) Renamed several classes in the project. 8) Deleted the Meta-Inf folder as uninteresting. Just one simple text file in it. 9) Renamed some more classes. On a class rename got an error dialog stating it could not find the class and output sent to .log.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/SearchUtil.java
new String[] { IDialogConstants.OK_LABEL },
				0);
	}
	
	private static boolean isBinaryPrimitveConstantOrString(IJavaElement element) {
		if (element != null && element.getElementType() == IJavaElement.FIELD) {
			IField field= (IField)element;
			int flags;
			try {
				flags= field.getFlags();
			} catch (JavaModelException ex) {
				return false;
			}
			return field.isBinary() && Flags.isStatic(flags) && Flags.isFinal(flags) && isPrimitiveOrString(field);
		}
		return false;
	}
	private static boolean isPrimitiveOrString(IField field) {
		String fieldType;
		try {
			fieldType= field.getTypeSignature();
		} catch (JavaModelException ex) {
			return false;
		}
		char first= fieldType.charAt(0);
		return (first != Signature.C_RESOLVED && first != Signature.C_UNRESOLVED && first != Signature.C_ARRAY)
			|| (first == Signature.C_RESOLVED && fieldType.substring(1, fieldType.length() - 1).equals(String.class.getName()));
	}
}