Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/java.base/share/classes/sun/security/ssl/Alert.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -124,13 +124,13 @@ SSLException createSSLException(String reason, Throwable cause) {

SSLException ssle;
if (cause instanceof IOException) {
ssle = new SSLException(reason);
ssle = new SSLException("(" + description + ") " + reason);
} else if ((this == UNEXPECTED_MESSAGE)) {
ssle = new SSLProtocolException(reason);
ssle = new SSLProtocolException("(" + description + ") " + reason);
} else if (handshakeOnly) {
ssle = new SSLHandshakeException(reason);
ssle = new SSLHandshakeException("(" + description + ") " + reason);
} else {
ssle = new SSLException(reason);
ssle = new SSLException("(" + description + ") " + reason);
}

if (cause != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ private void onCertificate(ServerHandshakeContext shc,
if (shc.sslConfig.clientAuthType !=
ClientAuthType.CLIENT_AUTH_REQUESTED) {
// unexpected or require client authentication
throw shc.conContext.fatal(Alert.BAD_CERTIFICATE,
throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE,
"Empty client certificate chain");
} else {
return;
Expand Down Expand Up @@ -1128,7 +1128,7 @@ private void onConsumeCertificate(ServerHandshakeContext shc,
shc.handshakeConsumers.remove(
SSLHandshake.CERTIFICATE_VERIFY.id);
if (shc.sslConfig.clientAuthType == CLIENT_AUTH_REQUIRED) {
throw shc.conContext.fatal(Alert.BAD_CERTIFICATE,
throw shc.conContext.fatal(Alert.CERTIFICATE_REQUIRED,
"Empty client certificate chain");
} else {
// optional client authentication
Expand All @@ -1152,7 +1152,7 @@ private void onConsumeCertificate(ClientHandshakeContext chc,
T13CertificateMessage certificateMessage )throws IOException {
if (certificateMessage.certEntries == null ||
certificateMessage.certEntries.isEmpty()) {
throw chc.conContext.fatal(Alert.BAD_CERTIFICATE,
throw chc.conContext.fatal(Alert.DECODE_ERROR,
"Empty server certificate chain");
}

Expand Down
2 changes: 1 addition & 1 deletion src/java.desktop/share/legal/harfbuzz.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Harfbuzz 11.2.0
## Harfbuzz 12.3.2

### Harfbuzz License

Expand Down
92 changes: 40 additions & 52 deletions src/java.desktop/share/native/libharfbuzz/OT/Color/COLR/COLR.hh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public:
foreground (foreground_),
instancer (instancer_)
{
if (font->is_synthetic ())
if (font->is_synthetic)
{
font = hb_font_create_sub_font (font);
hb_font_set_synthetic_bold (font, 0, 0, true);
Expand Down Expand Up @@ -178,7 +178,10 @@ struct hb_colrv1_closure_context_t :
{ glyphs->add (glyph_id); }

void add_layer_indices (unsigned first_layer_index, unsigned num_of_layers)
{ layer_indices->add_range (first_layer_index, first_layer_index + num_of_layers - 1); }
{
if (num_of_layers == 0) return;
layer_indices->add_range (first_layer_index, first_layer_index + num_of_layers - 1);
}

void add_palette_index (unsigned palette_index)
{ palette_indices->add (palette_index); }
Expand Down Expand Up @@ -650,10 +653,10 @@ struct PaintColrLayers
TRACE_SUBSET (this);
auto *out = c->serializer->embed (this);
if (unlikely (!out)) return_trace (false);
return_trace (c->serializer->check_assign (out->firstLayerIndex, c->plan->colrv1_layers.get (firstLayerIndex),
HB_SERIALIZE_ERROR_INT_OVERFLOW));

return_trace (true);
uint32_t first_layer_index = numLayers ? c->plan->colrv1_layers.get (firstLayerIndex) : 0;
return_trace (c->serializer->check_assign (out->firstLayerIndex, first_layer_index,
HB_SERIALIZE_ERROR_INT_OVERFLOW));
}

bool sanitize (hb_sanitize_context_t *c) const
Expand Down Expand Up @@ -1075,9 +1078,9 @@ struct PaintTranslate
float ddx = dx + c->instancer (varIdxBase, 0);
float ddy = dy + c->instancer (varIdxBase, 1);

bool p1 = c->funcs->push_translate (c->data, ddx, ddy);
c->funcs->push_translate (c->data, ddx, ddy);
c->recurse (this+src);
if (p1) c->funcs->pop_transform (c->data);
c->funcs->pop_transform (c->data);
}

HBUINT8 format; /* format = 14(noVar) or 15 (Var) */
Expand Down Expand Up @@ -1124,9 +1127,9 @@ struct PaintScale
float sx = scaleX.to_float (c->instancer (varIdxBase, 0));
float sy = scaleY.to_float (c->instancer (varIdxBase, 1));

bool p1 = c->funcs->push_scale (c->data, sx, sy);
c->funcs->push_scale (c->data, sx, sy);
c->recurse (this+src);
if (p1) c->funcs->pop_transform (c->data);
c->funcs->pop_transform (c->data);
}

HBUINT8 format; /* format = 16 (noVar) or 17(Var) */
Expand Down Expand Up @@ -1177,13 +1180,9 @@ struct PaintScaleAroundCenter
float tCenterX = centerX + c->instancer (varIdxBase, 2);
float tCenterY = centerY + c->instancer (varIdxBase, 3);

bool p1 = c->funcs->push_translate (c->data, +tCenterX, +tCenterY);
bool p2 = c->funcs->push_scale (c->data, sx, sy);
bool p3 = c->funcs->push_translate (c->data, -tCenterX, -tCenterY);
c->funcs->push_scale_around_center (c->data, sx, sy, tCenterX, tCenterY);
c->recurse (this+src);
if (p3) c->funcs->pop_transform (c->data);
if (p2) c->funcs->pop_transform (c->data);
if (p1) c->funcs->pop_transform (c->data);
c->funcs->pop_transform (c->data);
}

HBUINT8 format; /* format = 18 (noVar) or 19(Var) */
Expand Down Expand Up @@ -1228,9 +1227,9 @@ struct PaintScaleUniform
TRACE_PAINT (this);
float s = scale.to_float (c->instancer (varIdxBase, 0));

bool p1 = c->funcs->push_scale (c->data, s, s);
c->funcs->push_scale (c->data, s, s);
c->recurse (this+src);
if (p1) c->funcs->pop_transform (c->data);
c->funcs->pop_transform (c->data);
}

HBUINT8 format; /* format = 20 (noVar) or 21(Var) */
Expand Down Expand Up @@ -1278,13 +1277,9 @@ struct PaintScaleUniformAroundCenter
float tCenterX = centerX + c->instancer (varIdxBase, 1);
float tCenterY = centerY + c->instancer (varIdxBase, 2);

bool p1 = c->funcs->push_translate (c->data, +tCenterX, +tCenterY);
bool p2 = c->funcs->push_scale (c->data, s, s);
bool p3 = c->funcs->push_translate (c->data, -tCenterX, -tCenterY);
c->funcs->push_scale_around_center (c->data, s, s, tCenterX, tCenterY);
c->recurse (this+src);
if (p3) c->funcs->pop_transform (c->data);
if (p2) c->funcs->pop_transform (c->data);
if (p1) c->funcs->pop_transform (c->data);
c->funcs->pop_transform (c->data);
}

HBUINT8 format; /* format = 22 (noVar) or 23(Var) */
Expand Down Expand Up @@ -1328,9 +1323,9 @@ struct PaintRotate
TRACE_PAINT (this);
float a = angle.to_float (c->instancer (varIdxBase, 0));

bool p1 = c->funcs->push_rotate (c->data, a);
c->funcs->push_rotate (c->data, a);
c->recurse (this+src);
if (p1) c->funcs->pop_transform (c->data);
c->funcs->pop_transform (c->data);
}

HBUINT8 format; /* format = 24 (noVar) or 25(Var) */
Expand Down Expand Up @@ -1378,13 +1373,9 @@ struct PaintRotateAroundCenter
float tCenterX = centerX + c->instancer (varIdxBase, 1);
float tCenterY = centerY + c->instancer (varIdxBase, 2);

bool p1 = c->funcs->push_translate (c->data, +tCenterX, +tCenterY);
bool p2 = c->funcs->push_rotate (c->data, a);
bool p3 = c->funcs->push_translate (c->data, -tCenterX, -tCenterY);
c->funcs->push_rotate_around_center (c->data, a, tCenterX, tCenterY);
c->recurse (this+src);
if (p3) c->funcs->pop_transform (c->data);
if (p2) c->funcs->pop_transform (c->data);
if (p1) c->funcs->pop_transform (c->data);
c->funcs->pop_transform (c->data);
}

HBUINT8 format; /* format = 26 (noVar) or 27(Var) */
Expand Down Expand Up @@ -1432,9 +1423,9 @@ struct PaintSkew
float sx = xSkewAngle.to_float(c->instancer (varIdxBase, 0));
float sy = ySkewAngle.to_float(c->instancer (varIdxBase, 1));

bool p1 = c->funcs->push_skew (c->data, sx, sy);
c->funcs->push_skew (c->data, sx, sy);
c->recurse (this+src);
if (p1) c->funcs->pop_transform (c->data);
c->funcs->pop_transform (c->data);
}

HBUINT8 format; /* format = 28(noVar) or 29 (Var) */
Expand Down Expand Up @@ -1485,13 +1476,9 @@ struct PaintSkewAroundCenter
float tCenterX = centerX + c->instancer (varIdxBase, 2);
float tCenterY = centerY + c->instancer (varIdxBase, 3);

bool p1 = c->funcs->push_translate (c->data, +tCenterX, +tCenterY);
bool p2 = c->funcs->push_skew (c->data, sx, sy);
bool p3 = c->funcs->push_translate (c->data, -tCenterX, -tCenterY);
c->funcs->push_skew_around_center (c->data, sx, sy, tCenterX, tCenterY);
c->recurse (this+src);
if (p3) c->funcs->pop_transform (c->data);
if (p2) c->funcs->pop_transform (c->data);
if (p1) c->funcs->pop_transform (c->data);
c->funcs->pop_transform (c->data);
}

HBUINT8 format; /* format = 30(noVar) or 31 (Var) */
Expand Down Expand Up @@ -1626,7 +1613,7 @@ struct ClipBox
const ItemVarStoreInstancer &instancer) const
{
TRACE_SUBSET (this);
switch (u.format) {
switch (u.format.v) {
case 1: return_trace (u.format1.subset (c, instancer, VarIdx::NO_VARIATION));
case 2: return_trace (u.format2.subset (c, instancer));
default:return_trace (c->default_return_value ());
Expand All @@ -1635,7 +1622,7 @@ struct ClipBox

void closurev1 (hb_colrv1_closure_context_t* c) const
{
switch (u.format) {
switch (u.format.v) {
case 2: u.format2.closurev1 (c); return;
default:return;
}
Expand All @@ -1644,9 +1631,9 @@ struct ClipBox
template <typename context_t, typename ...Ts>
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
{
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
TRACE_DISPATCH (this, u.format);
switch (u.format) {
if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
TRACE_DISPATCH (this, u.format.v);
switch (u.format.v) {
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
default:return_trace (c->default_return_value ());
Expand All @@ -1657,7 +1644,7 @@ struct ClipBox
const ItemVarStoreInstancer &instancer) const
{
ClipBoxData clip_box;
switch (u.format) {
switch (u.format.v) {
case 1:
u.format1.get_clip_box (clip_box, instancer);
break;
Expand All @@ -1677,7 +1664,7 @@ struct ClipBox

protected:
union {
HBUINT8 format; /* Format identifier */
struct { HBUINT8 v; } format; /* Format identifier */
ClipBoxFormat1 format1;
ClipBoxFormat2 format2;
} u;
Expand Down Expand Up @@ -1857,9 +1844,9 @@ struct Paint
template <typename context_t, typename ...Ts>
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
{
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
TRACE_DISPATCH (this, u.format);
switch (u.format) {
if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value ();
TRACE_DISPATCH (this, u.format.v);
switch (u.format.v) {
case 1: return_trace (c->dispatch (u.paintformat1, std::forward<Ts> (ds)...));
case 2: return_trace (c->dispatch (u.paintformat2, std::forward<Ts> (ds)...));
case 3: return_trace (c->dispatch (u.paintformat3, std::forward<Ts> (ds)...));
Expand Down Expand Up @@ -1898,7 +1885,7 @@ struct Paint

protected:
union {
HBUINT8 format;
struct { HBUINT8 v; } format;
PaintColrLayers paintformat1;
NoVariable<PaintSolid> paintformat2;
Variable<PaintSolid> paintformat3;
Expand Down Expand Up @@ -2073,7 +2060,7 @@ struct delta_set_index_map_subset_plan_t
outer_bit_count = 1;
inner_bit_count = 1;

if (unlikely (!output_map.resize (map_count, false))) return false;
if (unlikely (!output_map.resize_dirty (map_count))) return false;

for (unsigned idx = 0; idx < map_count; idx++)
{
Expand Down Expand Up @@ -2693,7 +2680,8 @@ struct COLR
{
ItemVarStoreInstancer instancer (get_var_store_ptr (),
get_delta_set_index_map_ptr (),
hb_array (font->coords, font->num_coords));
hb_array (font->coords,
font->has_nonzero_coords ? font->num_coords : 0));
hb_paint_context_t c (this, funcs, data, font, palette_index, foreground, instancer);

hb_decycler_node_t node (c.glyphs_decycler);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ struct CPAL
if (first_color_to_layer_index.has (first_color_record_idx)) continue;

first_color_index_for_layer.push (first_color_record_idx);
if (unlikely (!c->serializer->propagate_error (first_color_index_for_layer))) return_trace (false);
first_color_to_layer_index.set (first_color_record_idx,
first_color_index_for_layer.length - 1);
}
Expand Down
Loading
Loading