Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-17717

Validation of @Path annotation with invalid argument cause error

    Details

    • Sprint:
      Sprint to Beta3 Release
    • Steps to Reproduce:
      Hide

      STEP: Create Dynamic Web Project with JAX-RS Support
      STEP: Create Resource class

      @Path("/rest")
      public class Resource {
      
      	@GET
      	@Path("{test}")
      	public void get(@PathParam("test") String test) {
      		
      	}
      }
      

      STEP: Change the valid argument to invalid (e.g. remove right brace)
      FAIL: An error occurs (in error log but sometimes also the dialog Problem Occured is showed)

      null
      org.jboss.tools.ws.jaxrs.core
      Error
      Mon Jun 30 13:09:27 CEST 2014
      Failed to build or refresh the JAX-RS metamodel
      
      java.lang.StringIndexOutOfBoundsException: String index out of range: -2
      	at java.lang.String.substring(String.java:1911)
      	at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsEndpoint.getDisplayablePathTemplate(JaxrsEndpoint.java:446)
      	at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsEndpoint.refreshUriPathTemplate(JaxrsEndpoint.java:327)
      	at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsEndpoint.update(JaxrsEndpoint.java:234)
      	at org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementChangedProcessorDelegate.processChange(JaxrsElementChangedProcessorDelegate.java:394)
      	at org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementChangedProcessorDelegate.processEvent(JaxrsElementChangedProcessorDelegate.java:100)
      	at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsMetamodel.processElementChange(JaxrsMetamodel.java:712)
      	at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsMetamodel.update(JaxrsMetamodel.java:734)
      	at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsJavaElement.updateAnnotation(JaxrsJavaElement.java:223)
      	at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsMetamodel.processJavaAnnotationChange(JaxrsMetamodel.java:492)
      	at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsMetamodel.processJavaElementChange(JaxrsMetamodel.java:421)
      	at org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JavaElementChangedBuildJob.run(JavaElementChangedBuildJob.java:75)
      	at org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JavaElementChangedBuildJob.execute(JavaElementChangedBuildJob.java:44)
      	at org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JavaElementChangedListener.elementChanged(JavaElementChangedListener.java:69)
      	at org.eclipse.jdt.internal.core.DeltaProcessor$4.run(DeltaProcessor.java:1695)
      	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
      	at org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:1685)
      	at org.eclipse.jdt.internal.core.DeltaProcessor.fireReconcileDelta(DeltaProcessor.java:1537)
      	at org.eclipse.jdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:1496)
      	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:770)
      	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:789)
      	at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1247)
      	at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:126)
      	at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:108)
      	at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:89)
      	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
      	at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:87)
      	at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:151)
      	at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:86)
      	at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:104)
      	at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77)
      	at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)
      
      Show
      STEP: Create Dynamic Web Project with JAX-RS Support STEP: Create Resource class @Path( "/ rest " ) public class Resource { @GET @Path( "{test}" ) public void get(@PathParam( "test" ) String test) { } } STEP: Change the valid argument to invalid (e.g. remove right brace) FAIL: An error occurs (in error log but sometimes also the dialog Problem Occured is showed) null org.jboss.tools.ws.jaxrs.core Error Mon Jun 30 13:09:27 CEST 2014 Failed to build or refresh the JAX-RS metamodel java.lang.StringIndexOutOfBoundsException: String index out of range: -2 at java.lang. String .substring( String .java:1911) at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsEndpoint.getDisplayablePathTemplate(JaxrsEndpoint.java:446) at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsEndpoint.refreshUriPathTemplate(JaxrsEndpoint.java:327) at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsEndpoint.update(JaxrsEndpoint.java:234) at org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementChangedProcessorDelegate.processChange(JaxrsElementChangedProcessorDelegate.java:394) at org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementChangedProcessorDelegate.processEvent(JaxrsElementChangedProcessorDelegate.java:100) at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsMetamodel.processElementChange(JaxrsMetamodel.java:712) at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsMetamodel.update(JaxrsMetamodel.java:734) at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsJavaElement.updateAnnotation(JaxrsJavaElement.java:223) at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsMetamodel.processJavaAnnotationChange(JaxrsMetamodel.java:492) at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsMetamodel.processJavaElementChange(JaxrsMetamodel.java:421) at org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JavaElementChangedBuildJob.run(JavaElementChangedBuildJob.java:75) at org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JavaElementChangedBuildJob.execute(JavaElementChangedBuildJob.java:44) at org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JavaElementChangedListener.elementChanged(JavaElementChangedListener.java:69) at org.eclipse.jdt.internal.core.DeltaProcessor$4.run(DeltaProcessor.java:1695) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:1685) at org.eclipse.jdt.internal.core.DeltaProcessor.fireReconcileDelta(DeltaProcessor.java:1537) at org.eclipse.jdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:1496) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:770) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:789) at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1247) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:126) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:108) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:89) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:87) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:151) at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:86) at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:104) at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)

      Description

      An error occurs when the argument of the path annotation is invalid. It occurs not only when the file is saved but also during typing.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                xcoulon Xavier Coulon
                Reporter:
                rrabara Radoslav RĂ¡bara
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: