Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug im SequentialCompositionSerializer #2

Open
aminfa opened this issue Jan 26, 2018 · 0 comments
Open

Bug im SequentialCompositionSerializer #2

aminfa opened this issue Jan 26, 2018 · 0 comments
Assignees
Labels

Comments

@aminfa
Copy link
Collaborator

aminfa commented Jan 26, 2018

Ich konnte nicht das Github Project finden, die die Implementation enthält. Deshalb schreibe ich es hier rein:

Der Bug:

Falls es in der Komposition eine Operation ohne Argumente gibt, dann gibt es ein ArrayIndexOutOfBoundException:
Der folgende Code also:

SequentialCompositionSerializer scs = new SequentialCompositionSerializer();
SequentialComposition sc = scs.readComposition("a = foo::bar({})");

Wirft folgende Exception:

java.lang.ArrayIndexOutOfBoundsException: 1
	at de.upb.crc901.configurationsetting.serialization.SequentialCompositionSerializer.readComposition(SequentialCompositionSerializer.java:61)
	... (Der restliche Stacktrace ist nicht relevant.)

Umgang:

Falls man ein Kommazeichen in den Geschweifte Klammern benutzt, kann man das Problem umgehen:

SequentialCompositionSerializer scs = new SequentialCompositionSerializer();
SequentialComposition sc = scs.readComposition("a = foo::bar({,})");
String serialization = scs.serializeComposition(sc);
System.out.println(serialization); // prints: a = foo::bar({})

// can't read the serialized output of scs itself. :D
scs.readComposition(serialization); // throws Exception again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants