Bug 172853 - Inner interface's are not know inside package's
Summary: Inner interface's are not know inside package's
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc4
Version: 4.0
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Andrew Haley
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 173278
TreeView+ depends on / blocked
 
Reported: 2005-11-10 16:10 UTC by Andrew Cagney
Modified: 2012-05-08 13:09 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-08 13:09:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 8544 0 'P3' 'RESOLVED' 'Inner interface''s are not know inside package''s' 2019-11-28 15:16:44 UTC

Description Andrew Cagney 2005-11-10 16:10:42 UTC
This is a RHEL 4 tracker.  There is a workaround (which is being applied).

With jdk-1.3.1 it's possible to use inner interfaces inside the package. GCC
does not compile the example below, but the jdk-1.3.1 does.

DisplayRenderer.java:
---------------------

  package test_pack;

  import test_pack.StyledText.*;

  class DisplayRenderer {
     StyledText text;

  DisplayRenderer(StyledText parent ) {
     text = parent;
  }

  protected void test() {
        LineCache lineCache; 
  }
  }

StyledText.java:
----------------

  package test_pack;

  public class StyledText {
        LineCache lineCache;

  public StyledText(int a){
  }

  public LineCache getCache() {
    return lineCache;
  }

  interface LineCache {

    public void calculate(int startLine, int lineCount);

  } // end LineCache 
  } // end StyledText

with 
  $ gcj -C test_pack/*.java

you get

  test_pack/DisplayRenderer.java:13: Type `LineCache' not
  found in the declaration
  of the local variable `lineCache'.
        LineCache lineCache;
           ^
  1 error

Release:
gcc 3.2 and gcc 3.1.1

Environment:
$ gcj -v
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.2/specs
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../libgcj.spec
rename spec lib to liborig
Configured with: /netrel/src/gcc-3.2-1/configure
--enable-languages=c,c++,f77,java
--enable-libgcj --enable-threads=posix --with-system-zlib --enable-nls
--without-included-gettext --enable-interpreter --disable-sjlj-exceptions 
--disable-version-specific-runtime-libs --enable-shared --build=i686-pc-linux
--host=i686-pc-cygwin --target=i686-pc-cygwin --enable-haifa --prefix=/usr 
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib 
--includedir=/nonexistent/include --libexecdir=/usr/sbin
Thread model: posix
gcc version 3.2 20020818 (prerelease)

the same problem was seen with gcc-3.1.1 on linux

------- Comment #3 From Tom Tromey 2004-01-21 00:43 [reply] -------

FYI, you can work around this by writing "StyledText.LineCache"
instead of just "LineCache".  I realize this isn't always feasible though.

Comment 1 Jakub Jelinek 2005-11-10 19:50:50 UTC
On RHEL4 gcc 3.2?

Comment 2 Andrew Cagney 2005-11-15 21:12:16 UTC
RHEL4 gcc4.

I put this down to low.  Since failing to apply the work-around results in a
build failure, this isn't hard to miss.


Comment 4 Andrew Haley 2012-05-08 13:09:26 UTC
We now use the ecj front end for gcj, which fully supports this construct.


Note You need to log in before you can comment on or make changes to this bug.