Top Description Fields Constructors Methods
java.util.stream

pack-priv final Class Tripwire

extends Object
Class Inheritance
Imports
java.security.AccessController, .PrivilegedAction, sun.util.logging.PlatformLogger

Utility class for detecting inadvertent uses of boxing in java.util.stream classes. The detection is turned on or off based on whether the system property org.openjdk.java.util.stream.tripwire is considered true according to Boolean#getBoolean(String). This should normally be turned off for production use.

API Note

Typical usage would be for boxing code to do:

if (Tripwire.ENABLED)
        Tripwire.trip(getClass(), "{0} calling Sink.OfInt.accept(Integer)");
Since
1.8

Field Summary

Modifier and TypeField and Description
pack-priv static final boolean
ENABLED

Should debugging checks be enabled?

private static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
trip(Class<?>
Name of the class generating the message
trippingClass
,
String
A message format string of the type expected by PlatformLogger
msg
)

Produces a log warning, using PlatformLogger.getLogger(className), using the supplied message.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ENABLEDback to summary
pack-priv static final boolean ENABLED

Should debugging checks be enabled?

Annotations
@SuppressWarnings:removal
TRIPWIRE_PROPERTYback to summary
private static final String TRIPWIRE_PROPERTY

Constructor Detail

Tripwireback to summary
private Tripwire()

Method Detail

tripback to summary
pack-priv static void trip(Class<?> trippingClass, String msg)

Produces a log warning, using PlatformLogger.getLogger(className), using the supplied message. The class name of trippingClass will be used as the first parameter to the message.

Parameters
trippingClass:Class<?>

Name of the class generating the message

msg:String

A message format string of the type expected by PlatformLogger