nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ZipProject extends AnAction { public void actionPerformed ( @ NotNull AnActionEvent e ) { final Project project = e . getProject ( ) ; assert project != null ; <START_BUG> final String projectRoot = ( project . getBasePath ( ) ) + "\\" ; <END_BUG> final String archiveName = Zipper . showArchiveNameInputDialog ( ) ; final String archivePath = ( projectRoot + archiveName ) + ( Zipper . FILE_EXTENSION ) ; try { ProgressManager . getInstance ( ) . runProcessWithProgressSynchronously ( new Runnable ( ) { @ Override public void run ( ) { ProgressManager . getInstance ( ) . getProgressIndicator ( ) . setIndeterminate ( true ) ; try { File dirObj = new File ( projectRoot ) ; ZipOutputStream out ; File temp ; try { temp = File . createTempFile ( archiveName , FILE_EXTENSION ) ; temp . deleteOnExit ( ) ; out = new ZipOutputStream ( new FileOutputStream ( temp ) ) ; Zipper . addDirectoryToZip ( dirObj , out , projectRoot ) ; out . close ( ) ; if ( temp . renameTo ( new File ( archivePath ) ) ) { Thread . sleep ( 50 ) ; VirtualFileManager . getInstance ( ) . asyncRefresh ( null ) ; } } catch ( IOException e1 ) { e1 . printStackTrace ( ) ; } catch ( InterruptedException e1 ) { e1 . printStackTrace ( ) ; } } catch ( Exception ignored ) { } } } , "Project<seq2seq4repair_space>is<seq2seq4repair_space>being<seq2seq4repair_space>packed" , false , project ) ; } catch ( Exception ignored ) { } } }

Fix:
final String projectRoot = ( project . getBasePath ( ) ) + ( File . separator ) ;
Buggy code:
public class Composite extends Scrollable { Layout layout ; Control [ ] tabList ; int layoutCount ; int backgroundMode ; Composite ( ) { } public Composite ( Composite parent , int style ) { } Control [ ] _getChildren ( ) { } Control [ ] _getTabList ( ) { } boolean acceptsFirstResponder ( int id , int sel ) { } int accessibilityAttributeNames ( int id , int sel ) { } boolean accessibilityIsIgnored ( int id , int sel ) { } public void changed ( Control [ ] changed ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } protected void checkSubclass ( ) { } Widget [ ] computeTabList ( ) { } void createHandle ( ) { } void drawBackground ( int id , NSGraphicsContext context , NSRect rect ) { } Composite findDeferredControl ( ) { } Menu [ ] findMenus ( Control control ) { } void fixChildren ( Shell newShell , Shell oldShell , Decorations newDecorations , Decorations oldDecorations , Menu [ ] menus ) { } void fixTabList ( Control control ) { } public int getBackgroundMode ( ) { } public Control [ ] getChildren ( ) { } public Layout getLayout ( ) { } public boolean getLayoutDeferred ( ) { } public Control [ ] getTabList ( ) { } boolean hooksKeys ( ) { } void invalidateChildrenVisibleRegion ( ) { } public boolean isLayoutDeferred ( ) { } boolean isOpaque ( int id , int sel ) { } boolean isTabGroup ( ) { } void keyDown ( int id , int sel , int theEvent ) { } public void layout ( ) { } public void layout ( boolean changed ) { } public void layout ( boolean changed , boolean all ) { } public void layout ( Control [ ] changed ) { } void markLayout ( boolean changed , boolean all ) { } Point minimumSize ( int wHint , int Hint , boolean changed ) { } boolean mouseEvent ( int id , int sel , int theEvent , int type ) { } void pageDown ( int id , int sel , int sender ) { } void pageUp ( int id , int sel , int sender ) { } void reflectScrolledClipView ( int id , int sel , int aClipView ) { } void releaseChildren ( boolean destroy ) { } void releaseWidget ( ) { } void removeControl ( Control control ) { if ( control . hasFocus ( ) ) <START_BUG> redraw ( ) ; <END_BUG> fixTabList ( control ) ; } void resized ( ) { } void scrollWheel ( int id , int sel , int theEvent ) { } public void setBackgroundMode ( int mode ) { } public boolean setFocus ( ) { } public void setLayout ( Layout layout ) { } public void setLayoutDeferred ( boolean defer ) { } boolean setScrollBarVisible ( ScrollBar bar , boolean visible ) { } boolean setTabGroupFocus ( ) { } public void setTabList ( Control [ ] tabList ) { } int traversalCode ( int key , NSEvent theEvent ) { } void updateBackgroundMode ( ) { } void updateCursorRects ( boolean enabled ) { } void updateLayout ( boolean all ) { } }

Fix:
redrawWidget ( view , true ) ;
Buggy code:
public class JavaInterpreter { private static final String START_BRACE = "{" ; private static final String END_BRACE = "}" ; private static final String START_PAREN = "(" ; private static final String END_PAREN = ")" ; private static final List < String > SYMBOLS = new ArrayList < String > ( ) { } ; public static void main ( String [ ] args ) throws Exception { } public void go ( ) throws Exception { } private JavaAction parseInput ( String nextInput ) { } private void compileAndEvaluateJavaAction ( JavaAction createdAction ) throws Exception { InterpreterSuperClass superClass = JavaInterpreterCompiler . getInstance ( ) . compile ( createdAction , true ) ; if ( superClass != null ) { <START_BUG> System . out . println ( ( ( superClass . evaluate ( ) ) + "\n\n" ) ) ; <END_BUG> } } }

Fix:
System . out . println ( ( ( superClass . evaluate ( ) ) + "\n" ) ) ;
Buggy code:
public class PerCflow extends PerClause { private boolean isBelow ; private Pointcut entry ; public PerCflow ( Pointcut entry , boolean isBelow ) { } public FuzzyBoolean match ( Shadow shadow ) { } public void resolveBindings ( IScope scope , Bindings bindings ) { } public Test findResidue ( Shadow shadow , ExposedState state ) { } public PerClause concretize ( ResolvedTypeX inAspect ) { PerCflow ret = new PerCflow ( entry , isBelow ) ; ret . inAspect = inAspect ; if ( inAspect . isAbstract ( ) ) return ret ; Member cflowStackField = new ResolvedMember ( Member . FIELD , inAspect , ( ( ( Modifier . STATIC ) | ( Modifier . PUBLIC ) ) | ( Modifier . FINAL ) ) , TypeX . forName ( CFLOW_STACK_TYPE ) , NameMangler . PERCFLOW_FIELD_NAME , TypeX . NONE ) ; World world = inAspect . getWorld ( ) ; CrosscuttingMembers xcut = inAspect . crosscuttingMembers ; Collection previousCflowEntries = xcut . getCflowEntries ( ) ; <START_BUG> Pointcut concreteEntry = entry . concretize ( inAspect , EMPTY ) ; <END_BUG> List innerCflowEntries = new ArrayList ( xcut . getCflowEntries ( ) ) ; innerCflowEntries . removeAll ( previousCflowEntries ) ; xcut . addConcreteShadowMunger ( Advice . makePerCflowEntry ( world , concreteEntry , isBelow , cflowStackField , inAspect , innerCflowEntries ) ) ; return ret ; } public void write ( DataOutputStream s ) throws IOException { } public static PerClause readPerClause ( DataInputStream s , ISourceContext context ) throws IOException { } public Kind getKind ( ) { } public String toString ( ) { } }

