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

AppletAttacks compiler errors for FinalCheck.java PrivateCheck.java

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.3.0
    • security-libs
    • beta
    • sparc
    • solaris_7
    • Not verified

      In Appletattacks security tests, compilation errors are seen for
      four java source code files:

      FinalCheck.java
      FinalMethodCheck.java
      PrivateCheck.java
      PrivateStaticCheck.java

      The java -version is:

      java version "1.3"
      Java(TM) 2 Runtime Environment, Standard Edition (build Solaris_JDK_1.3-b16)
      Java HotSpot(TM) Client VM (build 1.3-b16, mixed mode)

      The errors:

      FinalCheck.java:28: cannot inherit from final java.net.PasswordAuthentication
      class FinalCheck extends PasswordAuthentication {
                               ^
      FinalMethodCheck.java:33: read(byte[]) in FinalMethodCheck cannot override read(byte[]) in java.io.DataInputStream; overridden method is final
          public int read(byte b[]) throws IOException {
                     ^
      PrivateCheck.java:33: host has private access in java.net.URL
                  foo.host = "ruffles";
                     ^
      PrivateStaticCheck.java:30: factory has private access in java.net.Socket
              Socket.factory = null;
                    ^
      4 errors


      Afterwards, no class files are found and the appattacks.sh cannot cp
      any *.class files to the ~/public_html/Appletattacks

      Here is the output from a run on Sol 2.6:



      java version "1.3"
      Java(TM) 2 Runtime Environment, Standard Edition (build Solaris_JDK_1.3-b16)
      Java HotSpot(TM) Client VM (build 1.3-b16, mixed mode)
      END Setup ...
      $ ksh runAppletviewerTests.ksh
      USAGE : runAppletviewerTests [results-file-name]
      $ ksh runAppletviewerTests.ksh fail
      USAGE : runAppletviewerTests [java-home] [results-file-name]
       Results are in applets.fail
      JAVA_FLAGS=-server
      + cd /home/williami/MyTestArea/vsn/SECURITY/kestrel_jdk/TestSuite/src/headline/noWarningApp
      + echoStart headline/noWarningApp
      + sh Doit.sh
      + 1>> /home/williami/MyTestArea/vsn/SECURITY/kestrel_jdk/TestSuite/LOGS/applets.fail 2>& 1
      + echoFinish headline/noWarningApp
      + cd /home/williami/MyTestArea/vsn/SECURITY/kestrel_jdk/TestSuite/src/AppletAttacks
      + echoStart AppletAttacks
      + touch app_attack.SunOS.log
      + sh appattacks.sh app_attack.SunOS.log
      JAVA_FLAGS = -server



      TESTDIR is /home/williami/MyTestArea/vsn/SECURITY/kestrel_jdk/TestSuite/src/AppletAttacks



      + javac AddProviderTest.java ClassLoaderTest.java ClipboardAccessTest.java EventQueueAccessTest.java ExecTest.ja
      va ExitTest.java FactoryTest.java FileTest.java FinalCheck.java FinalMethodCheck.java GetAudioTest.java GetImage
      Test.java GetRedirectTest.java GetResourceTest.java GetenvTest.java ImageTest.java LoadLibraryTest.java NetworkT
      est.java OverflowTest.java PackageDefineTest.java PackageImportTest.java Patricide.java PrivateCheck.java Privat
      eStaticCheck.java PropertiesTest.java RemoveProviderTest.java SecurityExceptionTest.java SecurityManagerTest.jav
      a SecurityTest.java SecurityTestApplet.java SetIdentityScopeTest.java ThreadGroupTest.java URLTest.java Verifier
      Test.java WindowTest.java getLocalHostTest.java template.java
      FinalCheck.java:28: cannot inherit from final java.net.PasswordAuthentication
      class FinalCheck extends PasswordAuthentication {
                               ^
      FinalMethodCheck.java:33: read(byte[]) in FinalMethodCheck cannot override read(byte[]) in java.io.DataInputStre
      am; overridden method is final
          public int read(byte b[]) throws IOException {
                     ^
      PrivateCheck.java:33: host has private access in java.net.URL
                  foo.host = "ruffles";
                     ^
      PrivateStaticCheck.java:30: factory has private access in java.net.Socket
              Socket.factory = null;
                    ^
      Note: Some input files use or override a deprecated API.
      Note: Recompile with -deprecation for details.
      4 errors
      + set +x
      *.class: No such file or directory
      Note: java/net/InetAddress.java uses or overrides a deprecated API.
      Note: Recompile with -deprecation for details.
      Creating /home/williami/public_html/AppletAttacks
      Creating /home/williami/public_html/AppletAttacks/java
      Creating /home/williami/public_html/AppletAttacks/java/io
      Creating /home/williami/public_html/AppletAttacks/java/net
      Creating /home/williami/public_html/AppletAttacks/java/applet
      Creating /home/williami/public_html/AppletAttacks/sun
      Creating /home/williami/public_html/AppletAttacks/sun/applet
      ls *.class
      *.class: No such file or directory
      cp: cannot access *.class


            skesunw Stuart Ke (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: