pmd / pmd-designer Goto Github PK
View Code? Open in Web Editor NEWThe Rule Designer is a graphical tool that helps PMD users develop their custom rules
License: BSD 2-Clause "Simplified" License
The Rule Designer is a graphical tool that helps PMD users develop their custom rules
License: BSD 2-Clause "Simplified" License
Describe the bug
Running the designer fails with the following output
(sorry if this is a dumb question, I couldn't find anything related to it and I'm not familiar with it)
run.sh designer
Graphics Device initialization failed for : es2, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:222)
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:831)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
... 1 more
java.lang.RuntimeException: No toolkit found
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:831)
Additional context
openjdk version "16" 2021-03-16
OpenJDK Runtime Environment (build 16+14)
OpenJDK 64-Bit Server VM (build 16+14, mixed mode)
Describe the bug
The designer tool is nice but i think it might show the wrong class
To Reproduce
Steps to reproduce the behavior:
1.
export JAVAFX_HOME=/Users/nbaumgartner/Library/Java/JavaVirtualMachines/javafx-sdk-17.0.7 pmd-bin-6.55.0/bin/run.sh designer
package com.example;
import javafx.scene.control.Button;
public class Test {
private String foo;
class Button{
}
public Button button;
}
Expected behavior
Altough there is a import for Button in the class we define an own class Button. The expected qualified name should be: "com.example.Text.Button" and not "javafx.scene.control.Button"
PMDConfiguration configuration = new PMDConfiguration();
LanguageVersion goLanguageVersion = LanguageRegistry.getLanguage("java").getDefaultVersion();
configuration.setDefaultLanguageVersion(goLanguageVersion);
configuration.setReportFormat("json");
The above is when I write scanning methods through java, the language selected java can scan, but when I change to go or C#, it will report a null pointer, no clue about this, this is my personal reason
This is the only hint 【java.lang.NullPointerException】
Describe the bug
When using a rule that has pmd-java:typeIs checks, the rules are working fine in the designer, however the exported rules are not working later on when testing the rules in Java unit tests.
The rule would look something like:
//PrimaryPrefix/Name[@Image[ends-with(., 'Instant.now')]][pmd-java:typeIs('java.time.Instant')]
and the example code:
package foo;
public class Hello {
public static void main(String[] args) {
java.time.Instant.now();
}
}
This file fails validation as expected in the designer, but when the rule is exported, the rule no longer works, and violation is no longer reported. After debugging TypeIsFunction, it turned out that this happened because the rule was not set up to perform typeResolution. Manually adding the typeResolution="true"
attribute to the rule definition appears to fix this problem.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Either the UI should run the queries with typeResolution disabled (and have a visible enable flag), or the export view should add the required attribute to the rule definition.
Screenshots
Let me know if you need one.
Desktop (please complete the following information):
Having issue with xpath execution if source codes are indented with tab-characters.
Steps to reproduce the behaviour:
//MethodDeclaration
Expected behaviour
Indentation characters should not cause inconsistent behaviour in nodes detection.
Describe the bug
./pmd designer
[main] INFO net.sourceforge.pmd.cli.commands.internal.AbstractPmdSubcommand - Log level is at INFO
java.lang.NullPointerException
at java.util.Properties$LineReader.readLine(Properties.java:434)
at java.util.Properties.load0(Properties.java:353)
at java.util.Properties.load(Properties.java:341)
at net.sourceforge.pmd.util.fxdesigner.DesignerStarter.getJavaFxVersion(DesignerStarter.java:116)
at net.sourceforge.pmd.util.fxdesigner.DesignerStarter.isCompatibleJavaFxVersion(DesignerStarter.java:100)
at net.sourceforge.pmd.util.fxdesigner.DesignerStarter.launchGui(DesignerStarter.java:153)
at net.sourceforge.pmd.cli.commands.internal.DesignerCommand.execute(DesignerCommand.java:28)
at net.sourceforge.pmd.cli.commands.internal.AbstractPmdSubcommand.call(AbstractPmdSubcommand.java:35)
at net.sourceforge.pmd.cli.commands.internal.AbstractPmdSubcommand.call(AbstractPmdSubcommand.java:20)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at net.sourceforge.pmd.cli.PmdCli.main(PmdCli.java:18)
Version:
7.0.0-rc3
To Reproduce
Steps to reproduce the behavior:
run command "pmd designer"
Desktop:
JavaFx:
javafx.runtime.version=8.0.291
javafx.runtime.build=b09
Part of pmd/pmd#1931
Integrate the new logo ("branding").
I think, now that this class is in pmd-core, we can remove it from pmd-designer, don't we?
Originally posted by @adangel in pmd/pmd#2388
With pmd/pmd#4809 the class PropertyTypeId
has been internalized in pmd-core and should not be used by downstream projects.
From the class doc of PropertyTypeId:
This class' API is mainly provided to build GUIs for XPath rules like the rule designer, so that they have info about the available properties from XML. As such, the number of clients are probably low. Fow now, this stays as Internal API and might be changed.
PropertyTypeId is used by pmd-designer and by pmd-eclipse-plugin.
Maybe we can provide a public API for this. Or maybe this can be avoided by leveraging the serialization mechanism (PropertyDescriptor#serializer()) directly.
So that we can remove the backwards compatible stuff explicitly added for pmd-designer.
See pmd/pmd@17beee6
Hi. I ran pmd v7.1.0 and was told missing JAVAFX_HOME.
I set the env var and ran it again and was told No java executable found in PATH
If pmd is going to depend on an env var for locating the JDK then it should search for Java from there, not the path.
I have trouble launching the designer both from within an IDE, from the maven exec task, and from the binary distribution.
I tried with a JDK 11 and 17 packaged by Amazon Zulu, which comes with JavaFX included, and got various errors. I also tried with a manual install of the JavaFX 17 SDK and with the JAVAFX_HOME
env var that is recognized by our launch script and got the same errors.
@adangel can you describe your setup to run the designer with JavaFX 17?
Launches with JDK 11, but I get the following warning:
On JRE 9+, the following VM argument makes the controls smarter:
--add-opens javafx.controls/javafx.scene.control.skin=ALL-UNNAMED
Apparently this check doesn't match. The reported $java_vendor $java_ver
is openjdk 110
.
With JDK 17 I get the following:
PMD Rule Designer (v 7.0.0-rc1) initializing...
Exception in Application start method
java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:893)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.IllegalAccessError: class net.sourceforge.pmd.util.fxdesigner.util.DesignerUtil (in unnamed module @0x26ea8c2b) cannot access class com.sun.javafx.fxml.builder.ProxyBuilder (in module javafx.fxml) because module javafx.fxml does not export com.sun.javafx.fxml.builder to unnamed module @0x26ea8c2b
When adding --add-opens javafx.fxml/com.sun.javafx.fxml.builder=ALL-UNNAMED
explicitly I get
Caused by: javafx.fxml.LoadException:
file:/home/clem/Documents/PMD/pmd/sandbox/pmd-bin-7.0.0-SNAPSHOT/lib/pmd-ui-7.0.0-rc1.jar!/net/sourceforge/pmd/util/fxdesigner/fxml/editor.fxml:143
file:/home/clem/Documents/PMD/pmd/sandbox/pmd-bin-7.0.0-SNAPSHOT/lib/pmd-ui-7.0.0-rc1.jar!/net/sourceforge/pmd/util/fxdesigner/fxml/designer.fxml:118
...
Caused by: java.lang.RuntimeException: Cannot create instance of net.sourceforge.pmd.util.fxdesigner.util.controls.NodeParentageCrumbBar with given set of properties: [prefHeight, stylesheets, designerRoot, id]
at javafx.fxml/com.sun.javafx.fxml.builder.ProxyBuilder.build(ProxyBuilder.java:272)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:776)
./mvnw -Prunning,with-javafx exec:java
With both JDKs I get the following:
Caused by: javafx.fxml.LoadException:
/home/clem/Documents/PMD/designer/target/classes/net/sourceforge/pmd/util/fxdesigner/fxml/node-details.fxml:20
/home/clem/Documents/PMD/designer/target/classes/net/sourceforge/pmd/util/fxdesigner/fxml/designer.fxml:108
at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2722)
at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1024)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:759)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2853)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2649)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2563)
at javafx.fxml/javafx.fxml.FXMLLoader$IncludeElement.constructValue(FXMLLoader.java:1155)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:759)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2853)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2649)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2563)
at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2531)
at net.sourceforge.pmd.util.fxdesigner.Designer.start(Designer.java:107)
at net.sourceforge.pmd.util.fxdesigner.Designer.start(Designer.java:65)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:839)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:483)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:316)
... 1 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1022)
... 21 more
Caused by: java.lang.NullPointerException
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at net.sourceforge.pmd.util.fxdesigner.util.DesignerUtil.addCustomStyleSheets(DesignerUtil.java:139)
at net.sourceforge.pmd.util.fxdesigner.util.controls.ToolbarTitledPane.<init>(ToolbarTitledPane.java:50)
... 27 more
This exception also happens when I launch the app from within Intellij using the provided run configurations.
I get the following warning on app startup with JDK 17
OpenJDK 64-Bit Server VM warning: Ignoring option --illegal-access=warn; support was removed in 17.0
Describe the bug
When starting, JDK crashes. This happens when using Wayland. It works under X.
To Reproduce
bin/run.sh designer
Result:
(java:11347): Gdk-CRITICAL **: 10:23:53.849: gdk_x11_display_set_window_scale: assertion 'GDK_IS_X11_DISPLAY (display)' failed
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fde040c0afb, pid=11347, tid=11376
#
# JRE version: OpenJDK Runtime Environment (12.0.2+10) (build 12.0.2+10)
# Java VM: OpenJDK 64-Bit Server VM (12.0.2+10, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C [libX11.so.6+0x2eafb] XInternAtom+0x3b
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/andreas/PMD/source/pmd-github/pmd-dist/target/pmd-bin-6.18.0-SNAPSHOT/hs_err_pid11347.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
bin/run.sh: Zeile 218: 11347 Abgebrochen java ${HEAPSIZE} ${PMD_JAVA_OPTS} $(jre_specific_vm_options) -cp "${classpath}" "${CLASSNAME}" "$@"
Workaround
Start with PMD_JAVA_OPTS=-Djdk.gtk.version=2 bin/run.sh designer
Additional context
I only see support in the designer for a few languages, but PMD supports many more.
It would be good to be able to use any of the languages that are supported.
Describe the bug
There seems to be a security (?) issue with commons-io 2.7 - see pmd/pmd#4691
After googling (VULNDB-239195 is behind a paywall) I found this:
https://issues.apache.org/jira/browse/FLINK-22747
VULNDB-239195
"Vendor Specific News/Changelog Entry
https://commons.apache.org/proper/commons-io/changes-report.html#a2.8.0
Vendor Specific Solution URL
apache/commons-io@0de91c0
Vendor Specific Solution URL
apache/commons-io@97ae01c
Bug Tracker
https://issues.apache.org/jira/browse/IO-675"
In PMD, we already removed commons-io some time ago. I think, we should do the same in pmd-designer.
If you try to use those functions, you just get an exception in the exception log that the function is missing:
net.sourceforge.pmd.util.fxdesigner.model.XPathEvaluationException: java.lang.RuntimeException: org.jaxen.UnresolvableException: No Such Function typeIsExactly
at net.sourceforge.pmd.util.fxdesigner.model.XPathEvaluator.evaluateQuery(XPathEvaluator.java:89)
at net.sourceforge.pmd.util.fxdesigner.XPathPanelController.evaluateXPath(XPathPanelController.java:250)
at net.sourceforge.pmd.util.fxdesigner.MainDesignerController.lambda$refreshXPathResults$10(MainDesignerController.java:210)
at java.util.Optional.ifPresent(Optional.java:159)
at net.sourceforge.pmd.util.fxdesigner.MainDesignerController.refreshXPathResults(MainDesignerController.java:210)
at net.sourceforge.pmd.util.fxdesigner.XPathPanelController.lambda$beforeParentInit$4(XPathPanelController.java:137)
at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$0(NotificationAccumulator.java:134)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
at org.reactfx.ProperEventStream.emit(ProperEventStream.java:18)
at org.reactfx.EventStream$1.lambda$observeInputs$0(EventStream.java:423)
at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$0(NotificationAccumulator.java:134)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:57)
at org.reactfx.ProperEventStream.emit(ProperEventStream.java:18)
at org.reactfx.SuccessionReducingStream.handleTimeout(SuccessionReducingStream.java:73)
at org.reactfx.util.FxTimer.lambda$restart$0(FxTimer.java:89)
at com.sun.scenario.animation.shared.TimelineClipCore.visitKeyFrame(TimelineClipCore.java:239)
at com.sun.scenario.animation.shared.TimelineClipCore.playTo(TimelineClipCore.java:180)
at javafx.animation.Timeline.impl_playTo(Timeline.java:176)
at javafx.animation.AnimationAccessorImpl.playTo(AnimationAccessorImpl.java:39)
at com.sun.scenario.animation.shared.SingleLoopClipEnvelope.timePulse(SingleLoopClipEnvelope.java:99)
at javafx.animation.Animation.impl_timePulse(Animation.java:1102)
at javafx.animation.Animation$1.lambda$timePulse$25(Animation.java:186)
at java.security.AccessController.doPrivileged(Native Method)
at javafx.animation.Animation$1.timePulse(Animation.java:185)
at com.sun.scenario.animation.AbstractMasterTimer.timePulseImpl(AbstractMasterTimer.java:344)
at com.sun.scenario.animation.AbstractMasterTimer$MainLoop.run(AbstractMasterTimer.java:267)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:506)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:490)
at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$404(QuantumToolkit.java:319)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run$$$capture(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: org.jaxen.UnresolvableException: No Such Function typeIsExactly
at net.sourceforge.pmd.lang.rule.xpath.JaxenXPathRuleQuery.evaluate(JaxenXPathRuleQuery.java:73)
at net.sourceforge.pmd.lang.rule.XPathRule.evaluate(XPathRule.java:114)
at net.sourceforge.pmd.lang.java.rule.JavaRuleChainVisitor.visit(JavaRuleChainVisitor.java:42)
at net.sourceforge.pmd.lang.rule.AbstractRuleChainVisitor.visitAll(AbstractRuleChainVisitor.java:96)
at net.sourceforge.pmd.RuleChain.apply(RuleChain.java:67)
at net.sourceforge.pmd.RuleSets.apply(RuleSets.java:140)
at net.sourceforge.pmd.util.fxdesigner.model.XPathEvaluator.evaluateQuery(XPathEvaluator.java:84)
... 35 more
Caused by: org.jaxen.UnresolvableException: No Such Function typeIsExactly
at org.jaxen.SimpleFunctionContext.getFunction(SimpleFunctionContext.java:127)
at org.jaxen.ContextSupport.getFunction(ContextSupport.java:242)
at org.jaxen.Context.getFunction(Context.java:216)
at org.jaxen.expr.DefaultFunctionCallExpr.evaluate(DefaultFunctionCallExpr.java:176)
at org.jaxen.expr.DefaultAndExpr.evaluate(DefaultAndExpr.java:91)
at org.jaxen.expr.DefaultPredicate.evaluate(DefaultPredicate.java:95)
at org.jaxen.expr.PredicateSet.applyPredicate(PredicateSet.java:269)
at org.jaxen.expr.PredicateSet.evaluatePredicates(PredicateSet.java:244)
at org.jaxen.expr.DefaultStep.evaluate(DefaultStep.java:164)
at org.jaxen.expr.DefaultLocationPath.evaluate(DefaultLocationPath.java:140)
at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:102)
at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:677)
at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:216)
at net.sourceforge.pmd.lang.rule.xpath.JaxenXPathRuleQuery.evaluate(JaxenXPathRuleQuery.java:69)
... 41 more
Recent PMD 7.0.0-rc3 has removed the dependency to com.beust:jcommander:1.48 (see pmd/pmd#4523),
which is transitively used by pmd-designer. It's added back for now, so that the shipped pmd-designer can be
started, but should be removed eventually.
net.sourceforge.pmd.util.fxdesigner.MainCliArgs is anyway deprecated already.
See pmd/pmd@25e230a
Describe the bug
When trying to export the following rule:
//PrimaryPrefix/Name[@Image[ends-with(., 'Instant.now')]][pmd-java:typeIs('java.time.Instant')]|
//PrimaryPrefix/Name[@Image='now'][//ImportDeclaration[@Static=true()]/Name[@Image='java.time.Instant.now' or @Image='java.time.Instant']]
The export result pane displays the rule incorrectly escaped:
<value>
<![CDATA[
//PrimaryPrefix/Name[@Image[ends-with(., 'Instant.now')]][pmd-java:typeIs('java.time.Instant')]|
//PrimaryPrefix/Name[@Image='now'][//ImportDeclaration[@Static=true()]/Name[@Image='java.time.Instant.now' or @Image='java.time.Instant']]
]]>
</value>
Within a CDATA it should not be necessary to escape apostrophe as '
, and the same seemed to happen with double quotes as well.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The CDATA body is not escaped unnecessarily.
Screenshots
Let me know if you need one.
Desktop (please complete the following information):
pmd/pmd#2118 introduces a mechanism to add extension points for the designer.
Let language implementations provide language-specific insights to the designer without needing the designer to know about them
DesignerBindings
, which is provided by a LanguageVersionHandlergetImage
, this will be deprecated in 7.0)With pmd/pmd#4809 the method Attribute#replacementIfDeprecated()
of a XPath attribute has been internalized.
Previously the Designer used this to display the info, what should be used instead.
Now, it will only display, that the attribute is deprecated, but no further info.
Ideally the designer would display the javadoc of the attributes... then we don't need this method as the public API.
With PMD 7.0.0, there won't be any deprecated attributes for the beginning, so it's not a blocker that this method is gone.
Describe the bug
When editing a property through the popover, the description/default value are unwritable (reset themselves). Sometimes the property is deleted from the list (yet still apparently bound to the edit popover). This doesn't happen when editing properties from the rule export wizard. Possibly caused by popover focus issues (eg key press event bubbled up to the parent popover, which opens a new edit wizard?). Why doesn't this happen for the name property though? Very weird :(
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Description should be editable, changes should be synchronized with the rest of the app.
Desktop (please complete the following information):
Ubuntu 18.04, OpenJDK 13.0.1 w/ OpenJFX 13. Never seen that issue on my previous config (Ubuntu 16.04 + OpenJDK 11 w/ OpenJFX 11)
When trying the Designer 7.0.0-rc1 against PMD 7.0.0-rc3 (without the backwards compatible changes), it just
does nothing. Even with --verbose
, no exceptions are logged. I would expect some MethodNotFoundErrors or
ClassNotFoundErrors.
The backwards compatible change is: pmd/pmd@17beee6
Is your feature request related to a problem? Please describe.
When the source has long lines or the xpath expression is too long, there is no easy way to scroll.
Describe the solution you'd like
Scroll bar would be enough.
Describe alternatives you've considered
We could also wrap the lines (soft-wrap)
Running on Mac OSX with a version of JavaFX older than 14 produces garbled text as shown below.
In #53 we introduce a check to avoid running unsupported JavaFX versions under Mac OSX, but that currently means it's only possible to develop under Mac OSX by manually changing the referenced JavaFX libraries.
Bumping org.openjfx to 14.0.2.1 fixes this, but unfortunately introduces a number of new issues.
Firstly, the first test to use CodeArea
will fail, as internally it will try to animate the text, find that the JFX toolkit was never initialized and incur in a NPE. This is down to internal changes in JavaFX.
Fixing this by manually initializing the platform through Platform.startup(new Runnable() {})
will work locally, but fail in CI, as it can't run in headless mode. Therefore, it seems we need to introduce TestFX to properly support JavaFX testing and headless support.
Describe the bug
Just ran into this problem: Starting the designer resulted in a JVM crash:
$ pmd-bin-6.53.0/bin/run.sh designer
(java:51994): Gdk-CRITICAL **: 12:27:28.594: gdk_x11_display_set_window_scale: assertion 'GDK_IS_X11_DISPLAY (display)' failed
(java:51994): GLib-GObject-WARNING **: 12:27:28.594: invalid cast from 'GdkWaylandDisplay' to 'GdkX11Display'
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f1cb7cec53c, pid=51994, tid=52023
#
# JRE version: OpenJDK Runtime Environment Temurin-17.0.5+8 (17.0.5+8) (build 17.0.5+8)
# Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.5+8 (17.0.5+8, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# C [libX11.so.6+0x2e53c]
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/andreas/Dokumente/Projekte/2023-PMD/binaries/hs_err_pid51994.log
#
# If you would like to submit a bug report, please visit:
# https://github.com/adoptium/adoptium-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
pmd-bin-6.53.0/bin/run.sh: line 231: 51994 Aborted java ${HEAPSIZE} ${PMD_JAVA_OPTS} $(jre_specific_vm_options) -cp "${classpath}" "${CLASSNAME}" "$@"
Expected behavior
The designer should start without any problems.
Desktop (please complete the following information):
Additional context
GDK_BACKEND=x11
before starting the designer. This works for both java 11 and 17pmd-ui was just used for backwards compatibility. The project is really called pmd-designer.
This is a placeholder issue to keep track of the different smaller issues / nice to haves we find as we work on the new rule designer. None of these are blocking issues, they are small improvements to usability and user experience.
SourceFileScope
min
and max
for numeric descriptorstypeof()
info as part of the XPath Attributes, but these will only be non-null if using JRE / PMD classes. We need to be able to set it up manually. (via #1159)version
property, so all rules are exported as 1.0Language controls in the toolbar only sets the language used to parse / syntax color the editor:
But the XPath autocomplete / actual rule language is managed separately down here:
it's fixed upon creation. So if I change the language in the toolbar, the editor will immediately respond, but the XPath editor will continue working on the previous language until I manually click on the "+" to create a new rule for the current language.
This is particularly bad considering that the XPath expression will match against the current code regardless of the target language, so I can write an expression, have it work, but then upon exporting it, have it published for a separate language.
I think the most intuitive thing would be to drop the language from the xpath editor, and have it bound to always match the language set in the code editor.
To Reproduce
Steps to reproduce the behavior:
pmd designer
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.