switch (kafkaStreams.state()) {
                case RUNNING: {
                    if (kafkaStreams.state().isRunning()) {
                        countDownLatch.countDown();
                    }
                }
                break;
By Anonymous, 2018-07-05 18:05:59
#266 Java -28
        //JSONObject input;
        
        String givenName = input.get("propName") != null ? (String)input.get("propName") : null;

WHAT DA FUCK ASSHOLES

By Anonymous, 2018-03-15 15:28:55
String zeroPad(int number) {
  return number < 10 ? "0" + number : String.valueOf(number);
}

You could just have done String.format("%02d", number);

By Anonymous, 2022-04-30 10:50:20
public class MandateData {

    public final UUID coreId;
    public final UUID accountId;
    public final String accountRef;
    public final String creditorId;
    public final String creditorName;
    public final String debtorFirstName;
    public final String debtorLastName;
    public final String branchCode;
    public final String accountNumber;
    public final LocalDate signingDate;
    public final Address debtorAddress;

    private MandateData(UUID coreId, UUID accountId, String accountRef, String creditorId, String creditorName, String branchCode, String accountNumber, String debtorFirstName, String debtorLastName,
                        LocalDate signingDate, Address debtorAddress) {
        this.coreId = coreId;
        this.accountId = accountId;
        this.accountRef = accountRef;
        this.creditorId = creditorId;
        this.creditorName = creditorName;
        this.debtorFirstName = debtorFirstName;
        this.debtorLastName = debtorLastName;
        this.branchCode = branchCode;
        this.accountNumber = accountNumber;
        this.signingDate = signingDate;
        this.debtorAddress = debtorAddress;
    }

    public static MandateData creationMandateData(UUID coreId, UUID accountId, String accountRef, String creditorId, String creditorName, String branchCode, String accountNumber, String debtorFirstName, String debtorLastName,
                                                  LocalDate signingDate, Address debtorAddress) {
        return new MandateData(coreId, accountId, accountRef, creditorId, creditorName, branchCode, accountNumber, debtorFirstName, debtorLastName, signingDate, debtorAddress);
    }
}

There is an ancient and mysterious legend about public static constructor, called createShit. If anyone want's just to create an instance of Shit be aware of it! This is too obvious! just Implement static method with the exactly the same fields, and make constructor private. Don't write a shit!

By Anonymous, 2018-06-07 13:03:44
private HashMap<String, Tuple6<float[], String[], String[], String[], String[], String>> memberNameChangedToProtectTheInnocent = null;
By Anonymous, 2017-12-12 12:13:22
 private void EnableGPSAutoMatically() {
        GoogleApiClient googleApiClient = null;
        if (googleApiClient == null) {
            oogleApiClient = new GoogleApiClient.Builder(this)
                    .addApi(LocationServices.API).addConnectionCallbacks(this)
                    .addOnConnectionFailedListener(this).build();
            /* about 50 lines of code were here ... 
             * all depends on this if statement ... !
             * Actually the whole method depends on this if statement ! */
                    }
                }
            });
        }
}

what if that mysterious power change it to be not null !! It gonna be a holly object and You should not "new" it anymore ?! damn ... :)))

By Anonymous, 2018-03-28 11:31:15
    public static String arrayToString(List list) {
        if (list == null) {
            throw new IllegalArgumentException("list is null");
        }
        return list.toString()
                .replace("[", "")  //remove the right bracket
                .replace("]", "")  //remove the left bracket
                .trim();
    }
By Anonymous, 2023-07-30 00:29:07
public void sleep(long duration) {
    long start = System.currentTimeMillis();
    while(true) {
        if (System.currentTimeMillis() - start >= duration)
            break;
    }
}
By imaN NeO, 2018-10-28 09:35:15
public static Integer find(List<String> list, String name, int i) {
    if(list.get(i).equals(name)) {
        return i;
    }
    else return find(list, name, i+1)
}
By s0m31, 2022-06-03 15:54:11
                    //read country intformation and assign to variables
                    cName = InpList.get(0).replace(",", ".");
                    cCode = InpList.get(1).replace(",", ".");
                    cAlpha2 = InpList.get(2).replace(",", ".");
                    cAbreviation = InpList.get(3).replace(",", ".");
                    dYear = InpList.get(4).replace(",", ".");
                    dPoliticalCompatibility = InpList.get(5).replace(",", ".");
                    dRankPoliticalCompatibility = InpList.get(6).replace(",", ".");
                    dEconomicCompatibility = InpList.get(7).replace(",", ".");
                    dRankEconomicCompatibility = InpList.get(8).replace(",", ".");
                    dMilitaryCompatibility = InpList.get(9).replace(",", ".");
                    dRankMilitaryCompatibility = InpList.get(10).replace(",", ".");
                    dDemoScore = InpList.get(11).replace(",", ".");
                    dRankDemoScore = InpList.get(12).replace(",", ".");
                    dEnvironmentalCompatibility = InpList.get(13).replace(",", ".");
                    dRankEnvironmentalCompatibility = InpList.get(14).replace(",", ".");
                    dSumCompatibility = InpList.get(15).replace(",", ".");
                    dRankCompatibility = InpList.get(16).replace(",", ".");
                    dPoliticalUtility = InpList.get(17).replace(",", ".");
                    dRankPoliticalUtility = InpList.get(18).replace(",", ".");
                    dEconomicUtility = InpList.get(19).replace(",", ".");
                    dRankEconomicUtility = InpList.get(20).replace(",", ".");
                    dMilitaryUtility = InpList.get(21).replace(",", ".");
                    dRankMilitaryUtility = InpList.get(22).replace(",", ".");
                    dEnvironmentalUtility = InpList.get(23).replace(",", ".");
                    dRankEnvironmentalUtility = InpList.get(24).replace(",", ".");
                    dSumUtility = InpList.get(25).replace(",", ".");
                    dRankUtility = InpList.get(26).replace(",", ".");
                    dPoliticalScore = InpList.get(27).replace(",", ".");
                    dRankPoliticalScore = InpList.get(28).replace(",", ".");
                    dEconomicScore = InpList.get(29).replace(",", ".");
                    dRankEconomicScore = InpList.get(30).replace(",", ".");
                    dMilitaryScore = InpList.get(31).replace(",", ".");
                    dRankMilitaryScore = InpList.get(32).replace(",", ".");
                    dEnvironmentalScore = InpList.get(33).replace(",", ".");
                    dRankEnvironmentalScore = InpList.get(34).replace(",", ".");
                    dAggregate = InpList.get(35).replace(",", ".");
                    dRankAggregate = InpList.get(36).replace(",", ".");
By Anonymous, 2017-12-17 21:45:26
boolean isUserAuthorized = user.isSuperAdmin();
if (!isUserAuthorized) {
    isUserAuthorized = isUserAdminOfEntity1();
}
if (!isUserAuthorized) {
    isUserAuthorized = isUserAdminOfEntity2();
}
if (!isUserAuthorized) {
    throw new AccessDeniedException("Authenticated user is not admin ");
}
By tralaladidou, 2019-05-07 16:37:32
    @Override
    public String toString() {
        List<Integer> accountLevels = new ArrayList<>();
        List<String> accountIds = new ArrayList<>();

        for (SelectedHierarchyLevel selectedHierarchyLevel : selectedHierarchyLevels) {
            accountLevels.add(selectedHierarchyLevel.getLevel());
            accountIds.add(selectedHierarchyLevel.getAccountRowId());
        }

        vetoAreValidIds(accountIds);
        StringBuilder converterString = new StringBuilder();

        convert(accountLevels, converterString);
        converterString.append("$");
        convert(accountIds, converterString);

        return converterString.toString();
    }

Just because you can, doesn’t mean you should.

By Anonymous, 2019-04-12 10:55:17
public abstract class AbstractInventoryProductFactoryManagerSingletonServiceManagerFactoryExceptionHandlerResourceHandlerDatabaseConnectionHandlerImpl {
    
    private static AbstractInventoryProductFactoryManagerSingletonServiceManagerFactoryExceptionHandlerResourceHandlerDatabaseConnectionHandlerImpl theOneAndOnlyInstance;
    private Connection theUnbreakableEverlastingDatabaseLifeline;

    public static AbstractInventoryProductFactoryManagerSingletonServiceManagerFactoryExceptionHandlerResourceHandlerDatabaseConnectionHandlerImpl summonTheSingleton() {
        if (theOneAndOnlyInstance == null) {
            theOneAndOnlyInstance = new ConcreteImplementation();
        }
        return theOneAndOnlyInstance;
    }

