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

ECJ compiler errors #621

Merged
merged 1 commit into from
Mar 23, 2023
Merged

ECJ compiler errors #621

merged 1 commit into from
Mar 23, 2023

Conversation

snjeza
Copy link
Contributor

@snjeza snjeza commented Dec 30, 2022

Fixes #612

Signed-off-by: Snjezana Peco [email protected]

@snjeza snjeza changed the title ECJ compiler errors.Fixes #612 ECJ compiler errors Dec 30, 2022
@snjeza snjeza force-pushed the issue612 branch 2 times, most recently from 8e02b08 to a1229f1 Compare January 8, 2023 14:41
Copy link
Contributor

@stephan-herrmann stephan-herrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @snjeza, the change is going in a good direction.

@stephan-herrmann
Copy link
Contributor

For posterity: in search for the best location of the fix I suggested to push it into findMemberType() which @snjeza answered as causing regressions in some tests. I then made the experiment of pulling it out into QualifiedTypeReference.findNextTypeBinding(), like so:


	protected TypeBinding findNextTypeBinding(int tokenIndex, Scope scope, PackageBinding packageBinding) {
		LookupEnvironment env = scope.environment();
		try {
			env.missingClassFileLocation = this;
			if (this.resolvedType == null) {
				this.resolvedType = scope.getType(this.tokens[tokenIndex], packageBinding);
			} else {
// begin change:
				ReferenceBinding enclosingType = (ReferenceBinding) this.resolvedType;
				this.resolvedType = scope.getMemberType(this.tokens[tokenIndex], enclosingType);
				if (!this.resolvedType.isValidBinding()) {
					TypeBinding problemBinding = this.resolvedType;
					if (enclosingType.isHierarchyBeingConnected() && scope.kind == Scope.CLASS_SCOPE) {
						TypeDeclaration referenceContext = ((ClassScope) scope).referenceContext;
						TypeReference superTypeReference = referenceContext.superclass;
						if (superTypeReference != null && superTypeReference.resolvedType instanceof ReferenceBinding) {
							this.resolvedType = scope.findMemberType(this.tokens[tokenIndex], (ReferenceBinding) superTypeReference.resolvedType);
						}
						if ((this.resolvedType == null || !this.resolvedType.isValidBinding())
								&& referenceContext.superInterfaces != null && referenceContext.superInterfaces.length > 0) {
							TypeReference[] interfaces = referenceContext.superInterfaces;
							for (TypeReference reference : interfaces) {
								if (reference != null && reference.resolvedType instanceof ReferenceBinding) {
									this.resolvedType = scope.findMemberType(this.tokens[tokenIndex], (ReferenceBinding) reference.resolvedType);
									if (this.resolvedType != null) {
										break;
									}
								}
							}
						}
						if (this.resolvedType != null && this.resolvedType.isValidBinding()) {
							return this.resolvedType;
						}
					}

					this.resolvedType = new ProblemReferenceBinding(
						CharOperation.subarray(this.tokens, 0, tokenIndex + 1),
						(ReferenceBinding) problemBinding.closestMatch(),
						this.resolvedType.problemId());
// end change
				}
			}
			return this.resolvedType;
		} catch (AbortCompilation e) {
			e.updateContext(this, scope.referenceCompilationUnit().compilationResult);
			throw e;
		} finally {
			env.missingClassFileLocation = null;
		}
	}

On the one hand this would reflect the fact, that indeed a qualified type reference caused the original error. OTOH I cannot prove this to be a better location. That's why I'm just dumping that version here, should the change in getMemberType() cause trouble in a future incident.

@iloveeclipse
Copy link
Member

Since we've just merged JAVA20 branch code to master, I 've rebased branch to make sure we don't introduce a regression.

@stephan-herrmann
Copy link
Contributor

OK, so my extended description came a bit late :)
I had attempted to add:

Ensure qualified type references are correctly resolved relative to a type whose hierarchy is currently being conntected

@iloveeclipse
Copy link
Member

@stephan-herrmann : any objections to merge now, or you are still on it?

@stephan-herrmann stephan-herrmann merged commit 4b2e462 into eclipse-jdt:master Mar 23, 2023
robstryker pushed a commit to robstryker/eclipse.jdt.core that referenced this pull request Jul 18, 2024
Ensure qualified type references are correctly resolved relative to a type whose hierarchy is currently being connected
datho7561 pushed a commit to datho7561/eclipse.jdt.core that referenced this pull request Jul 23, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Jul 26, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
akurtakov pushed a commit to akurtakov/eclipse.jdt.core that referenced this pull request Jul 29, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
akurtakov pushed a commit to akurtakov/eclipse.jdt.core that referenced this pull request Aug 16, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Sep 5, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Sep 9, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Sep 10, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
akurtakov pushed a commit to akurtakov/eclipse.jdt.core that referenced this pull request Sep 18, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Sep 24, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Sep 24, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Oct 15, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
datho7561 pushed a commit to datho7561/eclipse.jdt.core that referenced this pull request Oct 18, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Oct 23, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
akurtakov pushed a commit to akurtakov/eclipse.jdt.core that referenced this pull request Nov 12, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Dec 5, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Dec 6, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Dec 13, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
datho7561 pushed a commit to datho7561/eclipse.jdt.core that referenced this pull request Dec 13, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Dec 15, 2024
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Jan 6, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
datho7561 pushed a commit to datho7561/eclipse.jdt.core that referenced this pull request Jan 7, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
akurtakov pushed a commit to akurtakov/eclipse.jdt.core that referenced this pull request Jan 10, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
robstryker added a commit to robstryker/eclipse.jdt.core that referenced this pull request Jan 15, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
datho7561 pushed a commit to datho7561/eclipse.jdt.core that referenced this pull request Jan 22, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
datho7561 pushed a commit to datho7561/eclipse.jdt.core that referenced this pull request Jan 22, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
datho7561 pushed a commit to datho7561/eclipse.jdt.core that referenced this pull request Jan 27, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Jan 29, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
datho7561 pushed a commit to datho7561/eclipse.jdt.core that referenced this pull request Jan 29, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
robstryker added a commit to robstryker/eclipse.jdt.core that referenced this pull request Jan 31, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
robstryker added a commit to robstryker/eclipse.jdt.core that referenced this pull request Jan 31, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Jan 31, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
robstryker added a commit to robstryker/eclipse.jdt.core that referenced this pull request Jan 31, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
datho7561 pushed a commit to datho7561/eclipse.jdt.core that referenced this pull request Jan 31, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
datho7561 pushed a commit to datho7561/eclipse.jdt.core that referenced this pull request Feb 3, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
akurtakov pushed a commit to akurtakov/eclipse.jdt.core that referenced this pull request Feb 6, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
robstryker added a commit to robstryker/eclipse.jdt.core that referenced this pull request Feb 6, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
robstryker added a commit to robstryker/eclipse.jdt.core that referenced this pull request Feb 6, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Feb 7, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
robstryker added a commit to robstryker/eclipse.jdt.core that referenced this pull request Feb 7, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Feb 10, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
mickaelistria pushed a commit to mickaelistria/eclipse.jdt.core that referenced this pull request Feb 10, 2025
…e-jdt#621)

* Fix some bugs requiring == for multiple resolutions on a node

Signed-off-by: Rob Stryker <[email protected]>

* Cleanup

Signed-off-by: Rob Stryker <[email protected]>

---------

Signed-off-by: Rob Stryker <[email protected]>
Co-authored-by: Rob Stryker <[email protected]>
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

Successfully merging this pull request may close these issues.

[compiler] ECJ compiler errors
3 participants