[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#414983: marked as done (gcj-4.1: Compilation bug with java.awt.Component.x)



Your message dated Mon, 23 Jul 2007 09:19:23 +0200
with message-id <18084.22139.219309.997536@gargle.gargle.HOWL>
and subject line Bug#414983: gcj-4.1: Compilation bug with java.awt.Component.x
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: gcj-4.1
Version: 4.1.1-20
Severity: normal

Hi,

The following program gives error at compilation:

import javax.swing.*;
import java.awt.*;

public class B
{
    int x = 0;
    class MonJPanel extends JPanel{
    protected void paintComponent (Graphics g){
        g.fillOval(x-1,9,52,52);
        }
    }
}

The error is:

snoopy:~/Balle$ javac B.java 
B.java: In class 'B$MonJPanel':
B.java: In method 'B$MonJPanel.paintComponent(java.awt.Graphics)':
B.java:9: error: Can't access package-private field
'java.awt.Component.x' from 'B$MonJPanel'.
            g.fillOval(x-1,9,52,52);
                          ^
1 error

Why does it try to use x from class Component instead of class B?

If I change x by xx, the compilation is ok.

Cheers,
Eugen Dedu

-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: powerpc (ppc)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-powerpc
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages gcj-4.1 depends on:
ii  gcc-4.1                 4.1.1-21         The GNU C compiler
ii  gcj-4.1-base            4.1.1-20         The GNU Compiler Collection (gcj b
ii  gij-4.1                 4.1.1-20         The GNU Java bytecode interpreter
ii  java-common             0.25             Base of all Java packages
ii  libc6                   2.3.6.ds1-13     GNU C Library: Shared libraries
ii  libc6-dev               2.3.6.ds1-13     GNU C Library: Development Librari
ii  libgcc1                 1:4.2-20060923-1 GCC support library
ii  libgcj7-0               4.1.1-20         Java runtime library for use with 
ii  libgcj7-dev             4.1.1-20         Java development headers and stati
ii  libgcj7-jar             4.1.1-20         Java runtime library for use with 
ii  zlib1g                  1:1.2.3-13       compression library - runtime

Versions of packages gcj-4.1 recommends:
ii  fastjar                       1:4.1.1-21 Jar creation utility

-- no debconf information


--- End Message ---
--- Begin Message ---
Version: 4.1.2-14

fixed in gcj-4.1 and gcj-4.2 in unstable.

Eugen Dedu writes:
> Package: gcj-4.1
> Version: 4.1.1-20
> Severity: normal
> 
> Hi,
> 
> The following program gives error at compilation:
> 
> import javax.swing.*;
> import java.awt.*;
> 
> public class B
> {
>     int x = 0;
>     class MonJPanel extends JPanel{
>     protected void paintComponent (Graphics g){
>         g.fillOval(x-1,9,52,52);
>         }
>     }
> }
> 
> The error is:
> 
> snoopy:~/Balle$ javac B.java 
> B.java: In class 'B$MonJPanel':
> B.java: In method 'B$MonJPanel.paintComponent(java.awt.Graphics)':
> B.java:9: error: Can't access package-private field
> 'java.awt.Component.x' from 'B$MonJPanel'.
>             g.fillOval(x-1,9,52,52);

--- End Message ---

Reply to: