After I create classes in a certain package, and add an enum declaration inside the class, I can no longer generate getters and setters. I suspect it has something to do with the project settings or setup, but I’m not sure where to look. If I make the same class in its own project, I don’t see the problem.
public class ExampleClass {
private enum SampleEnum {
A, B, C;
}
private SampleEnum e;
private String variableToGenerateCodeOn;
}
When I try to generate getters and setters for variableToGenerateCodeOn, I get this error: cannot analyze selected field 'variableToGenerateCodeOn'
Edit
When I resolved the errors with tomcat, the problem didn’t go away. Of two others on my team, one was able to repro the bug with the same code, the other wasn’t. I am now guessing it has to do with some workspace settings, but I am open to additional ideas. The original thought is still preserved below:
Outdated/Ruled-out idea
I have several errors from some included tomcat files. One of them that might be applicable:
Description: Enumeration cannot be resolved to a type
On Detail: sessionDetail.jsp
In Folder: {myproject}/tomcat/webapps/manager/WEB-INF/jsp
Location: line 104
This is a defect in Eclipse Indigo. The presence of some nested declaration confuses the getter/setter code. You can report it in bugzilla. For now, move the enum out to its own file or type the getters and setters by paw. [dog joke]