N
Nandan
The java compiler (1.4.2) won't compile the foll, it says cl may not
have been initialized.
Class cl;
try {
cl = gui.getClass();
Method hidden = cl.getMethod("isVisible", null);
Boolean falsebool = new Boolean(false); //for shame
if((Boolean) hidden.invoke(gui,null)==falsebool) { //lordy!
System.err.println("Obj is hidden " + key);
continue;
}
Object o = valuemethodmap.get(cl);
if (o == null)
continue;
String mtname = o.toString();
/*
* System.err.println("ID " + key + " isa " + gui.getClass() + "
* and methodmap gives " + mtname);
*/
Method mt = cl.getMethod(mtname, null);
Object retval = mt.invoke(gui, null);
Element guielem = new Element("control").setAttribute("name",
key.toString());
Element tentsel = new Element("contents").setAttribute(
"method", mtname);
tentsel.setText(retval.toString());
guielem.addContent(tentsel);
problem.addContent(guielem);
} catch (NoSuchMethodException nsme) {
System.err.println("Method " + nsme + "not found for" + cl);
}
How can a catch statement be reached without at least one statement being
(willan on-being) executed? Is this in the JVM spec or something, that
exceptions may (say) be raised in another thread or something?
Or is this another discipline issue, like not compiling on unreachable code?
--
Nandan Bagchee
So I think people who are mature and experienced, with a business background,
may be overrated. We used to call these guys 'newscasters', because they had
neat hair and spoke in deep, confident voices, and generally didn't know much
more than they read on the teleprompter.
-- Paul Graham
have been initialized.
Class cl;
try {
cl = gui.getClass();
Method hidden = cl.getMethod("isVisible", null);
Boolean falsebool = new Boolean(false); //for shame
if((Boolean) hidden.invoke(gui,null)==falsebool) { //lordy!
System.err.println("Obj is hidden " + key);
continue;
}
Object o = valuemethodmap.get(cl);
if (o == null)
continue;
String mtname = o.toString();
/*
* System.err.println("ID " + key + " isa " + gui.getClass() + "
* and methodmap gives " + mtname);
*/
Method mt = cl.getMethod(mtname, null);
Object retval = mt.invoke(gui, null);
Element guielem = new Element("control").setAttribute("name",
key.toString());
Element tentsel = new Element("contents").setAttribute(
"method", mtname);
tentsel.setText(retval.toString());
guielem.addContent(tentsel);
problem.addContent(guielem);
} catch (NoSuchMethodException nsme) {
System.err.println("Method " + nsme + "not found for" + cl);
}
How can a catch statement be reached without at least one statement being
(willan on-being) executed? Is this in the JVM spec or something, that
exceptions may (say) be raised in another thread or something?
Or is this another discipline issue, like not compiling on unreachable code?
--
Nandan Bagchee
So I think people who are mature and experienced, with a business background,
may be overrated. We used to call these guys 'newscasters', because they had
neat hair and spoke in deep, confident voices, and generally didn't know much
more than they read on the teleprompter.
-- Paul Graham