nus-yam/ex-repair huggingface dataset:
Program: 36483
Project: 36483
Buggy source:
/** 
 * @param name
 * @param c
 * @param category
 * @param instance owner of the field or null if static
 */
FieldConfig(String name,IsConfig c,Object instance,String category,MethodHandle getter,MethodHandle setter){
  super((Class)getter.type().returnType(),name,c,getValueFromFieldMethodHandle(getter,instance),category);
  this.getter=getter;
  this.setter=setter;
  this.instance=instance;
}

Fixed version (ground truth):
/** 
 * @param name
 * @param c
 * @param category
 * @param instance owner of the field or null if static
 */
@SuppressWarnings("String_Node_Str") FieldConfig(String name,IsConfig c,Object instance,String category,MethodHandle getter,MethodHandle setter){
  super((Class)getter.type().returnType(),name,c,getValueFromFieldMethodHandle(getter,instance),category);
  this.getter=getter;
  this.setter=setter;
  this.instance=instance;
}
Program: 36484
Project: 36484
Buggy source:
@Override public boolean isMinMax(){
  return !(Double.compare(min,Double.NaN) == 0 || Double.compare(max,Double.NaN) == 0) && Number.class.isAssignableFrom(unPrimitivize(getType()));
}

Fixed version (ground truth):
@Override public boolean isMinMax(){
  return !(Double.compare(min,Double.NaN) == 0 || Double.compare(max,Double.NaN) == 0) && Number.class.isAssignableFrom(getType());
}
Program: 36485
Project: 36485
Buggy source:
@Override public ObservableList<T> fromS(String str){
  ObservableList<T> l=observableArrayList();
  split(str,"String_Node_Str",x -> x).stream().map(s -> {
    T t=a.factory.get();
    List<Config<Object>> configs=(List)list(a.toConfigurable.apply(t).getFields());
    List<String> vals=split(s,"String_Node_Str",x -> x);
    if (configs.size() == vals.size())     forEachBoth(configs,vals,(c,v) -> c.setNapplyValue(c.fromS(v)));
    if (t.getClass().equals(configs.get(0).getType()))     return (T)configs.get(0).getValue();
 else     return t;
  }
).forEach(l::add);
  return l;
}

Fixed version (ground truth):
@Override public ObservableList<T> fromS(String str){
  ObservableList<T> l=observableArrayList();
  split(str,"String_Node_Str",x -> x).stream().map(s -> {
    T t=a.factory.get();
    List<Config<Object>> configs=(List)list(a.toConfigurable.apply(t).getFields());
    List<String> vals=split(s,"String_Node_Str");
    if (configs.size() == vals.size())     forEachBoth(configs,vals,(c,v) -> c.setNapplyValue(c.fromS(v)));
    if (t.getClass().equals(configs.get(0).getType()))     return (T)configs.get(0).getValue();
 else     return t;
  }
).forEach(l::add);
  return l;
}
Program: 36486
Project: 36486
Buggy source:
/** 
 * Equivalent to   {@link #apply()}. Exists for compatibility with   {@link Runnable}. 
 */
@Deprecated default void run(){
  apply();
}

Fixed version (ground truth):
/** 
 * Equivalent to   {@link #apply()}. Exists for compatibility with   {@link Runnable}. 
 */
default void run(){
  apply();
}
Program: 36487
Project: 36487
Buggy source:
/** 
 * Equivalent to   {@link #apply(Object)}}. Exists for compatibility with   {@link Predicate}. 
 */
@Deprecated @Override default boolean test(I i){
  return apply(i);
}

Fixed version (ground truth):
/** 
 * Equivalent to   {@link #apply(Object)}}. Exists for compatibility with   {@link Predicate}. 
 */
@Override default boolean test(I i){
  return apply(i);
}
Program: 36488
Project: 36488
Buggy source:
/** 
 * Equivalent to   {@link #apply()}. Exists for compatibility with   {@link Supplier}. 
 */
@Deprecated default O get(){
  return apply();
}

Fixed version (ground truth):
/** 
 * Equivalent to   {@link #apply()}. Exists for compatibility with   {@link Supplier}. 
 */
default O get(){
  return apply();
}
Program: 36489
Project: 36489
Buggy source:
/** 
 * Equivalent to   {@link #apply(Object)}}. Exists for compatibility with   {@link Callback}. 
 */
@Deprecated @Override default O call(I i){
  return apply(i);
}

Fixed version (ground truth):
/** 
 * Equivalent to   {@link #apply(Object)}. Exists for compatibility with   {@link Callback}. 
 */
@Override default O call(I i){
  return apply(i);
}
Program: 36490
Project: 36490
Buggy source:
@SuppressWarnings("String_Node_Str") default Ƒ1<I,O> nonNull(O or){
  return andThen(o -> o == null ? or : (O)o);
}

Fixed version (ground truth):
default Ƒ1<I,O> nonNull(O or){
  return andThen(o -> o == null ? or : o);
}
Program: 36491
Project: 36491
Buggy source:
private void setCoverPost(Item item,boolean imgAlreadyLoaded,File imgFile,Image img){
  runFX(() -> {
    if (item == getItem()) {
      System.out.println("String_Node_Str" + img + "String_Node_Str"+ imgFile);
      boolean animate=animateThumbOn.get().needsAnimation(this,imgAlreadyLoaded,imgFile,img);
      thumb.loadImage(img,imgFile);
      if (animate)       new Anim(thumb.getView()::setOpacity).dur(400).intpl(x -> x * x * x* x).play();
    }
  }
);
}

Fixed version (ground truth):
private void setCoverPost(Item item,boolean imgAlreadyLoaded,File imgFile,Image img){
  runFX(() -> {
    if (item == getItem()) {
      boolean animate=animateThumbOn.get().needsAnimation(this,imgAlreadyLoaded,imgFile,img);
      thumb.loadImage(img,imgFile);
      if (animate)       new Anim(thumb.getView()::setOpacity).dur(400).intpl(x -> x * x * x* x).play();
    }
  }
);
}
Program: 36492
Project: 36492
Buggy source:
@IsAction(name="String_Node_Str",desc="String_Node_Str",keys="String_Node_Str") public static void openLauncher(){
  File f=new File(APP.DIR_LAYOUTS,"String_Node_Str");
  ;
  Component c=UiContext.instantiateComponent(f);
  if (c != null) {
    OverlayPane op=new OverlayPane(){
      @Override public void show(){
        OverlayPane root=this;
        getChildren().add(c.load());
        if (c instanceof Widget) {
          ((Widget<?>)c).getController().getFieldOrThrow("String_Node_Str").setValue(true);
          ((Widget<?>)c).getController().getFieldOrThrow("String_Node_Str").setValue(true);
          ((Widget<?>)c).areaTemp=new ContainerNode(){
            @Override public Pane getRoot(){
              return root;
            }
            @Override public void show(){
            }
            @Override public void hide(){
            }
            @Override public void close(){
              root.hide();
            }
          }
;
        }
        super.show();
      }
    }
;
    op.display.set(SCREEN_OF_MOUSE);
    op.show();
    c.load().prefWidth(900);
    c.load().prefHeight(700);
  }
}

Fixed version (ground truth):
@IsAction(name="String_Node_Str",desc="String_Node_Str",keys="String_Node_Str") public static void openLauncher(){
  File f=new File(APP.DIR_LAYOUTS,"String_Node_Str");
  Component c=UiContext.instantiateComponent(f);
  if (c != null) {
    OverlayPane op=new OverlayPane(){
      @Override public void show(){
        OverlayPane root=this;
        getChildren().add(c.load());
        if (c instanceof Widget) {
          ((Widget<?>)c).getController().getFieldOrThrow("String_Node_Str").setValue(true);
          ((Widget<?>)c).getController().getFieldOrThrow("String_Node_Str").setValue(true);
          ((Widget<?>)c).areaTemp=new ContainerNode(){
            @Override public Pane getRoot(){
              return root;
            }
            @Override public void show(){
            }
            @Override public void hide(){
            }
            @Override public void close(){
              root.hide();
            }
          }
;
        }
        super.show();
      }
    }
;
    op.display.set(SCREEN_OF_MOUSE);
    op.show();
    c.load().prefWidth(900);
    c.load().prefHeight(700);
  }
}
Program: 36493
Project: 36493
Buggy source:
/** 
 * Create a new instance not initialized with any mime types definitions.
 * @return New blank instance
 */
public static MimeTypes blank(){
  return new MimeTypes(new Path[0]);
}

Fixed version (ground truth):
/** 
 * Create empty mime type repository. 
 */
public static MimeTypes blank(){
  return new MimeTypes(false);
}
Program: 36494
Project: 36494
Buggy source:
/** 
 * Initialize the mime types definitions with given one or more mime types definition files in standard /etc/mime.types format.
 * @param mimeTypesDefinitions Paths to mime types definition files
 */
public MimeTypes(Path... mimeTypesDefinitions){
  for (  Path f : mimeTypesDefinitions) {
    load(f);
  }
}

Fixed version (ground truth):
private MimeTypes(boolean addStandardTypes){
  if (addStandardTypes) {
    try (InputStream file=MimeTypes.class.getResourceAsStream("String_Node_Str");InputStreamReader ir=new InputStreamReader(file,"String_Node_Str");BufferedReader br=new BufferedReader(ir)){
      String line;
      while ((line=br.readLine()) != null) {
        loadOne(line);
      }
    }
 catch (    Exception e) {
      log(MimeTypes.class).error("String_Node_Str",e);
    }
  }
}
Program: 36495
Project: 36495
Buggy source:
/** 
 * Load and register a single line that starts with the mime type proceeded by any number of whitespaces, then a whitespace separated list of valid extensions for that mime type.
 * @param def Single mime type definition to load and register
 * @return this
 */
public MimeTypes loadOne(String def){
  if (def.startsWith(COMMENT_PREFIX))   return this;
  String[] halves=def.toLowerCase().split("String_Node_Str",2);
  MimeType mimeType=new MimeType(halves[0],halves[1].trim().split("String_Node_Str"));
  return register(mimeType);
}

Fixed version (ground truth):
/** 
 * Load and register a single line that starts with the mime type proceeded by any number of whitespaces, then a whitespace separated list of valid extensions for that mime type.
 * @param def Single mime type definition to load and register
 * @return this
 */
public MimeTypes loadOne(String def){
  if (def.startsWith("String_Node_Str"))   return this;
  String[] halves=def.toLowerCase().split("String_Node_Str",2);
  MimeType mimeType=new MimeType(halves[0],halves[1].trim().split("String_Node_Str"));
  return register(mimeType);
}
Program: 36497
Project: 36497
Buggy source:
/** 
 * Execute action for each observable value representing a javafx property of an object o. Additional provided arguments are name of the property and its non-erased generic type. Javafx properties are obtained from public propertynameProperty() methods using reflection.
 */
static void forEachJavaFXProperty(Object o,TriConsumer<ObservableValue,String,Class> action){
  for (  Method method : getAllMethods(o.getClass())) {
    String methodname=method.getName();
    if (methodname.endsWith("String_Node_Str") && !methodname.startsWith("String_Node_Str") && Modifier.isPublic(method.getModifiers())) {
      try {
        Class<?> returnType=method.getReturnType();
        if (ObservableValue.class.isAssignableFrom(returnType)) {
          String propertyName=methodname.substring(0,methodname.lastIndexOf("String_Node_Str"));
          method.setAccessible(true);
          ObservableValue<?> property=(ObservableValue)method.invoke(o);
          Class<?> propertyType=getGenericPropertyType(method.getGenericReturnType());
          action.accept(property,propertyName,propertyType);
        }
      }
 catch (      IllegalAccessException|InvocationTargetException e) {
        util.dev.Util.log(Util.class).error("String_Node_Str",e);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Execute action for each observable value representing a javafx property of an object o. Additional provided arguments are name of the property and its non-erased generic type. Javafx properties are obtained from public propertynameProperty() methods using reflection.
 */
static void forEachJavaFXProperty(Object o,TriConsumer<ObservableValue,String,Class> action){
  for (  Method method : getAllMethods(o.getClass())) {
    String methodname=method.getName();
    if (methodname.endsWith("String_Node_Str") && Modifier.isPublic(method.getModifiers()) && !methodname.startsWith("String_Node_Str")) {
      try {
        Class<?> returnType=method.getReturnType();
        if (ObservableValue.class.isAssignableFrom(returnType)) {
          String propertyName=methodname.substring(0,methodname.lastIndexOf("String_Node_Str"));
          method.setAccessible(true);
          ObservableValue<?> property=(ObservableValue)method.invoke(o);
          Class<?> propertyType=getGenericPropertyType(method.getGenericReturnType());
          if (isNonØ(property,propertyName,propertyType))           action.accept(property,propertyName,propertyType);
        }
      }
 catch (      IllegalAccessException|InvocationTargetException e) {
        log(Util.class).error("String_Node_Str",e);
      }
    }
  }
}
Program: 36499
Project: 36499
Buggy source:
@Override public V get(){
  if (isSet) {
    set(builder.get());
    builder=null;
  }
  return t;
}

Fixed version (ground truth):
public V get(Supplier<V> or){
  if (!isSet)   set(or.get());
  return v;
}
Program: 36500
Project: 36500
Buggy source:
public R(T value){
  set(value);
}

Fixed version (ground truth):
public R(V value){
  set(value);
}
Program: 36501
Project: 36501
Buggy source:
public void set(T val){
  isSet=true;
  t=val;
}

Fixed version (ground truth):
public void set(V val){
  v=val;
}
Program: 36502
Project: 36502
Buggy source:
public <M>T get(M m,Ƒ1<M,T> or){
  if (t == null)   set(or.apply(m));
  return t;
}

Fixed version (ground truth):
public <M>V get(M m,Ƒ1<M,V> or){
  if (v == null)   set(or.apply(m));
  return v;
}
Program: 36503
Project: 36503
Buggy source:
public void setOf(T v2,BinaryOperator<T> op){
  set(op.apply(get(),v2));
}

Fixed version (ground truth):
public void setOf(V v2,BinaryOperator<V> op){
  set(op.apply(get(),v2));
}
Program: 36504
Project: 36504
Buggy source:
public boolean isØ(){
  return t == null;
}

Fixed version (ground truth):
public boolean isØ(){
  return v == null;
}
Program: 36505
Project: 36505
Buggy source:
/** 
 * Same as   {@link #get()}, but mutates the value.
 * @param mutation_source, use null when type Void
 * @return the instance after applying mutation, ever null
 */
public V getM(M mutation_source){
  if (isSet) {
    set(builder.get());
    builder=null;
    isSet=true;
  }
  if (mutator != null)   mutator.accept(t,mutation_source);
  return t;
}

Fixed version (ground truth):
/** 
 * Same as   {@link #get()}, but mutates the value.
 * @param mutation_source, use null when type Void
 * @return the instance after applying mutation, ever null
 */
public V getM(M mutation_source){
  V v=get();
  if (mutator != null)   mutator.accept(v,mutation_source);
  return v;
}
Program: 36506
Project: 36506
Buggy source:
/** 
 * Convenience method to clean String objects. Assigns string empty value if it should be empty according to shouldBeEmpty() method. Use as a convenient filter for suspicious String objects. More formally returns: (shouldBeEmpty(str)) ? "" : str;
 * @see shouldBeEmpty(String str)
 * @param str String to emptify.
 * @return "" if String should be empty, otherwise does nothing..
 */
public static String emptifyString(String str){
  return shouldBeEmpty(str) ? "String_Node_Str" : str;
}

Fixed version (ground truth):
/** 
 * Convenience method to clean String objects. Assigns string empty value if it should be empty according to shouldBeEmpty() method. Use as a convenient filter for suspicious String objects. More formally returns: (shouldBeEmpty(str)) ? "" : str;
 * @param str String to emptify
 * @return "" if String should be empty, otherwise does nothing
 */
public static String emptifyString(String str){
  return shouldBeEmpty(str) ? "String_Node_Str" : str;
}
Program: 36507
Project: 36507
Buggy source:
/** 
 * Creates column that indexes rows from 1 and is right aligned. The column is of type Void - table data type agnostic.
 * @param name name of the column. For example "#"
 * @return the column
 */
public static <T>TableColumn<T,Void> createIndexColumn(String name){
  TableColumn<T,Void> c=new TableColumn(name);
  c.setSortable(false);
  c.setCellFactory(column -> new TableCell<T,Void>(){
{
      setAlignment(CENTER_RIGHT);
    }
    @Override protected void updateItem(    Void item,    boolean empty){
      super.updateItem(item,empty);
      if (empty)       setText(null);
 else       setText(String.valueOf(getIndex() + 1) + "String_Node_Str");
    }
  }
);
  return c;
}

Fixed version (ground truth):
/** 
 * Creates column that indexes rows from 1 and is right aligned. The column is of type Void - table data type agnostic.
 * @param name name of the column. For example "#"
 * @return the column
 */
public static <T>TableColumn<T,Void> createIndexColumn(String name){
  TableColumn<T,Void> c=new TableColumn<>(name);
  c.setSortable(false);
  c.setCellFactory(column -> new TableCell<>(){
{
      setAlignment(CENTER_RIGHT);
    }
    @Override protected void updateItem(    Void item,    boolean empty){
      super.updateItem(item,empty);
      if (empty)       setText(null);
 else       setText(String.valueOf(getIndex() + 1) + "String_Node_Str");
    }
  }
);
  return c;
}
Program: 36508
Project: 36508
Buggy source:
/** 
 * Prints out the value of Duration - string representation of the duration in the format h:m:s - 00:00:00. If any of the h,m,s values is single digit, decade digit '0' is written to retain the correct format only IF include_zeros = true. If hours = 0, they are left out. Example: 1:00:06 4:45 34
 * @param duration
 * @param include_zeros
 * @return
 */
public static String formatDuration(Duration duration,boolean include_zeros){
  if (include_zeros)   return formatDuration(duration);
  double sec_total=duration.toMillis() / 1000;
  int seconds=(int)sec_total % 60;
  int minutes=(int)((sec_total - seconds) / 60) % 60;
  int hours=(int)(sec_total - seconds - 60 * minutes) / 3600;
  if (hours > 99)   return String.format("String_Node_Str",hours,minutes,seconds);
 else   if (hours > 0)   return String.format("String_Node_Str",hours,minutes,seconds);
 else   if (minutes > 0)   return String.format("String_Node_Str",minutes,seconds);
 else   return String.format("String_Node_Str",seconds);
}

Fixed version (ground truth):
/** 
 * Prints out the value of Duration - string representation of the duration in the format h:m:s - 00:00:00. If any of the h,m,s values is single digit, decade digit '0' is written to retain the correct format only IF include_zeros = true. If hours = 0, they are left out. Example: 1:00:06 4:45 34
 */
public static String formatDuration(Duration duration,boolean include_zeros){
  if (include_zeros)   return formatDuration(duration);
  double sec_total=duration.toMillis() / 1000;
  int seconds=(int)sec_total % 60;
  int minutes=(int)((sec_total - seconds) / 60) % 60;
  int hours=(int)(sec_total - seconds - 60 * minutes) / 3600;
  if (hours > 99)   return String.format("String_Node_Str",hours,minutes,seconds);
 else   if (hours > 0)   return String.format("String_Node_Str",hours,minutes,seconds);
 else   if (minutes > 0)   return String.format("String_Node_Str",minutes,seconds);
 else   return String.format("String_Node_Str",seconds);
}
Program: 36509
Project: 36509
Buggy source:
/** 
 * Checks and formats String so it can be safely used for naming a File. Replaces all forbidden characters with "_".
 * @param str
 * @return
 */
public static String filenamizeString(String str){
  String out=str;
  out=out.replace("String_Node_Str","String_Node_Str");
  out=out.replace("String_Node_Str","String_Node_Str");
  out=out.replace("String_Node_Str","String_Node_Str");
  out=out.replace("String_Node_Str","String_Node_Str");
  out=out.replace("String_Node_Str","String_Node_Str");
  out=out.replace("String_Node_Str","String_Node_Str");
  out=out.replace("String_Node_Str","String_Node_Str");
  out=out.replace("String_Node_Str","String_Node_Str");
  return out;
}

Fixed version (ground truth):
/** 
 * Checks and formats String so it can be safely used for naming a File. Replaces all forbidden characters with "_".
 */
public static String filenamizeString(String str){
  String out=str;
  out=out.replace("String_Node_Str","String_Node_Str");
  out=out.replace("String_Node_Str","String_Node_Str");
  out=out.replace("String_Node_Str","String_Node_Str");
  out=out.replace("String_Node_Str","String_Node_Str");
  out=out.replace("String_Node_Str","String_Node_Str");
  out=out.replace("String_Node_Str","String_Node_Str");
  out=out.replace("String_Node_Str","String_Node_Str");
  out=out.replace("String_Node_Str","String_Node_Str");
  return out;
}
Program: 36510
Project: 36510
Buggy source:
/** 
 * Creates zeropadded string - string of a number with '0' added in to maintain consistency in number of length.
 * @param n number to turn onto zeropadded string
 * @param max number to zeropad to
 * @param ch character to use. Notable characters are: ' ' or '0'
 * @return
 */
public static String zeroPad(int n,int max,char ch){
  int diff=digits(max) - digits(n);
  String out="String_Node_Str";
  for (int i=1; i <= diff; i++)   out+=ch;
  return out + String.valueOf(n);
}

Fixed version (ground truth):
/** 
 * Creates zeropadded string - string of a number with '0' added in to maintain consistency in number of length.
 * @param n number to turn onto zeropadded string
 * @param max number to zeropad to
 * @param ch character to use. Notable characters are: ' ' or '0'
 */
public static String zeroPad(int n,int max,char ch){
  int diff=digits(max) - digits(n);
  String out="String_Node_Str";
  for (int i=1; i <= diff; i++)   out+=ch;
  return out + String.valueOf(n);
}
Program: 36511
Project: 36511
Buggy source:
public static boolean containsNoCase(String text,String phrase,boolean ignore){
  return ignore ? text.contains(phrase) : containsIgnoreCase(text,phrase);
}

Fixed version (ground truth):
public static boolean containsNoCase(String text,String phrase,boolean ignore){
  return ignore ? text.contains(phrase) : containsNoCase(text,phrase);
}
Program: 36512
Project: 36512
Buggy source:
/** 
 * Compares two Artwork objects. Artwork's equals() method doesnt return true properly. Use this method instead. <p> Method is deprecated as Artwork should not be used anyway. The method works well though.
 * @param art1
 * @param art2
 * @return
 */
@Deprecated public static boolean equals(Artwork art1,Artwork art2){
  if (art1 == null && art2 == null) {
    return true;
  }
  if (art1 == null || art2 == null) {
    return false;
  }
  return Arrays.equals(art1.getBinaryData(),art2.getBinaryData());
}

Fixed version (ground truth):
/** 
 * Compares two Artwork objects. Artwork's equals() method doesnt return true properly. Use this method instead. <p> Method is deprecated as Artwork should not be used anyway. The method works well though.
 */
@Deprecated public static boolean equals(Artwork art1,Artwork art2){
  if (art1 == null && art2 == null)   return true;
  if (art1 == null || art2 == null)   return false;
  return Arrays.equals(art1.getBinaryData(),art2.getBinaryData());
}
Program: 36513
Project: 36513
Buggy source:
/** 
 * @param number
 * @return number of digits of a number
 */
public static int digits(int number){
  int x=number;
  int cifres=0;
  while (x > 0) {
    x/=10;
    cifres++;
  }
  return cifres;
}

Fixed version (ground truth):
/** 
 * Return number of digits of the number.
 */
public static int digits(int number){
  int x=number;
  int cifres=0;
  while (x > 0) {
    x/=10;
    cifres++;
  }
  return cifres;
}
Program: 36514
Project: 36514
Buggy source:
private BooleanField(Config<Boolean> c){
  super(c);
  ObservableValue<Boolean> v=c instanceof PropertyConfig && ((PropertyConfig)c).getProperty() instanceof ObservableValue ? (ObservableValue)((PropertyConfig)c).getProperty() : c instanceof ReadOnlyPropertyConfig ? ((ReadOnlyPropertyConfig)c).getProperty() : null;
  observable=v != null;
  cBox=new CheckIcon();
  cBox.styleclass("String_Node_Str");
  cBox.selected.setValue(config.getValue());
  if (observable)   v.addListener((o,ov,nv) -> cBox.selected.setValue(nv));
  cBox.selected.addListener((o,ov,nv) -> config.setNapplyValue(nv));
}

Fixed version (ground truth):
private BooleanField(Config<Boolean> c){
  super(c);
  ObservableValue<Boolean> v=getObservableValue(c);
  observable=v != null;
  cBox=new CheckIcon();
  cBox.styleclass("String_Node_Str");
  cBox.selected.setValue(config.getValue());
  if (observable)   v.addListener((o,ov,nv) -> cBox.selected.setValue(nv));
  cBox.selected.addListener((o,ov,nv) -> config.setNapplyValue(nv));
}
Program: 36515
Project: 36515
Buggy source:
public FileField(Config<File> c){
  super(c);
  refreshItem();
  editor.setOnItemChange((ov,nv) -> apply(false));
}

Fixed version (ground truth):
public FileField(Config<File> c){
  super(c);
  ObservableValue<File> v=getObservableValue(c);
  observable=v != null;
  editor.setValue(config.getValue());
  if (observable)   v.addListener((o,ov,nv) -> editor.setValue(nv));
  editor.setOnItemChange((ov,nv) -> apply(false));
}
Program: 36516
Project: 36516
Buggy source:
/** 
 * Creates new progress indicator in this window's header, and returns it. Bind or set its progress value to show ongoing task's progress. <ul> <li> Set the the indicator's progress to -1, to indicate the task has started. This will display the indicator. <li> Stop the indicator by setting progress to 1, when your task finishes. </ul> Always do both on FX application thread. <p> Multiple indicators are supported. Never use the same one for more than one task/work. <p> Indicator is disposed of automatically when progress is set to 1. Be sure that the task finishes at some point!
 * @return indicator
 */
public ProgressIndicator taskAdd(){
  Spinner p=new Spinner();
  Anim a=new Anim(at -> setScaleXY(p,at * at)).dur(500).intpl(new ElasticInterpolator());
  p.progressProperty().addListener((o,ov,nv) -> {
    if (nv.doubleValue() == -1) {
      leftHeaderBox.getChildren().add(p);
      a.then(null).play();
    }
    if (nv.doubleValue() == 1) {
      a.then(() -> leftHeaderBox.getChildren().remove(p)).playClose();
    }
  }
);
  return p;
}

Fixed version (ground truth):
/** 
 * Creates new progress indicator in this window's header, and returns it. Bind or set its progress value to show ongoing task's progress. <ul> <li> Set the the indicator's progress to -1, to indicate the task has started. This will display the indicator. <li> Stop the indicator by setting progress to 1, when your task finishes. </ul> Always do both on FX application thread. <p> Multiple indicators are supported. Never use the same one for more than one task/work. <p> Indicator is disposed of automatically when progress is set to 1. Be sure that the task finishes at some point!
 * @return indicator
 */
public ProgressIndicator taskAdd(){
  return App.Build.appProgressIndicator(pi -> leftHeaderBox.getChildren().add(pi),pi -> leftHeaderBox.getChildren().remove(pi));
}
Program: 36517
Project: 36517
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public String getName(){
  return name;
}

Fixed version (ground truth):
@Override public String getName(){
  return name;
}
Program: 36518
Project: 36518
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public Action getDefaultValue(){
  return new Action(name,action,info,group,defaultKeys,defaultGlobal,continuous);
}

Fixed version (ground truth):
@Override public Action getDefaultValue(){
  return new Action(name,action,info,group,defaultKeys,defaultGlobal,continuous);
}
Program: 36519
Project: 36519
Buggy source:
/** 
 * Activates listening process for global hotkeys. Not running this method will cause registered global hotkeys to not get invoked. Use once when application initializes. Does nothing if not supported.
 */
public static void startGlobalListening(){
  if (isGlobalShortcutsSupported()) {
    JIntellitype.getInstance().addHotKeyListener(global_listener);
    JIntellitype.getInstance().addIntellitypeListener(media_listener);
  }
}

Fixed version (ground truth):
/** 
 * Activates listening process for global hotkeys. Not running this method will cause registered global hotkeys to not get invoked. Use once when application initializes. Does nothing if not supported.
 */
private static void startGlobalListening(){
  if (isGlobalShortcutsSupported) {
    JIntellitype.getInstance().addHotKeyListener(global_listener);
    JIntellitype.getInstance().addIntellitypeListener(media_listener);
  }
}
Program: 36520
Project: 36520
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public boolean isEditable(){
  return true;
}

Fixed version (ground truth):
@Override public boolean isEditable(){
  return true;
}
Program: 36521
Project: 36521
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public double getMin(){
  return Double.NaN;
}

Fixed version (ground truth):
@Override public double getMin(){
  return Double.NaN;
}
Program: 36522
Project: 36522
Buggy source:
public static Action from(Action a,String str){
  Action tmp=fromString(str);
  if (tmp != null) {
    a.global=tmp.global;
    a.keys=tmp.keys;
  }
  return a;
}

Fixed version (ground truth):
@Deprecated public static Action from(Action a,String str){
  Action tmp=fromString(str);
  if (tmp != null) {
    a.global=tmp.global;
    a.keys=tmp.keys;
  }
  return a;
}
Program: 36523
Project: 36523
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public String getInfo(){
  return info;
}

Fixed version (ground truth):
@Override public String getInfo(){
  return info;
}
Program: 36524
Project: 36524
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public double getMax(){
  return Double.NaN;
}

Fixed version (ground truth):
@Override public double getMax(){
  return Double.NaN;
}
Program: 36525
Project: 36525
Buggy source:
/** 
 * registering helper methods 
 */
private void changeKeys(String keys){
  if (keys.isEmpty()) {
    this.keys=NO_MATCH;
  }
 else {
    try {
      this.keys=KeyCombination.keyCombination(keys);
    }
 catch (    Exception e) {
      log(this).warn("String_Node_Str",name,keys,e);
      this.keys=NO_MATCH;
    }
  }
}

Fixed version (ground truth):
/** 
 * helper methods 
 */
private void changeKeys(String keys){
  if (keys.isEmpty()) {
    this.keys=NO_MATCH;
  }
 else {
    try {
      this.keys=KeyCombination.keyCombination(keys);
    }
 catch (    Exception e) {
      log(this).warn("String_Node_Str",name,keys,e);
      this.keys=NO_MATCH;
    }
  }
}
Program: 36526
Project: 36526
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public String getGuiName(){
  return name;
}

Fixed version (ground truth):
@Override public String getGuiName(){
  return name;
}
Program: 36527
Project: 36527
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public Class<Action> getType(){
  return Action.class;
}

Fixed version (ground truth):
@Override public Class<Action> getType(){
  return Action.class;
}
Program: 36528
Project: 36528
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public String getGroup(){
  return group;
}

Fixed version (ground truth):
@Override public String getGroup(){
  return group;
}
Program: 36529
Project: 36529
Buggy source:
/** 
 * Deactivates listening process for local hotkeys.
 */
public static void stopLocalListening(){
  if (!isLocalShortcutsSupported())   return;
  JIntellitype.getInstance().cleanUp();
}

Fixed version (ground truth):
/** 
 * Deactivates listening process for local hotkeys.
 */
private static void stopLocalListening(){
  Stage.getWindows().removeListener(local_listener_registrator);
  Stage.getWindows().forEach(window -> {
    Scene scene=window.getScene();
    if (scene != null)     Action.getActions().forEach(a -> a.unregisterInScene(scene));
  }
);
}
Program: 36530
Project: 36530
Buggy source:
/** 
 * Activates listening process for local hotkeys.
 */
public static void startLocalListening(){
  if (!isLocalShortcutsSupported())   return;
  Stage.getWindows().forEach(window -> executeWhenNonNull(window.sceneProperty(),scene -> getActions().forEach(a -> a.registerInScene(scene))));
  Stage.getWindows().addListener(local_listener_registrator);
}

Fixed version (ground truth):
/** 
 * Activates listening process for local hotkeys. 
 */
private static void startLocalListening(){
  Stage.getWindows().addListener(local_listener_registrator);
}
Program: 36531
Project: 36531
Buggy source:
/** 
 * Deactivates listening process for global hotkeys. Frees resources. This method should should always be ran at the end of application's life cycle if   {@link #stopGlobalListening()} was invoked at least once.Not doing so might prevent from the application to close successfully, because bgr listening thread will not close.
 */
public static void stopGlobalListening(){
  if (isGlobalShortcutsSupported()) {
    JIntellitype.getInstance().cleanUp();
  }
}

Fixed version (ground truth):
/** 
 * Deactivates listening process for global hotkeys. Frees resources. This method should should always be ran at the end of application's life cycle if   {@link #stopGlobalListening()} was invoked at least once.Not doing so might prevent from the application to close successfully, because bgr listening thread will not close.
 */
private static void stopGlobalListening(){
  if (isGlobalShortcutsSupported) {
    JIntellitype.getInstance().cleanUp();
  }
}
Program: 36532
Project: 36532
Buggy source:
private void registerGlobal(){
  JIntellitype.getInstance().registerHotKey(getID(),getKeys());
}

Fixed version (ground truth):
private void registerGlobal(){
  if (!isActionListening())   return;
  JIntellitype.getInstance().registerHotKey(getID(),getKeys());
}
Program: 36533
Project: 36533
Buggy source:
private Action(boolean isGlobal,KeyCombination keys){
  this.name=null;
  this.action=null;
  this.info=null;
  this.group=null;
  this.continuous=false;
  this.global=isGlobal;
  this.keys=keys;
  this.defaultGlobal=isGlobal;
  this.defaultKeys=getKeys();
}

Fixed version (ground truth):
@Deprecated private Action(boolean isGlobal,KeyCombination keys){
  this.name=null;
  this.action=null;
  this.info=null;
  this.group=null;
  this.continuous=false;
  this.global=isGlobal;
  this.keys=keys;
  this.defaultGlobal=isGlobal;
  this.defaultKeys=getKeys();
}
Program: 36534
Project: 36534
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public boolean isMinMax(){
  return false;
}

Fixed version (ground truth):
@Override public boolean isMinMax(){
  return false;
}
Program: 36535
Project: 36535
Buggy source:
public void unregister(){
  if (isGlobalShortcutsSupported())   unregisterGlobal();
  unregisterInApp();
}

Fixed version (ground truth):
public void unregister(){
  if (isGlobalShortcutsSupported())   unregisterGlobal();
  unregisterLocal();
}
Program: 36536
Project: 36536
Buggy source:
public void registerInScene(Scene s){
  if (!APP.initialized || s == null)   return;
  s.getAccelerators().put(getKeysForLocalRegistering(),this);
}

Fixed version (ground truth):
private void registerInScene(Scene s){
  if (!isActionListening())   return;
  s.getAccelerators().put(getKeysForLocalRegistering(),this);
}
Program: 36537
Project: 36537
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public void applyValue(Action val){
  register();
}

Fixed version (ground truth):
@Override public void applyValue(Action val){
  register();
}
Program: 36538
Project: 36538
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public Action getValue(){
  return this;
}

Fixed version (ground truth):
/** 
 * AS CONFIG 
 */
@Override public Action getValue(){
  return this;
}
Program: 36539
Project: 36539
Buggy source:
public void unregisterInScene(Scene s){
  if (s == null)   return;
  s.getAccelerators().remove(getKeysForLocalRegistering());
}

Fixed version (ground truth):
private void unregisterInScene(Scene s){
  if (s == null)   return;
  s.getAccelerators().remove(getKeysForLocalRegistering());
}
Program: 36540
Project: 36540
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public void setValue(Action val){
  set(val.isGlobal(),val.getKeys());
}

Fixed version (ground truth):
@Override public void setValue(Action val){
  set(val.isGlobal(),val.getKeys());
}
Program: 36541
Project: 36541
Buggy source:
public static Action fromString(String str){
  int i=str.lastIndexOf("String_Node_Str");
  if (i == -1)   return null;
  String s1=str.substring(0,i);
  String s2=str.substring(i + 1,str.length());
  boolean g=Boolean.parseBoolean(s1);
  KeyCombination k=s2.isEmpty() ? KeyCombination.NO_MATCH : KeyCodeCombination.valueOf(s2);
  return new Action(g,k);
}

Fixed version (ground truth):
@Deprecated public static Action fromString(String str){
  int i=str.lastIndexOf("String_Node_Str");
  if (i == -1)   return null;
  String s1=str.substring(0,i);
  String s2=str.substring(i + 1,str.length());
  boolean g=Boolean.parseBoolean(s1);
  KeyCombination k=s2.isEmpty() ? KeyCombination.NO_MATCH : KeyCodeCombination.valueOf(s2);
  return new Action(g,k);
}
Program: 36542
Project: 36542
Buggy source:
/** 
 * Activates shortcut. Only registered shortcuts can be invoked. <p> If the   {@link #hasKeysAssigned()} returns false, registration will nottake place. <p> For local action this method will succeed only after  {@link Scene} isalready initialized. For global, platform support is required. If it isnt, shortcut will be registered locally, although the action will remain global. <p> Note that shortcut can be registered globally multiple times even with the same keys and locally with different keys. Make sure the action is unregistered before registering it.
 */
public void register(){
  if (!hasKeysAssigned())   return;
  if (global && global_shortcuts.getValue() && isGlobalShortcutsSupported())   registerGlobal();
 else   runLater(this::registerInApp);
}

Fixed version (ground truth):
/** 
 * Activates shortcut. Only registered shortcuts can be invoked. <p> If the   {@link #hasKeysAssigned()} returns false, registration will nottake place. <p> For local action this method will succeed only after  {@link Scene} isalready initialized. For global, platform support is required. If it isnt, shortcut will be registered locally, although the action will remain global. <p> Note that shortcut can be registered globally multiple times even with the same keys and locally with different keys. Make sure the action is unregistered before registering it.
 */
public void register(){
  if (!hasKeysAssigned())   return;
  boolean can_be_global=global && global_shortcuts.getValue() && isGlobalShortcutsSupported();
  if (can_be_global)   registerGlobal();
 else   registerLocal();
}
Program: 36543
Project: 36543
Buggy source:
/** 
 * Returns to last remembered state. Needed during window initialization. Doesnt affect content of the window.
 */
public void update(){
  s.setWidth(WProp.get());
  s.setHeight(HProp.get());
  List<Screen> scrs=Screen.getScreens();
  Rectangle2D psb=Screen.getPrimary().getBounds();
  double sxmin=scrs.stream().mapToDouble(s -> s.getBounds().getMinX()).min().orElse(psb.getMinX());
  double symin=scrs.stream().mapToDouble(s -> s.getBounds().getMinY()).min().orElse(psb.getMinY());
  double sxmax=scrs.stream().mapToDouble(s -> s.getBounds().getMaxX()).min().orElse(psb.getMaxX());
  double symax=scrs.stream().mapToDouble(s -> s.getBounds().getMaxY()).min().orElse(psb.getMaxY());
  if (YProp.get() < symin)   YProp.setValue(symin);
  if (YProp.get() > symax)   YProp.setValue(symax);
  if (XProp.get() < sxmin)   XProp.setValue(sxmin);
  if (XProp.get() > sxmax)   XProp.setValue(sxmax);
  s.setX(XProp.get());
  s.setY(YProp.get());
  Maximized m=MaxProp.get();
  setMaximized(Maximized.NONE);
  setMaximized(m);
  if (FullProp.get())   run(322,() -> setFullscreen(true));
}

Fixed version (ground truth):
/** 
 * Returns to last remembered state. Needed during window initialization. Doesnt affect content of the window.
 */
public void update(){
  s.setWidth(WProp.get());
  s.setHeight(HProp.get());
  List<Screen> scrs=Screen.getScreens();
  Rectangle2D psb=Screen.getPrimary().getBounds();
  double sxmin=scrs.stream().mapToDouble(s -> s.getBounds().getMinX()).min().orElse(psb.getMinX());
  double symin=scrs.stream().mapToDouble(s -> s.getBounds().getMinY()).min().orElse(psb.getMinY());
  double sxmax=scrs.stream().mapToDouble(s -> s.getBounds().getMaxX()).min().orElse(psb.getMaxX());
  double symax=scrs.stream().mapToDouble(s -> s.getBounds().getMaxY()).min().orElse(psb.getMaxY());
  if (YProp.get() < symin)   YProp.setValue(symin);
  if (YProp.get() > symax)   YProp.setValue(symax);
  if (XProp.get() < sxmin)   XProp.setValue(sxmin);
  if (XProp.get() > sxmax)   XProp.setValue(sxmax);
  s.setX(XProp.get());
  s.setY(YProp.get());
  screen=getScreen(getCenterXY());
  Maximized m=MaxProp.get();
  setMaximized(Maximized.NONE);
  setMaximized(m);
  if (FullProp.get())   run(322,() -> setFullscreen(true));
}
Program: 36546
Project: 36546
Buggy source:
@Override public void init(){
  thumb.setBackgroundVisible(false);
  thumb.setBorderVisible(false);
  thumb.setDragEnabled(true);
  layAnchor(root,thumb.getPane(),0d);
  root.setOnDragOver(DragUtil.imageFileDragAccepthandlerNo(() -> img));
  root.setOnDragDropped(e -> {
    if (DragUtil.hasImage(e.getDragboard())) {
      Fut<File> future=DragUtil.getImage(e);
      future.use(img -> showImage(img),FX).showProgress(!future.isDone(),App.getWindow()::taskAdd).run();
      e.setDropCompleted(true);
      e.consume();
    }
  }
);
}

Fixed version (ground truth):
@Override public void init(){
  thumb.setBackgroundVisible(false);
  thumb.setBorderVisible(false);
  thumb.setDragEnabled(true);
  layAnchor(root,thumb.getPane(),0d);
  root.setOnDragOver(DragUtil.imgFileDragAccepthandlerNo(() -> img));
  root.setOnDragDropped(e -> {
    if (DragUtil.hasImage(e.getDragboard())) {
      Fut<File> future=DragUtil.getImage(e);
      future.use(img -> showImage(img),FX).showProgress(!future.isDone(),App.getWindow()::taskAdd).run();
      e.setDropCompleted(true);
      e.consume();
    }
  }
);
}
Program: 36549
Project: 36549
Buggy source:
private static Playlist getUnusedPlaylist(UUID id){
  List<Playlist> pall=list(PlaylistManager.playlists);
  WidgetManager.findAll(OPEN).filter(w -> w.getInfo().hasFeature(PlaylistFeature.class)).map(w -> ((PlaylistFeature)w.getController()).getPlaylist()).filter(isNotNULL).forEach(p -> pall.removeIf(pl -> pl.id.equals(p.id)));
  Playlist leaf=pall.isEmpty() ? null : pall.get(0);
  for (  Playlist p : pall)   if (p.id.equals(PlaylistManager.active))   leaf=p;
  if (leaf != null)   PlaylistManager.playlists.remove(leaf);
  if (leaf != null) {
    if (leaf.id.equals(PlaylistManager.active))     PlaylistManager.active=id;
    util.Util.setField(Playlist.class,leaf,"String_Node_Str",id);
  }
  return leaf == null ? new Playlist(id) : leaf;
}

Fixed version (ground truth):
private static Playlist getUnusedPlaylist(UUID id){
  List<Playlist> pall=list(PlaylistManager.playlists);
  WidgetManager.findAll(OPEN).filter(w -> w.getInfo().hasFeature(PlaylistFeature.class)).map(w -> ((PlaylistFeature)w.getController()).getPlaylist()).filter(ISNTØ).forEach(p -> pall.removeIf(pl -> pl.id.equals(p.id)));
  Playlist leaf=pall.isEmpty() ? null : pall.get(0);
  for (  Playlist p : pall)   if (p.id.equals(PlaylistManager.active))   leaf=p;
  if (leaf != null)   PlaylistManager.playlists.remove(leaf);
  if (leaf != null) {
    if (leaf.id.equals(PlaylistManager.active))     PlaylistManager.active=id;
    util.Util.setField(Playlist.class,leaf,"String_Node_Str",id);
  }
  return leaf == null ? new Playlist(id) : leaf;
}
Program: 36550
Project: 36550
Buggy source:
@Override protected void generateValue(){
  if (inconsistent_state || converter == null)   return;
  conjuction=chain.stream().filter(g -> g.on.get()).map(g -> g.chained.getValue()).filter(isNotNULL).map(g -> converter.apply(g._2,g._1)).reduce(Predicate::and).orElse(isTRUE);
  if (onFilterChange != null)   onFilterChange.accept(conjuction);
}

Fixed version (ground truth):
@Override protected void generateValue(){
  if (inconsistent_state || converter == null)   return;
  conjuction=chain.stream().filter(g -> g.on.get()).map(g -> g.chained.getValue()).filter(ISNTØ).map(g -> converter.apply(g._2,g._1)).reduce(Predicate::and).orElse(isTRUE);
  if (onFilterChange != null)   onFilterChange.accept(conjuction);
}
Program: 36551
Project: 36551
Buggy source:
private void timeUpdateDo(long frame){
  if (!user_drag && PLAYBACK.state.status.get() == PLAYING) {
    long Δt=posLastFrame == 0 ? 0 : (frame - posLastFrame) / 1000000;
    double Δp=Δt / timeTot.get().toMillis();
    double p=posLast + Δp;
    posLast=p;
    long now=System.currentTimeMillis();
    if (now - polastUpdate > posUpdateInterval) {
      polastUpdate=now;
      seeker.setValue(p);
    }
  }
  posLastFrame=frame;
}

Fixed version (ground truth):
private void timeUpdateDo(long frame){
  if (!user_drag && PLAYBACK.state.status.get() == PLAYING) {
    long Δt=posLastFrame == 0 ? 0 : (frame - posLastFrame) / 1000000;
    double Δp=Δt / timeTot.get().toMillis();
    posLast+=Δp;
    long now=System.currentTimeMillis();
    if (now - polastUpdate > posUpdateInterval) {
      polastUpdate=now;
      seeker.setValue(posLast);
    }
  }
  posLastFrame=frame;
}
Program: 36552
Project: 36552
Buggy source:
public static void launchComponent(File launcher){
  WidgetFactory wf=null;
  Component w=null;
  String wn=FileUtil.readFileLines(launcher).limit(1).findAny().orElse("String_Node_Str");
  wf=WidgetManager.getFactory(wn);
  if (wf != null)   w=wf.create();
  if (w == null) {
    try {
      w=(Component)App.INSTANCE.serialization.x.fromXML(launcher);
    }
 catch (    ClassCastException|StreamException ignored) {
    }
  }
  if (w == null) {
    wf=WidgetManager.getFactory(getName(launcher));
    if (wf != null)     w=wf.create();
  }
  if (w != null) {
    if (launching1st) {
      App.getWindow().setContent(w);
      launching1st=false;
    }
 else {
      showWindow(w);
    }
  }
}

Fixed version (ground truth):
public static void launchComponent(File launcher){
  try {
    WidgetFactory wf=null;
    Component w=null;
    String wn=FileUtil.readFileLines(launcher).limit(1).findAny().orElse("String_Node_Str");
    wf=WidgetManager.getFactory(wn);
    if (wf != null)     w=wf.create();
    if (w == null) {
      try {
        w=(Component)App.INSTANCE.serialization.x.fromXML(launcher);
      }
 catch (      ClassCastException|StreamException ignored) {
        LOGGER.error("String_Node_Str",launcher);
      }
    }
    if (w == null) {
      wf=WidgetManager.getFactory(getName(launcher));
      if (wf != null)       w=wf.create();
    }
    if (w != null) {
      if (launching1st) {
        App.getWindow().setContent(w);
        launching1st=false;
      }
 else {
        showWindow(w);
      }
    }
  }
 catch (  Exception x) {
    LOGGER.error("String_Node_Str",x);
  }
}
Program: 36553
Project: 36553
Buggy source:
public static void showSettings(String name,Configurable c,Node n){
  Configurator sc=new Configurator(true);
  sc.configure(c);
  PopOver p=new PopOver(sc);
  p.title.set((name == null ? "String_Node_Str" : name + "String_Node_Str") + "String_Node_Str");
  p.setArrowSize(0);
  p.setAutoFix(true);
  p.setAutoHide(true);
  p.show(n);
}

Fixed version (ground truth):
public static void showSettings(Configurable c,Node n){
  String name=c instanceof Widget ? ((Widget)c).getName() : "String_Node_Str";
  Configurator sc=new Configurator(true);
  sc.configure(c);
  PopOver p=new PopOver(sc);
  p.title.set((name == null ? "String_Node_Str" : name + "String_Node_Str") + "String_Node_Str");
  p.setArrowSize(0);
  p.setAutoFix(true);
  p.setAutoHide(true);
  p.show(n);
}
Program: 36554
Project: 36554
Buggy source:
/** 
 * @param widget widget to open, does nothing when null.
 */
public static Window showWindow(Component widget){
  Window w=Window.create();
  w.initLayout();
  w.setContent(widget);
  w.show();
  w.setScreen(Window.getActive().getScreen());
  w.setXyCenter();
  return w;
}

Fixed version (ground truth):
/** 
 * @param widget widget to open, does nothing when null.
 */
public static Window showWindow(Component widget){
  Window w=Window.create();
  w.initLayout();
  w.setContent(widget);
  w.show();
  w.setScreen(Window.getActive().getScreen());
  w.centerOnScreen();
  return w;
}
Program: 36555
Project: 36555
Buggy source:
public void setAsMain(){
  if (App.getWindow() != null)   throw new RuntimeException("String_Node_Str");
  main=true;
  setIcon(App.getIcon());
  setTitlePosition(Pos.CENTER_LEFT);
  App.window=this;
}

Fixed version (ground truth):
private void setAsMain(){
  no(App.getWindow() != null,"String_Node_Str");
  App.window=this;
  main=true;
  App.getWindowOwner().setX(getCenterX());
  moving.addListener((o,ov,nv) -> {
    if (ov && !nv)     App.getWindowOwner().setX(getCenterX());
  }
);
  setIcon(App.getIcon());
  setTitle(null);
}