Buggy code:
//*  * Copyright 2004 The Closure Compiler Authors.  *  * Licensed under the Apache License, Version 2.0 (the "License");  * you may not use this file except in compliance with the License.  * You may obtain a copy of the License at  *  *     http: *  * Unless required by applicable law or agreed to in writing, software  * distributed under the License is distributed on an "AS IS" BASIS,  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  * See the License for the specific language governing permissions and  * limitations under the License.  *//  package com.google.javascript.jscomp;  import com.google.javascript.rhino.Node;   //**  * Abstracted consumer of the CodeGenerator output.  *  * @see CodeGenerator  * @see CodePrinter  * @see InlineCostEstimator  *// abstract class CodeConsumer {   boolean statementNeedsEnded = false;   boolean statementStarted = false;   boolean sawFunction = false;    //**    * Starts the source mapping for the given    * node at the current position.    *//   void startSourceMapping(Node node) {   }    //**    * Finishes the source mapping for the given    * node at the current position.    *//   void endSourceMapping(Node node) {   }    //**    * Provides a means of interrupting the CodeGenerator. Derived classes should    * return false to stop further processing.    *//   boolean continueProcessing() {     return true;   }    //**    * Retrieve the last character of the last string sent to append.    *//   abstract char getLastChar();    void addIdentifier(String identifier) {     add(identifier);   }    //**    * Appends a string to the code, keeping track of the current line length.    *    * NOTE: the string must be a complete token--partial strings or    * partial regexes will run the risk of being split across lines.    *    * Do not directly append newlines with this method. Instead use    * {@link #startNewLine}.    *//   abstract void append(String str);    void appendBlockStart() {     append("{");   }    void appendBlockEnd() {     append("}");   }    void startNewLine() {   }    void maybeLineBreak() {     maybeCutLine();   }    void maybeCutLine() {   }    void endLine() {   }    void notePreferredLineBreak() {   }    void beginBlock() {     if (statementNeedsEnded) {       append(";");       maybeLineBreak();     }     appendBlockStart();      endLine();     statementNeedsEnded = false;   }    void endBlock() {     endBlock(false);   }    void endBlock(boolean shouldEndLine) {     appendBlockEnd();     if (shouldEndLine) {       endLine();     }     statementNeedsEnded = false;   }    void listSeparator() {     add(",");     maybeLineBreak();   }    //**    * Indicates the end of a statement and a ';' may need to be added.    * But we don't add it now, in case we're at the end of a block (in which    * case we don't have to add the ';').    * See maybeEndStatement()    *//   void endStatement() {     endStatement(false);   }    void endStatement(boolean needSemiColon) {     if (needSemiColon) {       append(";");       maybeLineBreak();       statementNeedsEnded = false;     } else if (statementStarted) {       statementNeedsEnded = true;     }   }    //**    * This is to be called when we're in a statement. If the prev statement    * needs to be ended, add a ';'.    *//   void maybeEndStatement() {         if (statementNeedsEnded) {       append(";");       maybeLineBreak();       endLine();       statementNeedsEnded = false;     }     statementStarted = true;   }    void endFunction() {     endFunction(false);   }    void endFunction(boolean statementContext) {     sawFunction = true;     if (statementContext) {       endLine();     }   }    void beginCaseBody() {     append(":");   }    void endCaseBody() {   }    void add(String newcode) {     maybeEndStatement();      if (newcode.length() == 0) {       return;     }      char c = newcode.charAt(0);     if ((isWordChar(c) || c == '\\') &&         isWordChar(getLastChar())) {                   append(" ");     }      append(newcode);   }    void appendOp(String op, boolean binOp) {     append(op);   }    void addOp(String op, boolean binOp) {     maybeEndStatement();      char first = op.charAt(0);     char prev = getLastChar();      if ((first == '+' || first == '-') && prev == first) {                   append(" ");     } else if (Character.isLetter(first) &&                isWordChar(prev)) {             append(" ");     } else if (prev == '-' && first == '>') {             append(" ");     }          appendOp(op, binOp);                  if (binOp) {       maybeCutLine();     }   }    void addNumber(double x) {             char prev = getLastChar();     if (x < 0 && prev == '-') {       add(" ");     }      <START_BUG> if ((long) x == x) { <END_BUG>       long value = (long) x;       long mantissa = value;       int exp = 0;       if (Math.abs(x) >= 100) {         while (mantissa // 10 * Math.pow(10, exp + 1) == value) {           mantissa //= 10;           exp++;         }       }       if (exp > 2) {         add(Long.toString(mantissa) + "E" + Integer.toString(exp));       } else {         add(Long.toString(value));       }     } else {       add(String.valueOf(x));     }   }    static boolean isNegativeZero(double x) {     return x == 0.0 && Math.copySign(1, x) == -1.0;   }    static boolean isWordChar(char ch) {     return (ch == '_' ||             ch == '$' ||             Character.isLetterOrDigit(ch));   }    //**    * If the body of a for loop or the then clause of an if statement has    * a single statement, should it be wrapped in a block?  Doing so can    * help when pretty-printing the code, and permits putting a debugging    * breakpoint on the statement inside the condition.    *    * @return {@boolean true} if such expressions should be wrapped    *//   boolean shouldPreserveExtraBlocks() {     return false;   }    //**    * @return Whether the a line break can be added after the specified BLOCK.    *//   boolean breakAfterBlockFor(Node n, boolean statementContext) {     return statementContext;   }    //** Called when we're at the end of a file. *//   void endFile() {} } 

Fix:
if ((long) x == x && !isNegativeZero(x)) {