Mistři v programování na #hovnokod

Spravne pouzitie roznych request type.

 public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    {
        doGet(request, response);
    }

Anonymous,

...protože je lepší dát vědět, že budu mazat mrtvý kód, než ho rovnou smazat :D

        //To bedeleted
        NotificationChannelsComponent notifChnl= new NotificationChannelsComponent(ewd);
        List <String > SelectedEmailChannel= new ArrayList<String>();
        SelectedEmailChannel.add("Ranjith Test");
        try{
            notifChnl.deleteEmailChannels(SelectedEmailChannel);
        }
        catch (Exception ex){
            testLog.info("Exception is "+ex);
        }
        //Delete till here

Anonymous,

Proč? Protoč kolotoč....

private boolean existsPrice;
.....
if (Boolean.TRUE.equals(existsPrice)) {

Anonymous,

Legitimny_kod_v_jave

    private class _{        
        int _;        
        _(int _){
            this._ = _;
        }
    }
    private class __{        
        _ __;        
        __(_ __){
            this.__ = __;
        }
    }

Anonymous,

Generovani unikatniho id

public class FFMPEGWorker {

    public static final Set<Integer> activeConversions = new HashSet<>();

    public static int getTaskID() {
        int response = (int)(Math.random() * Math.pow(2,30));
        if (activeConversions.isEmpty()) {
            activeConversions.add(response);
            return response;
        }
        while (activeConversions.contains(response) && response < 100000000 && response >= 1000000000) {
            response = (int)(Math.random() * Math.pow(2,30));
        }
        activeConversions.add(response);
        return response;
    }

}

Anonymous,