Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importing nested static method breaks compilation #1249

Closed
michaelkuechler opened this issue Nov 30, 2016 · 3 comments
Closed

importing nested static method breaks compilation #1249

michaelkuechler opened this issue Nov 30, 2016 · 3 comments

Comments

@michaelkuechler
Copy link

my system (latest stable builds):

IntelliJ IDEA 2016.3
Build #IU-163.7743.44, built on November 17, 2016
JRE: 1.8.0_112-release-408-b2 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
IntelliJ Lombok plugin Version: 0.13.16

to reproduce, I use the following code:

package ch;

import static ch.LombokBug.Inner.foo;
import org.junit.Test;
import lombok.AllArgsConstructor;

public class LombokBug {

	@Test
	public void test() {
		foo();
	}

	@AllArgsConstructor
	static class Inner {
		static void foo() {}
	}
}

what I get:

  • in the editor, everything looks fine (no compilation issue marked!)
  • however, if I want to execute the test, the compiler fails with following message (and hence test is not even executed):
Error:(14, 10) java: cannot find symbol
  symbol:   class AllArgsConstructor
  location: class ch.LombokBug

what I expect:

  • same result as with following code, i.e. test passes
package ch;

//import static ch.LombokBug.Inner.foo;
import org.junit.Test;
import lombok.AllArgsConstructor;

public class LombokBug {

	@Test
	public void test() {
		//foo();
		Inner.foo();
	}

	@AllArgsConstructor
	static class Inner {
		static void foo() {}
	}
}
@cowwoc
Copy link

cowwoc commented May 8, 2017

Please see https://github.com/cowwoc/jackson-annotating-nested-classes. If you do a normal (non-static) import on the nested static class (not even its members) you will get the exact same kind of errors.

@omega09
Copy link

omega09 commented May 10, 2017

Duplicate of #884 and friends.

@rzwitserloot
Copy link
Collaborator

cannot reproduce (and is not a duplicate of 884 and friends).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants