W3C home > Mailing lists > Public > www-jigsaw@w3.org > May to June 2000

compile errors in Jigsaw2.0.4 src code

From: yzhang <yzhang@home.com>
Date: Thu, 08 Jun 2000 23:21:59 -0700
Message-ID: <39408D06.9E25041F@home.com>
To: www-jigsaw@w3.org, yuzhang@ca.ibm.com
Hi,

I imported the whole Jigsaw2.0.4 src tree into Visual Age for Java2.

It popped up 274 Problems. 245 are warnings about deprecated classes or
methods. 29 are serious errors. All these 29 errors are in
org.w3c.jigadmin.*

These 29 errors belong to 2 types:

1, Field Initialization. The construct invoked to create inner class X
with arguments () is not defined.
2, Field Initialization. Cannot refer inside an inner class to a
non-final variable Y defined in a different method.

example:
-----------------------------------------------------------
public class AddResourcePanel extends JPanel {

 protected boolean ok;

 protected EditableStringChoice classSC;

 protected JTextField identifierTF;

 protected ResourceTreeBrowser browser = null;

 /**
  * Our internal ActionListener
  */
 ActionListener al = new ActionListener() {
 public void actionPerformed(ActionEvent ae) {
     if( ae.getActionCommand().equals("Ok") ||
  ae.getSource().equals(identifierTF)) {
      if(! classSC.getText().equals("")) {
   if (! identifierTF.getText().equals("")) {
       browser.setResourceToAdd(classSC.getText(),
           identifierTF.getText());
       browser.disposeAddResourcePopup();
       done();
   } else {
       identifierTF.requestFocus();
   }
      } else {
   classSC.requestFocus();
      }
  } else if ( ae.getActionCommand().equals("Cancel")) {
      browser.setResourceToAdd(null, null);
      browser.disposeAddResourcePopup();
      done();
  } else if(ae.getSource().equals(classSC)) {
      identifierTF.requestFocus();
  }
 }
 };

}
------------------------------------------------------------

In this example, X is ActionListener. Y is browser.

ActionListener is just an interface, not a class. I guess we can only
use an adapter as an internal class.

Also, I doubt if we need add 'final' in browser declaration.

Has anybody tried to compile the code successfully without these errors
by using any other compilers?

Thanks.

Yu
Received on Friday, 9 June 2000 02:19:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:34 GMT