SingleMolecule / iSBatch

Hierarchical batch plugin for ImageJ
http://singlemolecule.github.io/iSBatch/
1 stars 1 forks source link

Error message when running Peak Finder on Time lapse data #26

Closed vcaldas closed 9 years ago

vcaldas commented 9 years ago

Submitted by Andrew Robinson. Exception in thread "Run$_Thread-11" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.RangeCheck(ArrayList.java:547) at java.util.ArrayList.get(ArrayList.java:322) at utils.StringOperations.getArguments(StringOperations.java:46) at operations.peakFinder.FindPeaksOperation.run(FindPeaksOperation.java:257) at operations.peakFinder.FindPeaksOperation.runNode(FindPeaksOperation.java:173) at operations.peakFinder.FindPeaksOperation.visit(FindPeaksOperation.java:143) at model.Sample.accept(Sample.java:29) at operations.OperationRunner.run(OperationRunner.java:52) at java.lang.Thread.run(Thread.java:695)

cmpunter commented 9 years ago

This bug happens in the StringOperations class. When, in the getArguments method, the allMatches array list is empty you cannot get the first element out of it allMatches.get(0).equalsIgnoreCase() on line 46.

cmpunter commented 9 years ago

@vcaldas I added a check if (allMatches.size() > 0) { on line 46 in StringOperations.java (not committed yet) but I don't know what the consequences of this will be. The method will then return an empty string. Is this allowed?

vcaldas commented 9 years ago

Pull the last version. I changed quite a bit to make a better use of the plugins. I'll check if the error is still there after the updade.

vcaldas commented 9 years ago

Problem is solved in the new version.

cmpunter commented 9 years ago

In the master branch there is still no check for the size. Did you push your fix already into the master branch?

vcaldas commented 9 years ago

Yes. It is there. I think the size checking is not necessary no.w Check the code and confirm if you are getting the same result https://github.com/SingleMolecule/iSBatch/blob/master/src/operations/peakFinder/FindPeaksOperation.java

cmpunter commented 9 years ago

I still added the check in the StringOperations class, just to prevent this exception. What did you change in the FindPeaksOperation?

vcaldas commented 9 years ago

It calls the plugin directly now and execute all with same conditions. Before was a code repetition.