GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [core] Deprecate string property and string multi property by oowekyala · Pull Request #1501 · pmd/pmd Conversation
Member
Refs #1432 Many usages cannot be replaced just yet, because they are published API. Interestingly, AvoidDuplicateLiterals tried to implement its own StringMultiProperty based on a StringProperty, which makes it really hard to refactor. I think it's better to leave it like that until 7.0.0. There's surprisingly nearly nothing to do for #1027, and all of it will have to wait for 7.0.0. I suppose we don't use so many regexes.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsMost of the time they can't be changed right now
36 tasks done
|
There was an error while loading. Please reload this page.
Generated by 🚫 Danger |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can you have a look, whether we need the delim(",") call for the stringListProperties?
We should probably make the properties of Rule (violationSuppression**) and XPathRule (xpath, version) and all properties of all renderers private/package private in 7.0.0. I don't see a use case to have them public. Wdyt?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| * matching a regular expression. | ||
| */ | ||
| // TODO 7.0.0 use PropertyDescriptor<Pattern> | ||
| StringProperty VIOLATION_SUPPRESS_REGEX_DESCRIPTOR = new StringProperty("violationSuppressRegex", |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Ok, we can't switch it now, because the properties are a field of the interface Rule - which makes it public API.
Maybe we should remove it here in the (Java) API in 7.0.0? The only API left would be, when using a rule and setting the properties in the ruleset xml. There the type doesn't matter - since the String is then automatically converted into a Pattern.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yeah it would make sense to hide the descriptors. But we should probably allow setting these from Java somehow, for external tools that edit rules. The descriptors are definitely an implementation detail
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| public class XPathRule extends AbstractRule { | ||
|
|
||
| // TODO 7.0.0 use PropertyDescriptor<String> | ||
| public static final StringProperty XPATH_DESCRIPTOR = StringProperty.named("xpath") |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Same here - the properties of XPathRule shouldn't probably be public.
Maybe tag them for now as @internalapi?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
In fact I think for 7.0.0 XPathRule as a whole should be internal API. Since we're introducing XML sugar for XPath rules, we could jump on the occasion to completely hide away the implementation of XPath rules, and only provide a set of interfaces as API. That would allow language implementations to use different XPath rule classes at their discretion, and us to change the implementation transparently for any users. XPathRule's API would anyway be significantly broken by dropping Jaxen...
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yes, this makes sense, having XPathRule as whole internal API.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| public class YAHTMLRenderer extends AbstractAccumulatingRenderer { | ||
|
|
||
| public static final String NAME = "yahtml"; | ||
| // TODO 7.0.0 use PropertyDescriptor<Optional<File>> with a constraint that the file is an existing directory |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
👍 I like it
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| */ | ||
| public class GenericClassCounterRule extends AbstractJavaRule { | ||
|
|
||
| // Class is unused, properties won't be converted |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
On first look, this rule might be use case for multi file analysis...
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Maybe... We should probably scrap the class and add its purpose somewhere on the roadmap
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yes, no need to keep this class - we should just keep the idea/purpose of the rule.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.