Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-1199542

javac crashed with an exception while compiling a program

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.0alpha3
    • CPU:
      sparc
    • OS:
      solaris_2.4
    • Verification:
      Not verified

      Description

      From ###@###.### Tue Apr 4 11:39 PDT 1995

      > Hi Rob,
      >
      > Could you send me some more info regarding the bug you
      > reported? I have not seen this problem before.

      Sure.
      > Have fun,
      I'm trying.
      >
      > Type: bug
      >
      > Product: java
      >
      > Severity: painful
      >
      > Synopsis: javac crashed with an exception while compiling a program.
      >
      > URL where the error occured:
      >
      > Dialog or window where the error occured:
      >
      > Description:
      (with more detail)
      The source is provided as Sun mailtool attachments.
      There were two programs. I compiled filemenu.java successfully and
      it produced something called FileMenu.class.

      I compiled it with $JAVAPATH/javac filemenu.java
      Then I compiled window.java with $JAVAPATH/javac window.java
      Which produced the error message listed below.

      Throughout, CLASSPATH was . (just a dot for the current directory)

      >
      > Error Message:
      > java.tools.java.InternalError invalid class defintion: class FileMenu, AppMenus.FileMenu
      > at java.lang.Exception.<init>(Exception.java)
      > at java.tools.java.InternalError.<init>(InternalError.java)
      > at java.tools.java.ClassDeclaration.setDefinition(ClassDeclaration.java)
      > at java.tools.javac.BatchEnvironment.loadDefinition(BatchEnvironment.java)
      > at java.tools.java.Environment.loadDefinition(Environment.java)
      > at java.tools.java.ClassDeclaration.getClassDefinition(ClassDeclaration.java)
      > at java.tools.tree.NewInstanceExpression.checkValue(NewInstanceExpression.java)
      > at java.tools.tree.NewInstanceExpression.check(NewInstanceExpression.java)
      > at java.tools.tree.ExpressionStatement.check(ExpressionStatement.java)
      > at java.tools.tree.CompoundStatement.check(CompoundStatement.java)
      > javac: An exception has occurred in the compiler, please file a bug report.


      I believe that the compiler was unhappy because filemenu.java didn't
      contain any public classes.

      Rob Kroeger
      Computer Graphics Lab
      University of Waterloo
       
      -- filemenu.java --
      /* filemenu.java

         Implements a file menu.

         */

      package AppMenus;

      import java.lang.*;
      import java.io.*;
      import java.util.*;
      import awt.*;


      class FileMenu extends Menu {
          
          public FileMenu(MenuBar mbar) {
      super("File", mbar);

      MenuItem item;

      item = new MenuItem("New", this);
      // item.disable();
      item = new MenuItem("Open...", this);
      item = new MenuItem("Reload", this);
      item = new MenuItem("Save", this);
      // item.disable();
      item = new MenuItem("Save As...", this);
      //item.disable();
      new MenuItem("Print...", this);
      new MenuItem("View Source...", this);
      // viewSourceItem.disable();
      item = new MenuItem("Close", this);
      // item.disable();
      new MenuItem("Quit", this);
      // enabled = true;
          }
          
          // menu behaviour defined with this method
          public void selected(int index) {
      int height;
      int width;
      String args[];

      switch (index) {
      case 0: // New
      System.out.println( "Got a New" );
      break;
      case 1: // Open
      System.out.println( "Got an Open" );
      break;
      case 2: // Reload
      System.out.println( "Got a Reload" );
      break;
      case 3: // Save
      break;
      case 4: // Save As
      break;
      case 5: // Print...
      break;
      case 6: // View Source...
      break;
      case 7: // Close Window
      break;
      // else fall into quit case
      case 8: // Quit
      System.exit(0);
      break;
      default:
      System.out.println( "Got something I don't understand." );
      break;
      }
          }
      }

      -- window.java --

      /* window.java

         Open a window on the screen. Written with java

         */


      import java.lang.*;
      import java.io.*;
      import java.util.*;
      import awt.*;
      import AppMenus.*;



      /**
       * Class MySimpleFrame is an extension of an awt.Frame with
       * code to create a simple frame and put stuff in it.
       */
      class MySimpleFrame extends Frame{
          // all these statics make these shared.
          static WServer server = null;
          static Font labelFont;
          static Font inputFont;
          static Font dialogFont;
          static Color blue = null;

          public static Color anchorColor = null;
          public static Color visitedAnchorColor = null;


          static Image icon;

          static MenuBar mbar;
          
          // exit from system
          public void handleQuit() {
      System.out.println( "Exiting now. My existentialism is done." );
      System.exit(0);
          }


          // constructor
          
         public MySimpleFrame(WServer serv, String args[]) {
             // init the frame
      super(serv, true, null, 500, 500, Color.lightGray);

      setTitle( "Rob's Java Window");

      mbar = new MenuBar(this);
      new FileMenu( mbar );

      // Read properties and set defaults
        // if (blue == null) {
      //blue = new Color(serv, 29,21,91);
      //labelFont = serv.fonts.getFont("Helvetica", Font.BOLD, 14);
              // inputFont = serv.fonts.getFont("DialogInput", Font.BOLD, 12);
      //}

      // dialogFont = serv.fonts.getFont("Dialog", Font.BOLD, 12);
      // setDefaultFont(dialogFont);

      serv.sync();
      map();
          }


          public static void main( String args[] ) {
      WServer server;

      try {
      server = new WServer( );
      } catch( Exception e) {
      System.out.println( "Couldn't connect to window server" );
      return;
      }

      // make window server go
      server.start( );
      MySimpleFrame f = new MySimpleFrame( server, args );

          }
      }

        Attachments

          Activity

            People

            Assignee:
            ahoffsunw Arthur Hoff (Inactive)
            Reporter:
            ahoffsunw Arthur Hoff (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: