Skip to content

Commit 3895ef3

Browse files
committed
Upgrade Java and JavaFX version to 25
1 parent eacd750 commit 3895ef3

6 files changed

Lines changed: 30 additions & 57 deletions

File tree

.github/workflows/snapshot-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
packages: write
1313
steps:
1414
- uses: actions/checkout@v4
15-
- name: Setup Java 11
15+
- name: Setup Java 25
1616
uses: actions/setup-java@v3
1717
with:
18-
java-version: '11'
18+
java-version: '25'
1919
distribution: 'temurin'
2020
cache: 'maven'
2121
- name: Generate settings.xml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ single dedicated component without nested components to avoid duplicating styles
818818

819819
## Requirements <a name="requirements"></a>
820820

821-
Java 11+ and JavaFX 19.
821+
Java 25+ and JavaFX 25+.
822822

823823
## Dependencies <a name="dependencies"></a>
824824

patternfx-demo/src/main/java/com/techsenger/patternfx/demo/Demo.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,9 @@ protected void updateItem(Pattern item, boolean empty) {
6262
// the unit will be deinitialized automatically when the stage
6363
// is closed, via the handler registered with stage#setOnCloseRequest
6464
switch (pattern) {
65-
case MVP:
66-
new MvpRunner().run();
67-
break;
68-
case MVVM:
69-
new MvvmRunner().run();
70-
break;
71-
default:
72-
throw new AssertionError();
65+
case MVP -> new MvpRunner().run();
66+
case MVVM -> new MvvmRunner().run();
67+
default -> throw new AssertionError();
7368
}
7469
}
7570
});

patternfx-mvp/src/main/java/com/techsenger/patternfx/mvp/AbstractPresenter.java

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,13 @@ protected final void restoreHistory() {
165165
logger.debug("{} History is new. Skipping restoration", getDescriptor().getLogPrefix());
166166
} else {
167167
switch (policy) {
168-
case DATA:
168+
case DATA -> restoreData();
169+
case APPEARANCE -> restoreAppearance();
170+
case ALL -> {
169171
restoreData();
170-
break;
171-
case APPEARANCE:
172172
restoreAppearance();
173-
break;
174-
case ALL:
175-
restoreData();
176-
restoreAppearance();
177-
break;
178-
default:
179-
throw new AssertionError();
173+
}
174+
default -> throw new AssertionError();
180175
}
181176
}
182177
}
@@ -200,20 +195,14 @@ protected final void saveHistory() {
200195
var policy = getHistoryPolicy();
201196
logger.debug("{} History policy during save: {}", getDescriptor().getLogPrefix(), policy);
202197
switch (policy) {
203-
case DATA:
198+
case DATA -> saveData();
199+
case APPEARANCE -> saveAppearance();
200+
case ALL -> {
204201
saveData();
205-
break;
206-
case APPEARANCE:
207202
saveAppearance();
208-
break;
209-
case ALL:
210-
saveData();
211-
saveAppearance();
212-
break;
213-
case NONE:
214-
break;
215-
default:
216-
throw new AssertionError();
203+
}
204+
case NONE -> { }
205+
default -> throw new AssertionError();
217206
}
218207
}
219208

patternfx-mvvm/src/main/java/com/techsenger/patternfx/mvvm/AbstractViewModel.java

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,13 @@ protected final void restoreHistory() {
105105
logger.debug("{} History is new. Skipping restoration", getDescriptor().getLogPrefix());
106106
} else {
107107
switch (policy) {
108-
case DATA:
108+
case DATA -> restoreData();
109+
case APPEARANCE -> restoreAppearance();
110+
case ALL -> {
109111
restoreData();
110-
break;
111-
case APPEARANCE:
112112
restoreAppearance();
113-
break;
114-
case ALL:
115-
restoreData();
116-
restoreAppearance();
117-
break;
118-
default:
119-
throw new AssertionError();
113+
}
114+
default -> throw new AssertionError();
120115
}
121116
}
122117
}
@@ -147,20 +142,14 @@ protected final void saveHistory() {
147142
var policy = getHistoryPolicy();
148143
logger.debug("{} History policy during save: {}", getDescriptor().getLogPrefix(), policy);
149144
switch (policy) {
150-
case DATA:
145+
case DATA -> saveData();
146+
case APPEARANCE -> saveAppearance();
147+
case ALL -> {
151148
saveData();
152-
break;
153-
case APPEARANCE:
154149
saveAppearance();
155-
break;
156-
case ALL:
157-
saveData();
158-
saveAppearance();
159-
break;
160-
case NONE:
161-
break;
162-
default:
163-
throw new AssertionError();
150+
}
151+
case NONE -> { }
152+
default -> throw new AssertionError();
164153
}
165154
}
166155

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343

4444
<properties>
4545
<publishing.plugin.exclusions>patternfx-demo</publishing.plugin.exclusions>
46-
<!-- JavaFX 19 has a bug: it shows a system notification on Ubuntu when a dialog is closed -->
47-
<javafx.version>18</javafx.version>
46+
<maven.compiler.release>25</maven.compiler.release>
47+
<javafx.version>25</javafx.version>
4848
<osp.bom.version>1.8.0-SNAPSHOT</osp.bom.version>
4949
</properties>
5050

0 commit comments

Comments
 (0)