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 Feb 4, 2024. It is now read-only.
Using the context logger with primitive arrays like float[], char[], byte[] currently triggers a ClassCastException:
Exception in thread "main" java.lang.ClassCastException: [F cannot be cast to [Ljava.lang.Object;
at io.tracee.contextlogger.outputgenerator.RecursiveOutputElementTreeBuilderImpl.convertInstanceRecursively(RecursiveOutputElementTreeBuilderImpl.java:93)
at io.tracee.contextlogger.outputgenerator.RootOutputElementTreeBuilder.buildOutputElementTreeMain(RootOutputElementTreeBuilder.java:35)
at io.tracee.contextlogger.outputgenerator.RootOutputElementTreeBuilder.buildOutputElementTree(RootOutputElementTreeBuilder.java:69)
at io.tracee.contextlogger.outputgenerator.TraceeContextStringRepresentationBuilderImpl.createStringRepresentation(TraceeContextStringRepresentationBuilderImpl.java:18)
at io.tracee.contextlogger.TraceeContextLogger.provideOutput(TraceeContextLogger.java:92)
at io.tracee.contextlogger.connector.LogConnector.sendErrorReport(LogConnector.java:40)
at io.tracee.contextlogger.ConnectorFactory.sendErrorReportToConnectors(ConnectorFactory.java:82)
at io.tracee.contextlogger.TraceeContextLogger.logWithPrefixedMessage(TraceeContextLogger.java:67)
at io.tracee.contextlogger.TraceeContextLogger.log(TraceeContextLogger.java:58)
The text was updated successfully, but these errors were encountered:
atomic type arrays are now handled via an context provider.
This approach currently has a drawback.
Atomic type arrays will be outputted like this:
17:04:30.642 [main] ERROR i.t.c.connector.LogConnector - {
"<TYPE>":"char[]",
"value":"String<'['A', 'B', 'C', 'A', 'D', 'A', 'D', 'A', 'D', 'D', 'A', 'D', 'A', 'D', 'A', 'D', 'A', 'D', 'D', 'A', 'D', 'A', 'D', 'A']'>"
}
So we still need to add some kind of AtomicTraceeContextProvider which returns exactly one value.
tobiasstamann
changed the title
Handle atomic type arrays correctly
Handle primitive type arrays correctly
Mar 13, 2017
Using the context logger with primitive arrays like float[], char[], byte[] currently triggers a ClassCastException:
Exception in thread "main" java.lang.ClassCastException: [F cannot be cast to [Ljava.lang.Object;
at io.tracee.contextlogger.outputgenerator.RecursiveOutputElementTreeBuilderImpl.convertInstanceRecursively(RecursiveOutputElementTreeBuilderImpl.java:93)
at io.tracee.contextlogger.outputgenerator.RootOutputElementTreeBuilder.buildOutputElementTreeMain(RootOutputElementTreeBuilder.java:35)
at io.tracee.contextlogger.outputgenerator.RootOutputElementTreeBuilder.buildOutputElementTree(RootOutputElementTreeBuilder.java:69)
at io.tracee.contextlogger.outputgenerator.TraceeContextStringRepresentationBuilderImpl.createStringRepresentation(TraceeContextStringRepresentationBuilderImpl.java:18)
at io.tracee.contextlogger.TraceeContextLogger.provideOutput(TraceeContextLogger.java:92)
at io.tracee.contextlogger.connector.LogConnector.sendErrorReport(LogConnector.java:40)
at io.tracee.contextlogger.ConnectorFactory.sendErrorReportToConnectors(ConnectorFactory.java:82)
at io.tracee.contextlogger.TraceeContextLogger.logWithPrefixedMessage(TraceeContextLogger.java:67)
at io.tracee.contextlogger.TraceeContextLogger.log(TraceeContextLogger.java:58)
The text was updated successfully, but these errors were encountered: