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

Compile avoidance should respect public constant changes #1476

Closed
oehme opened this issue Feb 28, 2017 · 4 comments
Closed

Compile avoidance should respect public constant changes #1476

oehme opened this issue Feb 28, 2017 · 4 comments

Comments

@oehme
Copy link
Contributor

oehme commented Feb 28, 2017

The API extractor used by the new @CompileClasspath snapshotter drops public constants, making incremental builds incorrect. This affects the following use case:

class A {
  public static final int FOO = 1;
}

class B {
  public void bar() {
    System.out.println(A.FOO);
  }
}

When A.Foo is changed, B should be recompiled, but isn't, resulting in wrong results.

@melix
Copy link
Contributor

melix commented Feb 28, 2017

To be clear, this happens independently of incremental compilation and only if the 2 classes are in different projects.

@oehme
Copy link
Contributor Author

oehme commented Feb 28, 2017

The only workarounds are calling clean or --rerun-tasks or making a dummy change to B.

melix added a commit that referenced this issue Feb 28, 2017
This commit fixes the ABI extractor, which ignored the value of constants. This was bad because if a constant value
changed, we wouldn't trigger recompilation of consumers (independently of incremental compilation). Since the compiler
can inline those values, incremental compilation wouldn't catch the problem either.

Fixes: #1476
@melix
Copy link
Contributor

melix commented Feb 28, 2017

Here's the tentative fix. It coincidentally fixes #1474 when used with JDK 8 (but not JDK 7).

@oehme
Copy link
Contributor Author

oehme commented Feb 28, 2017

Fix looks good to me.

@oehme oehme modified the milestones: 3.4.1, 3.5 RC1 Mar 1, 2017
melix added a commit that referenced this issue Mar 1, 2017
This commit fixes the ABI extractor, which ignored the value of constants. This was bad because if a constant value
changed, we wouldn't trigger recompilation of consumers (independently of incremental compilation). Since the compiler
can inline those values, incremental compilation wouldn't catch the problem either.

Fixes: #1476
melix added a commit that referenced this issue Mar 2, 2017
This commit fixes the ABI extractor, which ignored the value of constants. This was bad because if a constant value
changed, we wouldn't trigger recompilation of consumers (independently of incremental compilation). Since the compiler
can inline those values, incremental compilation wouldn't catch the problem either.

Fixes: #1476
@melix melix closed this as completed Mar 3, 2017
@lacasseio lacasseio modified the milestones: 3.4.1 RC1, 3.4.1 Mar 3, 2017
@jjohannes jjohannes modified the milestones: 3.4.1, 3.4.1 RC1 Jun 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants