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

FHA: IndexOutOfBoundsException if likelihood unspecified #2093

Closed
jjhugues opened this issue Dec 2, 2019 · 1 comment · Fixed by #2094
Closed

FHA: IndexOutOfBoundsException if likelihood unspecified #2093

jjhugues opened this issue Dec 2, 2019 · 1 comment · Fixed by #2094
Assignees
Milestone

Comments

@jjhugues
Copy link
Contributor

@jjhugues jjhugues commented Dec 2, 2019

The following example triggers an exception

package foo
public
	system bar
		annex emv2 {**
			use behavior ErrorLibrary::FailStop; -- definition of error modes
			
			properties
				EMV2::severity => 1 applies to Failstop;
					--		EMV2::likelihood => C applies to Failstop;
				EMV2::hazards => ([crossreference => "";
						failure => "failure";
						phases => ("phases");
						description => "descr.";
						comment => "comment";
					]) applies to Failstop;
		**};
	end bar;

	system implementation bar.i
	end bar.i;
end foo;

java.lang.IndexOutOfBoundsException: Index: 0
at java.util.Collections$EmptyList.get(Collections.java:4454)
at org.osate.aadl2.errormodel.analysis.fha.FHAReport.reportHazardProperty(FHAReport.java:303)
at org.osate.aadl2.errormodel.analysis.fha.FHAReport.processHazards(FHAReport.java:138)
at org.osate.aadl2.errormodel.analysis.fha.FHAReport.doFHAReport(FHAReport.java:98)
at org.osate.aadl2.errormodel.analysis.handlers.FHAHandler.doAaxlAction(FHAHandler.java:70)
at org.osate.ui.handlers.AbstractAaxlHandler.processAaxlAction(AbstractAaxlHandler.java:482)
at org.osate.ui.handlers.AbstractAaxlHandler.actionBody(AbstractAaxlHandler.java:191)
at org.osate.ui.handlers.AaxlReadOnlyHandlerAsJob$ActionAsJob.runInWorkspace(AaxlReadOnlyHandlerAsJob.java:124)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

@jjhugues jjhugues self-assigned this Dec 2, 2019
@jjhugues

This comment has been minimized.

Copy link
Contributor Author

@jjhugues jjhugues commented Dec 2, 2019

Trivial copy/paste error, patch is

index 534eecad2..d10fab341 100644
--- a/emv2/org.osate.aadl2.errormodel.analysis/src/org/osate/aadl2/errormodel/analysis/fha/FHAReport.java
+++ b/emv2/org.osate.aadl2.errormodel.analysis/src/org/osate/aadl2/errormodel/analysis/fha/FHAReport.java
@@ -301,7 +300,7 @@ public final class FHAReport {
} else {
// did not have a type set. Let's use fmr (state of type set as failure mode.
EMV2PropertyAssociation Sev = SevList.isEmpty() ? null : SevList.get(0);

  •                                           EMV2PropertyAssociation Like = SevList.isEmpty() ? null : LikeList.get(0);
    
  •                                           EMV2PropertyAssociation Like = LikeList.isEmpty() ? null : LikeList.get(0);
    
jjhugues added a commit that referenced this issue Dec 2, 2019
@lwrage lwrage added this to the 2.6.1 milestone Dec 2, 2019
@lwrage lwrage modified the milestones: 2.6.1, 2.7.0 Dec 9, 2019
@lwrage lwrage changed the title FHA java.lang.IndexOutOfBoundsException if Likelihood unspecified FHA: IndexOutOfBoundsException if likelihood unspecified Dec 10, 2019
@lwrage lwrage closed this in #2094 Dec 10, 2019
lwrage added a commit that referenced this issue Dec 10, 2019
Bugfix for Issue #2093
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.