Bug 293876 - Refactoring does not work. Internal error.
Summary: Refactoring does not work. Internal error.
Status: CLOSED DUPLICATE of bug 293861
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-01 13:59 EST by Unge CLA
Modified: 2009-11-02 10:57 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Unge CLA 2009-11-01 13:59:57 EST
Can't rename any method in classes.

-- Error Details --
Date: Sun Nov 01 20:50:59 EET 2009
Message: Internal Error
Severity: Error
Product: Eclipse 1.2.0.20090618-0904 (org.eclipse.epp.package.jee.product)
Plugin: org.eclipse.jdt.ui
Session Data:
eclipse.buildId=I20090611-1540
java.version=1.6.0_0
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=ru_UA
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.jee.product


Exception Stack Trace:
java.lang.reflect.InvocationTargetException
	at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:110)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: Java Model Exception: Java Model Status [1.0.com.sun.tools.xjc.reader.xmlschema [in lib/jaxb-xjc.jar [in demo.papchap.httpserver]] does not exist]
	at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:502)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:246)
	at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:504)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:240)
	at org.eclipse.jdt.internal.core.SourceRefElement.generateInfos(SourceRefElement.java:107)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:515)
	at org.eclipse.jdt.internal.core.BinaryType.getElementInfo(BinaryType.java:285)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:238)
	at org.eclipse.jdt.internal.core.BinaryType.isInterface(BinaryType.java:722)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.findAllRippleMethods(RippleMethodFinder2.java:242)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.getAllRippleMethods(RippleMethodFinder2.java:168)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.getRelatedMethods(RippleMethodFinder2.java:161)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RenameMethodProcessor.initializeMethodsToRename(RenameMethodProcessor.java:236)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RenameMethodProcessor.doCheckFinalConditions(RenameMethodProcessor.java:360)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RenameVirtualMethodProcessor.doCheckFinalConditions(RenameVirtualMethodProcessor.java:143)
	at org.eclipse.jdt.internal.corext.refactoring.rename.JavaRenameProcessor.checkFinalConditions(JavaRenameProcessor.java:46)
	at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFinalConditions(ProcessorBasedRefactoring.java:224)
	at org.eclipse.ltk.core.refactoring.Refactoring.checkAllConditions(Refactoring.java:160)
	at org.eclipse.jdt.internal.ui.refactoring.RefactoringExecutionHelper$Operation.run(RefactoringExecutionHelper.java:80)
	at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
	at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4694)
	at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:106)
	... 1 more
Comment 1 Olivier Thomann CLA 2009-11-01 16:04:17 EST
Steps to reproduce would be welcome.
If you can extract a small test case that reproduces the issue, this would be perfect.
Comment 2 Unge CLA 2009-11-01 17:58:39 EST
(In reply to comment #1)
> Steps to reproduce would be welcome.
> If you can extract a small test case that reproduces the issue, this would be
> perfect.

Thank you for answer.
Hm, I do not know how I can reproduce this trouble to test case.
I try to change method name 'start' to 'go' (and others method to another names)
For example: this is my code:

public class HTTPDLauncher {
	private Logger log = Logger.getLogger(HTTPDLauncher.class);
	static String configName;
	private HTTPD httpd;
	private JAXBContext jc;
	private final String PACKAGE_NAME = "demo.papchap.httpserver.config.xmlimpl";
	
	private static void usage(String programName) {
		System.out.println("usage: " + programName + " [options]");
		System.out.println("options: -c, --config\t\tSet config xml file name");
		System.out.println("exiting.");
		System.exit(0);
	}
	private static void commandLineParse(String[] args) {
		if (args == null)
			return;
		String programName = System.getProperty("program.name", "HTTPD");
		String sopts = "-:hn:c:";
		LongOpt[] lopts = {
				new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
				new LongOpt("config", LongOpt.REQUIRED_ARGUMENT, null, 'c') };

		Getopt getopt = new Getopt(programName, args, sopts, lopts);
		int code;
		if (args.length < 1)
			usage(programName);
		while ((code = getopt.getopt()) != -1) {
			switch (code) {
			case ':':
			case '?':
				System.exit(1);
				break;
			case 1:
				System.err
						.println(programName + ": unused non-option argument: "
								+ getopt.getOptarg());
				break;
			case 'h':
				usage(programName);
			case 'c':
				configName = getopt.getOptarg();
				break;
			}

		}// end while
	}
	
	private ConfigRootHandler createConfig(){
		try {
			jc = JAXBContext.newInstance(PACKAGE_NAME);
			Unmarshaller u = jc.createUnmarshaller();
			ConfigRootHandler c = (ConfigRootHandler) u.unmarshal(new FileInputStream(
					configName));
			return c;
		} catch (Exception e) {
			log.error(e.toString(), e);
			System.err.println("Exiting.");
			System.exit(-1);
			return null; // java stub. 
		}				
	}
	
	public void start() {
		log.info("Demo HTTPD started");
		httpd = new HTTPD(createConfig());
		try{
			httpd.startSession();
			httpd.join();
		}catch(Exception e){
			log.error(e.toString(), e);
		}
		log.info("Done");
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		commandLineParse(args);
		HTTPDLauncher httpd = new HTTPDLauncher();
		httpd.start();
	}

}
Comment 3 Olivier Thomann CLA 2009-11-02 10:54:30 EST
It seems to be related to invalid package names (1.0.com.sun.tools.xjc.reader.xmlschema). '1' or '0' are invalid package names.

We need to have a consistent approach inside JDT when package names are invalid.
Comment 4 Olivier Thomann CLA 2009-11-02 10:57:54 EST
The problem with invalid package names is reported in bug 293861.
Closing as a duplicate of bug 293861.

*** This bug has been marked as a duplicate of bug 293861 ***