fedora-java / jurand Goto Github PK
View Code? Open in Web Editor NEWA tool for manipulating symbols present in Java source files.
License: Apache License 2.0
A tool for manipulating symbols present in Java source files.
License: Apache License 2.0
Jurand hangs when I try to run it on Groovy code.
I know Groovy is not supported, but Jurand should not hang - it should produce something (not necessairly correct) or raise error, but not hang.
Example reproducer:
wget https://repo1.maven.org/maven2/org/gradle/api/plugins/gradle-tomcat-plugin/0.9.9/gradle-tomcat-plugin-0.9.9-sources.jar
jar xf gradle-tomcat-plugin-0.9.9-sources.jar
jurand -p foo -i org/gradle/api/plugins/tomcat/internal/ShutdownMonitor.groovy
Implement a strict mode.
In strict mode Jurand should fail if:
-a
is given, but not annotation was removedFor example see this commit in guava package
Regex matcher com[.]google[.]errorprone[.]annotation[.]
matches nothing in Guava sources.
Yet the tool does not point this out.
Another matche com[.]google[.]errorprone[.]annotations[.]
was added to fix that.
Pull request demonstrates that matcher could be removed: https://src.fedoraproject.org/rpms/jurand/pull-request/3
I have the following file:
@č class ř{}
I am trying to remove @č
annotation.
jurand -a -n č -i ř.java
- does nothing
I have the following class:
import java.lang.annotation.*;
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.METHOD)
public @interface MyAnnotation {
}
I want to remove Retention annotation, but I can't do that with Jurand.
None of the calls I tried worked.
What arguments should I pass to Jurand to remove Retention?
In the following example Jurand removes only one annotation @Serial
- it skips annotations after custom annotation MyAnnotation
.
Input code:
import java.io.Serial;
class MyClass {
@Serial
int foo;
}
@interface MyAnnotation {
@Serial
int foo = 0;
}
class MyOtherClass {
@Serial
int foo;
}
Jurand invocation: jurand -i -a test_processed.java -n Serial
Actual output:
class MyClass {
int foo;
}
@interface MyAnnotation {
@Serial
int foo = 0;
}
class MyOtherClass {
@Serial
int foo;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.