Skip to content

Commit 4fc4d78

Browse files
committed
Merge remote-tracking branch 'origin/main'
# Conflicts: # app/pages/learn/01_tutorial/01_your-first-java-app/02_building-with-intellij-idea.md
2 parents 0517741 + 5bde670 commit 4fc4d78

File tree

8 files changed

+409
-130
lines changed

8 files changed

+409
-130
lines changed

app/data/javadoc.json

Lines changed: 197 additions & 40 deletions
Large diffs are not rendered by default.

app/data/javafxdoc.json

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"current_release": "19",
2+
"current_release": "23",
3+
"release_uuid": "343fae14109c42b09c0437fc90a10d4b",
34

4-
"javafx-documentation": "https://openjfx.io/javadoc/@@CURRENT_RELEASE@@/",
5-
"javafxdoc_root": "https://openjfx.io/javadoc/@@CURRENT_RELEASE@@/",
5+
"javafxdoc_root": "https://download.java.net/java/GA/javafx@@CURRENT_RELEASE@@/@@RELEASE_UUID@@/docs/api/",
66

77
"Application": "javafx.graphics/javafx/application/Application.html",
88

@@ -54,28 +54,27 @@
5454

5555
"FXMLLoader": "javafx.fxml/javafx/fxml/FXMLLoader.html",
5656
"Initializable": "javafx.fxml/javafx/fxml/Initializable.html",
57-
58-
"AnimationPackageSummary": "javafx.graphics/javafx/animation/package-summary",
59-
"WritableValue": "javafx.base/javafx/beans/value/WritableValue",
60-
"Animation": "javafx.graphics/javafx/animation/Animation",
61-
"Duration": "javafx.base/javafx/util/Duration",
62-
"Node": "javafx.graphics/javafx/scene/Node",
63-
"FadeTransition": "javafx.graphics/javafx/animation/FadeTransition",
64-
"FillTransition": "javafx.graphics/javafx/animation/FillTransition",
65-
"PathTransition": "javafx.graphics/javafx/animation/PathTransition",
66-
"ScaleTransition": "javafx.graphics/javafx/animation/ScaleTransition",
67-
"StrokeTransition": "javafx.graphics/javafx/animation/StrokeTransition",
68-
"TranslateTransition": "javafx.graphics/javafx/animation/TranslateTransition",
69-
"Timeline": "javafx.graphics/javafx/animation/Timeline",
70-
"KeyFrame": "javafx.graphics/javafx/animation/KeyFrame",
71-
"KeyValue": "javafx.graphics/javafx/animation/KeyValue",
72-
"Interpolator": "javafx.graphics/javafx/animation/Interpolator",
73-
"Interpolator.DISCRETE": "javafx.graphics/javafx/animation/Interpolator#DISCRETE",
74-
"Interpolator.LINEAR": "javafx.graphics/javafx/animation/Interpolator#LINEAR",
75-
"Interpolator.EASE_IN": "javafx.graphics/javafx/animation/Interpolator#EASE_IN",
76-
"Interpolator.EASE_OUT": "javafx.graphics/javafx/animation/Interpolator#EASE_OUT",
77-
"Interpolator.EASE_BOTH": "javafx.graphics/javafx/animation/Interpolator#EASE_BOTH",
78-
"Interpolator.SPLINE": "javafx.graphics/javafx/animation/Interpolator#SPLINE(double,double,double,double)",
79-
"Interpolator.TANGENT": "javafx.graphics/javafx/animation/Interpolator#TANGENT(javafx.util.Duration,double,javafx.util.Duration,double)",
80-
"AnimationTimer": "javafx.graphics/javafx/animation/AnimationTimer"
81-
}
57+
"AnimationPackageSummary": "javafx.graphics/javafx/animation/package-summary.html",
58+
"WritableValue": "javafx.base/javafx/beans/value/WritableValue.html",
59+
"Animation": "javafx.graphics/javafx/animation/Animation.html",
60+
"Duration": "javafx.base/javafx/util/Duration.html",
61+
"Node": "javafx.graphics/javafx/scene/Node.html",
62+
"FadeTransition": "javafx.graphics/javafx/animation/FadeTransition.html",
63+
"FillTransition": "javafx.graphics/javafx/animation/FillTransition.html",
64+
"PathTransition": "javafx.graphics/javafx/animation/PathTransition.html",
65+
"ScaleTransition": "javafx.graphics/javafx/animation/ScaleTransition.html",
66+
"StrokeTransition": "javafx.graphics/javafx/animation/StrokeTransition.html",
67+
"TranslateTransition": "javafx.graphics/javafx/animation/TranslateTransition.html",
68+
"Timeline": "javafx.graphics/javafx/animation/Timeline.html",
69+
"KeyFrame": "javafx.graphics/javafx/animation/KeyFrame.html",
70+
"KeyValue": "javafx.graphics/javafx/animation/KeyValue.html",
71+
"Interpolator": "javafx.graphics/javafx/animation/Interpolator.html",
72+
"Interpolator.DISCRETE": "javafx.graphics/javafx/animation/Interpolator.html#DISCRETE",
73+
"Interpolator.LINEAR": "javafx.graphics/javafx/animation/Interpolator.html#LINEAR",
74+
"Interpolator.EASE_IN": "javafx.graphics/javafx/animation/Interpolator.html#EASE_IN",
75+
"Interpolator.EASE_OUT": "javafx.graphics/javafx/animation/Interpolator.html#EASE_OUT",
76+
"Interpolator.EASE_BOTH": "javafx.graphics/javafx/animation/Interpolator.html#EASE_BOTH",
77+
"Interpolator.SPLINE": "javafx.graphics/javafx/animation/Interpolator.html#SPLINE(double,double,double,double)",
78+
"Interpolator.TANGENT": "javafx.graphics/javafx/animation/Interpolator.html#TANGENT(javafx.util.Duration,double,javafx.util.Duration,double)",
79+
"AnimationTimer": "javafx.graphics/javafx/animation/AnimationTimer.html"
80+
}

app/data/jep.json

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"root": "https://openjdk.org/jeps/",
3+
4+
"1": "JDK Enhancement-Proposal & Roadmap Process",
5+
"11": "Incubator Modules",
6+
"12": "Preview Features",
7+
8+
"110": "HTTP/2 Client (Incubator)",
9+
10+
"220": "Modular Run-Time Images",
11+
"225": "Javadoc Search",
12+
"286": "Local-Variable Type Inference",
13+
14+
"310": "Application Class-Data Sharing",
15+
"321": "HTTP Client",
16+
"325": "Switch Expressions (Preview)",
17+
"326": "Raw String Literals (Preview)",
18+
"328": "Flight Recorder",
19+
"333": "ZGC: A Scalable Low-Latency Garbage Collector (Experimental)",
20+
"345": "NUMA-Aware Memory Allocation for G1",
21+
"346": "Promptly Return Unused Committed Memory from G1",
22+
"349": "JFR Event Streaming",
23+
"354": "Switch Expressions (Second Preview)",
24+
"357": "Migrate from Mercurial to Git",
25+
"358": "Helpful NullPointerExceptions",
26+
"361": "Switch Expressions",
27+
"363": "Remove the Concurrent Mark Sweep (CMS) Garbage Collector",
28+
"369": "Migrate to GitHub",
29+
"372": "Remove the Nashorn JavaScript Engine",
30+
"374": "Disable and Deprecate Biased Locking",
31+
"376": "ZGC: Concurrent Thread-Stack Processing",
32+
"377": "ZGC: A Scalable Low-Latency Garbage Collector (Production)",
33+
"384": "Records (Second Preview)",
34+
"387": "Elastic Metaspace",
35+
"391": "macOS/AArch64 Port",
36+
"395": "Records",
37+
"397": "Sealed Classes (Second Preview)",
38+
"398": "Deprecate the Applet for Removal",
39+
40+
"400": "UTF-8 by Default",
41+
"407": "Remove RMI Activation",
42+
"408": "Simple Web Server",
43+
"409": "Sealed Classes",
44+
"411": "Deprecate the Security Manager for Removal",
45+
"413": "Code Snippets in Java API Documentation",
46+
"415": "Context-Specific Deserialization Filters",
47+
"416": "Reimplement Core Reflection with Method Handle",
48+
"418": "Internet-Address Resolution API",
49+
"421": "Deprecate Finalization for Removal",
50+
"445": {
51+
"title": "Implicitly Declared Classes and Instance Main Methods (Second Preview)",
52+
"status": "preview",
53+
"version": "22"
54+
},
55+
"460": {
56+
"title": "Vector API (Seventh Incubator)",
57+
"status": "incubator",
58+
"version": "22"
59+
},
60+
"463": {
61+
"title": "Implicitly Declared Classes and Instance Main Methods (Second Preview)",
62+
"status": "preview",
63+
"version": "22"
64+
},
65+
66+
"481": {
67+
"title": "Scoped Values (Third Preview)",
68+
"status": "preview",
69+
"version": "22"
70+
},
71+
72+
"8300604": "JEP draft: Preview Features: A Look Back, and A Look Ahead"
73+
}

