Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Java class implementing java.io.Serializable is beign recognized as non serializable #689

Open
ghost opened this issue Sep 18, 2017 · 0 comments

Comments

@ghost
Copy link

ghost commented Sep 18, 2017

Java serializable classes should be marked by ceylon backend as serializable. I have tested it with com.github.tombentley.alabama "1.0.4" but the exception arrises in SerializationContext which is ceylon.json class.

Java model class:

import java.io.Serializable;
public class SerializableModel implements Serializable {
	private String abc;
	public SerializableModel() {}
	public SerializableModel(String abc) {
		this.abc=abc;
	}
	public String getAbc() {
		return abc;
	}
	public void setAbc(String abc) {
		this.abc = abc;
	}
}

Ceylon test:

import ceylon.test {
	test
}
import com.github.tombentley.alabama {
	serialize
}
test
shared void testSerialization(){
SerializableModel model=SerializableModel("sadas");
value string = serialize(model);
assert(!string.empty);
}

Stacktrace:

ceylon.language.serialization.SerializationException "instance of non-serializable class: com.test.potiopa.beercraft.config.server::SerializableModel"
	at ceylon.language.serialization.SerializationContextImpl.references(SerializationContext.ceylon:35)
	at com.github.tombentley.alabama.Serializer.obj$priv$(Serializer.ceylon:323)
	at com.github.tombentley.alabama.Serializer.val$priv$(Serializer.ceylon:378)
	at com.github.tombentley.alabama.Serializer.serialize(Serializer.ceylon:397)
	at com.github.tombentley.alabama.serialize_.serialize(Serializer.ceylon:49)
	at com.github.tombentley.alabama.serialize_.serialize(Serializer.ceylon:42)
	at ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants