viatra / EMF-IncQuery

This repository is only kept for historic reasons. All development happens on eclipse.org
http://eclipse.org/viatra
13 stars 4 forks source link

Pattern language validator throws IndexOutOfBoundsException #305

Closed istvanrath closed 11 years ago

istvanrath commented 11 years ago

I have seen it coming from .checkUnusedVariables() and .checkPatternParametersType(), but the problem might be present in others too.

!ENTRY org.apache.log4j 4 0 2012-09-25 16:17:08.901
!MESSAGE org.eclipse.xtext.validation.CompositeEValidator  - Error executing EValidator

!STACK 0
org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, size=0
    at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:346)
    at org.eclipse.viatra2.patternlanguage.validation.EMFPatternLanguageJavaValidator.checkUnusedVariables(EMFPatternLanguageJavaValidator.java:373)
    at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
869760 [Worker-23] ERROR org.eclipse.xtext.validation.CompositeEValidator  - Error executing EValidator
org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, size=0
    at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:346)
    at org.eclipse.viatra2.patternlanguage.validation.EMFPatternLanguageJavaValidator.checkPatternParametersType(EMFPatternLanguageJavaValidator.java:454)
    at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
ujhelyiz commented 11 years ago

Last time I saw this such errors were related to #286. However, after the last commit (284a5ec359d32610c25e77a1ea6ce4426ec6a86e) these issues seemingly went away. Stupid question: did you regenerate the grammar files in the last 9 days (or are you using an update site version)?

istvanrath commented 11 years ago

I just updated to the latest from master, and re-run mwes. The error is still present. To reproduce, try e.g. editing the

 pattern teachesMoreClasses(T1:Teacher, T2:Teacher) {
    N == count find classesOfTeacher(T1,_SC1);
    M == count find classesOfTeacher(T2,_SC2);
    check(N > M);
  }

pattern and remove the Teacher type constraint from T1.

ujhelyiz commented 11 years ago

Thanks for the detailed test case. This issue was a remainder of #286. Fixed in master.

istvanrath commented 11 years ago

Seems to be gone. thanks!