You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.
There is a bug with the toString method of FilterChainContext. This occurrs at least in version 2.4.0-beta8 but upon manual inspection also in branches master and 2.4.x as of today.
To reproduce you can use log level finest and basically any request.
There are two overloads of String.valueOf, with Object and char[]. (Java 8)
Because of the dangerous unbound generic in getMessage both overloads would seem applicable, however the char[] overload is chosen, probably because it is more specific. See bytecode:
However String.valueOf(char[]) will fail if the result of getMessage is null. Also I would assume a ClassCastException could happen in other cases. This can be fixed by explicitly casting the result to object or ensuring that the correct generics are infered.
For completeness, part of the stacktrace, but that does not show the overload.
13:51:09.891 [grizzly-nio-kernel(2) SelectorRunner] WARN o.g.g.filterchain.DefaultFilterChain - GRIZZLY0013: Exception during FilterChain execution
java.lang.NullPointerException: null
at java.lang.String.<init>(Unknown Source)
at java.lang.String.valueOf(Unknown Source)
at org.glassfish.grizzly.filterchain.FilterChainContext.toString(FilterChainContext.java:1076)
The text was updated successfully, but these errors were encountered:
There is a bug with the toString method of FilterChainContext. This occurrs at least in version 2.4.0-beta8 but upon manual inspection also in branches master and 2.4.x as of today.
To reproduce you can use log level finest and basically any request.
The problem is in these methods https://github.com/javaee/grizzly/blob/2_4_0_beta8/modules/grizzly/src/main/java/org/glassfish/grizzly/filterchain/FilterChainContext.java#L397 and https://github.com/javaee/grizzly/blob/2_4_0_beta8/modules/grizzly/src/main/java/org/glassfish/grizzly/filterchain/FilterChainContext.java#L1069
There are two overloads of String.valueOf, with Object and char[]. (Java 8)
Because of the dangerous unbound generic in getMessage both overloads would seem applicable, however the char[] overload is chosen, probably because it is more specific. See bytecode:
However String.valueOf(char[]) will fail if the result of getMessage is null. Also I would assume a ClassCastException could happen in other cases. This can be fixed by explicitly casting the result to object or ensuring that the correct generics are infered.
For completeness, part of the stacktrace, but that does not show the overload.
The text was updated successfully, but these errors were encountered: