harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Luht (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-812) transient fields are serialized
Date Mon, 10 Jul 2006 10:22:31 GMT
transient fields are serialized

         Key: HARMONY-812
         URL: http://issues.apache.org/jira/browse/HARMONY-812
     Project: Harmony
        Type: Bug

  Components: Classlib  
 Environment: Windows XP professional
    Reporter: Anton Luht
    Priority: Minor

Classlib + VM version 419914 

build: win_ia32_msvc_debug

Fields that are marked as 'transient' are serialized though they shouldn't

Code to reproduce:

import java.io.*;

public class Test {
 public static void main(String[] args) throws Throwable {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();

    ObjectOutputStream oos = new ObjectOutputStream(baos);
    oos.writeObject(new Transient());

    ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
    Transient t = (Transient) ois.readObject();

    System.out.println(t.trs == null ? "PASSED" : "FAILED");

class Transient implements Serializable {
    transient String trs = "aaa";

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message