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

Error marker when null analysis enabled #854

Closed
snjeza opened this issue Mar 17, 2023 · 3 comments
Closed

Error marker when null analysis enabled #854

snjeza opened this issue Mar 17, 2023 · 3 comments

Comments

@snjeza
Copy link
Contributor

snjeza commented Mar 17, 2023

A related issue - redhat-developer/vscode-java#3002

Steps to reproduce:

Type mismatch: cannot convert from Class<App.MyInit> to Class<? extends Init<? extends Configuration>>
snjeza added a commit to snjeza/eclipse.jdt.core that referenced this issue Mar 17, 2023
JDT checks superinterfaces (issue eclipse-jdt#629)/superclasses(issue eclipse-jdt#854) before connecting the hierarchy.
It happens only null analysis is enabled.
Related issue
- eclipse-jdt#629
- eclipse-jdt#854

Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
snjeza added a commit to snjeza/eclipse.jdt.core that referenced this issue Mar 17, 2023
JDT checks superinterfaces (issue eclipse-jdt#629)/superclasses(issue eclipse-jdt#854) before connecting the hierarchy.
It happens only when null analysis is enabled.
Related issue
- eclipse-jdt#629
- eclipse-jdt#854

Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
snjeza added a commit to snjeza/eclipse.jdt.core that referenced this issue Mar 21, 2023
JDT checks superinterfaces (issue eclipse-jdt#629)/superclasses(issue eclipse-jdt#854) before connecting the hierarchy.
It happens only when null analysis is enabled.
Related issue
- eclipse-jdt#629
- eclipse-jdt#854

Fixes eclipse-jdt#854

Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
snjeza added a commit to snjeza/eclipse.jdt.core that referenced this issue Mar 21, 2023
JDT checks superinterfaces (issue eclipse-jdt#629)/superclasses(issue eclipse-jdt#854) before connecting the hierarchy.
The issue happens only when null analysis is enabled.
This patch try to find superinterfaces/superclasses in SourceTypeBinding.scope.requestContext
Related issue
- eclipse-jdt#629
- eclipse-jdt#854

Fixes eclipse-jdt#854

Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
snjeza added a commit to snjeza/eclipse.jdt.core that referenced this issue Mar 23, 2023
JDT checks superinterfaces (issue eclipse-jdt#629)/superclasses(issue eclipse-jdt#854) before connecting the hierarchy.
The issue happens only when null analysis is enabled.
This patch try to find superinterfaces/superclasses in SourceTypeBinding.scope.requestContext
Related issue
- eclipse-jdt#629
- eclipse-jdt#854

Fixes eclipse-jdt#854

Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
gayanper pushed a commit to snjeza/eclipse.jdt.core that referenced this issue Apr 2, 2023
JDT checks superinterfaces (issue eclipse-jdt#629)/superclasses(issue eclipse-jdt#854) before connecting the hierarchy.
The issue happens only when null analysis is enabled.
This patch try to find superinterfaces/superclasses in SourceTypeBinding.scope.requestContext
Related issue
- eclipse-jdt#629
- eclipse-jdt#854

Fixes eclipse-jdt#854

Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
snjeza added a commit to snjeza/eclipse.jdt.core that referenced this issue May 15, 2023
JDT checks superinterfaces (issue eclipse-jdt#629)/superclasses(issue eclipse-jdt#854) before connecting the hierarchy.
The issue happens only when null analysis is enabled.
This patch try to find superinterfaces/superclasses in SourceTypeBinding.scope.requestContext
Related issue
- eclipse-jdt#629
- eclipse-jdt#854

Fixes eclipse-jdt#854

Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
stephan-herrmann added a commit to stephan-herrmann/eclipse.jdt.core that referenced this issue May 18, 2023
(regression 2023-03)

Avoids any risky ahead-of-time resolving of annotation details

Common point-fix for these problems:
* eclipse-jdt#1007
* eclipse-jdt#854
* redhat-developer/vscode-java#3076

Reverts/replaces part of the fix from:
* eclipse-jdt#630
stephan-herrmann added a commit to stephan-herrmann/eclipse.jdt.core that referenced this issue May 18, 2023
(regression 2023-03)

Avoids any risky ahead-of-time resolving of annotation details

Common point-fix for these problems:
* eclipse-jdt#1007
* eclipse-jdt#854
* redhat-developer/vscode-java#3076

Reverts/replaces part of the fix from:
* eclipse-jdt#630
stephan-herrmann added a commit to stephan-herrmann/eclipse.jdt.core that referenced this issue May 18, 2023
(regression 2023-03)

Avoids any risky ahead-of-time resolving of annotation details

Common point-fix for these problems:
* eclipse-jdt#1007
* eclipse-jdt#854
* redhat-developer/vscode-java#3076
* eclipse-jdt#986

Reverts/replaces part of the fix from:
* eclipse-jdt#630
stephan-herrmann added a commit to stephan-herrmann/eclipse.jdt.core that referenced this issue May 18, 2023
(regression 2023-03)

Avoids any risky ahead-of-time resolving of annotation details

Common point-fix for these problems:
* eclipse-jdt#1007
* eclipse-jdt#854
* redhat-developer/vscode-java#3076
* eclipse-jdt#986

Reverts/replaces part of the fix from:
* eclipse-jdt#630
@stephan-herrmann
Copy link
Contributor

This problem is covered by #1067

stephan-herrmann added a commit to stephan-herrmann/eclipse.jdt.core that referenced this issue May 21, 2023
(regression 2023-03)

Avoids any risky ahead-of-time resolving of annotations

Introduces a new phase CONNECT_TYPE_HIERARCHY2 to finish deferred work

Common fix for these problems:
* eclipse-jdt#1007
* eclipse-jdt#854
* redhat-developer/vscode-java#3076
* eclipse-jdt#986

Reverts/replaces the fix from:
* eclipse-jdt#630
stephan-herrmann added a commit to stephan-herrmann/eclipse.jdt.core that referenced this issue May 21, 2023
(regression 2023-03)

Avoids any risky ahead-of-time resolving of annotations

Introduces a new phase CONNECT_TYPE_HIERARCHY2 to finish deferred work

Common fix for these problems:
* eclipse-jdt#1007
* eclipse-jdt#854
* redhat-developer/vscode-java#3076
* eclipse-jdt#986

Reverts/replaces the fix from:
* eclipse-jdt#630
stephan-herrmann added a commit to stephan-herrmann/eclipse.jdt.core that referenced this issue May 21, 2023
(regression 2023-03)

Avoids any risky ahead-of-time resolving of annotations

Introduces a new phase CONNECT_TYPE_HIERARCHY2 to finish deferred work

Common fix for these problems:
* eclipse-jdt#1007
* eclipse-jdt#854
* redhat-developer/vscode-java#3076
* eclipse-jdt#986

Reverts/replaces the fix from:
* eclipse-jdt#630
stephan-herrmann added a commit to stephan-herrmann/eclipse.jdt.core that referenced this issue May 21, 2023
(regression 2023-03)

Avoids any risky ahead-of-time resolving of annotations

Introduces a new phase CONNECT_TYPE_HIERARCHY2 to finish deferred work

Common fix for these problems:
* eclipse-jdt#1007
* eclipse-jdt#854
* redhat-developer/vscode-java#3076
* eclipse-jdt#986

Reverts/replaces the fix from:
* eclipse-jdt#630
@stephan-herrmann
Copy link
Contributor

New test has been disabled via #1079 to be re-fixed via #1077

stephan-herrmann added a commit to stephan-herrmann/eclipse.jdt.core that referenced this issue May 23, 2023
(regression 2023-03)

Avoids any risky ahead-of-time resolving of annotations

Introduces a new phase CONNECT_TYPE_HIERARCHY2 to finish deferred work

Common fix for these problems:
* eclipse-jdt#1007
* eclipse-jdt#854
* redhat-developer/vscode-java#3076
* eclipse-jdt#986

Replaces the reverted fix from:
* eclipse-jdt#630
stephan-herrmann added a commit to stephan-herrmann/eclipse.jdt.core that referenced this issue May 23, 2023
(regression 2023-03)

Avoids any risky ahead-of-time resolving of annotations

Introduces a new phase CONNECT_TYPE_HIERARCHY2 to finish deferred work

Common fix for these problems:
* eclipse-jdt#1007
* eclipse-jdt#854
* redhat-developer/vscode-java#3076
* eclipse-jdt#986

Replaces the reverted fix from:
* eclipse-jdt#630
stephan-herrmann added a commit to stephan-herrmann/eclipse.jdt.core that referenced this issue May 24, 2023
(regression 2023-03)

Avoids any risky ahead-of-time resolving of annotations

Introduces a new phase CONNECT_TYPE_HIERARCHY2 to finish deferred work

Common fix for these problems:
* eclipse-jdt#1007
* eclipse-jdt#854
* redhat-developer/vscode-java#3076
* eclipse-jdt#986

Replaces the reverted fix from:
* eclipse-jdt#630
stephan-herrmann added a commit that referenced this issue Jul 2, 2023
…ssion 2023-03) (#1077)

Avoids any risky ahead-of-time resolving of annotations
+ In ClassScope.findSuperType() remove the early 
  hasDefaultNullnessFor() from #630
+ In ReferenceBinding.implementsInterface() remove ahead-of-time
  resolving from from #630
+ TypeReference.internalResolveType() should never resolve any
  annotations when not ready
  - Readiness is determined by (tagBits & EndHierarchyCheck) != 0.
+ Scope.hasDefaultNullnessForType, when not ready, always answers false
  to leave a clean slate for a later phase to consider null annotations.

Introduces a new phase CONNECT_TYPE_HIERARCHY2 to finish deferred work
+ Starting from LookupEnvironment.completeBindings() a new phase has
  been introduced which may safely assume that all type hierarchies are
  fully completed to avoid all out-of-order processing
+ Central implementation of this phase is in TypeDeclaration.updateSupertypesWithAnnotations():
  - complete the initialization of tagBits relating to all kinds
    of annotations
  - traverse all superclass, superInterfaces and memberTypes links to
    update resolved bindings with information from anntations
+ 2nd level implementation is in TypeReference.updateWithAnnotations()
  which will resolve annotations and possibly update .resolvedType
  with that information

Common fix for these problems:
* #1007
* #854
* redhat-developer/vscode-java#3076
* #986
* #476

Replaces the reverted fix from:
* #630

Remove remnants of deferred checks from Bug 434570 et al see  #1074

Also:
+ additional tweak to help completion to find fields
+ Test isolation: fix deletion of jar and classpath entry
+ Test isolation: recover currentProject when run in a suite
+ Temp disable tests affected by #1201
@stephan-herrmann
Copy link
Contributor

Resolved via #1077

mpalat pushed a commit to mpalat/eclipse.jdt.core that referenced this issue Jul 6, 2023
…ssion 2023-03) (eclipse-jdt#1077)

Avoids any risky ahead-of-time resolving of annotations
+ In ClassScope.findSuperType() remove the early 
  hasDefaultNullnessFor() from eclipse-jdt#630
+ In ReferenceBinding.implementsInterface() remove ahead-of-time
  resolving from from eclipse-jdt#630
+ TypeReference.internalResolveType() should never resolve any
  annotations when not ready
  - Readiness is determined by (tagBits & EndHierarchyCheck) != 0.
+ Scope.hasDefaultNullnessForType, when not ready, always answers false
  to leave a clean slate for a later phase to consider null annotations.

Introduces a new phase CONNECT_TYPE_HIERARCHY2 to finish deferred work
+ Starting from LookupEnvironment.completeBindings() a new phase has
  been introduced which may safely assume that all type hierarchies are
  fully completed to avoid all out-of-order processing
+ Central implementation of this phase is in TypeDeclaration.updateSupertypesWithAnnotations():
  - complete the initialization of tagBits relating to all kinds
    of annotations
  - traverse all superclass, superInterfaces and memberTypes links to
    update resolved bindings with information from anntations
+ 2nd level implementation is in TypeReference.updateWithAnnotations()
  which will resolve annotations and possibly update .resolvedType
  with that information

Common fix for these problems:
* eclipse-jdt#1007
* eclipse-jdt#854
* redhat-developer/vscode-java#3076
* eclipse-jdt#986
* eclipse-jdt#476

Replaces the reverted fix from:
* eclipse-jdt#630

Remove remnants of deferred checks from Bug 434570 et al see  eclipse-jdt#1074

Also:
+ additional tweak to help completion to find fields
+ Test isolation: fix deletion of jar and classpath entry
+ Test isolation: recover currentProject when run in a suite
+ Temp disable tests affected by eclipse-jdt#1201
robstryker pushed a commit to robstryker/eclipse.jdt.core that referenced this issue Jul 18, 2024
…ssion 2023-03) (eclipse-jdt#1077)

Avoids any risky ahead-of-time resolving of annotations
+ In ClassScope.findSuperType() remove the early 
  hasDefaultNullnessFor() from eclipse-jdt#630
+ In ReferenceBinding.implementsInterface() remove ahead-of-time
  resolving from from eclipse-jdt#630
+ TypeReference.internalResolveType() should never resolve any
  annotations when not ready
  - Readiness is determined by (tagBits & EndHierarchyCheck) != 0.
+ Scope.hasDefaultNullnessForType, when not ready, always answers false
  to leave a clean slate for a later phase to consider null annotations.

Introduces a new phase CONNECT_TYPE_HIERARCHY2 to finish deferred work
+ Starting from LookupEnvironment.completeBindings() a new phase has
  been introduced which may safely assume that all type hierarchies are
  fully completed to avoid all out-of-order processing
+ Central implementation of this phase is in TypeDeclaration.updateSupertypesWithAnnotations():
  - complete the initialization of tagBits relating to all kinds
    of annotations
  - traverse all superclass, superInterfaces and memberTypes links to
    update resolved bindings with information from anntations
+ 2nd level implementation is in TypeReference.updateWithAnnotations()
  which will resolve annotations and possibly update .resolvedType
  with that information

Common fix for these problems:
* eclipse-jdt#1007
* eclipse-jdt#854
* redhat-developer/vscode-java#3076
* eclipse-jdt#986
* eclipse-jdt#476

Replaces the reverted fix from:
* eclipse-jdt#630

Remove remnants of deferred checks from Bug 434570 et al see  eclipse-jdt#1074

Also:
+ additional tweak to help completion to find fields
+ Test isolation: fix deletion of jar and classpath entry
+ Test isolation: recover currentProject when run in a suite
+ Temp disable tests affected by eclipse-jdt#1201
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 a pull request may close this issue.

2 participants