Mistři v programování na #hovnokod

Java #1644

    private boolean isMessageCountNull() {
        String server1 = ServiceLocator.getApplicationProperty("asyncServer1");
        String server2 = ServiceLocator.getApplicationProperty("asyncServer2");
        String server3 = ServiceLocator.getApplicationProperty("asyncServer3");
        String prostredi = ServiceLocator.getApplicationProperty("prostredi");

        if (prostredi.equals("jedno")) {
            if (getMessageCount(server1, jednaQueue) > 0 || getMessageCount(server1, druhaQueue) > 0
                    || getMessageCount(server2, jednaQueue) > 0 || getMessageCount(server2, druhaQueue) > 0
                    || getMessageCount(server3, jednaQueue) > 0 || getMessageCount(server3, druhaQueue) > 0) {
                return false;
            } else {
                return true;
            }
        } else if (prostredi.equals("druhy")) {
            if (getMessageCount(server1, jednaQueue) > 0 || getMessageCount(server1, druhaQueue) > 0
                    || getMessageCount(server2, jednaQueue) > 0 || getMessageCount(server2, druhaQueue) > 0) {
                return false;
            } else {
                return true;
            }
        } else if (prostredi.equals("treti")) {
            if (getMessageCount(server1, "jinaQueue") > 0 || getMessageCount(server1, "jinaQueue") > 0) {
                return false;
            } else {
                return true;
            }
        }
        return false;
    }

Anonymous,