Comments (4)
Hey,
glad it helps you :-) I actually thought about this myself in the past, the reason it's not in, is simply, that I wanted to wait, if this is really relevant in daily life. Which you just proved it is ;-)
I think this should be part of JavaClass
, so performance is better, and it's decoupled from the classpath.
A PR would be highly appreciated of course :-) In case it helps to get started, I think this would involve
- Adding a test to
ClassFileImporterTest
- In
JavaClassProcessor
check theaccess
parameter fororg.objectweb.asm.Opcodes.ACC_ENUM
(similar toOpcodes.ACC_INTERFACE
, which is already checked)
I wonder, if it would make sense, to support List<JavaEnumConstant> getEnumConstants()
as well (or List<String> getEnumConstants()
?)...
What do you think?
from archunit.
I've made some simple changes in PR #6
As for getEnumConstants()
I'm also not sure about it, currently I don't have such use case.
from archunit.
Thanks a lot, I've merged your PR :-) If you want to try the current 0.5.0-SNAPSHOT version with your changes, you can include the Sonatype snapshot repo
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
(note that there is a breaking change where @AnalyzeClasses(importOption = ...)
became @AnalyzeClasses(importOptions = ...)
)
As for getEnumConstants()
, guess I'll handle that like isEnum()
and wait, if anybody ever really needs this feature.
Anyway, thanks for contributing, I'll close this issue.
from archunit.
Thank you too, @codecholeric.
from archunit.
Related Issues (20)
- Add support to analyse list of classes HOT 1
- Add entry point `onlyClasses` and similar
- Add predicate to find overridden methods
- Enforce ArchTests when module is depended upon HOT 1
- Compatibility issue with logback-classic 1.4.12 HOT 2
- ClassFileImporter fails to load classes with synthetic methods HOT 2
- The tests are running too late HOT 2
- [BUG] Calling getEnclosingClass() on a nested class does provide a JavaClass with no members HOT 3
- fails with Spring Boot Nested Jars HOT 11
- getCallsOfSelf does not return calls made through interface reference HOT 4
- Add method support for function callMethod HOT 2
- Get modifiers of JavaParameter HOT 1
- Layer dependency rule ignores "catch" blocks
- Enum classes not recognized as enums and with with wrong access modifiers HOT 3
- Wrong line numbers and constructor call order
- JavaType#getAllInvolvedRawTypes() throws StackOverflowError with self-referential generic types HOT 2
- @AnalyzeClasses breaks JUnit 5 tag filtering HOT 3
- Is there a way to know if JavaCodeUnit is a switch/case statement? HOT 4
- Custom Error Messages for StoreUpdateFailedException
- Remove false positives from Transactional Proxy Rule HOT 2
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 archunit.