public static void restorePropertyAsNeeded ( final String propName , final String oldPropValue , final String newPropValue ) { java . security . AccessController . doPrivileged ( new java . security . PrivilegedAction < Object > ( ) { @ Override public Object run ( ) { if ( oldPropValue == null ) { System . clearProperty ( propName ) ; } else if ( ! oldPropValue . equalsIgnoreCase ( newPropValue ) ) { System . setProperty ( propName , oldPropValue ) ; } return null ; } } ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Restore property " + propName + " to previous value: " + oldPropValue ) ; }
This method restore the property value to the original value .