Ticket #1499 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

Plugin initializer issue with TypeChanger

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b5-scripting
Component: Core Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1510


I am trying to fix ticket #1474. In the process I've uncovered a bug in the initializer code. I cannot show it easily in a fashion that makes sense. However an artificial example follows:

Edit TypeChanger.java.

Change the declaration of menuService to have an initializer:

private MenuService menuService;

And declare this initializer:

protected void gludge() {

System.out.println("data = "+data);


Now run IJ2, load blobs, and change type to 16-bit. Exception thrown:

java.lang.NoSuchMethodException: imagej.core.commands.typechange.ChangeToUINT16.gludge()

at java.lang.Class.getDeclaredMethod(Class.java:1954)
at imagej.module.MethodRef.findMethod(MethodRef.java:80)
at imagej.module.MethodRef.<init>(MethodRef.java:56)
at imagej.module.AbstractModuleItem.initialize(AbstractModuleItem.java:179)
at imagej.plugin.InitPreprocessor.process(InitPreprocessor.java:61)
at imagej.module.ModuleRunner.preProcess(ModuleRunner.java:98)
at imagej.module.ModuleRunner.run(ModuleRunner.java:150)
at imagej.module.ModuleRunner.call(ModuleRunner.java:121)
at imagej.module.ModuleRunner.call(ModuleRunner.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)

Change History

comment:1 Changed 8 years ago by bdezonia

  • Owner changed from curtis to bdezonia
  • Status changed from new to assigned

comment:2 Changed 8 years ago by bdezonia

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed with commit e106ffb78556554393aa2265f4631f98e4ed75ac

comment:3 Changed 8 years ago by curtis

  • Milestone changed from imagej-2.0.0-beta6 to imagej-2.0.0-beta5-new

comment:4 Changed 8 years ago by bdezonia

  • Blocking 1510 added
Note: See TracTickets for help on using tickets.