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

ropertyParser.extractFieldNameFromGetterSetterMethodName throw exception java.lang.StringIndexOutOfBoundsException: String index out of range: 4 #33

Closed
jgrzebyta opened this issue Oct 10, 2014 · 2 comments

Comments

@jgrzebyta
Copy link

Hi,

I have an exception during compilation: http://pastebin.com/b6Uf7EBt
I use: java 1.7, gwt 2.6.1 gwt-jackson 0.6.2.

The error is somewhere here:

public static interface ResponseMapper extends ObjectMapper<Response> { }
public static ResponseMapper MAPPER = GWT.create(ResponseMapper.class);

Response is an interface:

 */
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class")
@JsonSubTypes({@JsonSubTypes.Type(value = ErrorResponse.class), @JsonSubTypes.Type(value = MessageResponse.class)})
public interface Response {

}

And has 2 implementations. One of them is MessageResponse:

package org.csgid.ucl.common.shared;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;

public class MessageResponse extends Response {

    public MessageResponse() {
    }

    @JsonCreator
    public MessageResponse(@JsonProperty("message") String message, 
                           @JsonProperty("data") Serializable data) {
        this.message = message;
        this.data = data;
    }

    private String message;
    private Serializable data;

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Serializable getData() {
        return data;
    }

    public void setData(Serializable data) {
        this.data = data;
    }
}

I tried everything: changed Response interface into abstract class, put the initialising code into different part of code, moved getters/setters declarations into the interface, moved GWT.crate either into onModuleLoad method or into view implementation constructor.

Please help,

Jacek

@nmorel
Copy link
Owner

nmorel commented Oct 10, 2014

Serializable is not supported in 0.6.2.
I'm currently implementing it but it will take some time.

@jgrzebyta
Copy link
Author

It helped. Thanks a lot!!
Jacek

On 10 October 2014 19:06, Nicolas Morel notifications@github.com wrote:

Serializable is not supported in 0.6.2.
I'm currently implementing it but it will take some time.


Reply to this email directly or view it on GitHub
#33 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants