Skip to content

Commit f0d6330

Browse files
committed
Merge master jdk-17.0.7+3 into openj9-staging
Signed-off-by: J9 Build <[email protected]>
2 parents 94a1148 + e9f3ae7 commit f0d6330

File tree

25 files changed

+1241
-182
lines changed

25 files changed

+1241
-182
lines changed

make/conf/github-actions.conf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ GTEST_VERSION=1.8.1
2929
JTREG_VERSION=6.1+3
3030

3131
LINUX_X64_BOOT_JDK_EXT=tar.gz
32-
LINUX_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.2%2B8/OpenJDK17U-jdk_x64_linux_hotspot_17.0.2_8.tar.gz
33-
LINUX_X64_BOOT_JDK_SHA256=288f34e3ba8a4838605636485d0365ce23e57d5f2f68997ac4c2e4c01967cd48
32+
LINUX_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.6%2B10/OpenJDK17U-jdk_x64_linux_hotspot_17.0.6_10.tar.gz
33+
LINUX_X64_BOOT_JDK_SHA256=a0b1b9dd809d51a438f5fa08918f9aca7b2135721097f0858cf29f77a35d4289
3434

3535
WINDOWS_X64_BOOT_JDK_EXT=zip
36-
WINDOWS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.2%2B8/OpenJDK17U-jdk_x64_windows_hotspot_17.0.2_8.zip
37-
WINDOWS_X64_BOOT_JDK_SHA256=d083479ca927dce2f586f779373d895e8bf668c632505740279390384edf03fa
36+
WINDOWS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.6%2B10/OpenJDK17U-jdk_x64_windows_hotspot_17.0.6_10.zip
37+
WINDOWS_X64_BOOT_JDK_SHA256=d544c4f00d414a1484c0a5c1758544f30f308c4df33f9a28bd4a404215d0d444
3838

3939
MACOS_X64_BOOT_JDK_EXT=tar.gz
40-
MACOS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.2%2B8/OpenJDK17U-jdk_x64_mac_hotspot_17.0.2_8.tar.gz
41-
MACOS_X64_BOOT_JDK_SHA256=3630e21a571b7180876bf08f85d0aac0bdbb3267b2ae9bd242f4933b21f9be32
40+
MACOS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.6%2B10/OpenJDK17U-jdk_x64_mac_hotspot_17.0.6_10.tar.gz
41+
MACOS_X64_BOOT_JDK_SHA256=faa2927584cf2bd0a35d2ac727b9f22725e23b2b24abfb3b2ac7140f4d65fbb4

src/java.desktop/share/classes/javax/swing/LayoutComparator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,8 +24,8 @@
2424
*/
2525
package javax.swing;
2626

