Skip to content

Commit

Permalink
Update example for Java 13 (#10)
Browse files Browse the repository at this point in the history
* fix switch statement for Java 13

* cleanup

* update to jdk 13

* Update gradle-wrapper.properties

Co-authored-by: Sergei Egorov <[email protected]>
  • Loading branch information
robfrank and bsideup authored Feb 26, 2020
1 parent 6b6d722 commit 04ffcfe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 12
java-version: 13
- name: Build with Gradle
run: ./gradlew build
5 changes: 3 additions & 2 deletions example/src/main/java/com/example/JabelExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.function.Function;

public class JabelExample {

public static void main(String[] args) {
System.out.println(new JabelExample().run(args));
}
Expand All @@ -14,7 +15,7 @@ public String run(String[] args) {
// https://openjdk.java.net/jeps/325
var result = switch (args.length) {
case 1 -> {
break "one";
yield "one";
}
case 2, 3 -> "two or three";
default -> new JabelExample().new Inner().innerPublic();
Expand All @@ -33,7 +34,7 @@ private String outerPrivate(List<String>... args) {
public String call() {
// Var in lambda parameter
Function<String, String> function = (var prefix) -> {
return prefix + Integer.toString(0);
return prefix + Integer.toString(0);
};
// Test indy strings
return function.apply("idk ");
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 04ffcfe

Please sign in to comment.