From hirt at openjdk.java.net Wed Mar 2 14:15:10 2022 From: hirt at openjdk.java.net (Marcus Hirt) Date: Wed, 2 Mar 2022 14:15:10 GMT Subject: RFR: JMC-9999 Allowing char attribute to be parsed [v3] In-Reply-To: References: Message-ID: On Fri, 25 Feb 2022 15:45:40 GMT, Gunnar Morling wrote: >> Hey @thegreystone, I noticed that JFR events with `char` attributes cannot be loaded into JMC: >> >> >> org.openjdk.jmc.flightrecorder.internal.InvalidJfrFileException: Unknown integer type: char >> at org.openjdk.jmc.flightrecorder.internal.parser.v1.ValueReaders$PrimitiveReader.readLong(ValueReaders.java:424) >> at org.openjdk.jmc.flightrecorder.internal.parser.v1.ValueReaders$QuantityReader.read(ValueReaders.java:192) >> at org.openjdk.jmc.flightrecorder.internal.parser.v1.TypeManager$EventTypeEntry.readEvent(TypeManager.java:319) >> at org.openjdk.jmc.flightrecorder.internal.parser.v1.TypeManager.readEvent(TypeManager.java:420) >> at org.openjdk.jmc.flightrecorder.internal.parser.v1.ChunkLoaderV1.call(ChunkLoaderV1.java:92) >> at org.openjdk.jmc.flightrecorder.internal.parser.v1.ChunkLoaderV1.call(ChunkLoaderV1.java:47) >> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) >> at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) >> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) >> at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) >> at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) >> at java.base/java.lang.Thread.run(Thread.java:833) >> >> >> The code in `ValueReaders::isNumeric` considers `char` to be numeric, causing this to be treated as `long` during parsing later on. With this fix, I can successfully load and examine a recording with such an attribute type using the `RecordingPrinter` (I haven't tried with the JMC UI, as I haven't set up the toolchain required for building it). >> >> If you agree on the fix per se, could you >> >> * log a JMC issue to which I can attribute this fix >> * advice me on how/where to test this change (I didn't find any tests in the `flightrecorder` module) >> >> Thanks! > > Gunnar Morling has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains two new commits since the last revision: > > - JMC-9999 Improving misleading variable name > - JMC-9999 Allowing char attribute to be parsed Marked as reviewed by hirt (Lead). ------------- PR: https://git.openjdk.java.net/jmc/pull/378 From duke at openjdk.java.net Wed Mar 2 18:03:12 2022 From: duke at openjdk.java.net (Alex Ciminian) Date: Wed, 2 Mar 2022 18:03:12 GMT Subject: RFR: 7449: Add GitHub action to verify copyright year [v3] In-Reply-To: References: Message-ID: On Sat, 11 Dec 2021 20:20:44 GMT, Alex Ciminian wrote: >> This PR adds a script to check copyright notices on changed files. I've not added a GitHub action yet, I'd like to get some feedback before doing that ?? >> >> The script is written in Kotlin and uses [JGit](https://www.eclipse.org/jgit/) to interface with the git repository. To run, it only needs the kotlin compiler which is [preinstalled on GitHub Actions runners](https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md). >> >> It works as follows: >> >> * diff the HEAD commit and the merge base between it and master (i.e. where the feature branch diverged from) >> * for every changed file (except deletions), validate the copyright header >> - if the file is new, it should have Oracle and Datadog copyright starting from the year of the HEAD commit >> - if the file is not new, it should keep the existing copyright holders and update the year range if necessary >> * we compare file contents from objects in the git repo, not the files themselves >> * currently we don't validate we're in the correct directory or the commits >> >> The output looks like this: >> >> >> kotlinc -script scripts/copyrightchecker.main.kts >> Checked out at: 759788185939b16f447e553b3ee64121187ea311 (base: 8b8aa7c299b92b655ba669a92d16f193beb406bc) >> ?? scripts/copyrightchecker.main.kts >> ? Validation succeeded >> >> >> >> kotlinc -script scripts/copyrightchecker.main.kts >> Checked out at: 7ad43eed12c9eb85a96882c9518a9acbe12e74c5 (base: ca204424ce32336f2923aff66f619d571b1fc720) >> ?? .gitignore >> ?? application/org.openjdk.jmc.feature.flightrecorder/feature.xml >> ?? Failed to parse: Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved. >> ?? application/org.openjdk.jmc.flightrecorder.heatmap/.classpath >> ?? application/org.openjdk.jmc.flightrecorder.heatmap/.gitignore >> ?? application/org.openjdk.jmc.flightrecorder.heatmap/META-INF/MANIFEST.MF >> ?? application/org.openjdk.jmc.flightrecorder.heatmap/build.properties >> ?? application/org.openjdk.jmc.flightrecorder.heatmap/icons/heatmap.png >> ?? application/org.openjdk.jmc.flightrecorder.heatmap/icons/heatmap at 2x.png >> ?? application/org.openjdk.jmc.flightrecorder.heatmap/plugin.properties >> ?? application/org.openjdk.jmc.flightrecorder.heatmap/plugin.xml >> ?? application/org.openjdk.jmc.flightrecorder.heatmap/pom.xml >> Expected: >> >>