Skip to content

Commit

Permalink
Merge branch 'master' into controlflow-switch-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Pine committed Apr 6, 2024
2 parents 8d56f57 + 4b4936c commit c5313f4
Show file tree
Hide file tree
Showing 23 changed files with 104 additions and 119 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/qodana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
args: --source-directory,./src/main/java , --fail-threshold, 0
post-pr-comment: "false"
- uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3
- uses: github/codeql-action/upload-sarif@4355270be187e1b672a7a1c7c7bae5afdc1ab94a # v3
with:
sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json
code-quality-spoon-javadoc:
Expand All @@ -37,6 +37,6 @@ jobs:
with:
args: --source-directory,./spoon-javadoc/src/main/java , --fail-threshold, 0
post-pr-comment: "false"
- uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3
- uses: github/codeql-action/upload-sarif@4355270be187e1b672a7a1c7c7bae5afdc1ab94a # v3
with:
sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
uses: github/codeql-action/upload-sarif@4355270be187e1b672a7a1c7c7bae5afdc1ab94a # v3.24.10
with:
sarif_file: results.sarif
33 changes: 10 additions & 23 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
let
base = rec {
jdk =
if javaVersion <= 21 then prev."jdk${toString javaVersion}"
else jdk22-ea;
if javaVersion <= 23 then prev."jdk${toString javaVersion}"
else abort "Not set up yet :)";
maven = prev.maven.override { inherit jdk; };
};
extra = with base; {
Expand All @@ -30,39 +30,27 @@
(if extraChecks then base // extra else base))
];
};
jdk22-ea = pkgs.stdenv.mkDerivation rec {
name = "jdk22-ea";
version = "22+16";
src = builtins.fetchTarball {
url = "https://download.java.net/java/early_access/jdk22/16/GPL/openjdk-22-ea+16_linux-x64_bin.tar.gz";
sha256 = "sha256:17fckjdr1gadm41ih2nxi8c7zdimk4s9p12d8jcr0paic74mqinj";
};
installPhase = ''
cd ..
mv $sourceRoot $out
'';
};
semver = pkgs.buildGoModule rec {
name = "semver";
version = "2.1.0";
version = "2.4.0";

vendorHash = "sha256-HKqZbgP7vqDJMaHUbSqfSOnBYwzOtIr9o2v/T9S+uNg=";
vendorHash = "sha256-/8rYdeOHp6Bdc3CD5tzw5M0hjTPd+aYZSW7w2Xi695Y=";
subPackages = [ "cmd/semver" ];

src = pkgs.fetchFromGitHub {
owner = "ffurrer2";
repo = "semver";
rev = "v${version}";
sha256 = "sha256-i/XPA2Hr2puJFKupIeBUE/yFPJxSeVsDWcz1OepxIcU=";
sha256 = "sha256-wl5UEu2U11Q0lZfm9reMhGMCI7y6sabk18j7SPWgy1k=";
};
};
jreleaser = pkgs.stdenv.mkDerivation rec {
pname = "jreleaser-cli";
version = "1.7.0";
version = "1.11.0";

src = pkgs.fetchurl {
url = "https://github.com/jreleaser/jreleaser/releases/download/v${version}/jreleaser-tool-provider-${version}.jar";
sha256 = "sha256-gr1IWisuep00xyoZWKXtHymWkQjbDhlk6+UC16bKXu0=";
sha256 = "sha256-VkINXKVBBBK6/PIRPMVKZGY9afE7mAsqrcFPh2Algqk=";
};

nativeBuildInputs = with pkgs; [ makeWrapper ];
Expand Down Expand Up @@ -220,17 +208,16 @@
{
devShells =
let
# We have additional options (currently EA jdks) on 64 bit linux systems
# We might have additional options (currently none) on 64 bit linux systems
blessedSystem = "x86_64-linux";
blessed = rec {
jdk22-ea = mkShell blessedSystem { javaVersion = 22; };
};
blessed = rec { };
common = forAllSystems
(system:
rec {
default = jdk17;
jdk17 = mkShell system { javaVersion = 17; };
jdk21 = mkShell system { javaVersion = 21; };
jdk22 = mkShell system { javaVersion = 22; };
extraChecks = mkShell system { extraChecks = true; javaVersion = 21; };
jReleaser = mkShell system { release = true; javaVersion = 21; };
});
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
<parent>
<groupId>fr.inria.gforge.spoon</groupId>
<artifactId>spoon-pom</artifactId>
<version>10.4.3-SNAPSHOT</version>
<version>11.0.1-SNAPSHOT</version>
<relativePath>spoon-pom</relativePath>
</parent>

<artifactId>spoon-core</artifactId>
<packaging>jar</packaging>
<version>10.4.3-SNAPSHOT</version>
<version>11.0.1-SNAPSHOT</version>
<name>Spoon Core</name>
<description>Spoon is a tool for meta-programming, analysis and transformation of Java programs.</description>
<url>http://spoon.gforge.inria.fr/</url>
Expand Down
4 changes: 2 additions & 2 deletions spoon-javadoc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<parent>
<artifactId>spoon-pom</artifactId>
<groupId>fr.inria.gforge.spoon</groupId>
<version>10.4.3-SNAPSHOT</version>
<version>11.0.1-SNAPSHOT</version>
<relativePath>../spoon-pom</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>spoon-javadoc</artifactId>
<packaging>jar</packaging>
<version>10.4.3-SNAPSHOT</version>
<version>11.0.1-SNAPSHOT</version>
<name>Spoon Javadoc</name>
<description>A javadoc parser for the java source code analysis tool spoon.</description>
<url>http://spoon.gforge.inria.fr/</url>
Expand Down
4 changes: 2 additions & 2 deletions spoon-pom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<groupId>fr.inria.gforge.spoon</groupId>
<artifactId>spoon-pom</artifactId>
<packaging>pom</packaging>
<version>10.4.3-SNAPSHOT</version>
<version>11.0.1-SNAPSHOT</version>
<name>Spoon POM</name>
<description>Common Maven config for Spoon modules</description>
<url>http://spoon.gforge.inria.fr/</url>
Expand All @@ -28,7 +28,7 @@
<maven.compiler.release>17</maven.compiler.release>
<runtime.log>target/velocity.log</runtime.log>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.outputTimestamp>1696689792</project.build.outputTimestamp>
<project.build.outputTimestamp>1712335042</project.build.outputTimestamp>
</properties>

<dependencies>
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/spoon/reflect/code/CtCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
package spoon.reflect.code;

import org.jspecify.annotations.Nullable;
import spoon.reflect.annotations.PropertyGetter;
import spoon.reflect.annotations.PropertySetter;
import spoon.reflect.path.CtRole;
Expand Down Expand Up @@ -95,6 +96,23 @@ public interface CtCase<S> extends CtStatement, CtStatementList {
@PropertySetter(role = CtRole.DEFAULT_EXPRESSION)
CtCase<S> setIncludesDefault(boolean includesDefault);

/**
* {@return the guard of this case}
* This method returns {@code null} if no guard is present.
*/
@PropertyGetter(role = CtRole.CONDITION)
@Nullable
CtExpression<?> getGuard();

/**
* Sets the guarding expression for this case.
*
* @param guard the expression guarding this case. If {@code null}, no guard will be inserted in the code.
* @return this case.
*/
@PropertySetter(role = CtRole.CONDITION)
CtCase<S> setGuard(@Nullable CtExpression<?> guard);

@Override
CtCase<S> clone();
}
18 changes: 0 additions & 18 deletions src/main/java/spoon/reflect/code/CtCasePattern.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
*/
package spoon.reflect.code;

import org.jspecify.annotations.Nullable;
import spoon.reflect.annotations.PropertyGetter;
import spoon.reflect.annotations.PropertySetter;

import static spoon.reflect.path.CtRole.CONDITION;
import static spoon.reflect.path.CtRole.PATTERN;

/**
Expand Down Expand Up @@ -45,22 +43,6 @@ public interface CtCasePattern extends CtExpression<Void> {
@PropertySetter(role = PATTERN)
CtCasePattern setPattern(CtPattern pattern);

/**
* {@return the guard of this case pattern}
* This method returns {@code null} if no guard is present.
*/
@PropertyGetter(role = CONDITION)
@Nullable CtExpression<?> getGuard();

/**
* Sets the guarding expression for this case pattern.
*
* @param guard the expression guarding this case pattern. If {@code null}, no guard will be inserted in the code.
* @return this case pattern.
*/
@PropertySetter(role = CONDITION)
CtCasePattern setGuard(@Nullable CtExpression<?> guard);

@Override
CtCasePattern clone();
}
Loading

0 comments on commit c5313f4

Please sign in to comment.