app/pages/future/innovation/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ subheader_select: innovation
77

88
## Amber
99

10-
The goal of Project Amber is to explore and incubate smaller, productivity-oriented Java language features that have been accepted as candidate JEPs under the [OpenJDK JEP process](https://openjdk.java.net/jeps/1). This Project is sponsored by the [Compiler Group](https://openjdk.java.net/groups/compiler/).
10+
The goal of Project Amber is to explore and incubate smaller, productivity-oriented Java language features that have been accepted as candidate JEPs under [JDK Enhancement-Proposal & Roadmap Process](jep:1). This Project is sponsored by the [Compiler Group](https://openjdk.org/groups/compiler/).
1111

12-
Most Project Amber features go through at least one round of Preview before becoming an official part of Java SE. See [JEP 12](https://openjdk.java.net/jeps/12) for an explanation of the Preview process, and [our tutorial](id:new_features.using_preview) on how to use preview features. For a given feature, there are separate JEPs for each round of preview and for final standardization.
12+
Most Project Amber features go through at least one round of Preview before becoming an official part of Java SE. See [Preview Features](jep:12) for an explanation of the Preview process, and [our tutorial](id:new_features.using_preview) on how to use preview features. For a given feature, there are separate JEPs for each round of preview and for final standardization.
1313

14-
Learn more at Project Amber's [Wiki](https://openjdk.java.net/projects/amber/), as well as Inside.java's [Amber page](https://inside.java/tag/amber).
14+
Learn more at Project Amber's [Wiki](https://openjdk.org/projects/amber/), as well as Inside.java's [Amber page](https://inside.java/tag/amber).
1515

1616
## Loom
1717

@@ -23,7 +23,7 @@ Project Loom is to intended to explore, incubate and deliver Java VM features an
2323

2424
This OpenJDK project is sponsored by the HotSpot Group.
2525

26-
Learn more at Project Loom's [Wiki](https://wiki.openjdk.java.net/display/loom/Main), as well as Inside.java's [Loom page](https://inside.java/tag/loom).
26+
Learn more at Project Loom's [Wiki](https://wiki.openjdk.org/display/loom/Main), as well as Inside.java's [Loom page](https://inside.java/tag/loom).
2727

2828
## Panama
2929

@@ -43,7 +43,7 @@ To this end, Project Panama will include most or all of these components:
4343
* tooling or wrapper interposition for safety
4444
* exploratory work with difficult-to-integrate native libraries
4545

46-
Learn more at Project Panama's [Wiki](https://openjdk.java.net/projects/panama/), as well as Inside.java's [Panama page](https://inside.java/tag/panama).
46+
Learn more at Project Panama's [Wiki](https://openjdk.org/projects/panama/), as well as Inside.java's [Panama page](https://inside.java/tag/panama).
4747

4848

4949
## Valhalla
@@ -58,7 +58,7 @@ The three main goals are:
5858

5959
A number of people describe Valhalla recently as being "primarily about performance". While it is understandable why people might come to that conclusion -- many of the motivations for Valhalla are, in fact, rooted in performance considerations -- this characterization misses something very important. Yes, performance is an important part of the story -- but so are safety, abstraction, encapsulation, expressiveness, maintainability, and compatible library evolution.
6060

61-
Learn more at the Valhalla Project [Wiki](https://wiki.openjdk.java.net/display/valhalla/Main), as well as Inside.java's [Valhalla page](https://inside.java/tag/valhalla).
61+
Learn more at the Valhalla Project [Wiki](https://wiki.openjdk.org/display/valhalla/Main), as well as Inside.java's [Valhalla page](https://inside.java/tag/valhalla).
6262

6363

6464
## ZGC
@@ -81,5 +81,5 @@ At a glance, ZGC is:
8181
At its core, ZGC is a concurrent garbage collector, meaning all heavy lifting work is done while Java threads continue to execute. This greatly limits the impact garbage collection will have on your application's response time.
8282

8383

84-
Learn more at the ZGC [Wiki](https://wiki.openjdk.java.net/display/zgc/Main), as well as Inside.java's [GC page](https://inside.java/tag/gc).
84+
Learn more at the ZGC [Wiki](https://wiki.openjdk.org/display/zgc/Main), as well as Inside.java's [GC page](https://inside.java/tag/gc).
8585

app/pages/learn/01_tutorial/03_getting-to-know-the-language/03_refactoring_to_functional_style/03_converting_foreach_with_if.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ for(String name: names) {
7676

7777
For the functional style, the `filter` method of `Stream` becomes a direct replacement of the imperative style `if`. The `filter` method will allow an element in the collection to pass through to the next stage in the functional pipeline if the predicate, passed in as a lambda, to the `filter()` method evaluates to `true`; otherwise, the value is discarded from further processing.
7878

79-
Let's conver the previous code to functional style:
79+
Let's convert the previous code to functional style:
8080

8181
```java
8282
List<String> names = List.of("Jack", "Paula", "Kate", "Peter");

app/pages/learn/01_tutorial/03_getting-to-know-the-language/04_classes_objects/01_enums.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ toc:
1717
- Precautions {precautions}
1818
- Conclusion {conclusion}
1919
description: "Working with enums."
20-
last_update: 2023-09-29
20+
last_update: 2024-07-08
2121
author: ["DanielSchmid"]
2222
---
2323
<a id="intro">&nbsp;</a>
@@ -32,7 +32,7 @@ No instances of the enum can be created outside of enum constants.
3232

3333
```java
3434
public enum DayOfWeek {
35-
// enum constant are listed here:
35+
// enum constants are listed here:
3636
MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY
3737
}
3838
```
@@ -71,11 +71,12 @@ switch (someDay) {
7171
}
7272
```
7373

74-
With [Switch Expressions](id:lang.classes-objects.switch-expression),
74+
With [switch expressions](id:lang.classes-objects.switch-expression),
7575
the compiler can check whether all values of the enum are handled.
7676
If any possible value is missing in a switch expression, there will be a compiler error.
77-
This is referred to as Exhaustiveness and can also be achieved with regular classes
78-
through [Sealed Classes](https://openjdk.org/jeps/409).
77+
This is referred to as exhaustiveness checking and can also be achieved with regular classes
78+
through [sealed classes](https://openjdk.org/jeps/409) and [pattern matching](/learn/pattern-matching/#switch).
79+
7980

8081
```java
8182
DayOfWeek someDay = DayOfWeek.FRIDAY;
@@ -99,7 +100,8 @@ Arguments to the constructor are passed in parenthesis after the declaration of
99100

100101
```java
101102
public enum DayOfWeek {
102-
MONDAY("MON"), TUESDAY("TUE"), WEDNESDAY("WED"), THURSDAY("THU"), FRIDAY("FRI"), SATURDAY("SAT"), SUNDAY("SUN");
103+
MONDAY("MON"), TUESDAY("TUE"), WEDNESDAY("WED"), THURSDAY("THU"), FRIDAY("FRI"),
104+
SATURDAY("SAT"), SUNDAY("SUN");
103105

104106
private final String abbreviation;
105107

@@ -140,9 +142,9 @@ This allows for comparing instances of enums as well as sorting or searching.
140142
```java
141143
public void compareDayOfWeek(DayOfWeek dayOfWeek){
142144
int comparison = dayOfWeek.compareTo(DayOfWeek.WEDNESDAY);
143-
if ( comparison < 0) {
145+
if (comparison < 0) {
144146
System.out.println("It's before the middle of the work week.");
145-
} else if(comparison > 0){
147+
} else if (comparison > 0) {
146148
System.out.println("It's after the middle of the work week.");
147149
} else {
148150
System.out.println("It's the middle of the work week.");
@@ -210,6 +212,6 @@ and reading these configuration files in the program in cases like this.
210212
<a id="conclusion">&nbsp;</a>
211213
## Conclusion
212214

213-
Enums provide a simple and safe way of representing a fixed set of constants while keeping most of the flexibilities of classes. They are a special type of class that can be used to write code that is elegant, readable, and maintainable, and work well with other newer modern features like [Switch Expressions](id:lang.classes-objects.switch-expression). Another special class is the Record class introduced in Java 19. Visit our [Records tutorial](id:lang.records) to learn more.
215+
Enums provide a simple and safe way of representing a fixed set of constants while keeping most of the flexibilities of classes. They are a special type of class that can be used to write code that is elegant, readable, maintainable and works well with other modern Java features like [switch expressions](id:lang.classes-objects.switch-expression). Another special class is the Record class introduced in JDK 16. Visit our [records tutorial](id:lang.records) to learn more.
214216

215217
To learn more about enums, visit the [`java.lang.Enum`](javadoc:Enum) javadoc.

0 commit comments

Comments
 (0)