File tree Expand file tree Collapse file tree 1 file changed +8
-23
lines changed
src/main/java/com/github/celldynamics/quimp/plugin/ecmm Expand file tree Collapse file tree 1 file changed +8
-23
lines changed Original file line number Diff line number Diff line change 75
75
public class ECMM_Mapping extends AbstractPluginQconf {
76
76
77
77
private static String thisPluginName = "ECMM Mapping" ;
78
+ /**
79
+ * Required version of IJ1.
80
+ */
81
+ public static final String requiredVersion = "1.52n" ;
78
82
79
83
private File fileToLoad = null ; // file to load paQP/QCONF
80
84
/**
@@ -557,33 +561,14 @@ protected void runFromPaqp() throws QuimpException {
557
561
@ Override
558
562
protected void validate () throws QuimpException {
559
563
super .validate ();
560
- boolean fail = false ;
561
564
String ver = IJ .getVersion ();
565
+ // strip ImageJ2 version from IJ1
562
566
if (ver .indexOf ("/" ) > -1 ) {
563
567
ver = ver .substring (ver .indexOf ("/" ) + 1 );
564
568
}
565
- LOGGER .info (ver );
566
- // assume letter code at the end
567
- try {
568
- if (Character .isLetter (ver .charAt (ver .length () - 1 ))) {
569
- String vern = ver .substring (0 , ver .length () - 1 ); // should be 1.52 only
570
- if (Double .parseDouble (vern ) < 1.52 ) {
571
- fail = true ;
572
- } else {
573
- if (ver .charAt (ver .length () - 1 ) < 'n' ) {
574
- fail = true ;
575
- }
576
- }
577
- } else {
578
- if (Double .parseDouble (ver ) < 1.52 ) {
579
- fail = true ;
580
- }
581
- }
582
- if (fail ) {
583
- throw new QuimpException ("IJ 1.52n version required (or above)" );
584
- }
585
- } catch (NullPointerException | NumberFormatException e ) {
586
- LOGGER .warn ("Cannot process IJ version." );
569
+ LOGGER .debug ("IJ1 version " + ver );
570
+ if (ver .compareTo (requiredVersion ) < 0 ) {
571
+ throw new QuimpException ("Required ImageJ 1.52n (or above)" );
587
572
}
588
573
}
589
574
You can’t perform that action at this time.
0 commit comments