27+
import java.util.ArrayList;
2728
import java.util.Comparator;
28-
import java.util.LinkedList;
2929
import java.util.ListIterator;
3030
import java.awt.Component;
3131
import java.awt.ComponentOrientation;
@@ -63,7 +63,7 @@ public int compare(Component a, Component b) {
6363
// each Component and then search from the Window down until the
6464
// hierarchy branches.
6565
if (a.getParent() != b.getParent()) {
66-
LinkedList<Component> aAncestory = new LinkedList<Component>();
66+
ArrayList<Component> aAncestory = new ArrayList<>();
6767

6868
for(; a != null; a = a.getParent()) {
6969
aAncestory.add(a);
@@ -76,7 +76,7 @@ public int compare(Component a, Component b) {
7676
throw new ClassCastException();
7777
}
7878

79-
LinkedList<Component> bAncestory = new LinkedList<Component>();
79+
ArrayList<Component> bAncestory = new ArrayList<>();
8080

8181
for(; b != null; b = b.getParent()) {
8282
bAncestory.add(b);

src/java.desktop/share/classes/javax/swing/border/EtchedBorder.java

Lines changed: 69 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,11 +24,14 @@
2424
*/
2525
package javax.swing.border;
2626

27+
import java.awt.BasicStroke;
2728
import java.awt.Graphics;
29+
import java.awt.Graphics2D;
2830
import java.awt.Insets;
29-
import java.awt.Rectangle;
3031
import java.awt.Color;
3132
import java.awt.Component;
33+
import java.awt.Stroke;
34+
import java.awt.geom.AffineTransform;
3235
import java.beans.ConstructorProperties;
3336

3437
/**
@@ -119,6 +122,22 @@ public EtchedBorder(int etchType, Color highlight, Color shadow) {
119122
this.shadow = shadow;
120123
}
121124

125+
private void paintBorderHighlight(Graphics g, Color c, int w, int h, int stkWidth) {
126+
g.setColor(c);
127+
g.drawRect(stkWidth/2, stkWidth/2, w-(2*stkWidth), h-(2*stkWidth));
128+
}
129+
130+
private void paintBorderShadow(Graphics g, Color c, int w, int h, int stkWidth) {
131+
g.setColor(c);
132+
g.drawLine(((3*stkWidth)/2), h-((3*stkWidth)/2), ((3*stkWidth)/2), ((3*stkWidth)/2)); // left line
133+
g.drawLine(((3*stkWidth)/2), ((3*stkWidth)/2), w-((3*stkWidth)/2), ((3*stkWidth)/2)); // top line
134+
135+
g.drawLine((stkWidth/2), h-(stkWidth-stkWidth/2),
136+
w-(stkWidth-stkWidth/2), h-(stkWidth-stkWidth/2)); // bottom line
137+
g.drawLine(w-(stkWidth-stkWidth/2), h-(stkWidth-stkWidth/2),
138+
w-(stkWidth-stkWidth/2), stkWidth/2); // right line
139+
}
140+
122141
/**
123142
* Paints the border for the specified component with the
124143
* specified position and size.
@@ -131,22 +150,59 @@ public EtchedBorder(int etchType, Color highlight, Color shadow) {
131150
* @param height the height of the painted border
132151
*/
133152
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
134-
int w = width;
135-
int h = height;
153+
// We remove any initial transforms to prevent rounding errors
154+
// when drawing in non-integer scales
155+
AffineTransform at = null;
156+
Stroke oldStk = null;
157+
int stkWidth = 1;
158+
boolean resetTransform = false;
159+
if (g instanceof Graphics2D) {
160+
Graphics2D g2d = (Graphics2D) g;
161+
at = g2d.getTransform();
162+
oldStk = g2d.getStroke();
163+
// if m01 or m10 is non-zero, then there is a rotation or shear
164+
// skip resetting the transform
165+
resetTransform = (at.getShearX() == 0) && (at.getShearY() == 0);
166+
if (resetTransform) {
167+
g2d.setTransform(new AffineTransform());
168+
stkWidth = (int) Math.floor(Math.min(at.getScaleX(), at.getScaleY()));
169+
g2d.setStroke(new BasicStroke((float) stkWidth));
170+
}
171+
}
136172

137-
g.translate(x, y);
173+
int w;
174+
int h;
175+
int xtranslation;
176+
int ytranslation;
177+
if (resetTransform) {
178+
w = (int) Math.floor(at.getScaleX() * width - 1);
179+
h = (int) Math.floor(at.getScaleY() * height - 1);
180+
xtranslation = (int) Math.ceil(at.getScaleX()*x+at.getTranslateX());
181+
ytranslation = (int) Math.ceil(at.getScaleY()*y+at.getTranslateY());
182+
} else {
183+
w = width;
184+
h = height;
185+
xtranslation = x;
186+
ytranslation = y;
187+
}
138188

139-
g.setColor(etchType == LOWERED? getShadowColor(c) : getHighlightColor(c));
140-
g.drawRect(0, 0, w-2, h-2);
189+
g.translate(xtranslation, ytranslation);
141190

142-
g.setColor(etchType == LOWERED? getHighlightColor(c) : getShadowColor(c));
143-
g.drawLine(1, h-3, 1, 1);
144-
g.drawLine(1, 1, w-3, 1);
191+
paintBorderShadow(g, (etchType == LOWERED) ? getHighlightColor(c)
192+
: getShadowColor(c),
193+
w, h, stkWidth);
194+
paintBorderHighlight(g, (etchType == LOWERED) ? getShadowColor(c)
195+
: getHighlightColor(c),
196+
w, h, stkWidth);
145197

146-
g.drawLine(0, h-1, w-1, h-1);
147-
g.drawLine(w-1, h-1, w-1, 0);
198+
g.translate(-xtranslation, -ytranslation);
148199

149-
g.translate(-x, -y);
200+
// Set the transform we removed earlier
201+
if (resetTransform) {
202+
Graphics2D g2d = (Graphics2D) g;
203+
g2d.setTransform(at);
204+
g2d.setStroke(oldStk);
205+
}
150206
}
151207

152208
/**

src/java.desktop/share/classes/javax/swing/border/LineBorder.java

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,9 @@
3434
import java.awt.geom.Rectangle2D;
3535
import java.awt.geom.RoundRectangle2D;
3636
import java.beans.ConstructorProperties;
37+
import java.awt.geom.AffineTransform;
38+
39+
import static sun.java2d.pipe.Region.clipRound;
3740

3841
/**
3942
* A class which implements a line border of arbitrary thickness
@@ -144,28 +147,70 @@ public void paintBorder(Component c, Graphics g, int x, int y, int width, int he
144147
if ((this.thickness > 0) && (g instanceof Graphics2D)) {
145148
Graphics2D g2d = (Graphics2D) g;
146149

150+
AffineTransform at = g2d.getTransform();
151+
152+
// if m01 or m10 is non-zero, then there is a rotation or shear
153+
// or if no Scaling enabled,
154+
// skip resetting the transform
155+
boolean resetTransform = ((at.getShearX() == 0) && (at.getShearY() == 0)) &&
156+
((at.getScaleX() > 1) || (at.getScaleY() > 1));
157+
158+
int xtranslation;
159+
int ytranslation;
160+
int w;
161+
int h;
162+
int offs;
163+
164+
if (resetTransform) {
165+
/* Deactivate the HiDPI scaling transform,
166+
* so we can do paint operations in the device
167+
* pixel coordinate system instead of the logical coordinate system.
168+
*/
169+
g2d.setTransform(new AffineTransform());
170+
double xx = at.getScaleX() * x + at.getTranslateX();
171+
double yy = at.getScaleY() * y + at.getTranslateY();
172+
xtranslation = clipRound(xx);
173+
ytranslation = clipRound(yy);
174+
w = clipRound(at.getScaleX() * width + xx) - xtranslation;
175+
h = clipRound(at.getScaleY() * height + yy) - ytranslation;
176+
offs = this.thickness * (int) at.getScaleX();
177+
} else {
178+
w = width;
179+
h = height;
180+
xtranslation = x;
181+
ytranslation = y;
182+
offs = this.thickness;
183+
}
184+
185+
g2d.translate(xtranslation, ytranslation);
186+
147187
Color oldColor = g2d.getColor();
148188
g2d.setColor(this.lineColor);
149189

150190
Shape outer;
151191
Shape inner;
152192

153-
int offs = this.thickness;
154193
int size = offs + offs;
155194
if (this.roundedCorners) {
156195
float arc = .2f * offs;
157-
outer = new RoundRectangle2D.Float(x, y, width, height, offs, offs);
158-
inner = new RoundRectangle2D.Float(x + offs, y + offs, width - size, height - size, arc, arc);
196+
outer = new RoundRectangle2D.Float(0, 0, w, h, offs, offs);
197+
inner = new RoundRectangle2D.Float(offs, offs, w - size, h - size, arc, arc);
159198
}
160199
else {
161-
outer = new Rectangle2D.Float(x, y, width, height);
162-
inner = new Rectangle2D.Float(x + offs, y + offs, width - size, height - size);
200+
outer = new Rectangle2D.Float(0, 0, w, h);
201+
inner = new Rectangle2D.Float(offs, offs, w - size, h - size);
163202
}
164203
Path2D path = new Path2D.Float(Path2D.WIND_EVEN_ODD);
165204
path.append(outer, false);
166205
path.append(inner, false);
167206
g2d.fill(path);
168207
g2d.setColor(oldColor);
208+
209+
g2d.translate(-xtranslation, -ytranslation);
210+
211+
if (resetTransform) {
212+
g2d.setTransform(at);
213+
}
169214
}
170215
}
171216

0 commit comments

Comments
 (0)