[ nice-Bugs-1286427 ] bytecode uses interfaces too much

"SourceForge.net" <[email protected]> Fri, 09 Sep 2005 22:49:09 -0700
Newsgroups gmane.comp.lang.nice.devel
Message-ID <[email protected]>
Bugs item #1286427, was opened at 2005-09-10 09:49
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1286427&group_id=12788

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Artem Gr Kozarezov (artemgr)
Assigned to: Nobody/Anonymous (nobody)
Summary: bytecode uses interfaces too much

Initial Comment:
Consider an example, hastily taken from a real-life:

public interface SmartResponseData {}
class DeflateOStream extends java.io.OutputStream
implements SmartResponseData {}
public class SmartResponse {
  ?SmartResponseData os = null;
}
public void finish(SmartResponse sr){
  let os = sr.os;
  if (os instanceof DeflateOStream) os.close();
}

The "os.close()" here will emit the
aload_N
instanceof DeflateOStream
ifeq NN
aload_N
checkcast java/io/Closable
invokeinterface java/io/Closable.close
under Nice 0.9.12, Java 1.5.0_04.

java/io/Closable is absent from Java 1.4, therefore the
code which is perfectly compatible with Java 1.4
becames incompatible becouse Nice used a Closable
interface to invoke close.

Nice should have preferred direct invocation of
checkcast DeflateOStream
invoke DeflateOStream.close
or nearest invocation of
checkcast java/io/OutputStream
invoke java/io/OutputStream.close
whereas Nice seems to choose which class to use for
invocation just at random.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1286427&group_id=12788


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf