Program: 30314
Project: 30314
Buggy source:
@Override public void update(int screenWidth,int screenHeight,boolean centerCamera){
  super.setWorldSize(minWorldWidth,minWorldHeight);
  Vector2 scaled=Scaling.fit.apply(getWorldWidth(),getWorldHeight(),screenWidth,screenHeight);
  setScreenWidth(Math.round(scaled.x));
  setScreenHeight(Math.round(scaled.y));
  if (getScreenWidth() < screenWidth) {
    float toViewportSpace=getScreenHeight() / getWorldHeight();
    float toWorldSpace=getWorldHeight() / getScreenHeight();
    float lengthen=(screenWidth - getScreenWidth()) * toWorldSpace;
    if (maxWorldWidth > 0)     lengthen=Math.min(lengthen,maxWorldWidth - minWorldWidth);
    setWorldWidth(getWorldWidth() + lengthen);
    setScreenWidth(getScreenWidth() + Math.round(lengthen * toViewportSpace));
  }
 else   if (getScreenHeight() < screenHeight) {
    float toViewportSpace=getScreenWidth() / getWorldWidth();
    float toWorldSpace=getWorldWidth() / getScreenWidth();
    float lengthen=(screenHeight - getScreenHeight()) * toWorldSpace;
    if (maxWorldHeight > 0)     lengthen=Math.min(lengthen,maxWorldHeight - minWorldHeight);
    setWorldHeight(getWorldHeight() + lengthen);
    setScreenHeight(getScreenHeight() + Math.round(lengthen * toViewportSpace));
  }
  setScreenX((screenWidth - getScreenWidth()) / 2);
  setScreenY((screenHeight - getScreenHeight()) / 2);
  apply(centerCamera);
  EngineLogger.debug("String_Node_Str" + getScreenWidth() + "String_Node_Str"+ getScreenHeight());
}

Fixed version (ground truth):
@Override public void update(int screenWidth,int screenHeight,boolean centerCamera){
  Vector2 s=Scaling.fill.apply(getWorldWidth(),getWorldHeight(),screenWidth,screenHeight);
  if (s.x > screenWidth)   setWorldWidth(minWorldWidth);
 else   setWorldHeight(minWorldHeight);
  Vector2 scaled=Scaling.fit.apply(getWorldWidth(),getWorldHeight(),screenWidth,screenHeight);
  setScreenWidth(Math.round(scaled.x));
  setScreenHeight(Math.round(scaled.y));
  if (getScreenWidth() < screenWidth) {
    float toViewportSpace=getScreenHeight() / getWorldHeight();
    float toWorldSpace=getWorldHeight() / getScreenHeight();
    float lengthen=(screenWidth - getScreenWidth()) * toWorldSpace;
    if (maxWorldWidth > 0)     lengthen=Math.min(lengthen,maxWorldWidth - minWorldWidth);
    setWorldWidth(getWorldWidth() + lengthen);
    setScreenWidth(getScreenWidth() + Math.round(lengthen * toViewportSpace));
  }
 else   if (getScreenHeight() < screenHeight) {
    float toViewportSpace=getScreenWidth() / getWorldWidth();
    float toWorldSpace=getWorldWidth() / getScreenWidth();
    float lengthen=(screenHeight - getScreenHeight()) * toWorldSpace;
    if (maxWorldHeight > 0)     lengthen=Math.min(lengthen,maxWorldHeight - minWorldHeight);
    setWorldHeight(getWorldHeight() + lengthen);
    setScreenHeight(getScreenHeight() + Math.round(lengthen * toViewportSpace));
  }
  setScreenX((screenWidth - getScreenWidth()) / 2);
  setScreenY((screenHeight - getScreenHeight()) / 2);
  apply(centerCamera);
  EngineLogger.debug("String_Node_Str" + getScreenWidth() + "String_Node_Str"+ getScreenHeight());
  EngineLogger.debug("String_Node_Str" + getWorldWidth() + "String_Node_Str"+ getWorldHeight());
}