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

Mostly empty classpath delta on classpath entry attribute change #486

Closed
trancexpress opened this issue Oct 21, 2022 · 1 comment · Fixed by #492
Closed

Mostly empty classpath delta on classpath entry attribute change #486

trancexpress opened this issue Oct 21, 2022 · 1 comment · Fixed by #492
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@trancexpress
Copy link
Contributor

If some of the classpath entry attributes change (e.g. JavaDoc location or test attribute), a delta like this is sent:

xxxx[*]:
{RESOLVED CLASSPATH CHANGED} 

From the attributes we have tested with, on changes in the module attribute the delta looks fine.

Any listener will observe the delta and will have no idea what changed, as classpath entries that did change are not listed. This seems to be due to ClasspathChange.generateDelta() detecting a change via JavaProject.areClasspathsEqual(), but not visiting entry attributes when adding children to the created delta.

In our case, this situation results in xtext triggering a full build on an irrelevant classpath change (the JavaDoc location). As xtext cannot examine what changed, it can only assume the worst and do a build.

We should ensure the delta contains the changed classpath entries, ideally also with information about what changed.

@trancexpress
Copy link
Contributor Author

I've asked on the JDT mailing list, whether we want to fill the delta with the missing information. We'll see if anyone objects or has other suggestions.

trancexpress added a commit to trancexpress/eclipse.jdt.core that referenced this issue Oct 25, 2022
…pse-jdt#486

When the JavaDoc of a classpath entry changes, a mostly empty delta is
created by ClasspathChange.

This change adds new API, to ensure such deltas list what classpath
attributes changed.

The new information is listed under new package fragment root children
of the delta with the new flag IJavaElementDelta.F_ATTRIBUTES. The
specific attribute changes can be accessed via:

org.eclipse.jdt.core.IJavaElementDelta.getAttributeDeltas()
org.eclipse.jdt.core.IClasspathAttributeDelta

getAttributeDeltas() will return an empty array if there are no
classpath attributes that changed or if the delta element cannot have
such changes.

Fixes: eclipse-jdt#486
trancexpress added a commit to trancexpress/eclipse.jdt.core that referenced this issue Oct 25, 2022
…pse-jdt#486

When the JavaDoc of a classpath entry changes, a mostly empty delta is
created by ClasspathChange.

This change adds new API, to ensure such deltas list what classpath
attributes changed.

The new information is listed under new package fragment root children
of the delta with the new flag IJavaElementDelta.F_ATTRIBUTES. The
specific attribute changes can be accessed via:

org.eclipse.jdt.core.IJavaElementDelta.getAttributeDeltas()
org.eclipse.jdt.core.IClasspathAttributeDelta

getAttributeDeltas() will return an empty array if there are no
classpath attributes that changed or if the delta element cannot have
such changes.

Fixes: eclipse-jdt#486
iloveeclipse pushed a commit to trancexpress/eclipse.jdt.core that referenced this issue Oct 27, 2022
…pse-jdt#486

When the JavaDoc of a classpath entry changes, a mostly empty delta is
created by ClasspathChange.

This change adds new API, to ensure such deltas list what classpath
attributes changed.

The new information is listed under new package fragment root children
of the delta with the new flag IJavaElementDelta.F_CLASSPATH_ATTRIBUTES.
The specific attribute changes can be accessed via:

org.eclipse.jdt.core.IJavaElementDelta.getClasspathAttributeDeltas()
org.eclipse.jdt.core.IClasspathAttributeDelta

getClasspathAttributeDeltas() will return an empty array if there are no
classpath attributes that changed or if the delta element cannot have
such changes.

Fixes: eclipse-jdt#486
iloveeclipse pushed a commit to trancexpress/eclipse.jdt.core that referenced this issue Dec 6, 2022
…pse-jdt#486

When the JavaDoc of a classpath entry changes, a mostly empty delta is
created by ClasspathChange.

This change adds new API, to ensure such deltas list what classpath
attributes changed.

The new information is listed under new package fragment root children
of the delta with the new flag IJavaElementDelta.F_CLASSPATH_ATTRIBUTES.
The specific attribute changes can be accessed via:

org.eclipse.jdt.core.IJavaElementDelta.getClasspathAttributeDeltas()
org.eclipse.jdt.core.IClasspathAttributeDelta

getClasspathAttributeDeltas() will return an empty array if there are no
classpath attributes that changed or if the delta element cannot have
such changes.

Fixes: eclipse-jdt#486
trancexpress added a commit to trancexpress/eclipse.jdt.core that referenced this issue Dec 7, 2022
…pse-jdt#486

When the JavaDoc of a classpath entry changes, a mostly empty delta is
created by ClasspathChange.

This change adds new API, to ensure such deltas list what classpath
attributes changed.

The new information is listed under new package fragment root children
of the delta with the new flag IJavaElementDelta.F_ATTRIBUTES. The
specific attribute changes can be accessed via:

org.eclipse.jdt.core.IJavaElementDelta.getAttributeDeltas()
org.eclipse.jdt.core.IClasspathAttributeDelta

