Community
Participate
Working Groups
Build Identifier: I20100608-0911 If one declares a private constructor with 255 parameters and accesses it from another class in the same file, Eclipse generates a synthetic constructor with 256 parameters, which is invalid and causes a ClassFormatError when the class is loaded. This is a bug that no real user should ever encounter, so I'm marking it trivial. For comparison, javac reports the following error, which is reasonable but doesn't give the user an explicit clue that a synthetic constructor is involved: SyntheticConstructorTooManyArgs.java:6: too many parameters static class A { ^ 1 error Reproducible: Always Steps to Reproduce: 1. Compile and run the file I am about to attach.
Created attachment 175636 [details] Test case
I think I have a fix for this. We would report: The synthetic method created to access A(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) of type SyntheticConstructorTooManyArgs.A has too many parameters How does this look ? And then a problem type is created for the corresponding class.
The error message sounds good. I'm not clear on what you are proposing with the "problem type", but it sounds like it might be overkill. Eclipse should be able to compile all code that references A and its members except for calls to the problematic synthetic method.
(In reply to comment #3) > The error message sounds good. I'm not clear on what you are proposing with > the "problem type", but it sounds like it might be overkill. Eclipse should be > able to compile all code that references A and its members except for calls to > the problematic synthetic method. Yes, but when the synthetic method cannot be created because it has too many parameters, then an error is issued and inside the environment this ends up as a problem type. A problem type is a type where each method is a problem method. So the methods exist, but they cannot be run without throwing an exception. This prevents lots of secondary errors.
Created attachment 178069 [details] Proposed fix This should be good enough for this corner case.
I will test the patch. But why does it change "report" to "eport" in an unrelated test case?
This is unrelated. When I create a test case, I end up with \r\n and I replace them with \bn. \report was causing me grief when I did a replace all. So I removed the 'r' from report. It is just that I released both changes at the same time.
Released for 3.7M2. I reverted the confusing change in test 81.
Eclipse compiler now behaves similar to the javac, but both compilers fail when the inner class is not static. For private constructors of non-static inner classes, the synthetic method takes two additional parameters. Filed bug 325321 to take care of it. As the mentioned bug is fixed, am marking this verified. Verified for 3.7M2 using build I20100909-1700