    public abstract void initiateUnswervingDatabaseLinkWithCompulsiveRetriesAndUnyieldingTimeout();
    public abstract InventoryProduct concoctAndJumpstartBrandNewInventoryProductPostRigorousValidation();
    public abstract Service bootstrapAndEnrollNovelServicePostInfallibleAvailabilityCheck();
    public abstract void seizeAndChronicleExceptionWithStackTrackAndSignalDeveloper(Exception e);
    public abstract void manageAndFineTuneResourceConsumptionForPeakEfficiency(Resource resource);
    public abstract void launchDatabaseTransactionWithOptimumIsolationLevel();
    public abstract void ratifyDatabaseTransactionAndScourForPossibleConflicts();
    public abstract void revokeDatabaseTransactionInEventOfUnforeseenErrors();
    public abstract void safelySeverDatabaseConnectionAndLiberatePreciousResources();
}
By unknown, 2023-06-08 21:13:00
  /** 
   * Deserializes the contents of the incoming message buffer {@code b}. 
   * 
   * @return deserialised object
   * @throws UnsupportedEncodingException If the named charset is not supported
   */
  Object r() throws UnsupportedEncodingException{
    int i=0, n, t=b[j++];
    if(t<0)
      switch(t){
        case -1:
          return rb();
        case (-2):
          return rg();
        case -4:
          return b[j++];
        case -5:
          return rh();
        case -6:
          return ri();
        case -7:
          return rj();
        case -8:
          return re();
        case -9:
          return rf();
        case -10:
          return rc();
        case -11:
          return rs();
        case -12:
          return rp();
        case -13:
          return rm();
        case -14:
          return rd();
        case -15:
          return rz();
        case -16:
          return rn();
        case -17:
          return ru();
        case -18:
          return rv();
        case -19:
          return rt();
      }
    if(t>99){
      if(t==100){
        rs();
        return r();
      }
      if(t<104)
        return b[j++]==0&&t==101?null:"func";
      if(t>105)
        r();
      else
        for(n=ri();i<n;i++)
          r();
      return "func";
    }
    if(t==99)
      return new Dict(r(),r());
    j++;
    if(t==98)
      return new Flip((Dict)r());
    n=ri();
    switch(t){
      case 0:
        Object[] L=new Object[n];
        for(;i<n;i++)
          L[i]=r();
        return L;
      case 1:
        boolean[] B=new boolean[n];
        for(;i<n;i++)
          B[i]=rb();
        return B;
      case 2: {
        UUID[] G=new UUID[n];
        for(;i<n;i++)
          G[i]=rg();
        return G;
      }
      case 4:
        byte[] G=new byte[n];
        for(;i<n;i++)
          G[i]=b[j++];
        return G;
      case 5:
        short[] H=new short[n];
        for(;i<n;i++)
          H[i]=rh();
        return H;
      case 6:
        int[] I=new int[n];
        for(;i<n;i++)
          I[i]=ri();
        return I;
      case 7:
        long[] J=new long[n];
        for(;i<n;i++)
          J[i]=rj();
        return J;
      case 8:
        float[] E=new float[n];
        for(;i<n;i++)
          E[i]=re();
        return E;
      case 9:
        double[] F=new double[n];
        for(;i<n;i++)
          F[i]=rf();
        return F;
      case 10:
        char[] C=new String(b,j,n,encoding).toCharArray();
        j+=n;
        return C;
      case 11:
        String[] S=new String[n];
        for(;i<n;i++)
          S[i]=rs();
        return S;
      case 12:
        Timestamp[] P=new Timestamp[n];
        for(;i<n;i++)
          P[i]=rp();
        return P;
      case 13:
        Month[] M=new Month[n];
        for(;i<n;i++)
          M[i]=rm();
        return M;
      case 14:
        Date[] D=new Date[n];
        for(;i<n;i++)
          D[i]=rd();
        return D;
      case 15:
        java.util.Date[] Z=new java.util.Date[n];
        for(;i<n;i++)
          Z[i]=rz();
        return Z;
      case 16:
        Timespan[] N=new Timespan[n];
        for(;i<n;i++)
          N[i]=rn();
        return N;
      case 17:
        Minute[] U=new Minute[n];
        for(;i<n;i++)
          U[i]=ru();
        return U;
      case 18:
        Second[] V=new Second[n];
        for(;i<n;i++)
          V[i]=rv();
        return V;
      case 19:
        Time[] T=new Time[n];
        for(;i<n;i++)
          T[i]=rt();
        return T;
    }
    return null;
  }

Manually maintained open-source code on GitHub. Looks like decompiled from obfuscated binary, they just reformatted it, added some comments and now are making manual changes. Current version: https://github.com/KxSystems/javakdb/blob/master/src/kx/c.java Original version: https://github.com/KxSystems/javakdb/blob/c9afe6fa32d7d3e3cddabdc9bd43f0155a5d2a1b/src/kx/c.java

By KxSystems, 2017-12-13 17:19:57
                Path path = FileSystems.getDefault().getPath("../../../../../../../../../../EmailResults.csv");
                Files.deleteIfExists(path);
By Anonymous, 2021-11-12 20:18:57