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

Weird error message if template binding has no real type #79

Closed
jeaf-anaptecs opened this issue Feb 29, 2024 · 0 comments
Closed

Weird error message if template binding has no real type #79

jeaf-anaptecs opened this issue Feb 29, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jeaf-anaptecs
Copy link
Contributor

Description

If a template bindung in the UML model has no actual type defined then a weird error message is visible when JEAF Generator is executed.


[ERROR] ERROR in Component of type org.openarchitectureware.check.CheckComponent
	org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, size=0 [String getReturnTypeName(uml::Operation operation)]  in workflow: CheckComponent: expression model.eAllContents.union({model}) check file(s): jeaf::JEAFChecks entity::EntityChecks java::ObjectMapperChecks jeaf::ValidationChecks jeaf::OpenAPIChecks 
[ERROR] ERROR in Component of type org.openarchitectureware.check.CheckComponent
	org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, size=0 [operation.getReturnTypeName()]  in workflow: CheckComponent: expression model.eAllContents.union({model}) check file(s): jeaf::JEAFChecks entity::EntityChecks java::ObjectMapperChecks jeaf::ValidationChecks jeaf::OpenAPIChecks 
[ERROR] ERROR in Component of type org.openarchitectureware.check.CheckComponent
	org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, size=0 [operation.getReturnTypeName().==("void")]  in workflow: CheckComponent: expression model.eAllContents.union({model}) check file(s): jeaf::JEAFChecks entity::EntityChecks java::ObjectMapperChecks jeaf::ValidationChecks jeaf::OpenAPIChecks 
[ERROR] ERROR in Component of type org.openarchitectureware.check.CheckComponent
	org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, size=0 [boolean isReturnTypeVoid(uml::Operation operation)]  in workflow: CheckComponent: expression model.eAllContents.union({model}) check file(s): jeaf::JEAFChecks entity::EntityChecks java::ObjectMapperChecks jeaf::ValidationChecks jeaf::OpenAPIChecks 
[ERROR] ERROR in Component of type org.openarchitectureware.check.CheckComponent
	org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, size=0 [operation.isReturnTypeVoid()]  in workflow: CheckComponent: expression model.eAllContents.union({model}) check file(s): jeaf::JEAFChecks entity::EntityChecks java::ObjectMapperChecks jeaf::ValidationChecks jeaf::OpenAPIChecks 
[ERROR] ERROR in Component of type org.openarchitectureware.check.CheckComponent
	org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, size=0 [if operation.isReturnTypeVoid() then getModelStatusCodeName(getRESTDefaultVoidStatusCode()) else getModelStatusCodeName(getRESTDefaultSuccessStatusCode())]  in workflow: CheckComponent: expression model.eAllContents.union({model}) check file(s): jeaf::JEAFChecks entity::EntityChecks java::ObjectMapperChecks jeaf::ValidationChecks jeaf::OpenAPIChecks 
[ERROR] ERROR in Component of type org.openarchitectureware.check.CheckComponent
	org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, size=0 [if operation.statusCode.name.!=("DEFAULT") then operation.statusCode.name else if operation.isReturnTypeVoid() then getModelStatusCodeName(getRESTDefaultVoidStatusCode()) else getModelStatusCodeName(getRESTDefaultSuccessStatusCode())]  in workflow: CheckComponent: expression model.eAllContents.union({model}) check file(s): jeaf::JEAFChecks entity::EntityChecks java::ObjectMapperChecks jeaf::ValidationChecks jeaf::OpenAPIChecks 
[ERROR] ERROR in Component of type org.openarchitectureware.check.CheckComponent
	org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, size=0 [String getStatusCodeName(JMM::RESTOperation operation)]  in workflow: CheckComponent: expression model.eAllContents.union({model}) check file(s): jeaf::JEAFChecks entity::EntityChecks java::ObjectMapperChecks jeaf::ValidationChecks jeaf::OpenAPIChecks 
[ERROR] ERROR in Component of type org.openarchitectureware.check.CheckComponent
	org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, size=0 [this.getStatusCodeName()]  in workflow: CheckComponent: expression model.eAllContents.union({model}) check file(s): jeaf::JEAFChecks entity::EntityChecks java::ObjectMapperChecks jeaf::ValidationChecks jeaf::OpenAPIChecks 
[ERROR] ERROR in Component of type org.openarchitectureware.check.CheckComponent
	org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, size=0 [isJAXRSStatusCode(this.getStatusCodeName())]  in workflow: CheckComponent: expression model.eAllContents.union({model}) check file(s): jeaf::JEAFChecks entity::EntityChecks java::ObjectMapperChecks jeaf::ValidationChecks jeaf::OpenAPIChecks 
[ERROR] ERROR in Component of type org.openarchitectureware.check.CheckComponent
	org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, size=0 [isJAXRSStatusCode(this.getStatusCodeName()).==(true)]  in workflow: CheckComponent: expression model.eAllContents.union({model}) check file(s): jeaf::JEAFChecks entity::EntityChecks java::ObjectMapperChecks jeaf::ValidationChecks jeaf::OpenAPIChecks 
