Skip to content

Commit 80ab189

Browse files
bric3RealCLanger
authored andcommitted
8070: Move to JDK 17 leftovers
Reviewed-by: clanger
1 parent 200d0f8 commit 80ab189

File tree

8 files changed

+159
-79
lines changed

8 files changed

+159
-79
lines changed

application/org.openjdk.jmc.flightrecorder.configuration/src/main/java/org/openjdk/jmc/flightrecorder/configuration/internal/DefaultValueMap.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
33
*
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -59,10 +59,8 @@ public DefaultValueMap(Map<K, ? extends IOptionDescriptor<?>> knownOptions) {
5959
this(knownOptions, null);
6060
}
6161

62-
@SuppressWarnings("unchecked")
6362
public DefaultValueMap(IMapper<K, IOptionDescriptor<?>> fallbacks) {
64-
// NOTE: Cast is just to circumvent issue in Eclipse 4.5.2 with JDK 7 compiler/libs.
65-
this((Map<K, ? extends IOptionDescriptor<?>>) Collections.emptyMap(), fallbacks);
63+
this(Collections.emptyMap(), fallbacks);
6664
}
6765

6866
public DefaultValueMap(Map<K, ? extends IOptionDescriptor<?>> knownOptions,

application/org.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/common/FilterEditor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
33
*
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -562,7 +562,7 @@ public void addRoot(IItemFilter filter) {
562562
notifyListener();
563563
}
564564

565-
private int validateDrop(List<? extends FilterNode> src, CompositeNode target, int operation) {
565+
private <N extends FilterNode> int validateDrop(List<N> src, CompositeNode target, int operation) {
566566
if (target == null ? root.children.containsAll(src) : target.children.containsAll(src)) {
567567
return DND.DROP_NONE;
568568
} else if (find(target, src)) {
@@ -582,7 +582,7 @@ private static boolean find(CompositeNode needle, List<? extends FilterNode> inH
582582
return false;
583583
}
584584

585-
private boolean performDrop(List<? extends FilterNode> src, CompositeNode target, int operation, int location) {
585+
private <N extends FilterNode> boolean performDrop(List<N> src, CompositeNode target, int operation, int location) {
586586
if (target == null) {
587587
target = root;
588588
}

application/org.openjdk.jmc.ui/src/main/java/org/openjdk/jmc/ui/misc/DndToolkit.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
33
*
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -112,8 +112,8 @@ public void dragFinished(DragSourceEvent event) {
112112
}
113113

114114
public static <T, U> ViewerDropAdapter createLocalDropListTarget(
115-
Viewer viewer, Class<T> targetType, Class<U> srcType, IDropAction<List<? extends U>, T> action,
116-
IDropValidator<List<? extends U>, T> validator) {
115+
Viewer viewer, Class<T> targetType, Class<U> srcType, IDropAction<List<U>, T> action,
116+
IDropValidator<List<U>, T> validator) {
117117
return createLocalDropTarget(viewer, targetType, new IDropAction<ISelection, T>() {
118118

119119
@SuppressWarnings("unchecked")

docker/Dockerfile-jmc

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,52 @@
1-
FROM openjdk:11-jdk-buster AS builder
1+
#
2+
# Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
3+
#
4+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5+
#
6+
# The contents of this file are subject to the terms of either the Universal Permissive License
7+
# v 1.0 as shown at http://oss.oracle.com/licenses/upl
8+
#
9+
# or the following license:
10+
#
11+
# Redistribution and use in source and binary forms, with or without modification, are permitted
12+
# provided that the following conditions are met:
13+
#
14+
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions
15+
# and the following disclaimer.
16+
#
17+
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of
18+
# conditions and the following disclaimer in the documentation and/or other materials provided with
19+
# the distribution.
20+
#
21+
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to
22+
# endorse or promote products derived from this software without specific prior written permission.
23+
#
24+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
25+
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
26+
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
27+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30+
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
31+
# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32+
#
33+
FROM eclipse-temurin:17-jammy AS builder
234

335
RUN apt-get update && apt-get install -y maven
436

37+
VOLUME [ "/root/.m2", "/target" ]
38+
539
WORKDIR /jmc
640
COPY core core/
741
COPY application application/
842
COPY configuration configuration/
943
COPY license license/
1044
COPY releng releng/
1145
COPY pom.xml ./
46+
COPY docker/docker-toolchains.xml .mvn/toolchains.xml
1247
RUN grep -rl localhost:8080 releng | xargs sed -i s/localhost:8080/p2:8080/
1348
ENV MAVEN_OPTS="-Xmx1G"
1449

15-
CMD cd /jmc/core && mvn clean install && cd /jmc && mvn package && cp -a /jmc/target/* /target
50+
CMD mvn clean install --file core/pom.xml --toolchains .mvn/toolchains.xml \
51+
&& mvn package --toolchains .mvn/toolchains.xml \
52+
&& cp -a /jmc/target/* /target

docker/Dockerfile-p2

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,36 @@
1-
FROM openjdk:11-jdk-buster
1+
#
2+
# Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
3+
#
4+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5+
#
6+
# The contents of this file are subject to the terms of either the Universal Permissive License
7+
# v 1.0 as shown at http://oss.oracle.com/licenses/upl
8+
#
9+
# or the following license:
10+
#
11+
# Redistribution and use in source and binary forms, with or without modification, are permitted
12+
# provided that the following conditions are met:
13+
#
14+
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions
15+
# and the following disclaimer.
16+
#
17+
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of
18+
# conditions and the following disclaimer in the documentation and/or other materials provided with
19+
# the distribution.
20+
#
21+
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to
22+
# endorse or promote products derived from this software without specific prior written permission.
23+
#
24+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
25+
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
26+
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
27+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30+
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
31+
# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32+
#
33+
FROM eclipse-temurin:17-jammy
234

335
RUN apt-get update && apt-get install -y maven
436

docker/docker-compose.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,41 @@
1+
#
2+
# Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
3+
#
4+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5+
#
6+
# The contents of this file are subject to the terms of either the Universal Permissive License
7+
# v 1.0 as shown at http://oss.oracle.com/licenses/upl
8+
#
9+
# or the following license:
10+
#
11+
# Redistribution and use in source and binary forms, with or without modification, are permitted
12+
# provided that the following conditions are met:
13+
#
14+
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions
15+
# and the following disclaimer.
16+
#
17+
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of
18+
# conditions and the following disclaimer in the documentation and/or other materials provided with
19+
# the distribution.
20+
#
21+
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to
22+
# endorse or promote products derived from this software without specific prior written permission.
23+
#
24+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
25+
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
26+
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
27+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30+
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
31+
# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32+
#
133
version: '3'
234
services:
335
p2:
436
build:
537
context: ..
638
dockerfile: docker/Dockerfile-p2
7-
ports:
8-
- "8080:8080"
939
jmc:
1040
build:
1141
context: ..

docker/docker-toolchains.xml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
4+
5+
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6+
7+
The contents of this file are subject to the terms of either the Universal Permissive License
8+
v 1.0 as shown at http://oss.oracle.com/licenses/upl
9+
10+
or the following license:
11+
12+
Redistribution and use in source and binary forms, with or without modification, are permitted
13+
provided that the following conditions are met:
14+
15+
1. Redistributions of source code must retain the above copyright notice, this list of conditions
16+
and the following disclaimer.
17+
18+
2. Redistributions in binary form must reproduce the above copyright notice, this list of
19+
conditions and the following disclaimer in the documentation and/or other materials provided with
20+
the distribution.
21+
22+
3. Neither the name of the copyright holder nor the names of its contributors may be used to
23+
endorse or promote products derived from this software without specific prior written permission.
24+
25+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
26+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
27+
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
28+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
32+
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33+
-->
34+
<toolchains>
35+
<toolchain>
36+
<type>jdk</type>
37+
<provides>
38+
<version>17</version>
39+
<vendor>temurin</vendor>
40+
<id>JavaSE-17</id>
41+
</provides>
42+
<configuration>
43+
<jdkHome>/opt/java/openjdk/</jdkHome>
44+
</configuration>
45+
</toolchain>
46+
</toolchains>

pom.xml

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!--
2+
<!--
33
Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
44
55
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -180,69 +180,6 @@
180180
</plugins>
181181
</build>
182182
</profile>
183-
<profile>
184-
<id>2022-06</id>
185-
<build>
186-
<plugins>
187-
<plugin>
188-
<groupId>org.eclipse.tycho</groupId>
189-
<artifactId>target-platform-configuration</artifactId>
190-
<version>${tycho.version}</version>
191-
<configuration>
192-
<target>
193-
<artifact>
194-
<groupId>org.openjdk.jmc</groupId>
195-
<artifactId>platform-definition-2022-06</artifactId>
196-
<version>${revision}${changelist}</version>
197-
</artifact>
198-
</target>
199-
</configuration>
200-
</plugin>
201-
</plugins>
202-
</build>
203-
</profile>
204-
<profile>
205-
<id>2022-03</id>
206-
<build>
207-
<plugins>
208-
<plugin>
209-
<groupId>org.eclipse.tycho</groupId>
210-
<artifactId>target-platform-configuration</artifactId>
211-
<version>${tycho.version}</version>
212-
<configuration>
213-
<target>
214-
<artifact>
215-
<groupId>org.openjdk.jmc</groupId>
216-
<artifactId>platform-definition-2022-03</artifactId>
217-
<version>${revision}${changelist}</version>
218-
</artifact>
219-
</target>
220-
</configuration>
221-
</plugin>
222-
</plugins>
223-
</build>
224-
</profile>
225-
<profile>
226-
<id>2021-12</id>
227-
<build>
228-
<plugins>
229-
<plugin>
230-
<groupId>org.eclipse.tycho</groupId>
231-
<artifactId>target-platform-configuration</artifactId>
232-
<version>${tycho.version}</version>
233-
<configuration>
234-
<target>
235-
<artifact>
236-
<groupId>org.openjdk.jmc</groupId>
237-
<artifactId>platform-definition-2021-12</artifactId>
238-
<version>${revision}${changelist}</version>
239-
</artifact>
240-
</target>
241-
</configuration>
242-
</plugin>
243-
</plugins>
244-
</build>
245-
</profile>
246183
</profiles>
247184
<build>
248185
<plugins>

0 commit comments

Comments
 (0)