Menu

#638 Error: java.lang.IndexOutOfBoundsException on tag validation with custom tags

3.0
closed-fixed
None
5
2013-12-18
2013-11-23
No

During console validation of tags, I get the following error on many projects:

Initializing
Loading Project
Validating tags
16290: Error: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
16290: Error: at java.util.ArrayList.rangeCheck(ArrayList.java:604)
16290: Error: at java.util.ArrayList.get(ArrayList.java:382)
16290: Error: at org.omegat.core.tagvalidation.TagValidation.inspectOrderedTags(TagValidation.java:208)
16290: Error: at org.omegat.core.tagvalidation.TagValidation.inspectOmegaTTags(TagValidation.java:136)
16290: Error: at org.omegat.gui.tagvalidation.TagValidationTool.checkEntry(TagValidationTool.java:235)
16290: Error: at org.omegat.gui.tagvalidation.TagValidationTool.listInvalidTags(TagValidationTool.java:174)
16290: Error: at org.omegat.gui.tagvalidation.TagValidationTool.listInvalidTags(TagValidationTool.java:156)
16290: Error: at org.omegat.Main.validateTagsConsoleMode(Main.java:323)
16290: Error: at org.omegat.Main.runConsoleTranslate(Main.java:282)
16290: Error: at org.omegat.Main.main(Main.java:180)
An error has occured: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3

Discussion

  • Didier Briel

    Didier Briel - 2013-12-04

    In my short test, I do not reproduce it.
    (java -jar OmegaT.jar "C:\Users\Didier\Documents\OmegaT\test" --mode=console-translate --tag-validation=warn)

    Can you provide a project together with the corresponding command line to reproduce the issue?

    Didier

     
  • Guido Leenders

    Guido Leenders - 2013-12-09

    Omegat.prefs needs:

    <tagValidation_customPattern>(&amp;[0-9])|(\{res:[^}]*\})</tagValidation_customPattern>
    <tagValidation_removePattern></tagValidation_removePattern>
    

    Send project file by private email.

     
  • Didier Briel

    Didier Briel - 2013-12-10
    • summary: Error: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3 --> Error: java.lang.IndexOutOfBoundsException on tag validation with custom tags
     
  • Didier Briel

    Didier Briel - 2013-12-10

    I get the same error in graphical mode, so that's not related to being in console mode.

    Didier

     
  • Aaron Madlon-Kay

    I can also confirm; the issue occurs when "Allow translated tags to be in a different order" is off.

    I'm working on a patch now.

     
  • Didier Briel

    Didier Briel - 2013-12-11
    • assigned_to: Aaron Madlon-Kay
    • Group: SVN --> 3.0
     
  • Aaron Madlon-Kay

    You can work around this issue for now by turning on "Allow translated tags to be in a different order". When the tags are not structured XML-style tags (<g0></g0>) the result should be the same.

    Also, this issue exposes an unrelated problem of custom regex tags not being highlighted in the target text in the Tag Validation window.

     

    Last edit: Aaron Madlon-Kay 2013-12-12
  • Didier Briel

    Didier Briel - 2013-12-12
    • status: open --> open-fixed
     
    • Alex Buloichik

      Alex Buloichik - 2013-12-13

      " - status: open --> open-fixed"
      I'm not sure about this ;)

      Well, the particular instance reported is fixed :)

      Probably, there are many issues in that case.
      See TagValidation.java:207: commonTagsSrc and commonTagsLoc can >have
      different length.

      Also, it will be good to review inspectOrderedTags() method how >it handles
      multiple tags occurrences(like "{pp} {pp}"). Some calls like
      "commonTagsSrc.remove(tag);", "locTags.contains(tag)" looks not >so good for
      that, but maybe I'm wrong.

      So, it will be good to write some unit tests for that. Say me if >I need to
      do it myself.

      If you can improve the code (as discussed in dev-tech) and write test units, by all means do.
      Thank you.

      Didier

       

      Last edit: Didier Briel 2013-12-13
  • Didier Briel

    Didier Briel - 2013-12-12

    Fixed in SVN (/trunk).

    Didier

     
  • Didier Briel

    Didier Briel - 2013-12-13
    • assigned_to: Aaron Madlon-Kay --> Alex Buloichik
     
  • Didier Briel

    Didier Briel - 2013-12-18
    • status: open-fixed --> closed-fixed
     
  • Didier Briel

    Didier Briel - 2013-12-18

    Fixed in the released version 3.0.8 of OmegaT.

    (As written, this particular instance of the issue is fixed, even if the code can be improved.)

    Didier

     

Log in to post a comment.

MongoDB Logo MongoDB