[ERROR] org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, size=0[EvaluationException : org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, size=0
	java::Naming.ext[10178,29] on line 211 'operation.getReturnTypeName()'
	java::OpenAPIFunctions.ext[16518,28] on line 326 'operation.isReturnTypeVoid()'
	jeaf::OpenAPIChecks.chk[1349,24] on line 19 'this.getStatusCodeName()'

	at org.openarchitectureware.expression.ast.Expression.evaluate(Expression.java:59)
	at org.openarchitectureware.expression.ast.OperationCall.evaluateInternal(OperationCall.java:63)
	at org.openarchitectureware.expression.ast.Expression.evaluate(Expression.java:51)
	at org.openarchitectureware.xtend.ast.ExpressionExtensionStatement.evaluateInternal2(ExpressionExtensionStatement.java:61)
	at org.openarchitectureware.xtend.ast.ExpressionExtensionStatement.evaluateInternal(ExpressionExtensionStatement.java:50)
	at org.openarchitectureware.xtend.ast.AbstractExtension.evaluate(AbstractExtension.java:166)
	at org.openarchitectureware.expression.ast.OperationCall.evaluate(OperationCall.java:346)
	at org.openarchitectureware.expression.ast.OperationCall.evaluateInternal(OperationCall.java:107)
	at org.openarchitectureware.expression.ast.Expression.evaluate(Expression.java:51)
	at org.openarchitectureware.expression.ast.IfExpression.evaluateInternal(IfExpression.java:58)
	at org.openarchitectureware.expression.ast.Expression.evaluate(Expression.java:51)
	at org.openarchitectureware.expression.ast.IfExpression.evaluateInternal(IfExpression.java:70)
	at org.openarchitectureware.expression.ast.Expression.evaluate(Expression.java:51)
	at org.openarchitectureware.xtend.ast.ExpressionExtensionStatement.evaluateInternal2(ExpressionExtensionStatement.java:61)
	at org.openarchitectureware.xtend.ast.ExpressionExtensionStatement.evaluateInternal(ExpressionExtensionStatement.java:50)
	at org.openarchitectureware.xtend.ast.AbstractExtension.evaluate(AbstractExtension.java:166)
	at org.openarchitectureware.expression.ast.OperationCall.evaluate(OperationCall.java:346)
	at org.openarchitectureware.expression.ast.OperationCall.evaluateInternal(OperationCall.java:107)
	at org.openarchitectureware.expression.ast.Expression.evaluate(Expression.java:51)
	at org.openarchitectureware.expression.ast.OperationCall.evaluateInternal(OperationCall.java:69)
	at org.openarchitectureware.expression.ast.Expression.evaluate(Expression.java:51)
	at org.openarchitectureware.expression.ast.OperationCall.evaluateInternal(OperationCall.java:63)
	at org.openarchitectureware.expression.ast.Expression.evaluate(Expression.java:51)
	at org.openarchitectureware.xtend.ast.Check.validate(Check.java:140)
	at org.openarchitectureware.xtend.ast.ExtensionFile.check(ExtensionFile.java:198)
	at org.openarchitectureware.check.CheckFacade.checkAll(CheckFacade.java:50)
	at org.openarchitectureware.check.CheckComponent.invokeInternal2(CheckComponent.java:139)
	at org.openarchitectureware.expression.AbstractExpressionsUsingWorkflowComponent.invokeInternal(AbstractExpressionsUsingWorkflowComponent.java:164)
	at org.openarchitectureware.workflow.lib.AbstractWorkflowComponent2.invoke(AbstractWorkflowComponent2.java:61)
	at org.openarchitectureware.workflow.container.CompositeComponent.internalInvoke(CompositeComponent.java:129)
	at org.openarchitectureware.workflow.container.CompositeComponent.invoke(CompositeComponent.java:112)
	at org.openarchitectureware.workflow.WorkflowRunner.executeWorkflow(WorkflowRunner.java:380)
	at org.openarchitectureware.workflow.WorkflowRunner.run(WorkflowRunner.java:261)
	at com.anaptecs.jeaf.generator.maven.GeneratorMojo.runUMLGenerator(GeneratorMojo.java:1809)
	at com.anaptecs.jeaf.generator.maven.GeneratorMojo.execute(GeneratorMojo.java:1165)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:370)
	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:351)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:215)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:171)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:163)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:294)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:960)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:293)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:196)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)

Expected behavior

  • Modeling issue is detcted during check phase and a meaningful error message is shown
@jeaf-anaptecs jeaf-anaptecs added the bug Something isn't working label Feb 29, 2024
@jeaf-anaptecs jeaf-anaptecs self-assigned this Feb 29, 2024
jeaf-anaptecs added a commit that referenced this issue Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant