Clone Tools
  • last updated a few minutes ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
JBIDE-25669: Unexpected JAX-RS validation error for Feature (#302)

* JBIDE-25669: Unexpected JAX-RS validation error for Feature

Signed-off-by: Jeff MAURY <jmaury@redhat.com>

* Fix failing tests

Signed-off-by: Jeff MAURY <jmaury@redhat.com>

  1. … 6 more files in changeset.
JBIDE-21977 - Unexpected JAX-RS validation error for client filters

Added support for classes that implement the 'javax.ws.rs.container.DynamicFeature'

interface.

  1. … 4 more files in changeset.
JBIDE-21977 - Unexpected JAX-RS validation error for client filters

Added support for classes that implement the 'javax.ws.rs.container.DynamicFeature'

interface.

  1. … 4 more files in changeset.
JBIDE-18690 - ResourceException while deleting project

  1. … 2 more files in changeset.
JBIDE-18994 - Unexpected JAX-RS validation error for client filters

  1. … 6 more files in changeset.
JBIDE-18994/JBIDE-18953 - Unexpected JAX-RS validation error for client filters

  1. … 6 more files in changeset.
JBIDE-11766 - Work with "Annotation Properties" view breaks JAX-RS explorer

- Using jobs to process Java changes and Resource changes, with a scheduling rule

to avoid concurrency (race conditions).

- Fixing unit tests that now need to wait until the jobs (running asynchronously in another thread)

are done before doing the assertions, with a timeout (set to a lage enough value to allow for debugging)

- Fixed usage of compilation unit's working copy vs primary copy in some tests.

- Calling "ICompilationUnit.makeConsistent(IProgressMonitor)" resolves the problem where in some

cases, some JAX-RS annotations would not be "seen" by the JAX-RS tooling, resulting in elements being removed

- Removed the CompilationUnitRepository which worked as a cache for the Compilation Units AST, but could contain stale data

- Changed the 'Refresh Action' to trigger a real metamodel build ad then refresh the UI, which avoids the need to perform a project build.

  1. … 52 more files in changeset.
JBIDE-11766 - Work with "Annotation Properties" view breaks JAX-RS explorer

- Using jobs to process Java changes and Resource changes, with a scheduling rule

to avoid concurrency (race conditions).

- Fixing unit tests that now need to wait until the jobs (running asynchronously in another thread)

are done before doing the assertions, with a timeout (set to a lage enough value to allow for debugging)

- Fixed usage of compilation unit's working copy vs primary copy in some tests.

- Calling "ICompilationUnit.makeConsistent(IProgressMonitor)" resolves the problem where in some

cases, some JAX-RS annotations would not be "seen" by the JAX-RS tooling, resulting in elements being removed

- Removed the CompilationUnitRepository which worked as a cache for the Compilation Units AST, but could contain stale data

- Changed the 'Refresh Action' to trigger a real metamodel build ad then refresh the UI, which avoids the need to perform a project build.

  1. … 52 more files in changeset.
JBIDE-16940 - Fixing more sonar issues in JAX-RS plugins

  1. … 5 more files in changeset.
JBIDE-16940 - Fixing sonar issues in JAX-RS plugins

  1. … 14 more files in changeset.
JBIDE-17296 - Missing warning decorator on the "JAX-RS Web Services" node when no application is defined

Also includes fixes for:

- JBIDE-17078 - JAX-RS Problems doesn't appears after the JAX-RS Support is activated

- JBIDE-17771 - Trigger validation when JAX-RS nature is added on a project

- JBIDE-18068 - JAX-RS Explorer doesn't have "expand" icon

- JBIDE-18114 - Invalid state of JAX-RS Web Services node in Project Explorer after JAX-RS Support removal

    • -0
    • +50
    ./domain/IJaxrsMetamodelChangedListener.java
    • -1
    • +1
    ./domain/IJaxrsParameterAggregatorField.java
    • -1
    • +1
    ./domain/IJaxrsParameterAggregatorProperty.java
    • -0
    • +62
    ./domain/JaxrsMetamodelDelta.java
    • -11
    • +14
    ./domain/JaxrsMetamodelLocator.java
  1. … 39 more files in changeset.
JBIDE-18022 - For JBIDE 4.2.0.CR1: Ensure copyrights and provider names are correct in all plugins and features [Webservices]

    • -1
    • +1
    ./domain/IJaxrsElementChangedListener.java
    • -1
    • +1
    ./domain/IJaxrsEndpointChangedListener.java
    • -2
    • +10
    ./domain/IJaxrsJavaApplication.java
  1. … 363 more files in changeset.
JBIDE-17663 - JAX-RS Explorer doesn't reflect binding parameter to field

Using flags to retrieve the type of JAX-RS annotation(s) that were part of the removed element

Using the 'Flags' class instead of 'int' in other places.

    • -0
    • +53
    ./domain/IAnnotatedElement.java
  1. … 50 more files in changeset.
JBIDE-17712 - BeanParam: matrix parameter is not recognized

works both on Parameter Aggregator Fields and Properties (setter methods)

Endpoint URI Path Template changes when the field/property type is changed

(eg: String -> Integer)

  1. … 11 more files in changeset.
JBIDE-17653 - Node 'JAX-RS Web Services' doesn't appear after JAX-RS Support is added

    • -7
    • +24
    ./domain/JaxrsMetamodelLocator.java
  1. … 14 more files in changeset.
JBIDE-16825 - Provide support for new @BeanParam JAX-RS Annotation

Also implemented JBIDE-17575 - Support JAX-RS annotations on bean properties

Improved JUnit tests speed by avoiding building a full metamodel for each test

    • -0
    • +59
    ./domain/IAnnotatedSourceType.java
    • -0
    • +9
    ./domain/IJavaMethodParameter.java
    • -0
    • +46
    ./domain/IJavaMethodSignature.java
    • -0
    • +35
    ./domain/IJaxrsParameterAggregator.java
    • -0
    • +20
    ./domain/IJaxrsParameterAggregatorField.java
    • -0
    • +20
    ./domain/IJaxrsParameterAggregatorProperty.java
    • -0
    • +23
    ./domain/IJaxrsResourceProperty.java
  1. … 128 more files in changeset.
JBIDE-16763 - Add support for JAX-RS ParamConverterProvider

    • -0
    • +20
    ./domain/IJaxrsParamConverterProvider.java
  1. … 20 more files in changeset.
JBIDE-17151 - Improve the Restful Services Wizard

  1. … 52 more files in changeset.
JBIDE-16753 - Provide support for server-side Filters and Interceptors

Added support for ContainerRequestFilter, ContainerResponseFilter, ReaderInterceptor and WriterInterceptor

Renamed org.jboss.tools.ws.jaxrs.core.jdt to org.jboss.tools.ws.jaxrs.utils to better reflect the content of this package

Removed org.jboss.tools.ws.jaxrs.core.utils.JavaFieldsVisitor and replaced by using org.eclipse.jdt.core.dom.NodeFinder

Added Hyperlink navigation when selecting a NameBinding element, to navigate from a Resource/ResourceMethod/Application to

its associated Filter/Interceptor.

Added JUnit tests in core and ui (validation) to cover new code

Also fixed:

* JBIDE-16790 - Should add/remove Resource Methods and Endpoints when adding/removing @HttpMethod annotation

* JBIDE-15526 - JAX-RS validation problems are not linked

    • -0
    • +26
    ./domain/IJaxrsJavaApplication.java
    • -0
    • +18
    ./domain/IJaxrsJavaElement.java
    • -0
    • +27
    ./domain/IJaxrsNameBinding.java
  1. … 222 more files in changeset.
JBIDE-10539 - Support for JAX-RS Field injection

Also changed the way URL Path Template are displayed on endpoints in the JAX-RS Explorer

also fixed JBIDE-12029 - No type for PathParam parameters in JAX-RS REST Web Services Explorer

  1. … 51 more files in changeset.
JBIDE-15548 - Use JUnit @Rules instead of inheritance in test cases

  1. … 57 more files in changeset.
JBIDE-16422 - Fixing sonar issues in RS (not WS) code

Fixing 'critical' issues plus a bunch of 'major' ones

Added more unit tests for edge cases (null args in method calls)

  1. … 31 more files in changeset.
JBIDE-15428 - No JAX-RS problems when importing a project that contains HTTPMethod annotation without @Target and @Retention

Skipping the Java ElementChangeEvents when the Java Project is not open yet. This avoids race conditions during import.

Bonus: import seem to be twice as fast as before ;-)

Other changes:

- Move the call the JaxrsMetamodel#setBuildStatus() to finally{} blocks of JaxrsMetamodel#processXXX() methods

- Adjusted some javadoc, log messages and catch() blocks (avoiding to catch Exception or Throwable)

- Added a ReadWriteLock on all public methods of the JaxrsMetamodel to avoid concurrent access to the metamodel by different threads, for example if an async build

is still running and the validation is started. This avoids the following type of error:

{code}

!ENTRY org.jboss.tools.common 4 0 2013-10-09 18:17:54.307

!MESSAGE

!STACK 0

org.jboss.tools.common.validation.JBTValidationException

at org.jboss.tools.common.validation.ValidatorManager.validateInJob(ValidatorManager.java:101)

at org.eclipse.wst.validation.internal.operations.ValidatorJob.run(ValidatorJob.java:78)

at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

Caused by: java.util.ConcurrentModificationException

at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)

at java.util.HashMap$ValueIterator.next(HashMap.java:822)

at org.jboss.tools.ws.jaxrs.core.internal.metamodel.validation.JaxrsMetamodelValidator.validateAll(JaxrsMetamodelValidator.java:268)

at org.jboss.tools.ws.jaxrs.core.internal.metamodel.validation.JaxrsMetamodelValidator.validate(JaxrsMetamodelValidator.java:153)

at org.jboss.tools.common.validation.ValidatorManager.validate(ValidatorManager.java:117)

at org.jboss.tools.common.validation.ValidatorManager.validateInJob(ValidatorManager.java:81)

... 2 more

{code}

- added some tests to increase code coverage

    • -37
    • +40
    ./domain/JaxrsMetamodelLocator.java
  1. … 21 more files in changeset.
