This is the mail archive of the java-prs@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcj/343: can't cast array to serializable



>Number:         343
>Category:       gcj
>Synopsis:       can't cast array to serializable
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apbianco
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 07 16:00:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Tom Tromey
>Release:        unknown-1.0
>Organization:
>Environment:

>Description:
Java arrays implement serializable (as of 1.1 or 1.2,
I forget).  However, gcj disallows casting an array
to serializable:

import java.io.*;
public class t
{
  public static void main (String[] args)
  {
    System.out.println ((Serializable) args);
  }
}

creche. gcj --syntax-only t.java 
t.java: In class `t':
t.java: In method `main(java.lang.String[])':
t.java:6: Invalid cast from `java.lang.String[]' to `java.io.Serializable'.
    System.out.println ((Serializable) args);
                        ^
1 error
creche. javac t.java
creche. 

>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]