Skip to content

Commit

Permalink
Merge #5404, #5408 and #5409 from 4.1 into 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BalusC committed Mar 9, 2024
2 parents bae89d5 + 6397374 commit cbff0b0
Show file tree
Hide file tree
Showing 105 changed files with 21,736 additions and 335 deletions.
6 changes: 0 additions & 6 deletions action/faces-config.NavData

This file was deleted.

18 changes: 9 additions & 9 deletions impl/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2021, 2023 Contributors to Eclipse Foundation.
Copyright (c) 2021, 2024 Contributors to Eclipse Foundation.
Copyright (c) 2017, 2021 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -55,7 +55,7 @@
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.1.0-M1</version>
<version>6.1.0-M2</version>
<scope>provided</scope>
</dependency>

Expand All @@ -75,21 +75,21 @@
<dependency>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
<version>6.0.0-M1</version>
<version>6.0.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<version>4.1.0-M1</version>
<version>4.1.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-el-api</artifactId>
<version>4.1.0-M1</version>
<version>4.1.0</version>
<scope>provided</scope>
</dependency>

Expand Down Expand Up @@ -130,23 +130,23 @@
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<version>3.2.0-M1</version>
<version>3.2.0-M2</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>jakarta.xml.ws</groupId>
<artifactId>jakarta.xml.ws-api</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>3.0.0-M1</version>
<version>3.0.0</version>
</dependency>


Expand Down Expand Up @@ -286,7 +286,7 @@

<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.2</version>
<version>3.2.5</version>
<configuration>
<trimStackTrace>false</trimStackTrace>
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
Expand Down
Expand Up @@ -53,20 +53,11 @@
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;

import com.sun.faces.application.ApplicationAssociate;
import com.sun.faces.application.ConverterPropertyEditorFactory;
import com.sun.faces.application.ViewMemberInstanceFactoryMetadataMap;
import com.sun.faces.cdi.CdiUtils;
import com.sun.faces.config.WebConfiguration;
import com.sun.faces.util.FacesLogger;
import com.sun.faces.util.MessageUtils;
import com.sun.faces.util.ReflectionUtils;
import com.sun.faces.util.Util;

import jakarta.el.ExpressionFactory;
import jakarta.el.ValueExpression;
import jakarta.enterprise.inject.spi.BeanManager;
Expand All @@ -76,13 +67,32 @@
import jakarta.faces.component.UIComponent;
import jakarta.faces.component.behavior.Behavior;
import jakarta.faces.context.FacesContext;
import jakarta.faces.convert.BooleanConverter;
import jakarta.faces.convert.ByteConverter;
import jakarta.faces.convert.CharacterConverter;
import jakarta.faces.convert.Converter;
import jakarta.faces.convert.DateTimeConverter;
import jakarta.faces.convert.DoubleConverter;
import jakarta.faces.convert.FloatConverter;
import jakarta.faces.convert.IntegerConverter;
import jakarta.faces.convert.LongConverter;
import jakarta.faces.convert.ShortConverter;
import jakarta.faces.convert.UUIDConverter;
import jakarta.faces.render.RenderKit;
import jakarta.faces.render.Renderer;
import jakarta.faces.validator.Validator;
import jakarta.faces.view.ViewDeclarationLanguage;

import com.sun.faces.application.ApplicationAssociate;
import com.sun.faces.application.ConverterPropertyEditorFactory;
import com.sun.faces.application.ViewMemberInstanceFactoryMetadataMap;
import com.sun.faces.cdi.CdiUtils;
import com.sun.faces.config.WebConfiguration;
import com.sun.faces.util.FacesLogger;
import com.sun.faces.util.MessageUtils;
import com.sun.faces.util.ReflectionUtils;
import com.sun.faces.util.Util;

public class InstanceFactory {

// Log instance for this class
Expand All @@ -97,14 +107,15 @@ public class InstanceFactory {
private static final Map<Class<?>, String> STANDARD_TYPE_TO_CONV_ID_MAP = new HashMap<>(16, 1.0f);

static {
STANDARD_CONV_ID_TO_TYPE_MAP.put("jakarta.faces.Byte", new Class<?>[] { Byte.TYPE, Byte.class });
STANDARD_CONV_ID_TO_TYPE_MAP.put("jakarta.faces.Boolean", new Class<?>[] { Boolean.TYPE, Boolean.class });
STANDARD_CONV_ID_TO_TYPE_MAP.put("jakarta.faces.Character", new Class<?>[] { Character.TYPE, Character.class });
STANDARD_CONV_ID_TO_TYPE_MAP.put("jakarta.faces.Short", new Class<?>[] { Short.TYPE, Short.class });
STANDARD_CONV_ID_TO_TYPE_MAP.put("jakarta.faces.Integer", new Class<?>[] { Integer.TYPE, Integer.class });
STANDARD_CONV_ID_TO_TYPE_MAP.put("jakarta.faces.Long", new Class<?>[] { Long.TYPE, Long.class });
STANDARD_CONV_ID_TO_TYPE_MAP.put("jakarta.faces.Float", new Class<?>[] { Float.TYPE, Float.class });
STANDARD_CONV_ID_TO_TYPE_MAP.put("jakarta.faces.Double", new Class<?>[] { Double.TYPE, Double.class });
STANDARD_CONV_ID_TO_TYPE_MAP.put(ByteConverter.CONVERTER_ID, new Class<?>[] { Byte.TYPE, Byte.class });
STANDARD_CONV_ID_TO_TYPE_MAP.put(BooleanConverter.CONVERTER_ID, new Class<?>[] { Boolean.TYPE, Boolean.class });
STANDARD_CONV_ID_TO_TYPE_MAP.put(CharacterConverter.CONVERTER_ID, new Class<?>[] { Character.TYPE, Character.class });
STANDARD_CONV_ID_TO_TYPE_MAP.put(ShortConverter.CONVERTER_ID, new Class<?>[] { Short.TYPE, Short.class });
STANDARD_CONV_ID_TO_TYPE_MAP.put(IntegerConverter.CONVERTER_ID, new Class<?>[] { Integer.TYPE, Integer.class });
STANDARD_CONV_ID_TO_TYPE_MAP.put(LongConverter.CONVERTER_ID, new Class<?>[] { Long.TYPE, Long.class });
STANDARD_CONV_ID_TO_TYPE_MAP.put(FloatConverter.CONVERTER_ID, new Class<?>[] { Float.TYPE, Float.class });
STANDARD_CONV_ID_TO_TYPE_MAP.put(DoubleConverter.CONVERTER_ID, new Class<?>[] { Double.TYPE, Double.class });
STANDARD_CONV_ID_TO_TYPE_MAP.put(UUIDConverter.CONVERTER_ID, new Class<?>[] { UUID.class });
for (Map.Entry<String, Class<?>[]> entry : STANDARD_CONV_ID_TO_TYPE_MAP.entrySet()) {
Class<?>[] types = entry.getValue();
String key = entry.getKey();
Expand Down
31 changes: 30 additions & 1 deletion impl/src/main/java/com/sun/faces/config/manager/FacesSchema.java
Expand Up @@ -30,6 +30,8 @@
import static com.sun.faces.config.manager.FacesSchema.Schemas.FACES_3_0_XSD_FILE;
import static com.sun.faces.config.manager.FacesSchema.Schemas.FACES_4_0_XSD;
import static com.sun.faces.config.manager.FacesSchema.Schemas.FACES_4_0_XSD_FILE;
import static com.sun.faces.config.manager.FacesSchema.Schemas.FACES_4_1_XSD;
import static com.sun.faces.config.manager.FacesSchema.Schemas.FACES_4_1_XSD_FILE;
import static com.sun.faces.config.manager.FacesSchema.Schemas.FACES_CONFIG_1_X_DEFAULT_NS;
import static com.sun.faces.config.manager.FacesSchema.Schemas.JAKARTAEE_SCHEMA_DEFAULT_NS;
import static com.sun.faces.config.manager.FacesSchema.Schemas.JAVAEE_SCHEMA_DEFAULT_NS;
Expand Down Expand Up @@ -63,13 +65,15 @@ public enum FacesSchema {
FACES_23(FACES_2_3_XSD, FACES_2_3_XSD_FILE),
FACES_30(FACES_3_0_XSD, FACES_3_0_XSD_FILE),
FACES_40(FACES_4_0_XSD, FACES_4_0_XSD_FILE),
FACES_41(FACES_4_1_XSD, FACES_4_1_XSD_FILE),

// taglib.xml
FACELET_TAGLIB_20(Schemas.FACELET_TAGLIB_2_0_XSD, Schemas.FACELET_TAGLIB_2_0_XSD_FILE),
FACELET_TAGLIB_22(Schemas.FACELET_TAGLIB_2_2_XSD, Schemas.FACELET_TAGLIB_2_2_XSD_FILE),
FACELET_TAGLIB_23(Schemas.FACELET_TAGLIB_2_3_XSD, Schemas.FACELET_TAGLIB_2_3_XSD_FILE),
FACELET_TAGLIB_30(Schemas.FACELET_TAGLIB_3_0_XSD, Schemas.FACELET_TAGLIB_3_0_XSD_FILE),
FACELET_TAGLIB_40(Schemas.FACELET_TAGLIB_4_0_XSD, Schemas.FACELET_TAGLIB_4_0_XSD_FILE);
FACELET_TAGLIB_40(Schemas.FACELET_TAGLIB_4_0_XSD, Schemas.FACELET_TAGLIB_4_0_XSD_FILE),
FACELET_TAGLIB_41(Schemas.FACELET_TAGLIB_4_1_XSD, Schemas.FACELET_TAGLIB_4_1_XSD_FILE);

/**
* Constants for individual schema files
Expand All @@ -90,6 +94,7 @@ public static class Schemas {
public static final String FACELET_TAGLIB_2_3_XSD = "/com/sun/faces/web-facelettaglibrary_2_3.xsd";
public static final String FACELET_TAGLIB_3_0_XSD = "/com/sun/faces/web-facelettaglibrary_3_0.xsd";
public static final String FACELET_TAGLIB_4_0_XSD = "/com/sun/faces/web-facelettaglibrary_4_0.xsd";
public static final String FACELET_TAGLIB_4_1_XSD = "/com/sun/faces/web-facelettaglibrary_4_1.xsd";

public static final String FACES_1_2_XSD = "/com/sun/faces/web-facesconfig_1_2.xsd";
public static final String FACES_1_1_XSD = "/com/sun/faces/web-facesconfig_1_1.xsd";
Expand All @@ -99,12 +104,14 @@ public static class Schemas {
public static final String FACES_2_3_XSD = "/com/sun/faces/web-facesconfig_2_3.xsd";
public static final String FACES_3_0_XSD = "/com/sun/faces/web-facesconfig_3_0.xsd";
public static final String FACES_4_0_XSD = "/com/sun/faces/web-facesconfig_4_0.xsd";
public static final String FACES_4_1_XSD = "/com/sun/faces/web-facesconfig_4_1.xsd";

public static final String FACELET_TAGLIB_2_0_XSD_FILE = AS_SCHEMA_DIR + "web-facelettaglibrary_2_0.xsd";
public static final String FACELET_TAGLIB_2_2_XSD_FILE = AS_SCHEMA_DIR + "web-facelettaglibrary_2_2.xsd";
public static final String FACELET_TAGLIB_2_3_XSD_FILE = AS_SCHEMA_DIR + "web-facelettaglibrary_2_3.xsd";
public static final String FACELET_TAGLIB_3_0_XSD_FILE = AS_SCHEMA_DIR + "web-facelettaglibrary_3_0.xsd";
public static final String FACELET_TAGLIB_4_0_XSD_FILE = AS_SCHEMA_DIR + "web-facelettaglibrary_4_0.xsd";
public static final String FACELET_TAGLIB_4_1_XSD_FILE = AS_SCHEMA_DIR + "web-facelettaglibrary_4_1.xsd";

// #### faces-config.xml XSDs within GlassFish

Expand All @@ -115,6 +122,7 @@ public static class Schemas {
public static final String FACES_2_3_XSD_FILE = AS_SCHEMA_DIR + "web-facesconfig_2_3.xsd";
public static final String FACES_3_0_XSD_FILE = AS_SCHEMA_DIR + "web-facesconfig_3_0.xsd";
public static final String FACES_4_0_XSD_FILE = AS_SCHEMA_DIR + "web-facesconfig_4_0.xsd";
public static final String FACES_4_1_XSD_FILE = AS_SCHEMA_DIR + "web-facesconfig_4_1.xsd";

/**
* Contains associations between grammar name and the physical resource.
Expand Down Expand Up @@ -160,6 +168,11 @@ public static class Schemas {
FACES_4_0_XSD,
FACES_4_0_XSD_FILE
},
{
"web-facesconfig_4_1.xsd",
FACES_4_1_XSD,
FACES_4_1_XSD_FILE
},
{
"facelet-taglib_1_0.dtd",
"/com/sun/faces/facelet-taglib_1_0.dtd",
Expand Down Expand Up @@ -190,6 +203,11 @@ public static class Schemas {
FACELET_TAGLIB_4_0_XSD,
FACELET_TAGLIB_4_0_XSD_FILE
},
{
"web-facelettaglibrary_4_1.xsd",
FACELET_TAGLIB_4_1_XSD,
FACELET_TAGLIB_4_1_XSD_FILE
},
{
"web-facesconfig_1_2.xsd",
FACES_1_2_XSD,
Expand Down Expand Up @@ -230,6 +248,11 @@ public static class Schemas {
"/com/sun/faces/jakartaee_10.xsd",
AS_SCHEMA_DIR + "jakartaee_10.xsd"
},
{
"jakartaee_11.xsd",
"/com/sun/faces/jakartaee_11.xsd",
AS_SCHEMA_DIR + "jakartaee_11.xsd"
},
{
"javaee_web_services_client_1_2.xsd",
"/com/sun/faces/javaee_web_services_client_1_2.xsd",
Expand Down Expand Up @@ -293,6 +316,12 @@ public static FacesSchema fromDocumentId(String documentNS, String version, Stri
switch (documentNS) {
case JAKARTAEE_SCHEMA_DEFAULT_NS: {
switch (version) {
case "4.1":
if ("facelet-taglib".equals(localName)) {
return FACELET_TAGLIB_41;
} else {
return FACES_41;
}
case "4.0":
if ("facelet-taglib".equals(localName)) {
return FACELET_TAGLIB_40;
Expand Down
Expand Up @@ -420,7 +420,7 @@ public void setViewRoot(UIViewRoot root) {
if (viewRoot != null && !viewRoot.equals(root)) {
Map<String, Object> viewMap = viewRoot.getViewMap(false);
if (viewMap != null) {
viewRoot.getViewMap().clear();
viewMap.clear();
}
RequestStateManager.clearAttributesOnChangeOfView(this);
}
Expand Down
Expand Up @@ -52,8 +52,8 @@ public void execute(FacesContext facesContext) throws FacesException {
} catch (RuntimeException re) {
String exceptionMessage = re.getMessage();
if (null != exceptionMessage) {
if (LOGGER.isLoggable(Level.WARNING)) {
LOGGER.log(Level.WARNING, exceptionMessage, re);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, exceptionMessage, re);
}
}
throw new FacesException(exceptionMessage, re);
Expand Down
Expand Up @@ -57,8 +57,8 @@ public void execute(FacesContext facesContext) throws FacesException {
} catch (RuntimeException re) {
String exceptionMessage = re.getMessage();
if (null != exceptionMessage) {
if (LOGGER.isLoggable(Level.WARNING)) {
LOGGER.log(Level.WARNING, exceptionMessage, re);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, exceptionMessage, re);
}
}
throw new FacesException(exceptionMessage, re);
Expand Down
Expand Up @@ -50,8 +50,8 @@ public void execute(FacesContext facesContext) throws FacesException {
} catch (RuntimeException re) {
String exceptionMessage = re.getMessage();
if (null != exceptionMessage) {
if (LOGGER.isLoggable(Level.WARNING)) {
LOGGER.log(Level.WARNING, exceptionMessage, re);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, exceptionMessage, re);
}
}
throw new FacesException(exceptionMessage, re);
Expand Down
Expand Up @@ -51,8 +51,8 @@ public void execute(FacesContext facesContext) {
} catch (RuntimeException re) {
String exceptionMessage = re.getMessage();
if (null != exceptionMessage) {
if (LOGGER.isLoggable(Level.WARNING)) {
LOGGER.log(Level.WARNING, exceptionMessage, re);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, exceptionMessage, re);
}
}
throw new FacesException(exceptionMessage, re);
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 Contributors to Eclipse Foundation.
* Copyright (c) 2023, 2024 Contributors to Eclipse Foundation.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -489,4 +489,14 @@ public <T> InterceptionFactory<T> createInterceptionFactory(CreationalContext<T>
return wrapped.createInterceptionFactory(ctx, clazz);
}

@Override
public boolean isMatchingBean(Set<Type> beanTypes, Set<Annotation> beanQualifiers, Type requiredType, Set<Annotation> requiredQualifiers) {
return wrapped.isMatchingBean(beanTypes, beanQualifiers, requiredType, requiredQualifiers);
}

@Override
public boolean isMatchingEvent(Type specifiedType, Set<Annotation> specifiedQualifiers, Type observedEventType, Set<Annotation> observedEventQualifiers) {
return wrapped.isMatchingEvent(specifiedType, specifiedQualifiers, observedEventType, observedEventQualifiers);
}

}

0 comments on commit cbff0b0

Please sign in to comment.