nus-yam/ex-repair huggingface dataset:
Buggy code:
public class JXPath extends Task { public static String PREFIX = "jxpath:" ; JXPath . JXPathPropertyHelper helper = new JXPath . JXPathPropertyHelper ( ) ; public JXPath ( ) { } public JXPathContext getJXPathContext ( ) { } public void execute ( ) { } static class JXPathPropertyHelper extends PropertyHelper { JXPathContext jxpathCtx ; public boolean setPropertyHook ( String ns , String name , Object v , boolean inh , boolean user , boolean isNew ) { } public Object getPropertyHook ( String ns , String name , boolean user ) { if ( ! ( name . startsWith ( JXPath . PREFIX ) ) ) { return super . getPropertyHook ( ns , name , user ) ; } name = name . substring ( JXPath . PREFIX . length ( ) ) ; String result = "" ; Iterator iter = jxpathCtx . iterate ( name ) ; <START_BUG> if ( iter == null ) { <END_BUG> return "null" ; } result += iter . next ( ) ; while ( iter . hasNext ( ) ) { Object o = iter . next ( ) ; result += ",<seq2seq4repair_space>" + o ; } return result ; } } public static class JXPathHashtableHandler implements DynamicPropertyHandler { private static final String [ ] STRING_ARRAY = new String [ 0 ] ; public String [ ] getPropertyNames ( Object object ) { } public Object getProperty ( Object object , String propertyName ) { } public void setProperty ( Object object , String propertyName , Object value ) { } } public class AntVariables implements Variables { protected AntVariables ( ) { } public void declareVariable ( String varName , Object value ) { } public Object getVariable ( String varName ) { } public boolean isDeclaredVariable ( String varName ) { } public void undeclareVariable ( String varName ) { } } }

Fix:
if ( ( iter == null ) || ( ! ( iter . hasNext ( ) ) ) ) {
Buggy code:
public abstract class PropPanelStateVertex extends PropPanelModelElement { protected static ImageIcon _stateIcon = ResourceLoader . lookupIconResource ( "State" ) ; protected static ImageIcon _actionStateIcon = ResourceLoader . lookupIconResource ( "ActionState" ) ; protected static ImageIcon _compositeStateIcon = ResourceLoader . lookupIconResource ( "CompositeState" ) ; protected static ImageIcon _simpleStateIcon = ResourceLoader . lookupIconResource ( "SimpleState" ) ; protected static ImageIcon _shallowHistoryIcon = ResourceLoader . lookupIconResource ( "ShallowHistory" ) ; protected static ImageIcon _deepHistoryIcon = ResourceLoader . lookupIconResource ( "DeepHistory" ) ; protected static ImageIcon _finalStateIcon = ResourceLoader . lookupIconResource ( "FinalState" ) ; protected static ImageIcon _initialIcon = ResourceLoader . lookupIconResource ( "Initial" ) ; protected static ImageIcon _forkIcon = ResourceLoader . lookupIconResource ( "Fork" ) ; protected static ImageIcon _joinIcon = ResourceLoader . lookupIconResource ( "Join" ) ; protected static ImageIcon _transitionIcon = ResourceLoader . lookupIconResource ( "Transition" ) ; protected JScrollPane incomingScroll ; protected JScrollPane outgoingScroll ; public PropPanelStateVertex ( String name , int columns ) { } public PropPanelStateVertex ( String name , ImageIcon icon , int columns ) { } public void navigateUp ( ) { } public MStateMachine getStateMachine ( ) { } public List getIncomings ( ) { } public List getOutgoings ( ) { } public void removeElement ( ) { Object target = getTarget ( ) ; if ( target instanceof MStateVertex ) { MStateVertex sv = ( ( MStateVertex ) ( target ) ) ; Object newTarget = sv . getContainer ( ) ; <START_BUG> UmlFactory . getFactory ( ) . getStateMachines ( ) . removeStateVertex ( sv ) ; <END_BUG> if ( newTarget != null ) { navigateTo ( newTarget ) ; } } } }

Fix:
sv . remove ( ) ;
Buggy code:
public class Reservation implements Booking { private final int ID ; private int vehicleID ; private Timestamp tStart ; private Timestamp tEnd ; private int customerID ; private boolean isMaintenance ; public Reservation ( int ID , int vehicleID , Timestamp tStart , Timestamp tEnd , int customerID ) { } public void updateObject ( int vehicleID , Timestamp tStart , Timestamp tEnd , int customerID ) { } public boolean isBooked ( Timestamp timestamp ) { <START_BUG> return ( timestamp . after ( tStart ) ) && ( timestamp . before ( tEnd ) ) ; <END_BUG> } public boolean isMaintenance ( ) { } public int getID ( ) { } public int getVehicleID ( ) { } public Timestamp getTStart ( ) { } public Timestamp getTEnd ( ) { } public int getCustomerID ( ) { } }

Fix:
return ( ( timestamp . equals ( tStart ) ) || ( timestamp . equals ( tEnd ) ) ) || ( ( timestamp . after ( tStart ) ) && ( timestamp . before ( tEnd ) ) ) ;
Buggy code:
public class FrequencyCalculator { public List < String > calcTokenFrequencyForAllDocs ( List < List < String > > engineeredDocuments ) { List < String > result = new ArrayList < > ( ) ; HashMap < String , Integer > tokenFrequencies = new HashMap < > ( ) ; for ( List < String > doc : engineeredDocuments ) { for ( String token : doc ) { if ( tokenFrequencies . containsKey ( token ) ) { tokenFrequencies . put ( token , ( ( tokenFrequencies . get ( token ) ) + 1 ) ) ; } else { tokenFrequencies . put ( token , 1 ) ; } } } List < Pair < String , Integer > > tokensWithFrequencies = new ArrayList < > ( ) ; for ( String token : tokenFrequencies . keySet ( ) ) { tokensWithFrequencies . add ( new Pair < String , Integer > ( token , tokenFrequencies . get ( token ) ) ) ; } Collections . sort ( tokensWithFrequencies , new Comparator < Pair < String , Integer > > ( ) { @ Override public int compare ( Pair < String , Integer > o1 , Pair < String , Integer > o2 ) { <START_BUG> return ( o1 . getSecond ( ) ) - ( o2 . getSecond ( ) ) ; <END_BUG> } } ) ; for ( Pair < String , Integer > tokenWithFreq : tokensWithFrequencies ) { result . add ( tokenWithFreq . getFirst ( ) ) ; } return result ; } public List < TreeMap < String , Double > > calcTokenFrequency ( List < List < String > > engineeredDocuments ) { } public List < TreeMap < String , Double > > calcTokenFrequencyForTest ( List < List < String > > engineeredDocuments ) { } }

Fix:
return ( o2 . getSecond ( ) ) - ( o1 . getSecond ( ) ) ;
Buggy code:
public abstract class PostingsBaseFormat { public final String name ; protected PostingsBaseFormat ( String name ) { } public abstract PostingsReaderBase postingsReaderBase ( SegmentReadState state ) throws IOException { } public abstract PostingsWriterBase postingsWriterBase ( SegmentWriteState state ) throws IOException { } <START_BUG> public abstract void files ( Directory dir , SegmentInfo segmentInfo , int codecID , Set < String > files ) throws IOException ; <END_BUG> }

Fix:
public abstract void files ( Directory dir , SegmentInfo segmentInfo , String segmentSuffix , Set < String > files ) throws IOException ;
Buggy code:
public class MessageDeleter implements Runnable { private final int minuteInMillis = 60000 ; @ Autowired MessageService MS ; public boolean executeCleaning ( ) { try { <START_BUG> Thread . sleep ( 10 ) ; <END_BUG> System . out . println ( "Deleting<seq2seq4repair_space>Started!" ) ; List < Message > messageList = MS . getAllMessages ( ) ; for ( Message vLookUp : messageList ) { Date deletionDate = new Date ( ( ( vLookUp . getDate ( ) . getTime ( ) ) + ( ( vLookUp . getTtl ( ) ) * ( minuteInMillis ) ) ) ) ; if ( deletionDate . after ( new Date ( ) ) ) { MS . delete ( vLookUp ) ; } } return true ; } catch ( InterruptedException ex ) { Logger . getLogger ( MessageDeleter . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; return false ; } } @ Override public void run ( ) { } }

Fix:
Thread . sleep ( 5000 ) ;
Buggy code:
public abstract class AbstractXtendXpandEditor extends TextEditor { private AbstractExtXptContentOutlinePage outlinePage = null ; private SearchActionGroup searchActionGroup ; private BreakpointActionGroup bpActionGroup ; @ Override public void doRevertToSaved ( ) { } @ Override public void doSave ( final IProgressMonitor aMonitor ) { } @ Override public void doSaveAs ( ) { } @ Override protected void editorContextMenuAboutToShow ( final IMenuManager menu ) { <START_BUG> menu . add ( new Separator ( "mwe" ) ) ; <END_BUG> super . editorContextMenuAboutToShow ( menu ) ; final ActionContext context = new ActionContext ( getSelectionProvider ( ) . getSelection ( ) ) ; searchActionGroup . setContext ( context ) ; searchActionGroup . fillContextMenu ( menu ) ; searchActionGroup . setContext ( null ) ; bpActionGroup . fillContextMenu ( menu ) ; } @ SuppressWarnings ( "unchecked" ) @ Override public Object getAdapter ( final Class aRequired ) { } protected abstract AbstractExtXptContentOutlinePage createOutlinePage ( ) { } @ Override protected void createActions ( ) { } @ Override protected void rulerContextMenuAboutToShow ( final IMenuManager menu ) { } public ISourceViewer internalGetSourceViewer ( ) { } }

Fix:
menu . add ( new Separator ( "Xpand" ) ) ;
Buggy code:
public class TrayItem extends Item { Tray parent ; String toolTipText ; int imageHandle ; int tooltipsHandle ; ImageList imageList ; public TrayItem ( Tray parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } protected void checkSubclass ( ) { } void createWidget ( int index ) { } void createHandle ( int index ) { state |= HANDLE ; handle = OS . gtk_plug_new ( 0 ) ; if ( ( handle ) == 0 ) error ( ERROR_NO_HANDLES ) ; imageHandle = OS . gtk_image_new ( ) ; if ( ( imageHandle ) == 0 ) error ( ERROR_NO_HANDLES ) ; OS . gtk_container_add ( handle , imageHandle ) ; OS . gtk_widget_show ( handle ) ; OS . gtk_widget_show ( imageHandle ) ; int id = OS . gtk_plug_get_id ( handle ) ; int monitor = 0 ; int screen = OS . gdk_screen_get_default ( ) ; if ( screen != 0 ) { monitor = OS . gdk_screen_get_number ( screen ) ; } byte [ ] trayBuffer = Converter . wcsToMbcs ( null , ( "_NET_SYSTEM_TRAY_S" + monitor ) , true ) ; int trayAtom = OS . gdk_atom_intern ( trayBuffer , true ) ; int xTrayAtom = OS . gdk_x11_atom_to_xatom ( trayAtom ) ; int xDisplay = OS . GDK_DISPLAY ( ) ; int trayWindow = OS . XGetSelectionOwner ( xDisplay , xTrayAtom ) ; byte [ ] messageBuffer = Converter . wcsToMbcs ( null , "_NET_SYSTEM_TRAY_OPCODE" , true ) ; int messageAtom = OS . gdk_atom_intern ( messageBuffer , true ) ; int xMessageAtom = OS . gdk_x11_atom_to_xatom ( messageAtom ) ; XClientMessageEvent event = new XClientMessageEvent ( ) ; event . type = OS . ClientMessage ; event . window = trayWindow ; event . message_type = xMessageAtom ; event . format = 32 ; event . data [ 0 ] = OS . GDK_CURRENT_TIME ; event . data [ 1 ] = OS . SYSTEM_TRAY_REQUEST_DOCK ; event . data [ 2 ] = id ; int clientEvent = OS . g_malloc ( sizeof ) ; OS . memmove ( clientEvent , event , sizeof ) ; <START_BUG> OS . XSendEvent ( OS . GDK_DISPLAY ( ) , trayWindow , false , NoEventMask , clientEvent ) ; <END_BUG> OS . g_free ( clientEvent ) ; } public String getToolTipText ( ) { } int gtk_button_press_event ( int widget , int eventPtr ) { } void hookEvents ( ) { } public boolean getVisible ( ) { } void releaseChild ( ) { } void releaseWidget ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setImage ( Image image ) { } public void setToolTipText ( String string ) { } public void setVisible ( boolean visible ) { } }

Fix:
OS . XSendEvent ( xDisplay , trayWindow , false , NoEventMask , clientEvent ) ;
Buggy code:
public class XSLTProcess extends MatchingTask { private File m_destDir ; private File m_baseDir ; private String m_xslFile ; private String m_targetExtension = ".html" ; private ArrayList m_params = new ArrayList ( ) ; private File m_inFile ; private File m_outFile ; private Path m_classpath ; private boolean m_stylesheetLoaded ; private boolean m_force ; private String m_outputtype ; private XSLTLiaison m_liaison ; private String m_processor ; public void setBasedir ( File dir ) { } public void setClasspath ( Path classpath ) throws TaskException { } public void setClasspathRef ( Reference r ) throws TaskException { } public void setDestdir ( File dir ) { } public void setExtension ( String name ) { } public void setForce ( boolean force ) { } public void setIn ( File inFile ) { } public void setOut ( File outFile ) { } public void setOutputtype ( String type ) { } public void setProcessor ( String processor ) { } public void setStyle ( String xslFile ) { } public Path createClasspath ( ) throws TaskException { if ( ( m_classpath ) == null ) { <START_BUG> m_classpath = new Path ( getProject ( ) ) ; <END_BUG> } return m_classpath . createPath ( ) ; } public XSLTParam createParam ( ) { } public void execute ( ) throws TaskException { } protected XSLTLiaison getLiaison ( ) throws TaskException { } protected void configureLiaison ( File stylesheet ) throws TaskException { } private void ensureDirectoryFor ( File targetFile ) throws TaskException { } private Class loadClass ( String classname ) throws Exception { } private void process ( File baseDir , String xmlFile , File destDir , File stylesheet ) throws TaskException { } private void process ( File inFile , File outFile , File stylesheet ) throws TaskException { } private void resolveProcessor ( String proc ) throws Exception { } }

Fix:
m_classpath = new Path ( ) ;
Buggy code:
public class PolicyParsing { private static final BigInteger BI_2_32 = BigInteger . ONE . shiftLeft ( 32 ) ; private static final BigInteger BI_2_16 = BigInteger . ONE . shiftLeft ( 16 ) ; private static final BigInteger BI_2_08 = BigInteger . ONE . shiftLeft ( 8 ) ; private static final BigInteger BI_2_04 = BigInteger . ONE . shiftLeft ( 4 ) ; private static final BigInteger BI_2_02 = BigInteger . ONE . shiftLeft ( 2 ) ; private static final boolean IS_GREATER = true ; private static final boolean IS_SMALLER = ! ( PolicyParsing . IS_GREATER ) ; public static String parsePolicy ( String input ) throws ParseException { try { <START_BUG> ASTStart policy = ParseTree . createParseTree ( input . replace ( "," , "." ) ) ; <END_BUG> return PolicyParsing . postFix ( policy ) ; } catch ( TokenMgrError e ) { throw new ParseException ( e . getMessage ( ) ) ; } } private static String postFix ( ASTStart root ) throws ParseException { } private static StringBuffer postFix_m ( Node current ) throws ParseException { } private static void handleAreaAttribute ( ASTAreaAttribute current , StringBuffer retVal ) throws ParseException { } private static void handleAttribute ( ASTAttribute current , StringBuffer retVal ) throws ParseException { } private static void handleNumericalAttribute ( ASTNumericalAttribute current , StringBuffer retVal ) throws ParseException { } private static void handleNumericalAttribute ( String name , boolean greaterThan , BigInteger number , StringBuffer retVal ) throws ParseException { } private static void handleOf ( ASTOf current , StringBuffer retVal ) { } private static void handleExpression ( ASTExpression current , StringBuffer retVal ) { } }

Fix:
ASTStart policy = ParseTree . createParseTree ( input ) ;
Buggy code:
public class P071 { public static void main ( String [ ] args ) { final int n = ( ( args . length ) > 0 ) ? Integer . parseInt ( args [ 0 ] ) : 1000000 ; int a = 1 ; int b = 2 ; int c = 3 ; int d = 7 ; int k = ( n + b ) // d ; int p = ( k * c ) - a ; int q = ( k * d ) - b ; <START_BUG> k = ( n + p ) // d ; <END_BUG> a = ( k * c ) - p ; b = ( k * d ) - q ; System . out . println ( ( ( ( ( ( ( ( ( ( ( ( ( "Found<seq2seq4repair_space>...,<seq2seq4repair_space>" + p ) + "//" ) + q ) + ",<seq2seq4repair_space>" ) + c ) + "//" ) + d ) + ",<seq2seq4repair_space>" ) + a ) + "//" ) + b ) + ",<seq2seq4repair_space>..." ) ) ; System . out . println ( ( ( ( "For<seq2seq4repair_space>d<seq2seq4repair_space>≤<seq2seq4repair_space>" + n ) + "<seq2seq4repair_space>the<seq2seq4repair_space>numerator<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>fraction<seq2seq4repair_space>immediately<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>left<seq2seq4repair_space>of<seq2seq4repair_space>3//7<seq2seq4repair_space>is<seq2seq4repair_space>" ) + p ) ) ; } }

Fix:
k = ( n + q ) // d ;
Buggy code:
public class MarkAsFlaggedAction extends FrameAction implements SelectionListener { public MarkAsFlaggedAction ( AbstractFrameController frameController ) { } public void actionPerformed ( ActionEvent evt ) { <START_BUG> FolderCommandReference [ ] r = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameController ( ) ) ) . getTableSelection ( ) ; <END_BUG> r [ 0 ] . setMarkVariant ( MARK_AS_FLAGGED ) ; MarkMessageCommand c = new MarkMessageCommand ( r ) ; processor . addOp ( c ) ; } public void selectionChanged ( SelectionChangedEvent e ) { } }

Fix:
FolderCommandReference [ ] r = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameMediator ( ) ) ) . getTableSelection ( ) ;
Buggy code:
public class NativeManagementRemoveHandler extends AbstractRemoveStepHandler { public static final NativeManagementRemoveHandler INSTANCE = new NativeManagementRemoveHandler ( ) ; private NativeManagementRemoveHandler ( ) { } @ Override protected void performRemove ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { <START_BUG> RbacSanityCheckOperation . registerOperation ( context ) ; <END_BUG> super . performRemove ( context , operation , model ) ; } @ Override protected boolean requiresRuntime ( OperationContext context ) { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override protected void recoverServices ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } }

Fix:
RbacSanityCheckOperation . addOperation ( context ) ;
Buggy code:
public class GameWindow { private JFrame window ; private GameCanvas gc ; public GameWindow ( String title , Dimension size ) { } public GameCanvas getCanvas ( ) { } public static void main ( String [ ] args ) throws IOException { GameWindow gw = new GameWindow ( "Simple<seq2seq4repair_space>test" , new Dimension ( 800 , 600 ) ) ; gw . gc . start ( ) ; File image = new File ( "res//art//tiles//basic-tiles.png" ) ; SquareSpriteLoader loader = new SquareSpriteLoader ( image , 64 ) ; BufferedImage [ ] graffix = new BufferedImage [ 4 ] ; for ( int i = 0 ; i < ( graffix . length ) ; ++ i ) { graffix [ i ] = loader . getImage ( i , 0 ) ; } <START_BUG> AnimatedTile at = new AnimatedTile ( 0 , 0 , 15 , graffix , 64 ) ; <END_BUG> Renderable atHolder = new DumbRenderer ( ) ; atHolder . setGraphicals ( at ) ; atHolder . setOffset ( 20 , 20 ) ; gw . gc . addRenderingTarget ( atHolder ) ; } }

Fix:
AnimatedTile at = new AnimatedTile ( 0 , 0 , 15 , graffix , 64 , false ) ;
Buggy code:
public class AttributeBasedSessionPassivationTestCase extends SessionPassivationAbstractCase { @ Deployment ( name = DEPLOYMENT_1 , managed = false , testable = false ) @ TargetsContainer ( CONTAINER_1 ) public static Archive < ? > deployment0 ( ) { } @ Deployment ( name = DEPLOYMENT_2 , managed = false , testable = false ) @ TargetsContainer ( CONTAINER_2 ) public static Archive < ? > deployment1 ( ) { } private static Archive < ? > createDeployment ( ) { WebArchive war = ShrinkWrap . create ( WebArchive . class , "passivating-attribute.war" ) ; war . addClass ( SimpleServlet . class ) ; war . setWebXML ( ClusteredWebSimpleTestCase . class . getPackage ( ) , "web.xml" ) ; war . addAsWebInfResource ( SessionPassivationAbstractCase . class . getPackage ( ) , "jboss-web_passivation_attribute.xml" , "jboss-web.xml" ) ; <START_BUG> System . out . println ( war . toString ( true ) ) ; <END_BUG> return war ; } }

Fix:
log . info ( war . toString ( true ) ) ;
Buggy code:
public class ItemMaterial extends Item implements ITTinkererItem { public static String [ ] names = new String [ ] { "ingot" , "gem" , "prism" } ; public EnumAura aura ; public int materialIndex ; public ItemMaterial ( EnumAura aura , int materialIndex ) { } public ItemMaterial ( ItemMaterial . MaterialPair materialPair ) { } public ItemMaterial ( ) { } public static ItemMaterial getItemFromSpecs ( ItemMaterial . MaterialPair pair ) { } @ Override public ArrayList < Object > getSpecialParameters ( ) { } @ Override public String getItemName ( ) { } @ Override public boolean shouldRegister ( ) { } @ Override public boolean shouldDisplayInTab ( ) { } @ Override public ThaumicTinkererRecipe getRecipeItem ( ) { if ( ( materialIndex ) == 1 ) { <START_BUG> PylonRecipeRegistry . registerRecipe ( new pixlepix . auracascade . data . recipe . PylonRecipe ( new ItemStack ( this ) , new PylonRecipeComponent ( new pixlepix . auracascade . data . AuraQuantity ( EnumAura . WHITE_AURA , 600000 ) , new ItemStack ( Items . diamond ) ) , new PylonRecipeComponent ( new pixlepix . auracascade . data . AuraQuantity ( EnumAura . WHITE_AURA , 50000 ) , new ItemStack ( ItemMaterial . getItemFromSpecs ( new ItemMaterial . MaterialPair ( aura , 0 ) ) ) ) , new PylonRecipeComponent ( new pixlepix . auracascade . data . AuraQuantity ( EnumAura . WHITE_AURA , 50000 ) , new ItemStack ( ItemMaterial . getItemFromSpecs ( new ItemMaterial . MaterialPair ( aura , 0 ) ) ) ) , new PylonRecipeComponent ( new pixlepix . auracascade . data . AuraQuantity ( EnumAura . WHITE_AURA , 50000 ) , new ItemStack ( ItemMaterial . getItemFromSpecs ( new ItemMaterial . MaterialPair ( aura , 0 ) ) ) ) ) ) ; <END_BUG> } return null ; } public static class MaterialPair { private final EnumAura aura ; private final int materialIndex ; public MaterialPair ( EnumAura aura , int materialIndex ) { } } }

