Community
Participate
Working Groups
From post in eclipse.tools =================================== The internal java compiler has some serious bugs which prevent me from compiling programs which compile just fine when using the java compiler. (One annoying one is if I have an inner class within my class and the inner class tries to access the protected methods of the outer class's parents, i get exceptions thrown)
I tried to send a trimmed out version of my package as a zip but the group does not allow any attachments. So what I am doing now is attaching all the source files as plain text demarcated with lines. Can somebody create appropriate directory structure for the files and see the problem ? It happens in EmailDialog.java. I see a small red "x" in front of it with the message "the method showInfoPopup in EmailDialog is not visible" I think the class is compiled, but the byte codes might not be correct because of this problem. Thanks, Jalpesh. =================== /* * EmailTest.java * * Created on January 3, 2001, 1:41 PM */ package com.bea.commerce.tools.rules; import javax.swing.*; import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.net.URLEncoder; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; /** * * @author jalpesh */ public class EmailDialog extends AbstractClauseEditor { ActionListener previewButtonListener = null; ** Creates new form EmailTest */ public EmailDialog(Dialog aParent) { super(aParent); } class PreviewButtonListener implements ActionListener { public void actionPerformed(ActionEvent ae) { Component c = (Component)ae.getSource(); EmailDialog.this.showInfoPopup("INFO_ValidURI","INFO_ValidURI_message"); } } } ==================== package com.bea.commerce.tools.rules; import java.awt.*; import javax.swing.*; import com.bea.commerce.tools.AbstractEditorDialog; abstract public class AbstractClauseEditor extends AbstractEditorDialog { public AbstractClauseEditor(Frame anOwner) { super(); } public AbstractClauseEditor(Dialog anOwner) { super(); } } ==================== package com.bea.commerce.tools; import java.awt.*; import java.awt.event.ComponentListener; import java.awt.event.ComponentEvent; import java.awt.event.WindowListener; import java.awt.event.WindowEvent; import java.awt.event.MouseAdapter; import javax.swing.JDialog; import javax.swing.JOptionPane; import java.awt.Cursor; abstract public class AbstractEditorDialog extends JDialog { protected void showInfoPopup(String aTitle, String aMessage) { JOptionPane.showMessageDialog(this, aMessage, aTitle, JOptionPane.INFORMATION_MESSAGE); } } ====================
Our compiler rejects the code, it only allows the protected access if the invocation is implicit. If removing the qualifier, then it compiles fine: /*EmailDialog.this.*/showInfoPopup("INFO_ValidURI", "INFO_ValidURI_message"); This is still a bug though.
Problem identified. We authorized such qualified super calls but not qualified this calls (also needed to tune the visibility check).
Actually, even "new EmailDialog().showInfoPopup" should be authorized. Adding test cases to suites.
Fixed for both method and field access.