Modify

Opened 15 years ago

#237 new defect

Transport code generation failure for classes without default super constructor

Reported by: hauma Owned by: hauma
Priority: normal Milestone: 2.0
Component: jpc Version: 1.09c
Severity: normal Keywords:
Cc:

Description

Wrong transport code is generated, when jpc tries to retrofit a serializable class that does extend a non-serializable class, which has no default constructor.

When compiling the following example (with the -local option to prevent transport code generation for all classes (see: ticket:233)), jpc crashes with "errors in generated code":

class A {
    private int x;
    A(int x) {
        this.x = x;
    }
}

class B extends A implements java.io.Serializable {
    int y;
    B(int x, int y) {
        super(x);
        this.y = y;
    }
}

In such situation, no transport code should be generated at all, because it is impossible to generate transport code for B that marshals the complete state including the private instance variable x of superclass A.

Attachments (0)

Change History (0)

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain hauma.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from hauma to the specified user. Next status will be 'new'.
The owner will be changed from hauma to anonymous. Next status will be 'assigned'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.