Fix:
PylonRecipeRegistry . registerRecipe ( new pixlepix . auracascade . data . recipe . PylonRecipe ( new ItemStack ( this ) , new PylonRecipeComponent ( new pixlepix . auracascade . data . AuraQuantity ( EnumAura . WHITE_AURA , 60000 ) , new ItemStack ( Items . diamond ) ) , new PylonRecipeComponent ( new pixlepix . auracascade . data . AuraQuantity ( EnumAura . WHITE_AURA , 50000 ) , new ItemStack ( ItemMaterial . getItemFromSpecs ( new ItemMaterial . MaterialPair ( aura , 0 ) ) ) ) , new PylonRecipeComponent ( new pixlepix . auracascade . data . AuraQuantity ( EnumAura . WHITE_AURA , 50000 ) , new ItemStack ( ItemMaterial . getItemFromSpecs ( new ItemMaterial . MaterialPair ( aura , 0 ) ) ) ) , new PylonRecipeComponent ( new pixlepix . auracascade . data . AuraQuantity ( EnumAura . WHITE_AURA , 50000 ) , new ItemStack ( ItemMaterial . getItemFromSpecs ( new ItemMaterial . MaterialPair ( aura , 0 ) ) ) ) ) ) ;
Buggy code:
public class UndeployHandler extends CommandHandlerWithHelp { public UndeployHandler ( ) { } @ Override protected void handle ( CommandContext ctx , String args ) { ModelControllerClient client = ctx . getModelControllerClient ( ) ; if ( client == null ) { ctx . printLine ( "The<seq2seq4repair_space>controller<seq2seq4repair_space>client<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>available.<seq2seq4repair_space>Make<seq2seq4repair_space>sure<seq2seq4repair_space>you<seq2seq4repair_space>are<seq2seq4repair_space>connected<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>controller." ) ; return ; } if ( args == null ) { <START_BUG> ctx . printLine ( "The<seq2seq4repair_space>argument<seq2seq4repair_space>is<seq2seq4repair_space>missing." ) ; <END_BUG> return ; } DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder ( ) ; builder = new DefaultOperationRequestBuilder ( ) ; builder . setOperationName ( "undeploy" ) ; builder . addNode ( "deployment" , args ) ; ModelNode result ; try { ModelNode request = builder . buildRequest ( ) ; result = client . execute ( request ) ; } catch ( Exception e ) { ctx . printLine ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>undeploy:<seq2seq4repair_space>" + ( e . getLocalizedMessage ( ) ) ) ) ; return ; } if ( ! ( Util . isSuccess ( result ) ) ) { ctx . printLine ( ( "Undeploy<seq2seq4repair_space>failed:<seq2seq4repair_space>" + ( Util . getFailureDescription ( result ) ) ) ) ; return ; } builder = new DefaultOperationRequestBuilder ( ) ; builder . setOperationName ( "remove" ) ; builder . addNode ( "deployment" , args ) ; try { ModelNode request = builder . buildRequest ( ) ; result = client . execute ( request ) ; } catch ( Exception e ) { ctx . printLine ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>remove<seq2seq4repair_space>the<seq2seq4repair_space>deployment<seq2seq4repair_space>content<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>repository:<seq2seq4repair_space>" + ( e . getLocalizedMessage ( ) ) ) ) ; return ; } if ( ! ( Util . isSuccess ( result ) ) ) { ctx . printLine ( ( "Remove<seq2seq4repair_space>failed:<seq2seq4repair_space>" + ( Util . getFailureDescription ( result ) ) ) ) ; return ; } ctx . printLine ( ( ( "'" + args ) + "'<seq2seq4repair_space>undeployed<seq2seq4repair_space>successfully." ) ) ; } }

Fix:
ctx . printColumns ( Util . getDeployments ( client ) ) ;
Buggy code:
public class InstructionCodec extends JsonCodec < Instruction > { protected static final Logger log = LoggerFactory . getLogger ( InstructionCodec . class ) ; private void encodeL0 ( ObjectNode result , L0ModificationInstruction instruction ) { } private void encodeL2 ( ObjectNode result , L2ModificationInstruction instruction , CodecContext context ) { } private void encodeL3 ( ObjectNode result , L3ModificationInstruction instruction ) { } @ Override public ObjectNode encode ( Instruction instruction , CodecContext context ) { Preconditions . checkNotNull ( instruction , "Instruction<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; final ObjectNode result = context . mapper ( ) . createObjectNode ( ) . put ( "type" , instruction . type ( ) . toString ( ) ) ; switch ( instruction . type ( ) ) { case OUTPUT : final Instructions . OutputInstruction outputInstruction = ( ( Instructions . OutputInstruction ) ( instruction ) ) ; <START_BUG> result . put ( "portNumber" , outputInstruction . port ( ) . toLong ( ) ) ; <END_BUG> break ; case DROP : break ; case L0MODIFICATION : final L0ModificationInstruction l0ModificationInstruction = ( ( L0ModificationInstruction ) ( instruction ) ) ; encodeL0 ( result , l0ModificationInstruction ) ; break ; case L2MODIFICATION : final L2ModificationInstruction l2ModificationInstruction = ( ( L2ModificationInstruction ) ( instruction ) ) ; encodeL2 ( result , l2ModificationInstruction , context ) ; break ; case L3MODIFICATION : final L3ModificationInstruction l3ModificationInstruction = ( ( L3ModificationInstruction ) ( instruction ) ) ; encodeL3 ( result , l3ModificationInstruction ) ; default : InstructionCodec . log . info ( "Cannot<seq2seq4repair_space>convert<seq2seq4repair_space>instruction<seq2seq4repair_space>type<seq2seq4repair_space>of<seq2seq4repair_space>{}" , instruction . type ( ) ) ; break ; } return result ; } }

Fix:
result . put ( "port" , outputInstruction . port ( ) . toLong ( ) ) ;
Buggy code:
public final class ContextualReturn < T > { private static final Object NO_RESULT = new Object ( ) ; private final T value ; private final Context context ; private ContextualReturn ( Context context , T value ) { } public boolean hasValue ( ) { } public T getValue ( ) throws NoSuchElementException { } public Context getContext ( ) { } public static < T > ContextualReturn < T > of ( Context context , T result ) { } @ SuppressWarnings ( "unchecked" ) public static < T > ContextualReturn < T > empty ( Context context ) { <START_BUG> return new ContextualReturn < T > ( Context . empty ( ) , ( ( T ) ( ContextualReturn . NO_RESULT ) ) ) ; <END_BUG> } }

Fix:
return new ContextualReturn < T > ( context , ( ( T ) ( ContextualReturn . NO_RESULT ) ) ) ;
Buggy code:
public class UrlEncoder { public enum Type { QUERY , PATH , FULL_PATH ; } protected BitSet dontNeedEncoding ; private final char stopChar ; protected static final int caseDiff = 'a' - 'A' ; public static final UrlEncoder QUERY_INSTANCE = new UrlEncoder ( UrlEncoder . Type . QUERY , '' ) ; public static final UrlEncoder PATH_INSTANCE = new UrlEncoder ( UrlEncoder . Type . PATH , '' ) ; public static final UrlEncoder FULL_PATH_INSTANCE = new UrlEncoder ( UrlEncoder . Type . FULL_PATH , '?' ) ; protected UrlEncoder ( UrlEncoder . Type type , char stopChar ) { } public String encode ( String s , Charset enc ) { } public String encode ( String s , String enc ) { boolean needToChange = false ; <START_BUG> StringBuffer out = new StringBuffer ( s . length ( ) ) ; <END_BUG> Charset charset ; CharArrayWriter charArrayWriter = new CharArrayWriter ( ) ; if ( enc == null ) { throw new NullPointerException ( "charsetName" ) ; } try { charset = Charset . forName ( enc ) ; } catch ( IllegalCharsetNameException e ) { throw new RuntimeException ( new UnsupportedEncodingException ( enc ) ) ; } catch ( UnsupportedCharsetException e ) { throw new RuntimeException ( new UnsupportedEncodingException ( enc ) ) ; } boolean stopEncoding = false ; for ( int i = 0 ; i < ( s . length ( ) ) ; ) { int c = s . charAt ( i ) ; if ( ( stopEncoding == false ) && ( c == ( stopChar ) ) ) { stopEncoding = true ; } if ( ( stopEncoding == true ) || ( dontNeedEncoding . get ( c ) ) ) { if ( c == '<seq2seq4repair_space>' ) { c = '+' ; needToChange = true ; } out . append ( ( ( char ) ( c ) ) ) ; i ++ ; } else { do { charArrayWriter . write ( c ) ; if ( ( c >= 55296 ) && ( c <= 56319 ) ) { if ( ( i + 1 ) < ( s . length ( ) ) ) { int d = s . charAt ( ( i + 1 ) ) ; if ( ( d >= 56320 ) && ( d <= 57343 ) ) { charArrayWriter . write ( d ) ; i ++ ; } } } i ++ ; } while ( ( i < ( s . length ( ) ) ) && ( ! ( dontNeedEncoding . get ( ( c = s . charAt ( i ) ) ) ) ) ) ; charArrayWriter . flush ( ) ; String str = new String ( charArrayWriter . toCharArray ( ) ) ; byte [ ] ba = new byte [ 0 ] ; try { ba = str . getBytes ( charset . name ( ) ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } for ( int j = 0 ; j < ( ba . length ) ; j ++ ) { out . append ( '%' ) ; char ch = Character . forDigit ( ( ( ( ba [ j ] ) > > 4 ) & 15 ) , 16 ) ; if ( Character . isLetter ( ch ) ) { ch -= UrlEncoder . caseDiff ; } out . append ( ch ) ; ch = Character . forDigit ( ( ( ba [ j ] ) & 15 ) , 16 ) ; if ( Character . isLetter ( ch ) ) { ch -= UrlEncoder . caseDiff ; } out . append ( ch ) ; } charArrayWriter . reset ( ) ; needToChange = true ; } } return needToChange ? out . toString ( ) : s ; } }

Fix:
StringBuilder out = new StringBuilder ( s . length ( ) ) ;
Buggy code:
final class KMeansUtil { private static final Logger log = LoggerFactory . getLogger ( KMeansUtil . class ) ; private KMeansUtil ( ) { } public static void configureWithClusterInfo ( Configuration conf , Path clusterPath , Collection < Cluster > clusters ) { for ( Writable value : new org . apache . mahout . common . iterator . sequencefile . SequenceFileDirValueIterable < Writable > ( clusterPath , PathType . LIST , PathFilters . partFilter ( ) , conf ) ) { Class < ? extends Writable > valueClass = value . getClass ( ) ; if ( valueClass . equals ( ClusterWritable . class ) ) { ClusterWritable clusterWritable = ( ( ClusterWritable ) ( value ) ) ; value = clusterWritable . getValue ( ) ; valueClass = value . getClass ( ) ; } <START_BUG> KMeansUtil . log . info ( "Read<seq2seq4repair_space>1<seq2seq4repair_space>Cluster<seq2seq4repair_space>from<seq2seq4repair_space>{}" , clusterPath ) ; <END_BUG> if ( valueClass . equals ( Kluster . class ) ) { clusters . add ( ( ( Kluster ) ( value ) ) ) ; } else if ( valueClass . equals ( Canopy . class ) ) { Canopy canopy = ( ( Canopy ) ( value ) ) ; clusters . add ( new Kluster ( canopy . getCenter ( ) , canopy . getId ( ) , canopy . getMeasure ( ) ) ) ; } else { throw new IllegalStateException ( ( "Bad<seq2seq4repair_space>value<seq2seq4repair_space>class:<seq2seq4repair_space>" + valueClass ) ) ; } } } }

Fix:
KMeansUtil . log . debug ( "Read<seq2seq4repair_space>1<seq2seq4repair_space>Cluster<seq2seq4repair_space>from<seq2seq4repair_space>{}" , clusterPath ) ;
Buggy code:
public class ScopedComponentResolverTest extends WicketTestCase { public ScopedComponentResolverTest ( String name ) { } protected void setUp ( ) throws Exception { super . setUp ( ) ; <START_BUG> application . getPageSettings ( ) . addComponentResolver ( new ScopedComponentResolver ( ) ) ; <END_BUG> } public void testRenderHomePage ( ) throws Exception { } }

Fix:
application . getApplication ( ) . getPageSettings ( ) . addComponentResolver ( new ScopedComponentResolver ( ) ) ;
Buggy code:
public class ObjectUtils { public static final ObjectUtils . Null NULL = new ObjectUtils . Null ( ) ; public ObjectUtils ( ) { } public static < T > T defaultIfNull ( final T object , final T defaultValue ) { } public static < T > T firstNonNull ( final T ... values ) { } @ Deprecated public static boolean equals ( final Object object1 , final Object object2 ) { } public static boolean notEqual ( final Object object1 , final Object object2 ) { } @ Deprecated public static int hashCode ( final Object obj ) { } @ Override public String toString ( ) { } @ Deprecated public static int hashCodeMulti ( final Object ... objects ) { int hash = 1 ; if ( objects != null ) { for ( final Object object : objects ) { <START_BUG> int tmpHash = ObjectUtils . hashCode ( object ) ; <END_BUG> hash = ( hash * 31 ) + tmpHash ; } } return hash ; } public static String identityToString ( final Object object ) { } public static void identityToString ( final Appendable appendable , final Object object ) throws IOException { } public static void identityToString ( final StrBuilder builder , final Object object ) { } public static void identityToString ( final StringBuffer buffer , final Object object ) { } public static void identityToString ( final StringBuilder builder , final Object object ) { } @ Deprecated public static String toString ( final Object obj ) { } @ Deprecated public static String toString ( final Object obj , final String nullStr ) { } public static < T extends Comparable < ? super T > > T min ( final T ... values ) { } public static < T extends Comparable < ? super T > > T max ( final T ... values ) { } public static < T extends Comparable < ? super T > > int compare ( final T c1 , final T c2 ) { } public static < T extends Comparable < ? super T > > int compare ( final T c1 , final T c2 , final boolean nullGreater ) { } public static < T extends Comparable < ? super T > > T median ( final T ... items ) { } public static < T > T median ( final Comparator < T > comparator , final T ... items ) { } public static < T > T mode ( final T ... items ) { } public static < T > T clone ( final T obj ) { } public static < T > T cloneIfPossible ( final T obj ) { } public static class Null implements Serializable { private static final long serialVersionUID = 7092611880189329093L ; Null ( ) { } private Object readResolve ( ) { } } public static boolean CONST ( final boolean v ) { } public static byte CONST ( final byte v ) { } public static byte CONST_BYTE ( final int v ) throws IllegalArgumentException { } public static char CONST ( final char v ) { } public static short CONST ( final short v ) { } public static short CONST_SHORT ( final int v ) throws IllegalArgumentException { } public static int CONST ( final int v ) { } public static long CONST ( final long v ) { } public static float CONST ( final float v ) { } public static double CONST ( final double v ) { } public static < T > T CONST ( final T v ) { } }

Fix:
final int tmpHash = ObjectUtils . hashCode ( object ) ;
Buggy code:
public final class DirectoryDialoger { private static String lastJFCDirectory = null ; private static final JFileChooser jfc = new JFileChooser ( ) ; private DirectoryDialoger ( ) { } public static JFileChooser promptToOpenFile ( ) { if ( ( DirectoryDialoger . lastJFCDirectory ) == null ) { <START_BUG> String start = JMeterUtils . getPropDefault ( "user.dir" , "" ) ; <END_BUG> if ( ! ( start . equals ( "" ) ) ) { DirectoryDialoger . jfc . setCurrentDirectory ( new File ( start ) ) ; } } DirectoryDialoger . jfc . setFileSelectionMode ( JFileChooser . DIRECTORIES_ONLY ) ; int retVal = DirectoryDialoger . jfc . showDialog ( ReportGuiPackage . getInstance ( ) . getMainFrame ( ) , JMeterUtils . getResString ( "report_select" ) ) ; DirectoryDialoger . lastJFCDirectory = DirectoryDialoger . jfc . getCurrentDirectory ( ) . getAbsolutePath ( ) ; if ( retVal == ( JFileChooser . APPROVE_OPTION ) ) { return DirectoryDialoger . jfc ; } else { return null ; } } }

Fix:
String start = System . getProperty ( "user.dir" , "" ) ;
Buggy code:
public class Snippet173 { public static void main ( String [ ] args ) { Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; shell . setText ( "Main<seq2seq4repair_space>Window" ) ; shell . setLayout ( new FillLayout ( ) ) ; final Browser browser ; try { browser = new Browser ( shell , SWT . NONE ) ; } catch ( SWTError e ) { <START_BUG> System . out . println ( ( "Count<seq2seq4repair_space>not<seq2seq4repair_space>instantiate<seq2seq4repair_space>Browser:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; <END_BUG> return ; } Snippet173 . initialize ( display , browser ) ; shell . open ( ) ; browser . setUrl ( "http:////www.cnn.com" ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } static void initialize ( final Display display , Browser browser ) { } }

Fix:
System . out . println ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>instantiate<seq2seq4repair_space>Browser:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ;
Buggy code:
public abstract class AbstractBloodTestLoader { protected final int FIRST_COL ; protected final int LAST_COL ; protected final int HEADER_ROW ; protected static final String filepattern = ".*[0-9]+-[0-9]+\\.xlsx" ; protected static final String sheetpattern = "[0-9]+" ; protected ExcelHelper helper = new ExcelHelper ( ) ; protected final Map < String , String > conversions = Maps . newHashMap ( ) ; protected final ImportHelper importhelper = new ImportHelper ( ) ; public AbstractBloodTestLoader ( int first_col , int last_col , int header_row ) { } public void loadFolder ( String folder ) { } public void loadFile ( String filename ) { } public void loadSheet ( Sheet sheet ) { } protected abstract AbstractEntity createEntity ( ) { } protected abstract void save ( AbstractEntity bloodtest ) { } private void loadRow ( Sheet sheet , List < String > fields , int rownum , String idnum ) { List < String > values = getValues ( sheet , rownum ) ; AbstractEntity bloodtest = createEntity ( ) ; importhelper . setProperty ( bloodtest , "idnum" , idnum ) ; for ( int index = 0 ; index < ( fields . size ( ) ) ; index ++ ) { String field = fields . get ( index ) ; String value = values . get ( index ) ; if ( field . equals ( "日付" ) ) { if ( value . trim ( ) . equals ( "" ) ) <START_BUG> continue ; <END_BUG> value = fixDate ( value ) ; } importhelper . setProperty ( bloodtest , field , value ) ; } save ( bloodtest ) ; } protected String fixDate ( String value ) { } private List < String > getFields ( Sheet sheet ) { } private List < String > getValues ( Sheet sheet , int rownum ) { } private boolean filenameMatches ( String path ) { } private boolean sheetMatches ( Sheet sheet ) { } No newline ; at end ; of file ; }

Fix:
return ;
Buggy code:
public class AjcTaskCompileCommand implements ICommand { public static int COMPILE_SECONDS_WITHOUT_MESSAGES = 20 ; public static int COMPILE_MAX_SECONDS = 300 ; static boolean waitUntilMessagesQuiet ( IMessageHolder holder , int seconds , int timeoutSeconds ) { LangUtil . throwIaxIfNull ( holder , "holder" ) ; if ( ( ( 0 >= timeoutSeconds ) || ( 0 >= seconds ) ) || ( timeoutSeconds <= seconds ) ) { return false ; } long curTime = System . currentTimeMillis ( ) ; final long timeout = curTime + ( timeoutSeconds * 1000 ) ; final Thread thread = Thread . currentThread ( ) ; final long targetQuietTime = 1000 * seconds ; int numMessages = holder . numMessages ( null , true ) ; long numMessagesTime = curTime ; final long checkInterval ; { long interval = seconds // 10 ; if ( interval > 3000 ) { interval = 3000 ; } else if ( interval < 200 ) { interval = 500 ; } checkInterval = interval ; } while ( ( curTime < timeout ) && ( curTime < ( numMessagesTime + targetQuietTime ) ) ) { long nextCheck = curTime + checkInterval ; while ( nextCheck > curTime ) { try { <START_BUG> thread . sleep ( ( nextCheck - curTime ) ) ; <END_BUG> } catch ( InterruptedException e ) { } curTime = System . currentTimeMillis ( ) ; } int newNumMessages = holder . numMessages ( null , true ) ; if ( newNumMessages != numMessages ) { numMessages = newNumMessages ; numMessagesTime = curTime ; } } return curTime >= ( numMessagesTime + targetQuietTime ) ; } MessageHandler messages = new MessageHandler ( ) ; AjcTask ajcTask ; File incrementalFile ; Thread incrementalCompileThread ; public void quit ( ) { } public boolean runCommand ( String [ ] args , IMessageHandler handler ) { } public boolean repeatCommand ( IMessageHandler handler ) { } protected boolean doCommand ( IMessageHandler handler , boolean repeat ) { } protected boolean makeAjcTask ( String [ ] args , IMessageHandler handler ) { } protected boolean updateIncrementalFile ( boolean create , boolean delete ) { } }

Fix:
Thread . sleep ( ( nextCheck - curTime ) ) ;
Buggy code:
public class Header { private int id ; private boolean [ ] flags ; byte rcode ; byte opcode ; private short [ ] counts ; public Header ( int _id ) { } public Header ( ) { } public Header ( DataByteInputStream in ) throws IOException { } public void toWire ( DataByteOutputStream out ) throws IOException { } public byte [ ] toWire ( ) throws IOException { } public void setFlag ( int bit ) { } void setFlags ( boolean [ ] _flags ) { <START_BUG> flags = flags ; <END_BUG> } public void unsetFlag ( int bit ) { } public boolean getFlag ( int bit ) { } boolean [ ] getFlags ( ) { } public int getID ( ) { } public void setID ( int _id ) { } static short randomID ( ) { } public void setRcode ( byte value ) { } public byte getRcode ( ) { } public void setOpcode ( byte value ) { } public byte getOpcode ( ) { } public void setCount ( int field , int value ) { } public void incCount ( int field ) { } public void decCount ( int field ) { } public short getCount ( int field ) { } private void writeFlags ( DataByteOutputStream out ) throws IOException { } private void readFlags ( DataByteInputStream in ) throws IOException { } public String printFlags ( ) { } public String toString ( ) { } public Object clone ( ) { } }

Fix:
flags = _flags ;
Buggy code:
public class SubjectContainsSearchProvider extends AbstractMailSearchProvider implements ISearchProvider { public SubjectContainsSearchProvider ( ) { } public String getName ( ) { <START_BUG> return "Subject_Contains" ; <END_BUG> } public String getNamespace ( ) { } public ISearchCriteria getCriteria ( String searchTerm ) { } @ Override protected FilterCriteria createFilterCriteria ( String searchTerm ) { } }

Fix:
return "subject_contains" ;
Buggy code:
public class ModelCMPL extends Model { @ Override public boolean print ( String file , int i ) { try { PrintWriter out = new PrintWriter ( new FileWriter ( ( ( file + "-" ) + i ) ) ) ; String baseFile = "" ; Scanner sc = new Scanner ( this . getClass ( ) . getResourceAsStream ( ( "//" + ( Configuration . RUN_MODEL_CMPL ) ) ) ) ; while ( sc . hasNextLine ( ) ) baseFile += ( sc . nextLine ( ) ) + "\n" ; sc . close ( ) ; <START_BUG> out . print ( String . format ( baseFile , RUN_SOLVER_CMPL , RUN_RES_CMPL , ( ( ( Configuration . RUN_DATA_CMPL ) + "-" ) + i ) , CMPL_THREADS ) ) ; <END_BUG> out . flush ( ) ; out . close ( ) ; return true ; } catch ( Exception e ) { return false ; } } public static void print ( int datas ) { } }

Fix:
out . print ( String . format ( baseFile , RUN_SOLVER_CMPL , ( ( ( Configuration . RUN_RES_CMPL ) + "-" ) + i ) , ( ( ( Configuration . RUN_DATA_CMPL ) + "-" ) + i ) , CMPL_THREADS ) ) ;
Buggy code:
public class ScoutPitActivity extends ScoutingActivity { private PitScoutingFragment pitFragment ; private TeamDetailsView teamDetails ; private int teamNumber ; private String teamName ; private long teamID ; private static final int REQUEST_IMAGE_CAPTURE = 1 ; private File imageFilePath ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void setupActionBar ( ) { } public void scoutingComplete ( ) { pitFragment . writeContentsToBundle ( scoutingViewsState , ( ( ViewGroup ) ( pitFragment . getView ( ) ) ) ) ; if ( ! ( pitFragment . isComplete ( ) ) ) { Toast . makeText ( this , "Some<seq2seq4repair_space>required<seq2seq4repair_space>fields<seq2seq4repair_space>are<seq2seq4repair_space>blank!<seq2seq4repair_space>Please<seq2seq4repair_space>fill<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>fields<seq2seq4repair_space>highlighted<seq2seq4repair_space>in<seq2seq4repair_space>red." , LENGTH_LONG ) . show ( ) ; return ; } Bundle hierarchialBundle = JSONBundleTools . createHierarchicalBundle ( scoutingViewsState ) ; Log . d ( "Bundle" , hierarchialBundle . toString ( ) ) ; JSONObject scoringJson = JSONBundleTools . writeBundleToJSONObject ( hierarchialBundle ) ; JSONObject completeJson = new JSONObject ( ) ; try { completeJson . put ( "team_number" , teamNumber ) ; completeJson . put ( "team_name" , teamName ) ; SharedPreferences prefs = PreferenceManager . getDefaultSharedPreferences ( this ) ; String scouterName = prefs . getString ( SCOUTER_NAME , null ) ; completeJson . put ( "scouter_id" , scouterName ) ; completeJson . put ( "scoring" , scoringJson ) ; Log . d ( "bundle" , completeJson . toString ( 4 ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } try { PitData data = new PitData ( ) ; data . setTeamNumber ( teamNumber ) ; data . setContent ( completeJson . toString ( 4 ) ) ; DataManager . getInstance ( ) . saveChangedFile ( this , data ) ; Toast . makeText ( this , "Pit<seq2seq4repair_space>data<seq2seq4repair_space>saved<seq2seq4repair_space>successfully" , LENGTH_SHORT ) . show ( ) ; } catch ( Exception e ) { <START_BUG> Toast . makeText ( this , "Pit<seq2seq4repair_space>data<seq2seq4repair_space>saved<seq2seq4repair_space>successfullyError<seq2seq4repair_space>saving<seq2seq4repair_space>pit<seq2seq4repair_space>data" , LENGTH_SHORT ) . show ( ) ; <END_BUG> e . printStackTrace ( ) ; } this . finish ( ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private void takePicture ( ) throws IOException { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } }

Fix:
Toast . makeText ( this , "Error<seq2seq4repair_space>saving<seq2seq4repair_space>pit<seq2seq4repair_space>data" , LENGTH_SHORT ) . show ( ) ;