This is the mail archive of the java-prs@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcj/278: full hiearchy of interfaces not checked?


The following reply was made to PR gcj/278; it has been noted by GNATS.

From: Bryce McKinlay <bryce@albatross.co.nz>
To: osk@hem.passagen.se
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/278: full hiearchy of interfaces not checked?
Date: Mon, 03 Jul 2000 22:47:35 +1200

 This is a multi-part message in MIME format.
 --------------9BAB4FC556DE4E9507B0F7D1
 Content-Type: text/plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 osk@hem.passagen.se wrote:
 
 > If BorderLayout only extends LayoutManager and not LayoutManager2, everything
 > is fine. So it seems that the class hierarchy of interfaces are not checked
 > in arguments.
 
 This seems to be a case of gcj behaving differently depending on whethere the classes referenced exist as
 .class files or .java files. When the LayoutManager interfaces exist as class files, interface_of_p will
 return false (when it should return true), but if they exist as java files it works okay.
 
 Here is a proposed patch.
 
 regards
 
   [ bryce ]
 
 
 
 --------------9BAB4FC556DE4E9507B0F7D1
 Content-Type: text/plain; charset=us-ascii;
  name="gcj-PR278.patch"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="gcj-PR278.patch"
 
 2000-07-03  Bryce McKinlay  <bryce@albatross.co.nz>
 
 	* class.c (interface_of_p): Call load_class on arguments if they're
 	not loaded.
 
 Index: class.c
 ===================================================================
 RCS file: /cvs/gcc/egcs/gcc/java/class.c,v
 retrieving revision 1.70
 diff -u -r1.70 class.c
 --- class.c	2000/06/27 04:30:18	1.70
 +++ class.c	2000/07/03 10:40:51
 @@ -432,6 +432,11 @@
    int n, i;
    tree basetype_vec;
  
 +  if (! CLASS_LOADED_P (type1))
 +    load_class (type1, 1);
 +  if (! CLASS_LOADED_P (type2))
 +    load_class (type2, 1);
 +
    if (!(basetype_vec = TYPE_BINFO_BASETYPES (type2)))
      return 0;
    n = TREE_VEC_LENGTH (basetype_vec);
 
 --------------9BAB4FC556DE4E9507B0F7D1--
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]