Buggy code:
public class BiDiFlipper extends DefaultTreeVisitor implements CssCompilerPass { private final MutatingVisitController visitController ; boolean shouldSwapLeftRightInUrl ; boolean shouldSwapLtrRtlInUrl ; public BiDiFlipper ( MutatingVisitController visitController , boolean swapLtrRtlInUrl , boolean swapLeftRightInUrl ) { } private static final Map < String , String > EXACT_MATCHING_FOR_FLIPPING = new ImmutableMap . Builder < String , String > ( ) . put ( "ltr" , "rtl" ) . put ( "rtl" , "ltr" ) . put ( "left" , "right" ) . put ( "right" , "left" ) . build ( ) ; private static final Map < String , String > ENDS_WITH_MATCHING_FOR_FLIPPING = new ImmutableMap . Builder < String , String > ( ) . put ( "-left" , "-right" ) . put ( "-right" , "-left" ) . put ( "-bottomleft" , "-bottomright" ) . put ( "-topleft" , "-topright" ) . put ( "-bottomright" , "-bottomleft" ) . put ( "-topright" , "-topleft" ) . build ( ) ; private static final Map < String , String > CONTAINS_MATCHING_FOR_FLIPPING = new ImmutableMap . Builder < String , String > ( ) . put ( "-left-" , "-right-" ) . put ( "-right-" , "-left-" ) . build ( ) ; private static final Map < String , String > STARTS_WITH_MATCHING_FOR_FLIPPING = new ImmutableMap . Builder < String , String > ( ) . put ( "e-" , "w-" ) . put ( "se-" , "sw-" ) . put ( "ne-" , "nw-" ) . put ( "w-" , "e-" ) . put ( "sw-" , "se-" ) . put ( "nw-" , "ne-" ) . build ( ) ; private static final Set < String > PROPERTIES_WITH_FLIPPABLE_PERCENTAGE = ImmutableSet . of ( "background" ) ; private static final Map < Pattern , String > URL_LTRTL_PATTERN_FOR_FLIPPING = new ImmutableMap . Builder < Pattern , String > ( ) . put ( Pattern . compile ( "(?<![a-zA-Z])([-_\\.//]*)ltr([-_\\.//]+)" ) , "$1rtl$2" ) . put ( Pattern . compile ( "(?<![a-zA-Z])([-_\\.//]*)rtl([-_\\.//]+)" ) , "$1ltr$2" ) . build ( ) ; private static final Map < Pattern , String > URL_LEFTRIGHT_PATTERN_FOR_FLIPPING = new ImmutableMap . Builder < Pattern , String > ( ) . put ( Pattern . compile ( "(?<![a-zA-Z])([-_\\.//]*)left([-_\\.//]+)" ) , "$1right$2" ) . put ( Pattern . compile ( "(?<![a-zA-Z])([-_\\.//]*)right([-_\\.//]+)" ) , "$1left$2" ) . build ( ) ; private boolean isAutoOrInheritOrTransparent ( String value ) { } private boolean isCssHexColorNode ( CssValueNode valueNode ) { } private boolean isNumericNode ( CssValueNode valueNode ) { } private boolean isNumericAndHasPercentage ( CssValueNode value ) { } private boolean isNodeValidForPercentageFlipping ( CssPropertyNode propertyNode ) { } private CssValueNode flipPercentageValueNode ( CssValueNode valueNode ) { } private List < CssValueNode > flipFourNumericValues ( List < CssValueNode > valueNodes ) { } private String flipValue ( String value ) { } private < T extends CssValueNode > T flipNode ( T tNode ) { } private String flipUrlValue ( String value ) { } private CssValueNode flipUrlNode ( CssValueNode valueNode ) { if ( ! ( ( valueNode instanceof CssFunctionNode ) && ( "url" . equals ( ( ( CssFunctionNode ) ( valueNode ) ) . getFunctionName ( ) ) ) ) ) { return valueNode ; } CssFunctionNode oldFunctionNode = ( ( CssFunctionNode ) ( valueNode ) ) ; CssFunctionArgumentsNode functionArguments = oldFunctionNode . getArguments ( ) ; Preconditions . checkArgument ( ( 1 == ( functionArguments . numChildren ( ) ) ) , "url<seq2seq4repair_space>function<seq2seq4repair_space>taking<seq2seq4repair_space>more<seq2seq4repair_space>than<seq2seq4repair_space>one<seq2seq4repair_space>argument" ) ; CssValueNode oldArgument = functionArguments . getChildAt ( 0 ) ; String oldUrlValue = oldArgument . getValue ( ) ; String newUrlValue = flipUrlValue ( oldUrlValue ) ; <START_BUG> CssValueNode newArgument = new CssLiteralNode ( ( ( CssLiteralNode ) ( oldArgument ) ) ) ; <END_BUG> newArgument . setValue ( newUrlValue ) ; List < CssValueNode > newArgumentsList = new ArrayList < CssValueNode > ( ) ; newArgumentsList . add ( newArgument ) ; CssFunctionNode newFunctionNode = oldFunctionNode . deepCopy ( ) ; newFunctionNode . setArguments ( new CssFunctionArgumentsNode ( newArgumentsList ) ) ; return newFunctionNode ; } @ Override public boolean enterDeclaration ( CssDeclarationNode declarationNode ) { } @ Override public void runPass ( ) { } }

Fix:
CssValueNode newArgument = oldArgument . deepCopy ( ) ;