Giter VIP home page Giter VIP logo

jodd-proxetta's Introduction

Jodd Proxetta

Jodd GitHub release Maven Central javadoc Build Status codecov Codacy Badge Stack Overflow BSD License

๐ŸŒŸ Java Proxy library. Method parameters. Method references.

๐Ÿก Website: proxetta.jodd.org

โค๏ธ For developers, by developer.

jodd-proxetta's People

Contributors

igr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jodd-proxetta's Issues

Proxetta > 3.8.6 throws StringIndexOutOfBoundsException

Current behavior

I have updated Proxette and now get a StringIndexOutOfBoundsException. It looks like that every version above 3.8.6 can not handle this case anymore.

java.lang.StringIndexOutOfBoundsException: String index out of range: 0

	at java.lang.String.charAt(String.java:658)
	at jodd.asm5.Frame.execute(Frame.java:1361)
	at jodd.asm5.MethodWriter.visitTypeInsn(MethodWriter.java:855)
	at jodd.proxetta.asm.ProxettaAsmUtil.castToReturnType(ProxettaAsmUtil.java:553)
	at jodd.proxetta.asm.ProxettaMethodBuilder$1$1.visitMethodInsn(ProxettaMethodBuilder.java:375)
	at jodd.asm5.ClassReader.readCode(ClassReader.java:1496)
	at jodd.asm5.ClassReader.readMethod(ClassReader.java:1032)
	at jodd.asm5.ClassReader.accept(ClassReader.java:708)
	at jodd.asm5.ClassReader.accept(ClassReader.java:521)
	at jodd.proxetta.asm.ProxettaMethodBuilder.createProxyMethod(ProxettaMethodBuilder.java:185)
	at jodd.proxetta.asm.ProxettaMethodBuilder.visitEnd(ProxettaMethodBuilder.java:103)
	at jodd.asm5.ClassReader.readMethod(ClassReader.java:1036)
	at jodd.asm5.ClassReader.accept(ClassReader.java:708)
	at jodd.asm5.ClassReader.accept(ClassReader.java:521)
	at jodd.proxetta.impl.ProxyProxettaBuilder.process(ProxyProxettaBuilder.java:76)
	at jodd.proxetta.ProxettaBuilder.process(ProxettaBuilder.java:220)
	at jodd.proxetta.ProxettaBuilder.define(ProxettaBuilder.java:255)
	at jodd.methref.MethrefProxetta.defineProxy(MethrefProxetta.java:56)
	at jodd.methref.Methref.<init>(Methref.java:57)
	at jodd.methref.Methref.on(Methref.java:79)
	at com.mudz.proxetta.ProxettaTest.testProxetta(ProxettaTest.java:12)
	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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:221)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)

Expected behavior

No Exception

Steps to Reproduce the Problem

public interface Bar<T> {
	T bar();
}
public class Foo implements Bar<Foo> {

	public Foo() {
	}

	@Override
	public Foo bar() {
		return new Foo();
	}
}

And the test:

public class ProxettaTest {

	@Test
	public void testProxetta() {
		Methref.on(Foo.class);
	}
}

dependencies:

<dependency>
    <groupId>org.jodd</groupId>
    <artifactId>jodd-proxetta</artifactId>
    <version>3.9</version> <!-- works with 3.8.6 -->
</dependency>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.