getAttributeDeltas() will return an empty array if there are no
classpath attributes that changed or if the delta element cannot have
such changes.

Fixes: eclipse-jdt#486
trancexpress added a commit to trancexpress/eclipse.jdt.core that referenced this issue Dec 7, 2022
…pse-jdt#486

When the JavaDoc of a classpath entry changes, a mostly empty delta is
created by ClasspathChange.

This change adds new API, to ensure such deltas list what classpath
attributes changed.

The new information is listed under new package fragment root children
of the delta with the new flag IJavaElementDelta.F_CLASSPATH_ATTRIBUTES.
The specific attribute changes can be accessed via:

org.eclipse.jdt.core.IJavaElementDelta.getClasspathAttributeDeltas()
org.eclipse.jdt.core.IClasspathAttributeDelta

getClasspathAttributeDeltas() will return an empty array if there are no
classpath attributes that changed or if the delta element cannot have
such changes.

Fixes: eclipse-jdt#486
iloveeclipse pushed a commit to trancexpress/eclipse.jdt.core that referenced this issue Dec 7, 2022
…pse-jdt#486

When the JavaDoc of a classpath entry changes, a mostly empty delta is
created by ClasspathChange.

This change adds new API, to ensure such deltas list what classpath
attributes changed.

The new information is listed under new package fragment root children
of the delta with the new flag IJavaElementDelta.F_CLASSPATH_ATTRIBUTES.
The specific attribute changes can be accessed via:

org.eclipse.jdt.core.IJavaElementDelta.getClasspathAttributeDeltas()
org.eclipse.jdt.core.IClasspathAttributeDelta

getClasspathAttributeDeltas() will return an empty array if there are no
classpath attributes that changed or if the delta element cannot have
such changes.

Fixes: eclipse-jdt#486
trancexpress added a commit to trancexpress/eclipse.jdt.core that referenced this issue Dec 8, 2022
…pse-jdt#486

When the JavaDoc of a classpath entry changes, a mostly empty delta is
created by ClasspathChange.

This change adds new API, to ensure such deltas list what classpath
attributes changed.

The new information is listed under new package fragment root children
of the delta with the new flag IJavaElementDelta.F_CLASSPATH_ATTRIBUTES.
The specific attribute changes can be accessed via:

org.eclipse.jdt.core.IJavaElementDelta.getClasspathAttributeDeltas()
org.eclipse.jdt.core.IClasspathAttributeDelta

getClasspathAttributeDeltas() will return an empty array if there are no
classpath attributes that changed or if the delta element cannot have
such changes.

Fixes: eclipse-jdt#486
trancexpress added a commit to trancexpress/eclipse.jdt.core that referenced this issue Dec 8, 2022
…pse-jdt#486

When the JavaDoc of a classpath entry changes, a mostly empty delta is
created by ClasspathChange.

This change adds new API, to ensure such deltas list what classpath
attributes changed.

The new information is listed under new package fragment root children
of the delta with the new flag IJavaElementDelta.F_CLASSPATH_ATTRIBUTES.
The specific attribute changes can be accessed via:

org.eclipse.jdt.core.IJavaElementDelta.getClasspathAttributeDeltas()
org.eclipse.jdt.core.IClasspathAttributeDelta

getClasspathAttributeDeltas() will return an empty array if there are no
classpath attributes that changed or if the delta element cannot have
such changes.

Fixes: eclipse-jdt#486
trancexpress added a commit to trancexpress/eclipse.jdt.core that referenced this issue Dec 8, 2022
…pse-jdt#486

When the JavaDoc of a classpath entry changes, a mostly empty delta is
created by ClasspathChange.

This change adds new API, to ensure such deltas list what classpath
attributes changed.

The new information is listed under new package fragment root children
of the delta with the new flag IJavaElementDelta.F_CLASSPATH_ATTRIBUTES.
The specific attribute changes can be accessed via:

org.eclipse.jdt.core.IJavaElementDelta.getClasspathAttributeDeltas()
org.eclipse.jdt.core.IClasspathAttributeDelta

getClasspathAttributeDeltas() will return an empty array if there are no
classpath attributes that changed or if the delta element cannot have
such changes.

Fixes: eclipse-jdt#486
iloveeclipse pushed a commit that referenced this issue Dec 8, 2022
When the JavaDoc of a classpath entry changes, a mostly empty delta is
created by ClasspathChange.

This change adds new API, to ensure such deltas list what classpath
attributes changed.

The new information is listed under new package fragment root children
of the delta with the new flag IJavaElementDelta.F_CLASSPATH_ATTRIBUTES.
The specific attribute changes can be accessed via:

org.eclipse.jdt.core.IJavaElementDelta.getClasspathAttributeDeltas()
org.eclipse.jdt.core.IClasspathAttributeDelta

getClasspathAttributeDeltas() will return an empty array if there are no
classpath attributes that changed or if the delta element cannot have
such changes.

Fixes: #486
@iloveeclipse iloveeclipse added the enhancement New feature or request label Dec 9, 2022
@iloveeclipse iloveeclipse added this to the 4.27 M1 milestone Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants