PATCH: java: suppress java.lang.Object constructor

Alexandre Petit-Bianco apbianco@cygnus.com
Fri Jul 13 13:46:00 GMT 2001


Jeff Sturm writes:

> The simplest patch didn't work because dropping super() has the
> unexpected side effect of preventing calls to finit$.

It needs to because the constructor might dictate hidden finit$
args. Your patch causes a regression on my side. I'll look into it.

./A

class nested_with_ctor {
  
  void fct(final String s, final int i)
  {
      class nested {
	  String buffer = s+i;
	  String getString () { return buffer; }
	  nested (int i) { buffer = "(int)"+i; }
	  nested () {}
      }
      nested x = new nested ();
      System.out.println (x.getString ());
      nested y = new nested (123);
      System.out.println (y.getString ());
  }
  public static void main (String[] arg)
  {
    System.out.println ("Testing class `nested_with_ctor'...");
    new nested_with_ctor ().fct ("Yikes!", 321);
  }
}



More information about the Java-patches mailing list