Fix:
Pointcut concreteEntry = entry . concretize ( inAspect , 0 , null ) ;
Buggy code:
public class JMeterTreeListener implements KeyListener , MouseListener , TreeSelectionListener { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private TreePath currentPath ; private ActionListener actionHandler ; private JMeterTreeModel model ; private JTree tree ; public JMeterTreeListener ( JMeterTreeModel model ) { } public JMeterTreeListener ( ) { } public void setModel ( JMeterTreeModel m ) { } public void setActionHandler ( ActionListener ah ) { } public void setJTree ( JTree tree ) { } public void setEndWindow ( Container window ) { } public JTree getJTree ( ) { } public JMeterTreeNode getCurrentNode ( ) { } public JMeterTreeNode [ ] getSelectedNodes ( ) { } public TreePath removedSelectedNode ( ) { } @ Override public void valueChanged ( TreeSelectionEvent e ) { JMeterTreeListener . log . debug ( "value<seq2seq4repair_space>changed,<seq2seq4repair_space>updating<seq2seq4repair_space>currentPath" ) ; currentPath = e . getNewLeadSelectionPath ( ) ; <START_BUG> actionHandler . actionPerformed ( new ActionEvent ( this , 3333 , "edit" ) ) ; <END_BUG> } @ Override public void mouseClicked ( MouseEvent ev ) { } @ Override public void mouseReleased ( MouseEvent e ) { } @ Override public void mouseEntered ( MouseEvent e ) { } @ Override public void mousePressed ( MouseEvent e ) { } @ Override public void mouseExited ( MouseEvent ev ) { } @ Override public void keyPressed ( KeyEvent e ) { } @ Override public void keyReleased ( KeyEvent e ) { } @ Override public void keyTyped ( KeyEvent e ) { } private boolean isRightClick ( MouseEvent e ) { } private void displayPopUp ( MouseEvent e ) { } }

Fix:
actionHandler . actionPerformed ( new ActionEvent ( this , 3333 , ActionNames . EDIT ) ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class JBossASManagedInContainerTestCase { @ Deployment public static JavaArchive createDeployment ( ) throws Exception { } @ Test public void testDeployedService ( ) throws Exception { MBeanServerConnection mbeanServer = getMBeanServer ( ) ; ObjectName objectName = new ObjectName ( "jboss:name=test,type=config" ) ; waitForMbean ( mbeanServer , objectName ) ; <START_BUG> Object o = mbeanServer . getAttribute ( objectName , "IntervalSeconds" ) ; <END_BUG> mbeanServer . setAttribute ( objectName , new Attribute ( "IntervalSeconds" , 2 ) ) ; } protected MBeanServerConnection getMBeanServer ( ) throws Exception { } protected void waitForMbean ( MBeanServerConnection mbeanServer , ObjectName name ) throws Exception { } }

Fix:
mbeanServer . getAttribute ( objectName , "IntervalSeconds" ) ;
Buggy code:
public class IgnoredClassRunner extends Runner { private final Class < ? > fTestClass ; public IgnoredClassRunner ( Class < ? > testClass ) { } @ Override public void run ( RunNotifier notifier ) { notifier . fireTestIgnored ( getDescription ( ) ) ; <START_BUG> notifier . fireTestIgnoredReason ( getDescription ( ) , new org . junit . Assume . AssumptionViolatedException ( fTestClass . getAnnotation ( Ignore . class ) . value ( ) ) ) ; <END_BUG> } @ Override public Description getDescription ( ) { } }

Fix:
notifier . fireTestAssumptionFailed ( getDescription ( ) , new org . junit . Assume . AssumptionViolatedException ( fTestClass . getAnnotation ( Ignore . class ) . value ( ) ) ) ;
Buggy code:
public class DayDV extends AbstractDateTimeDV { private static final int DAY_SIZE = 5 ; public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { } protected DateTimeData parse ( String str ) throws SchemaDateTimeException { } protected String dateToString ( DateTimeData date ) { } protected XMLGregorianCalendar getXMLGregorianCalendar ( DateTimeData date ) { <START_BUG> return factory . newXMLGregorianCalendar ( DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , date . unNormDay , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , ( date . hasTimeZone ( ) ? ( ( date . timezoneHr ) * 60 ) + ( date . timezoneMin ) : DatatypeConstants . FIELD_UNDEFINED ) ) ; <END_BUG> } }

Fix:
return datatypeFactory . newXMLGregorianCalendar ( DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , date . unNormDay , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , ( date . hasTimeZone ( ) ? ( ( date . timezoneHr ) * 60 ) + ( date . timezoneMin ) : DatatypeConstants . FIELD_UNDEFINED ) ) ;
Buggy code:
public class PlayerBackground extends Background { private static final long serialVersionUID = 5665319881433223605L ; public PlayerBackground ( ) { } private EnumMap < BruceScore , Double > bruceGainRate ; private TreeSet < String > jobBlacklist ; private String backgroundRival ; public PlayerBackground ( NameTag nameTag , EnumMap < BruceScore , Double > bruceGainRate , TreeSet < String > jobBlacklist , String backgroundRival ) { } public int getScoreGain ( BruceScore score , int level ) { } public boolean isCompatibleJob ( PlayerJob job ) { } public boolean hasCompatibleBackground ( PlayerActor actor ) { <START_BUG> return ( backgroundRival ) != ( actor . getBackgroundName ( ) ) ; <END_BUG> } }

Fix:
return ! ( backgroundRival . equals ( actor . getBackgroundName ( ) ) ) ;
Buggy code:
@ Repository @ Scope ( "request" ) public class MenuDao extends BaseDao { public void createMenu ( Menu menu ) { } public List < Map < String , Object > > getMenus ( Long ownerID ) { <START_BUG> String sql = "SELECT<seq2seq4repair_space>menus.id<seq2seq4repair_space>as<seq2seq4repair_space>id,menus.name<seq2seq4repair_space>as<seq2seq4repair_space>name<seq2seq4repair_space>,menus.ownerID<seq2seq4repair_space>as<seq2seq4repair_space>ownerID,menus.likes<seq2seq4repair_space>as<seq2seq4repair_space>likes,menuRecipe.recipeID<seq2seq4repair_space>as<seq2seq4repair_space>recipeID<seq2seq4repair_space>FROM<seq2seq4repair_space>menus<seq2seq4repair_space>INNER<seq2seq4repair_space>JOIN<seq2seq4repair_space>menuRecipe<seq2seq4repair_space>ON<seq2seq4repair_space>menus.id<seq2seq4repair_space>=<seq2seq4repair_space>menuRecipe.menuID<seq2seq4repair_space>WHERE<seq2seq4repair_space>ownerID=?<seq2seq4repair_space>AND<seq2seq4repair_space>menus.isDeleted=0" ; <END_BUG> return this . jdbcTemplate . queryForList ( sql , ownerID ) ; } }

Fix:
String sql = "SELECT<seq2seq4repair_space>menus.id,menus.name,menus.ownerID,menus.likes,menuRecipe.recipeID<seq2seq4repair_space>FROM<seq2seq4repair_space>menus<seq2seq4repair_space>INNER<seq2seq4repair_space>JOIN<seq2seq4repair_space>menuRecipe<seq2seq4repair_space>ON<seq2seq4repair_space>menus.id<seq2seq4repair_space>=<seq2seq4repair_space>menuRecipe.menuID<seq2seq4repair_space>WHERE<seq2seq4repair_space>ownerID=?<seq2seq4repair_space>AND<seq2seq4repair_space>NOT<seq2seq4repair_space>menus.isDeleted" ;
Buggy code:
public class FieldInfo extends ClassFileStruct implements Comparable , AttributeNamesConstants , IBinaryField , TypeIds { private Constant constant ; private boolean isDeprecated ; private boolean isSynthetic ; private int [ ] constantPoolOffsets ; private int accessFlags ; private char [ ] name ; private char [ ] signature ; private int attributeBytes ; private Object wrappedConstantValue ; public FieldInfo ( byte [ ] classFileBytes , int [ ] offsets , int offset ) { } public Constant getConstant ( ) { } public int getModifiers ( ) { } public char [ ] getName ( ) { } public char [ ] getTypeName ( ) { } public Object getWrappedConstantValue ( ) { if ( ( this . wrappedConstantValue ) == null ) { if ( hasConstant ( ) ) { Constant fieldConstant = getConstant ( ) ; switch ( fieldConstant . typeID ( ) ) { case TypeIds . T_int : this . wrappedConstantValue = new Integer ( fieldConstant . intValue ( ) ) ; break ; case TypeIds . T_byte : this . wrappedConstantValue = new Byte ( fieldConstant . byteValue ( ) ) ; break ; case TypeIds . T_short : this . wrappedConstantValue = new Short ( fieldConstant . shortValue ( ) ) ; break ; case TypeIds . T_char : this . wrappedConstantValue = new Character ( fieldConstant . charValue ( ) ) ; break ; case TypeIds . T_float : this . wrappedConstantValue = new Float ( fieldConstant . floatValue ( ) ) ; break ; case TypeIds . T_double : this . wrappedConstantValue = new Double ( fieldConstant . doubleValue ( ) ) ; break ; case TypeIds . T_boolean : <START_BUG> this . wrappedConstantValue = Boolean . valueOf ( fieldConstant . booleanValue ( ) ) ; <END_BUG> break ; case TypeIds . T_long : this . wrappedConstantValue = new Long ( fieldConstant . longValue ( ) ) ; break ; case T_String : this . wrappedConstantValue = fieldConstant . stringValue ( ) ; } } } return this . wrappedConstantValue ; } public boolean hasConstant ( ) { } public boolean isSynthetic ( ) { } private void readConstantAttribute ( ) { } private void readDeprecatedAndSyntheticAttributes ( ) { } public int sizeInBytes ( ) { } public void throwFormatException ( ) throws ClassFormatException { } public String toString ( ) { } public int compareTo ( Object o ) { } void initialize ( ) { } protected void reset ( ) { } }

Fix:
this . wrappedConstantValue = org . eclipse . jdt . internal . compiler . util . Util . valueOf ( fieldConstant . booleanValue ( ) ) ;
Buggy code:
public class SingletonComponent extends SessionBeanComponent implements LockableComponent { private static final Logger logger = Logger . getLogger ( SingletonComponent . class ) ; private volatile SingletonComponentInstance singletonComponentInstance ; private final boolean initOnStartup ; private final Map < String , LockType > beanLevelLockType ; private final Map < EJBBusinessMethod , LockType > methodLockTypes ; private final Map < EJBBusinessMethod , AccessTimeoutDetails > methodAccessTimeouts ; private final List < ServiceName > dependsOn ; public SingletonComponent ( final SingletonComponentCreateService singletonComponentCreateService , final List < ServiceName > dependsOn ) { } @ Override protected BasicComponentInstance instantiateComponentInstance ( AtomicReference < ManagedReference > instanceReference , Interceptor preDestroyInterceptor , Map < Method , Interceptor > methodInterceptors , final InterceptorFactoryContext interceptorContext ) { } public SingletonComponentInstance getComponentInstance ( ) { } @ Override public void start ( ) { } @ Override public void stop ( final StopContext stopContext ) { } @ Override public LockType getLockType ( Method method ) { } @ Override public AccessTimeoutDetails getAccessTimeout ( Method method ) { final EJBBusinessMethod ejbMethod = new EJBBusinessMethod ( method ) ; final AccessTimeoutDetails accessTimeout = this . methodAccessTimeouts . get ( ejbMethod ) ; if ( accessTimeout != null ) { return accessTimeout ; } final AccessTimeoutDetails beanTimeout = this . beanLevelAccessTimeout . get ( method . getDeclaringClass ( ) . getName ( ) ) ; if ( beanTimeout != null ) { return beanTimeout ; } <START_BUG> return new AccessTimeoutDetails ( 5 , TimeUnit . MINUTES ) ; <END_BUG> } @ Override public AccessTimeoutDetails getDefaultAccessTimeout ( ) { } private synchronized void destroySingletonInstance ( ) { } @ Override public TimedObjectInvoker getTimedObjectInvoker ( ) { } }

Fix:
return getDefaultAccessTimeout ( ) ;
Buggy code:
public class AllocationExpression extends Expression implements InvocationSite { public TypeReference type ; public Expression [ ] arguments ; public MethodBinding binding ; MethodBinding syntheticAccessor ; public AllocationExpression ( ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public Expression enclosingInstance ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public boolean isSuperAccess ( ) { } public boolean isTypeAccess ( ) { } public void manageEnclosingInstanceAccessIfNecessary ( BlockScope currentScope ) { } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope ) { if ( ( binding . isPrivate ( ) ) && ( ( currentScope . enclosingSourceType ( ) ) != ( binding . declaringClass ) ) ) { if ( currentScope . environment ( ) . options . isPrivateConstructorAccessChangingVisibility ) { binding . tagForClearingPrivateModifier ( ) ; } else { <START_BUG> syntheticAccessor = ( ( SourceTypeBinding ) ( binding . declaringClass ) ) . addSyntheticMethod ( binding ) ; <END_BUG> currentScope . problemReporter ( ) . needToEmulateMethodAccess ( binding , this ) ; } } } public TypeBinding resolveType ( BlockScope scope ) { } public void setActualReceiverType ( ReferenceBinding receiverType ) { } public void setDepth ( int i ) { } public void setFieldIndex ( int i ) { } public String toStringExpression ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope scope ) { } }

