GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [core] Deprecate string property and string multi property by oowekyala · Pull Request #1501 · pmd/pmd

Conversation

@oowekyala

@oowekyala oowekyala commented Dec 4, 2018

Copy link
Copy Markdown
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 reactions
oowekyala added 8 commits December 4, 2018 08:32
@oowekyala
Deprecate StringProperty
96e3a63
@oowekyala
Deprecate StringMultiProperty
34ca3f6
@oowekyala
Remove some usages, rework properties of AvoidDuplicateLiterals
452ea02
@oowekyala
Rollback bc of too much work
ab80d6b
@oowekyala
Update usages of StringProperty
e6a42f3
Most of the time they can't be changed right now
@oowekyala
Migrate usages of StringMultiProperty
37dfa19
@oowekyala
brushup
097901e
@oowekyala
Update release notes
3a47c93
@oowekyala oowekyala added the is:deprecation The main focus is deprecating public APIs or rules, eg to make them internal, or removing them label Dec 4, 2018
@oowekyala oowekyala added this to the 6.10.0 milestone Dec 4, 2018
@oowekyala oowekyala mentioned this pull request Dec 4, 2018
[core] Implementation plan for property framework changes #1432
Closed
36 tasks done
@oowekyala
Style
904d76a
@ghost

ghost commented Dec 4, 2018 •
edited by ghost
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
1 Message
📖 This changeset introduces 0 new violations and 0 new errors,
removes 0 violations and 0 errors. Full report
✅ This changeset introduces 0 new violations and 0 new errors,
removes 0 violations and 0 errors. Full report

Generated by 🚫 Danger

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

adangel
adangel reviewed Dec 4, 2018
View reviewed changes

@adangel adangel left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...rc/main/java/net/sourceforge/pmd/lang/apex/rule/codestyle/VariableNamingConventionsRule.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pmd-core/src/main/java/net/sourceforge/pmd/Rule.java
* matching a regular expression.
*/
// TODO 7.0.0 use PropertyDescriptor<Pattern>
StringProperty VIOLATION_SUPPRESS_REGEX_DESCRIPTOR = new StringProperty("violationSuppressRegex",

@adangel adangel Dec 4, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@oowekyala oowekyala Dec 4, 2018

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/XPathRule.java
public class XPathRule extends AbstractRule {

// TODO 7.0.0 use PropertyDescriptor<String>
public static final StringProperty XPATH_DESCRIPTOR = StringProperty.named("xpath")

@adangel adangel Dec 4, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@oowekyala oowekyala Dec 4, 2018

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@adangel adangel Dec 5, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pmd-core/src/main/java/net/sourceforge/pmd/properties/PropertyFactory.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pmd-core/src/main/java/net/sourceforge/pmd/renderers/YAHTMLRenderer.java
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

@adangel adangel Dec 4, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I like it

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/LinguisticNamingRule.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/GenericClassCounterRule.java
*/
public class GenericClassCounterRule extends AbstractJavaRule {

// Class is unused, properties won't be converted

@adangel adangel Dec 4, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@oowekyala oowekyala Dec 4, 2018

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@adangel adangel Dec 5, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentRule.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentRule.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

oowekyala added 2 commits December 4, 2018 23:44
@oowekyala
Fix line length
a6e71f3
@oowekyala
Remove wrong comment
9cb7ac6
@adangel adangel self-assigned this Dec 5, 2018
adangel
adangel approved these changes Dec 5, 2018
View reviewed changes
@adangel
adangel merged commit 9cb7ac6 into pmd:master Dec 5, 2018
@oowekyala
oowekyala deleted the deprecate-string-property branch December 6, 2018 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adangel adangel adangel approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@adangel adangel

Labels

is:deprecation The main focus is deprecating public APIs or rules, eg to make them internal, or removing them

Projects

None yet

Milestone

6.10.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@oowekyala @adangel
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.