NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #1499 (closed defect: fixed)

Opened 2012-10-02T11:12:10-05:00

Last modified 2012-10-10T15:22:14-05:00

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

Description

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:

@Parameter(initializer="gludge")
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 2012-10-02T14:06:37-05:00 by bdezonia

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

comment:2 Changed 2012-10-02T14:06:53-05:00 by bdezonia

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

Fixed with commit e106ffb78556554393aa2265f4631f98e4ed75ac

comment:3 Changed 2012-10-10T13:27:50-05:00 by curtis

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

comment:4 Changed 2012-10-10T15:22:14-05:00 by bdezonia

  • Blocking 1510 added