Fix:
syntheticAccessor = ( ( SourceTypeBinding ) ( binding . declaringClass ) ) . addSyntheticMethod ( binding , isSuperAccess ( ) ) ;
Buggy code:
public class OpenHrisUtilities { public boolean checkInputIfDouble ( String num ) { } public double convertStringToDouble ( String num ) { } public int convertStringToInteger ( String num ) { } public double formatNumValueWithComma ( double val ) { } public String convertDateFormat ( String date ) { } public String convertDateFormatWithTime ( String date ) { } public String convertDateFormatYearMonth ( String date ) { } public static String convertDateFormatForCalendar ( String date ) { } public int convertBooleanValueToInt ( String value ) { } public String removeCommaFromString ( String val ) { } public Date parsingDate ( String date ) { } public Date parsingDateWithTime ( String str ) { } public boolean convertStringToBoolean ( String string ) { } public Boolean checkInputIfInteger ( String num ) { } public Date parseDateWithDifferentFormat ( String date ) throws ParseException { } public double roundOffToTwoDecimalPlaces ( double amount ) { } public boolean checkForDuplicatedBranch ( String str ) { boolean result = false ; <START_BUG> if ( ( ( ( ( ( str . equals ( "boracay" ) ) || ( str . equals ( "head<seq2seq4repair_space>office" ) ) ) || ( str . equals ( "eastwood" ) ) ) || ( str . equals ( "baguio" ) ) ) || ( str . equals ( "fairview" ) ) ) || ( str . equals ( "sta.<seq2seq4repair_space>lucia" ) ) ) { <END_BUG> result = true ; } return result ; } }

Fix:
if ( ( ( ( ( ( ( str . equals ( "boracay" ) ) || ( str . equals ( "head<seq2seq4repair_space>office" ) ) ) || ( str . equals ( "eastwood" ) ) ) || ( str . equals ( "baguio" ) ) ) || ( str . equals ( "fairview" ) ) ) || ( str . equals ( "sta.<seq2seq4repair_space>lucia" ) ) ) || ( str . equals ( "on-call<seq2seq4repair_space>and<seq2seq4repair_space>trainees" ) ) ) {
Buggy code:
public class StormConfigUtil { private StormConfigUtil ( ) { } public static String getStringValue ( Config stormConf , String key , String defaultValue ) { } public static int getIntValue ( Config stormConf , String key , int defaultValue ) { Object config = stormConf . get ( key ) ; if ( config == null ) { return defaultValue ; } <START_BUG> return Integer . valueOf ( config . toString ( ) ) ; <END_BUG> } @ SuppressWarnings ( "unchecked" ) public static List < String > getStringListValue ( Config stormConf , String key ) { } @ SuppressWarnings ( { "rawtypes" } ) public static Map getMapValue ( Config stormConf , String key ) { } }

Fix:
return Integer . parseInt ( config . toString ( ) ) ;
Buggy code:
public class PlayingState extends NiftyOverlayBasicGameState { private int lastDelta ; @ Override public int getID ( ) { } @ Override protected void initGameAndGUI ( GameContainer container , StateBasedGame game ) throws SlickException { } @ Override protected void prepareNifty ( Nifty nifty , StateBasedGame game ) { <START_BUG> nifty . fromXml ( "illarion//client//gui//xml//gamescreen.xml" , "gamescreen" ) ; <END_BUG> } @ Override protected void renderGame ( GameContainer container , StateBasedGame game , Graphics g ) throws SlickException { } @ Override protected void updateGame ( GameContainer container , StateBasedGame game , int delta ) throws SlickException { } @ Override protected void enterState ( GameContainer container , StateBasedGame game ) throws SlickException { } @ Override protected void leaveState ( GameContainer container , StateBasedGame game ) throws SlickException { } }

Fix:
nifty . fromXmlWithoutStartScreen ( "illarion//client//gui//xml//gamescreen.xml" ) ;
Buggy code:
public class Mapper extends DataType implements Cloneable { protected Mapper . MapperType type = null ; protected String classname = null ; protected Path classpath = null ; protected String from = null ; protected String to = null ; public Mapper ( Project p ) { } public void setClassname ( String classname ) { } public void setClasspath ( Path classpath ) { } public void setClasspathRef ( Reference r ) { } public void setFrom ( String from ) { } public void setRefid ( Reference r ) throws BuildException { } public void setTo ( String to ) { } public void setType ( Mapper . MapperType type ) { } public FileNameMapper getImplementation ( ) throws BuildException { if ( isReference ( ) ) { return getRef ( ) . getImplementation ( ) ; } if ( ( ( type ) == null ) && ( ( classname ) == null ) ) { throw new BuildException ( "one<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>attributes<seq2seq4repair_space>type<seq2seq4repair_space>or<seq2seq4repair_space>classname<seq2seq4repair_space>is<seq2seq4repair_space>required" ) ; } if ( ( ( type ) != null ) && ( ( classname ) != null ) ) { throw new BuildException ( "must<seq2seq4repair_space>not<seq2seq4repair_space>specify<seq2seq4repair_space>both<seq2seq4repair_space>type<seq2seq4repair_space>and<seq2seq4repair_space>classname<seq2seq4repair_space>attribute" ) ; } try { if ( ( type ) != null ) { classname = type . getImplementation ( ) ; } Class c = null ; if ( ( classpath ) == null ) { c = Class . forName ( classname ) ; } else { AntClassLoader al = new AntClassLoader ( getProject ( ) , classpath ) ; c = al . loadClass ( classname ) ; AntClassLoader . initializeClass ( c ) ; } FileNameMapper m = ( ( FileNameMapper ) ( c . newInstance ( ) ) ) ; m . setFrom ( from ) ; m . setTo ( to ) ; return m ; } catch ( BuildException be ) { throw be ; } catch ( Throwable t ) { <START_BUG> throw new BuildException ( t ) ; <END_BUG> } finally { if ( ( type ) != null ) { classname = null ; } } } public Path createClasspath ( ) { } protected Mapper getRef ( ) { } public static class MapperType extends EnumeratedAttribute { private Properties implementations ; public MapperType ( ) { } public String getImplementation ( ) { return implementations . getProperty ( getValue ( ) ) ; } public String [ ] getValues ( ) { } } }

Fix:
throw new BuildException ( "Error" , t ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class Visualizer extends PApplet { private NodeSetManager mngr ; private float xCenter = 0.0F ; private float yCenter = 0.0F ; private float xSize = 1.0F ; private float ySize = 1.0F ; private HashSet < GraphNode > toRender ; public void setup ( ) { } public void draw ( ) { clear ( ) ; toRender = mngr . getRenderableNodes ( this . xCenter , this . yCenter , this . xSize , this . ySize ) ; System . out . println ( ( ( ( ( ( "drawing<seq2seq4repair_space>" + ( toRender . size ( ) ) ) + "<seq2seq4repair_space>nodes<seq2seq4repair_space>at<seq2seq4repair_space>" ) + ( xCenter ) ) + "," ) + ( yCenter ) ) ) ; for ( GraphNode x : toRender ) { ellipse ( ( ( ( ( x . getxPos ( ) ) - ( xCenter ) ) // ( xSize ) ) * ( width ) ) , ( ( ( ( x . getyPos ( ) ) - ( yCenter ) ) // ( ySize ) ) * ( height ) ) , ( ( ( ( x . getRadius ( ) ) // ( xSize ) ) * ( width ) ) * 2.0F ) , ( ( ( ( x . getRadius ( ) ) // ( xSize ) ) * ( width ) ) * 2.0F ) ) ; } <START_BUG> xCenter += 0.002 ; <END_BUG> yCenter += 0.003 ; } public NodeSetManager initManager ( ) { } }

Fix:
xCenter += 0.01 ;
Buggy code:
public final class InDeferredThreadExecutor implements Executor { public void execute ( Runnable command ) { <START_BUG> new Thread ( command ) . run ( ) ; <END_BUG> } }

Fix:
new Thread ( command ) . start ( ) ;
Buggy code:
public final class RepositoryGeneratorImpl implements RepositoryGenerator { private RepositoryAdmin repositoryAdmin ; private ModelledResourceManager modelledResourceManager ; private LocalPlatform tempDir ; private static Logger logger = LoggerFactory . getLogger ( RepositoryGeneratorImpl . class ) ; private static Collection < BundleResourceTransformer > bundleResourceTransformers = new ArrayList < BundleResourceTransformer > ( ) ; private static final String MANDATORY_DIRECTIVE = ( Constants . MANDATORY_DIRECTIVE ) + ":" ; public void setModelledResourceManager ( ModelledResourceManager modelledResourceManager ) { } public void setTempDir ( LocalPlatform tempDir ) { } public void setBundleResourceTransformers ( List < BundleResourceTransformer > brts ) { } public RepositoryGeneratorImpl ( RepositoryAdmin repositoryAdmin ) { } private static void addProperty ( Document doc , Element capability , String name , String value , String type ) { } private static void writeResource ( Resource r , String uri , Document doc , Element root ) throws IOException { } private static void writeCapability ( Capability c , Document doc , Element resource ) throws IOException { RepositoryGeneratorImpl . logger . debug ( LOG_ENTRY , "writeCapability" , new Object [ ] { c , doc , resource } ) ; Element capability = doc . createElement ( "capability" ) ; capability . setAttribute ( "name" , c . getName ( ) ) ; resource . appendChild ( capability ) ; Property [ ] props = c . getProperties ( ) ; for ( Property entry : props ) { String name = ( ( String ) ( entry . getName ( ) ) ) ; String objectAttrs = entry . getValue ( ) ; <START_BUG> String type = RepositoryGeneratorImpl . getType ( name ) ; <END_BUG> if ( ( objectAttrs . startsWith ( "\"" ) ) && ( objectAttrs . endsWith ( "\"" ) ) ) objectAttrs = objectAttrs . substring ( 1 , ( ( objectAttrs . length ( ) ) - 1 ) ) ; RepositoryGeneratorImpl . addProperty ( doc , capability , name , objectAttrs , type ) ; } RepositoryGeneratorImpl . logger . debug ( LOG_EXIT , "writeCapability" ) ; } private static void writeRequirement ( Requirement req , Document doc , Element resource ) throws IOException { } public void generateRepository ( String repositoryName , Collection < ? extends ModelledResource > byValueBundles , OutputStream os ) throws IOException , ResolverException { } public static void generateRepository ( RepositoryAdmin repositoryAdmin , String repositoryName , Collection < ? extends ModelledResource > byValueBundles , OutputStream os ) throws IOException , ResolverException { } private static String getType ( String name ) { } public void generateRepository ( String [ ] source , OutputStream fout ) throws IOException { } }

Fix:
String type = ( ( entry . getType ( ) ) == null ) ? RepositoryGeneratorImpl . getType ( name ) : entry . getType ( ) ;
Buggy code:
public class HasTag extends EvalFunc < Boolean > { public HasTag ( ) throws ParserConfigurationException { } @ Override public Boolean exec ( Tuple input ) throws IOException { if ( ( input == null ) || ( ( input . size ( ) ) == 0 ) ) return null ; <START_BUG> if ( ( input . size ( ) ) != 2 ) <END_BUG> throw new IOException ( "HasTag<seq2seq4repair_space>takes<seq2seq4repair_space>at<seq2seq4repair_space>least<seq2seq4repair_space>two<seq2seq4repair_space>parameters" ) ; Map < String , String > tags = ( ( Map < String , String > ) ( input . get ( 0 ) ) ) ; String keys = ( ( String ) ( input . get ( 1 ) ) ) ; String values = ( ( input . size ( ) ) > 2 ) ? ( ( String ) ( input . get ( 2 ) ) ) : null ; return HasTag . hasTag ( tags , keys , values ) ; } public static boolean hasTag ( Map < String , String > tags , String keys , String values ) { } }

Fix:
if ( ( input . size ( ) ) < 2 )
Buggy code:
public class LocationList extends HashMap < Integer , Location > implements Iterable < Location > , Iterator < Location > { private static final long serialVersionUID = 5423811612672652279L ; private int count = 0 ; public LocationList ( ) { } public LocationList ( Element [ ] locationElements ) { } public LocationList ( String [ ] locs ) { } @ Override public Location remove ( Object key ) { Location o = super . remove ( key ) ; System . out . println ( ( ( ( "Remove:<seq2seq4repair_space>" + key ) + "<seq2seq4repair_space>" ) + o ) ) ; Object [ ] loc = this . values ( ) . toArray ( ) ; this . clear ( ) ; for ( int i = 0 ; i < ( loc . length ) ; ++ i ) { System . out . println ( ( ( ( "[" + i ) + "]<seq2seq4repair_space>" ) + ( loc [ i ] ) ) ) ; <START_BUG> this . put ( ( i ++ ) , ( ( Location ) ( loc [ i ] ) ) ) ; <END_BUG> } o . stop ( ) ; return o ; } public String toXML ( ) { } @ Override public Iterator < Location > iterator ( ) { } @ Override public boolean hasNext ( ) { } @ Override public Location next ( ) { } public void remove ( ) { } }

Fix:
this . put ( i , ( ( Location ) ( loc [ i ] ) ) ) ;
Buggy code:
public final class RollingCharBuffer { private Reader reader ; private char [ ] buffer = new char [ 32 ] ; private int nextWrite ; private int nextPos ; private int count ; private boolean end ; public void reset ( Reader reader ) { } public int get ( int pos ) throws IOException { if ( pos == ( nextPos ) ) { if ( end ) { return - 1 ; } final int ch = reader . read ( ) ; if ( ch == ( - 1 ) ) { end = true ; return - 1 ; } if ( ( count ) == ( buffer . length ) ) { final char [ ] newBuffer = new char [ ArrayUtil . oversize ( ( 1 + ( count ) ) , NUM_BYTES_CHAR ) ] ; System . arraycopy ( buffer , nextWrite , newBuffer , 0 , ( ( buffer . length ) - ( nextWrite ) ) ) ; System . arraycopy ( buffer , 0 , newBuffer , ( ( buffer . length ) - ( nextWrite ) ) , nextWrite ) ; nextWrite = buffer . length ; buffer = newBuffer ; } if ( ( nextWrite ) == ( buffer . length ) ) { nextWrite = 0 ; } buffer [ ( ( nextWrite ) ++ ) ] = ( ( char ) ( ch ) ) ; ( count ) ++ ; ( nextPos ) ++ ; return ch ; } else { assert pos < ( nextPos ) ; <START_BUG> assert ( ( nextPos ) - pos ) <= ( count ) ; <END_BUG> final int index = getIndex ( pos ) ; return buffer [ index ] ; } } private boolean inBounds ( int pos ) { } private int getIndex ( int pos ) { } public char [ ] get ( int posStart , int length ) { } public void freeBefore ( int pos ) { } }

Fix:
assert ( ( nextPos ) - pos ) <= ( count ) : ( ( ( ( "nextPos=" + ( nextPos ) ) + "<seq2seq4repair_space>pos=" ) + pos ) + "<seq2seq4repair_space>count=" ) + ( count ) ;
Buggy code:
public class Game { private Team home ; private Team away ; private BoxScore boxscore ; public Game ( Team h , Team a ) { } public int homePoints ( ) { } public int awayPoints ( ) { <START_BUG> return boxscore . getHome ( ) . get ( "Points" ) ; <END_BUG> } public Team winner ( ) { } public void end ( ) { } public Team onOffense ( ) { } public Team other ( Team t ) { } public StatLine statLine ( Team t ) { } public StatLine homeStatLine ( ) { } public StatLine awayStatLine ( ) { } public Team homeTeam ( ) { } public Team awayTeam ( ) { } public void tipoff ( ) { } }

Fix:
return boxscore . getAway ( ) . get ( "Points" ) ;
Buggy code:
public class JsonpPollingTransportHandler extends AbstractHttpSendingTransportHandler { @ Override public TransportType getTransportType ( ) { } @ Override protected MediaType getContentType ( ) { } @ Override public PollingSockJsSession createSession ( String sessionId , WebSocketHandler handler ) { <START_BUG> Assert . notNull ( getSockJsConfig ( ) , "This<seq2seq4repair_space>transport<seq2seq4repair_space>requires<seq2seq4repair_space>SockJsConfiguration" ) ; <END_BUG> return new PollingSockJsSession ( sessionId , getSockJsConfig ( ) , handler ) ; } @ Override public void handleRequestInternal ( ServerHttpRequest request , ServerHttpResponse response , AbstractHttpSockJsSession session ) throws TransportErrorException { } @ Override protected FrameFormat getFrameFormat ( ServerHttpRequest request ) { } }

Fix:
Assert . state ( ( ( getSockJsConfig ( ) ) != null ) , "This<seq2seq4repair_space>transport<seq2seq4repair_space>requires<seq2seq4repair_space>SockJsConfiguration" ) ;
Buggy code:
@ XmlAccessorType ( XmlAccessType . FIELD ) @ XmlType ( name = "PopupScreen" ) @ SpoutClassBinding ( baseInterface = org . getspout . spoutapi . gui . PopupScreen . class , defaultImpl = GenericPopup . class ) public class PopupScreen extends WidgetContainer { @ XmlAttribute @ SpoutFieldBinding ( name = "bgVisible" ) protected Boolean background ; @ XmlAttribute @ SpoutFieldBinding protected Boolean transparent ; @ Override protected Widget newWidget ( ) { } @ Override protected void putWidget ( Widget widget , Widget child ) { <START_BUG> ( ( org . getspout . spoutapi . gui . PopupScreen ) ( widget ) ) . attachWidget ( this . plugin , widget ) ; <END_BUG> } }

Fix:
( ( org . getspout . spoutapi . gui . PopupScreen ) ( widget ) ) . attachWidget ( this . plugin , child ) ;
Buggy code:
public class AjaxMouseEventPage extends BasePage { public AjaxMouseEventPage ( ) { } private void addEventType ( final MouseEventType eventType ) { WebMarkupContainer box = new WebMarkupContainer ( this , eventType . name ( ) . toLowerCase ( ) ) ; box . add ( new AjaxMouseEventBehavior ( eventType ) { @ Override <START_BUG> protected void onEvent ( AjaxRequestTarget target , MouseEvent event ) { <END_BUG> StringBuffer output = new StringBuffer ( ) ; output . append ( "Event<seq2seq4repair_space>type:<seq2seq4repair_space>on" ) . append ( eventType . name ( ) . toLowerCase ( ) ) . append ( "\n" ) ; output . append ( "Mouse<seq2seq4repair_space>button:<seq2seq4repair_space>" ) . append ( event . getButton ( ) ) . append ( "\n" ) ; output . append ( "X<seq2seq4repair_space>position:<seq2seq4repair_space>" ) . append ( event . getXPos ( ) ) . append ( "\n" ) ; output . append ( "Y<seq2seq4repair_space>position:<seq2seq4repair_space>" ) . append ( event . getYPos ( ) ) . append ( "\n" ) ; output . append ( "Shift<seq2seq4repair_space>key<seq2seq4repair_space>pressed?<seq2seq4repair_space>" ) . append ( event . isShiftKeyPressed ( ) ) . append ( "\n" ) ; output . append ( "Alt<seq2seq4repair_space>key<seq2seq4repair_space>pressed?<seq2seq4repair_space>" ) . append ( event . isAltKeyPressed ( ) ) . append ( "\n" ) ; output . append ( "Ctrl<seq2seq4repair_space>key<seq2seq4repair_space>pressed?<seq2seq4repair_space>" ) . append ( event . isCtrlKeyPressed ( ) ) . append ( "\n" ) ; MultiLineLabel label = new MultiLineLabel ( AjaxMouseEventPage . this , "output" , output . toString ( ) ) ; label . setOutputMarkupId ( true ) ; target . addComponent ( label ) ; } } ) ; } }

Fix:
protected void onEvent ( final AjaxRequestTarget target , final MouseEvent event ) {
Buggy code:
public class EventQueue extends LinkedList < Event > { @ Override public boolean offer ( Event event ) { boolean rv = Event . isEnabled ( event . getClass ( ) ) ; if ( rv ) { <START_BUG> EventControlPanel . print ( ( ( ( event . getClass ( ) . getSimpleName ( ) ) + "<seq2seq4repair_space>fired<seq2seq4repair_space>in<seq2seq4repair_space>" ) + ( eventThread . getName ( ) ) ) ) ; <END_BUG> super . offer ( event ) ; } return rv ; } }

Fix:
EventControlPanel . print ( ( ( ( event . getClass ( ) . getSimpleName ( ) ) + "<seq2seq4repair_space>fired<seq2seq4repair_space>in<seq2seq4repair_space>" ) + ( Thread . currentThread ( ) . getName ( ) ) ) ) ;
Buggy code:
public class AbstractLeastSquaresOptimizerTest { public static AbstractLeastSquaresOptimizer createOptimizer ( ) { } @ Test public void testGetChiSquare ( ) throws IOException { } @ Test public void testGetRMS ( ) throws IOException { } @ Test public void testGetSigma ( ) throws IOException { final StatisticalReferenceDataset dataset ; dataset = StatisticalReferenceDatasetFactory . createKirby2 ( ) ; final AbstractLeastSquaresOptimizer optimizer ; optimizer = AbstractLeastSquaresOptimizerTest . createOptimizer ( ) ; final double [ ] a = dataset . getParameters ( ) ; final double [ ] y = dataset . getData ( ) [ 1 ] ; final double [ ] w = new double [ y . length ] ; Arrays . fill ( w , 1.0 ) ; final int dof = ( y . length ) - ( a . length ) ; optimizer . optimize ( 1 , dataset . getLeastSquaresProblem ( ) , y , w , a ) ; final double [ ] sig = optimizer . getSigma ( ) ; final double [ ] expected = dataset . getParametersStandardDeviations ( ) ; for ( int i = 0 ; i < ( sig . length ) ; i ++ ) { final double actual = ( FastMath . sqrt ( ( ( optimizer . getChiSquare ( ) ) // dof ) ) ) * ( sig [ i ] ) ; <START_BUG> Assert . assertEquals ( ( ( ( dataset . getName ( ) ) + ",<seq2seq4repair_space>parameter<seq2seq4repair_space>#" ) + i ) , actual , expected [ i ] , ( 1.0E-8 * ( expected [ i ] ) ) ) ; <END_BUG> } } }

Fix:
Assert . assertEquals ( ( ( ( dataset . getName ( ) ) + ",<seq2seq4repair_space>parameter<seq2seq4repair_space>#" ) + i ) , expected [ i ] , actual , ( 1.3E-8 * ( expected [ i ] ) ) ) ;
Buggy code:
public class Die { private int value ; private int sides ; private Random randomNumber ; public Die ( int sides ) { } public int value ( ) { } public void roll ( ) { <START_BUG> this . value = ( randomNumber . nextInt ( this . sides ) ) + 1 ; <END_BUG> } }

Fix:
this . value = ( this . randomNumber . nextInt ( this . sides ) ) + 1 ;
Buggy code:
public class TestBean { private Double x = Double . valueOf ( 1.0 ) ; private String y = "1.0" ; public Double getX ( ) { } public String getY ( ) { } public void setX ( Double double1 ) { } public void setY ( String string ) { } public Double getZ ( ) { <START_BUG> throw new MathRuntimeException ( "?" , null ) ; <END_BUG> } public void setZ ( Double double1 ) { } }

Fix:
throw new MathRuntimeException ( "?" ) ;
Buggy code:
public class PrintCommand implements Command { CrapsApi api ; Disassembler dis ; StatePrinter sp ; String labelPattern = "\\p{Alpha}[\\p{Alnum}\\-_]+" ; String hexPattern = "0x\\p{XDigit}+" ; String addrPattern = ( ( ( "(" + ( hexPattern ) ) + ")|(" ) + ( labelPattern ) ) + ")" ; Pattern register = Pattern . compile ( "print<seq2seq4repair_space>+%r(\\d+)" ) ; Pattern address = Pattern . compile ( ( ( "print<seq2seq4repair_space>+(" + ( addrPattern ) ) + ")" ) ) ; Pattern addressRange = Pattern . compile ( ( ( ( ( "print<seq2seq4repair_space>+(" + ( addrPattern ) ) + ")<seq2seq4repair_space>*\\.*<seq2seq4repair_space>*(" ) + ( addrPattern ) ) + ")" ) ) ; Pattern addressIncr = Pattern . compile ( ( ( "print<seq2seq4repair_space>+(" + ( addrPattern ) ) + ")<seq2seq4repair_space>*\\+<seq2seq4repair_space>*(\\p{Digit}+)" ) ) ; PrintCommand ( CrapsApi api , Disassembler dis , StatePrinter sp ) { } public String help ( ) { } public String name ( ) { } public void run ( String command ) throws CommException { } public Long parseAddress ( String txt ) { } public boolean impl ( String command ) throws CommException { Matcher mRegister = register . matcher ( command ) ; if ( mRegister . matches ( ) ) { int register = Integer . parseInt ( mRegister . group ( 1 ) ) ; long value = api . readRegister ( register ) ; print ( "%r" , mRegister . group ( 1 ) , value ) ; return true ; } Matcher mAddress = address . matcher ( command ) ; if ( mAddress . matches ( ) ) { Long address = parseAddress ( mAddress . group ( 1 ) ) ; if ( address != null ) { long value = api . readMemory ( address ) ; <START_BUG> print ( "0x" , mRegister . group ( 1 ) , value ) ; <END_BUG> } return true ; } Matcher mRange = addressRange . matcher ( command ) ; if ( mRange . matches ( ) ) { Long first = parseAddress ( mRange . group ( 1 ) ) ; Long last = parseAddress ( mRange . group ( 4 ) ) ; if ( ( first != null ) && ( last != null ) ) { sp . printStack ( first , last ) ; } return true ; } Matcher mIncr = addressIncr . matcher ( command ) ; if ( mIncr . matches ( ) ) { Long address = parseAddress ( mIncr . group ( 1 ) ) ; long incr = Long . parseLong ( mIncr . group ( 4 ) ) ; if ( address != null ) { sp . printStack ( address , ( address + incr ) ) ; } return true ; } if ( command . equals ( name ( ) ) ) { sp . printAll ( ) ; return true ; } return false ; } private void print ( String prefix , String mem , long value ) { } }

Fix:
print ( "0x" , ( address + "" ) , value ) ;
Buggy code:
public class Rhodecode extends HgBrowser { @ DataBoundConstructor public Rhodecode ( String url ) throws MalformedURLException { } @ Override public URL getChangeSetLink ( MercurialChangeSet changeSet ) throws IOException { } @ Override public URL getFileLink ( String path ) throws MalformedURLException { } @ Override public URL getDiffLink ( String path ) throws MalformedURLException { checkCurrentIsNotNull ( ) ; <START_BUG> return new URL ( getUrl ( ) , ( ( ( "changeset//" + ( current . getShortNode ( ) ) ) + "//" ) + ( path . replace ( "//" , "-" ) ) ) ) ; <END_BUG> } @ Extension public static class DescriptorImpl extends Descriptor < RepositoryBrowser < ? > > { public String getDisplayName ( ) { } @ Override public Rhodecode newInstance ( StaplerRequest req , JSONObject json ) throws FormException { } } private static final long serialVersionUID = 1L ; }

Fix:
return new URL ( getUrl ( ) , ( ( ( "changeset//" + ( current . getShortNode ( ) ) ) + "#C" ) + ( path . replace ( "//" , "-" ) ) ) ) ;
Buggy code:
@ Service public class TransformServiceImpl { private static final Logger log = Logger . getLogger ( TransformServiceImpl . class ) ; @ Autowired private ContactManager contactManager ; @ Autowired private DateEventManager dateEventManager ; @ Autowired private DateEventTypeManager dateEventTypeManager ; @ Autowired private ImageManager imageManager ; @ Autowired private RelationshipManager relationshipManager ; @ Autowired private MinistryManager ministryManager ; @ Autowired private EventManager eventManager ; @ Autowired private UserManager userManager ; @ Autowired private PasswordEncoder passwordEncoder ; @ Autowired private EmailProviderManager emailProviderManager ; public void copyAudit ( AbstractPersistent source , BasicForm dest ) { } public DateEventForm getForm ( DateEvent dateEvent ) { } public void setForm ( DateEventForm dateEventForm , DateEvent dateEvent ) { } public DateEventTypeForm getForm ( DateEventType dateEventType ) { } public DateEventType setForm ( DateEventTypeForm dateEventTypeForm ) { } public ContactForm getForm ( Contact contact ) { } public BasicContactForm getBasicForm ( Contact contact , boolean loadLazy ) { } public ContactForm getForm ( Contact contact , boolean loadLazy ) { } public MinistryForm getForm ( Ministry ministry ) { } public EventForm getForm ( Event event ) { } public Event setForm ( EventForm eventForm ) { } public Contact setForm ( ContactForm contactForm ) { } public Ministry setForm ( MinistryForm ministryForm ) { } public User setForm ( UserForm userForm ) { User user = new User ( ) ; if ( ( userForm . getId ( ) ) != null ) { user = userManager . find ( userForm . getId ( ) ) ; } user . setUserName ( userForm . getUserName ( ) ) ; user . setEnabled ( userForm . isEnabled ( ) ) ; user . setUpdatedBy ( userForm . getUpdatedBy ( ) ) ; if ( ( ( userForm . getEmailProviderId ( ) ) != null ) && ( ( userForm . getEmailProviderId ( ) ) > 0 ) ) { user . setEmailProvider ( emailProviderManager . find ( userForm . getEmailProviderId ( ) ) ) ; } if ( StringUtils . hasLength ( userForm . getPassword ( ) ) ) { user . setPassword ( passwordEncoder . encode ( userForm . getPassword ( ) ) ) ; } <START_BUG> if ( ( userForm . getContact ( ) ) != null ) { <END_BUG> user . setContact ( contactManager . find ( userForm . getContact ( ) . getId ( ) ) ) ; } user . setEmailAccountAddress ( userForm . getEmailAccountAddress ( ) ) ; user . setEmailAccountFrom ( userForm . getEmailAccountFrom ( ) ) ; if ( StringUtils . hasLength ( userForm . getEmailAccountPassword ( ) ) ) { user . setEmailAccountPassword ( userForm . getEmailAccountPassword ( ) ) ; } return user ; } public UserForm getForm ( User user ) { } }

Fix:
if ( ( ( userForm . getContact ( ) ) != null ) && ( ( userForm . getContact ( ) . getId ( ) ) != null ) ) {