Comments (8)
I've committed a more complete test to cover different parameter types.
See testAnnotationParameterTypes().
Lionel.
from spoon.
I fixed the problem. I'll provide a pull request in a few minutes. 😄
from spoon.
Another bug occures on my machine with your new tests.
spoon.compiler.ModelBuildingException: AnnotParamTypes cannot be resolved to a type at D:\Programmieren\CubeEngine\spoon\src\test\java\spoon\test\annotation\Main.java:8
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.report(JDTBasedSpoonCompiler.java:489)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.reportProblems(JDTBasedSpoonCompiler.java:504)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:464)
at spoon.test.annotation.AnnotationTest.testModelBuildingAnnotationBoundUsage(AnnotationTest.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
from spoon.
ok, yes sorry @boeserwolf91 . I was running the test from inside Eclipse only which introduced a side effect. The new commit should fix this compilation error.
from spoon.
@seintur I see. I'll give it a try and check whether it works.
I created the pull request now. I hope I didn't do something wrong and it really works.
from spoon.
@seintur Can you please add a few more primitives to the annotation? I noticed that short shouldn't work. I fixed it with my pull request too.
And you've mistakes in line 111 and line 123.. The length of the integer array isn't 2.
The tests passed for me with my fix.
from spoon.
@boeserwolf91 Thanks for the notice. I've commited some tests with other primitive types. Don't know yet what's going on, but there seems to be an issue with short (see the commented assert statements on lines 118 and 134 of AnnotationTest).
from spoon.
My previous comment abort short can be discarded. I had missed the second commit by @boeserwolf91 that addresses this issue.
from spoon.
Related Issues (20)
- Java Compatibility with Older Versions of Spoon HOT 1
- [Bug]: CtReferenceImpl.isSpecialType throws an exception
- [Bug]: Bug adding comment in AST of lambda HOT 2
- Update a method calls reference
- java 22 HOT 1
- [Bug]: Control Flow graph missing edge for implicit default case in switch
- [Bug]: Control Flow Graph doesn't handle cases with multiple expressions
- Spotless for imports HOT 2
- [Bug]: Spoon inserts incorrect break in enhanced switch block
- [Feature Request]: Minimize Parens in `DefaultJavaPrettyPrinter` should use operator precedence (`(a == b) || (b == c)` could be `a == b || b == c`) HOT 2
- [Bug]: Javadoc of class missing HOT 1
- improve reproducible build architecture for Spoon HOT 7
- Unable to start JavaFX UI
- How to Implement Angelic Value with Spoon for APR
- Processing import Statements HOT 2
- links to some of the transformation examples are broken
- [Bug]: Not allowed javaletter or keyword in identifier found. See JLS for correct identifier. Identifier: E' HOT 1
- [Bug]: can not process lombok annatations HOT 3
- How to create static call graph with only invocations within project?
- [Bug]: Inconsistent parent for `CtTypeReferenceImpl` in `CtRecordComponentImpl` which points to a `CtMethodImpl`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spoon.