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

Error with Arrays #29

Open
vasapower opened this issue Nov 6, 2018 · 0 comments
Open

Error with Arrays #29

vasapower opened this issue Nov 6, 2018 · 0 comments
Labels

Comments

@vasapower
Copy link

The instrumented code:

public final CompletableFuture<Boolean> call(String longString) {
    String[] split = longString.split(" ");
    String name = split[0];
    String surname = split[1];

    //again...
    name = split[0];
    //...
}

Raises me the following exception:

java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at it.mvi.core.functionalities.FunctionalitiesHelper.getFunctionality(FunctionalitiesHelper.java:36)
	at it.mvi.core.functionalities.FunctionalitiesManager.executeWork(FunctionalitiesManager.java:128)
	at it.mvi.core.functionalities.FunctionalitiesManager.executeWork(FunctionalitiesManager.java:34)
	at it.mvi.core.functionalities.FunctionalitiesManager.call(FunctionalitiesManager.java:21)
	at com.metaring.homepagecontactformbackend.HomepagecontactformbackendFunctionalitiesManager.contact(HomepagecontactformbackendFunctionalitiesManager.java:16)
	at com.metaring.homepagecontactformbackend.Main.start(Main.java:20)
	at com.metaring.homepagecontactformbackend.Main.main(Main.java:14)
Caused by: java.lang.VerifyError: Inconsistent stackmap frames at branch target 494
Exception Details:
  Location:
    com/metaring/homepagecontactformbackend/ContactFunctionalityImpl.call(Lcom/metaring/homepagecontactformbackend/ContactForm;)Ljava/util/concurrent/CompletableFuture; @494: new
  Reason:
    Type 'java/lang/Object' (current frame, locals[8]) is not assignable to 'java/lang/String' (stack map, locals[8])
  Current Frame:
    bci: @465
    flags: { }
    locals: { 'com/metaring/homepagecontactformbackend/ContactFunctionalityImpl', 'com/metaring/homepagecontactformbackend/ContactForm', 'it/mvi/core/type/factory/DataRepresentationFactory', 'java/lang/String', '[Ljava/lang/String;', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'java/lang/Object', 'java/lang/String', 'java/lang/String', 'it/mvi/core/type/DataRepresentation', 'java/lang/String', 'it/mvi/core/type/DataRepresentation', 'it/mvi/core/type/DataRepresentation' }
    stack: { 'it/mvi/core/type/DataRepresentation' }
  Stackmap Frame:
    bci: @494
    flags: { }
    locals: { 'com/metaring/homepagecontactformbackend/ContactFunctionalityImpl', 'com/metaring/homepagecontactformbackend/ContactForm', 'it/mvi/core/type/factory/DataRepresentationFactory', 'java/lang/String', '[Ljava/lang/String;', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'it/mvi/core/type/DataRepresentation', 'java/lang/String', 'it/mvi/core/type/DataRepresentation', 'it/mvi/core/type/DataRepresentation' }
    stack: { }
  Bytecode:
  ...

It is raised when the class is loaded into ClassLoader for the first time in application.
I am sure that the problem is in that piece of code because I tried a lot of alternatives, and solved using:

List<String> split = Arrays.asList(longString.split(" "));
String name = split.get(0);

//again...
name = split.get(0);

But I want my customers enjoy development experience through my SDK...
Can you help, please?

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