Buggy code:
public class WorldMaker { private final char [ ] generic = new char [ ] { 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' , 'H' , 'I' , 'J' , 'K' , 'L' , 'M' , 'N' , 'O' , 'P' , 'Q' , 'R' , 'S' , 'T' , 'U' , 'V' , 'W' , 'X' , 'Y' , 'Z' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '0' } ; private final String [ ] greek = new String [ ] { "Alpha" , "Beta" , "Gamma" , "Delta" , "Epsilon" , "Zeta" , "Eta" , "Theta" , "Iota" , "Kappa" , "Lambda" , "Mu" , "Nu" , "Xi" , "Omicron" , "Pi" , "Rho" , "Sigma" , "Tau" , "Upsilon" , "Phi" , "Chi" , "Psi" , "Omega" } ; private final String [ ] namePrefixModifiers = new String [ ] { "New" , "Cape" , "Port" } ; private final String [ ] nameSuffixModifiers = new String [ ] { "Minor" , "Major" } ; private final ArrayList < String > usedSystemNames = new ArrayList < > ( ) ; private final ArrayList < String > usedPlanetNames = new ArrayList < > ( ) ; Random rnd ; public WorldMaker ( ) { } public static void main ( String [ ] args ) { } public final String generate ( int masterSeed , int minPlanetsPerSystem , int maxPlanetsPerSystem , int minSystems , int maxSystems , int worldSize , int minSystemSize , int maxSystemSize , int minPlanetSize , int maxPlanetSize , int minNebulaPerSystem , float nebulaProbability , float fieldProbability ) { } private Vector3f pointNearSimpling ( WorldMaker . Simpling host ) { } private String pickPlanetTexture ( ArrayList < Term > planetTypes ) { float [ ] prob = new float [ planetTypes . size ( ) ] ; for ( int a = 0 ; a < ( planetTypes . size ( ) ) ; a ++ ) { prob [ a ] = Float . parseFloat ( planetTypes . get ( a ) . getValue ( "probability" ) ) ; } float [ ] stops = new float [ planetTypes . size ( ) ] ; for ( int a = 0 ; a < ( stops . length ) ; a ++ ) { stops [ a ] = sumAtIndex ( a , prob ) ; } <START_BUG> float val = new Random ( ) . nextFloat ( ) ; <END_BUG> int index = 0 ; { for ( int a = 1 ; a < ( stops . length ) ; a ++ ) { if ( val >= ( stops [ ( a - 1 ) ] ) ) { index = a ; } } } Term type = planetTypes . get ( index ) ; System . out . println ( ( ( index + "<seq2seq4repair_space>::<seq2seq4repair_space>" ) + ( type . getValue ( "name" ) ) ) ) ; return type . getValue ( "name" ) ; } private float sumAtIndex ( int index , float [ ] arr ) { } private ArrayList < WorldMaker . Sysling > makeSyslings ( int numSystems , Random rnd , int worldSize ) { } private String randomName ( ) { } public String randomPlanetName ( ) { } public String randomSystemName ( char [ ] sample ) { } private void dropSov ( ArrayList < WorldMaker . Sysling > syslings ) { } private void dropStations ( ArrayList < WorldMaker . Sysling > syslings , Faction faction ) { } public class Sysling { private final Vector3f loc ; private WorldMaker . Sysling [ ] neighbors ; private final ArrayList < WorldMaker . Sysling > connections = new ArrayList < > ( ) ; private final ArrayList < WorldMaker . Statling > stations = new ArrayList < > ( ) ; private final String name ; private String owner = "Neutral" ; private String ambientMusic = "Audio//Music//Undefined.wav" ; private String dangerMusic = "Audio//Music//Committing.wav" ; private final SuperFaction neutralFaction = new SuperFaction ( null , "Neutral" ) ; public Sysling ( String name , Vector3f loc ) { } public void addConnection ( WorldMaker . Sysling sys ) { } public boolean connectedTo ( WorldMaker . Sysling test ) { } public void sortBuddy ( ArrayList < WorldMaker . Sysling > verse ) { } public WorldMaker . Sysling findBuddy ( ArrayList < WorldMaker . Sysling > verse , int place ) { } public boolean collideWith ( WorldMaker . Sysling test ) { } public double distance ( WorldMaker . Sysling comp ) { } public Vector3f getLoc ( ) { } public String getName ( ) { } @ Override public String toString ( ) { } public String getOwner ( ) { } public void setOwner ( String owner ) { } public ArrayList < WorldMaker . Statling > getStations ( ) { } public String getAmbientMusic ( ) { } public final void setAmbientMusic ( String ambientMusic ) { } public String getDangerMusic ( ) { } public final void setDangerMusic ( String dangerMusic ) { } } public class Statling { private String name ; private String type ; private String owner ; public Statling ( String name , String type , String owner ) { } public String getName ( ) { } public void setName ( String name ) { } public String getType ( ) { } public void setType ( String type ) { } public String getOwner ( ) { } public void setOwner ( String owner ) { } } public class Simpling { private final Vector3f loc ; private final float rad ; public Simpling ( Vector3f loc , float rad ) { } public boolean collideWith ( WorldMaker . Simpling test ) { } public Vector3f getLoc ( ) { } public float getRad ( ) { } } }

Fix:
float val = rnd . nextFloat ( ) ;