JBIDE-15428 - No JAX-RS problems when importing a project that contains HTTPMethod annotation without @Target and @Retention

Skipping the Java ElementChangeEvents when the Java Project is not open yet. This avoids race conditions during import.

Bonus: import seem to be twice as fast as before ;-)

Other changes:

- Move the call the JaxrsMetamodel#setBuildStatus() to finally{} blocks of JaxrsMetamodel#processXXX() methods

- Adjusted some javadoc, log messages and catch() blocks (avoiding to catch Exception or Throwable)

- Added a ReadWriteLock on all public methods of the JaxrsMetamodel to avoid concurrent access to the metamodel by different threads, for example if an async build

is still running and the validation is started. This avoids the following type of error:

{code}

!ENTRY org.jboss.tools.common 4 0 2013-10-09 18:17:54.307

!MESSAGE

!STACK 0

org.jboss.tools.common.validation.JBTValidationException

at org.jboss.tools.common.validation.ValidatorManager.validateInJob(ValidatorManager.java:101)

at org.eclipse.wst.validation.internal.operations.ValidatorJob.run(ValidatorJob.java:78)

at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

Caused by: java.util.ConcurrentModificationException

at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)

at java.util.HashMap$ValueIterator.next(HashMap.java:822)

at org.jboss.tools.ws.jaxrs.core.internal.metamodel.validation.JaxrsMetamodelValidator.validateAll(JaxrsMetamodelValidator.java:268)

at org.jboss.tools.ws.jaxrs.core.internal.metamodel.validation.JaxrsMetamodelValidator.validate(JaxrsMetamodelValidator.java:153)

at org.jboss.tools.common.validation.ValidatorManager.validate(ValidatorManager.java:117)

at org.jboss.tools.common.validation.ValidatorManager.validateInJob(ValidatorManager.java:81)

... 2 more

{code}

- added some tests to increase code coverage

    • -37
    • +40
    ./domain/JaxrsMetamodelLocator.java
  1. … 21 more files in changeset.
JBIDE-12860 - JAX-RS validation problems are not linked

Added a custom JAXRS_PROBLEM_TYPE attribute in JAX-RS markers.

Those JAX-RS Problem markers are now indexed with Lucene.

Thus, it becomes possible to look for resource that have the same

error as a given resource, even if this later one has been deleted.

(eg: looking for duplicate application problem after an application

has been removed).

When a JAX-RS Element is removed, its associated JAX-RS Markers are

removed from the index *during the validation phase* (the markers

still exist and are still indexed until the validation is performed).

Added some JUnit tests to verify the good behaviour againts the case

where a project has 2 JAX-RS application then one is removed.

  1. … 22 more files in changeset.
JBIDE-12860 - JAX-RS validation problems are not linked

Added a custom JAXRS_PROBLEM_TYPE attribute in JAX-RS markers.

Those JAX-RS Problem markers are now indexed with Lucene.

Thus, it becomes possible to look for resource that have the same

error as a given resource, even if this later one has been deleted.

(eg: looking for duplicate application problem after an application

has been removed).

When a JAX-RS Element is removed, its associated JAX-RS Markers are

removed from the index *during the validation phase* (the markers

still exist and are still indexed until the validation is performed).

Added some JUnit tests to verify the good behaviour againts the case

where a project has 2 JAX-RS application then one is removed.

  1. … 22 more files in changeset.
JBIDE-15039 - JAX-RS Problem decorator not shown on the Project Explorer node

Main refactoring/changes in this PR consist in:

- compare the problem level of each JAX-RS element before vs after the validation, and

in case of change, notify the metamodel. The metamodel will look for all affected Endpoints and

send 'problem level change' notification to the listeners (here, the UI). In turn, the UI will *update*

the associated node (update -> no refresh for sub nodes) to get a proper image decorator.

- same logix with the metamodel itself, except that the public problem level includes the problem level of the

JAX-RS elements, which means that the 'JAX-RS Web Services' node now reflects the whole Metamodel and thus, displays the

global problem level.

This new UI refresh strategy also reduces the number of times refresh occurred (there's now a single refresh per affected element, even

if this element has multiple problems).

- also fixed a problem where the UI listener would only be registered once the "JAX-RS Web Services" node was expended

    • -0
    • +13
    ./domain/IJaxrsEndpointChangedListener.java
    • -0
    • +13
    ./domain/IJaxrsStatus.java
  1. … 25 more files in changeset.
JBIDE-15039 - JAX-RS Problem decorator not shown on the Project Explorer node

Adding notification each time a JAX-RS element is validated so that it's UI element gets refreshed

Also 'update' the parent node element to show/hide the problem decorator

  1. … 5 more files in changeset.
applied JBIDE-14913 to beta2 branch

  1. … 5 more files in changeset.
JBIDE-14913 - JAX-RS Web Services node is empty after project import or workbench startup

displaying the "Loading..." node when the Metamodel is being built

Using a proper Mutex Rule to avoid multiple concurrent builds

Registering the Metamodel Listener at the right moment and only once, so that changes

can be applied on the UI

  1. … 5 more files in changeset.