- 1
- 2
- 3
- 4
@Override public int hashCode()
    {
        return id.hashCode(); // id - Integer !!!
    }Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+73
@Override public int hashCode()
    {
        return id.hashCode(); // id - Integer !!!
    }Хэшкод интегера
+71
newMatrix.setElement(newMatrix.getElement(i, j) + getElement(i, k) * matrix.getElement(k, j), i, j);Профессиональный говнокод.
+74
private void showProgress() {
    if(mIndProgressVisible && mIndProgress != null && mIndProgress.isShowing()) return;
    if(!mIndProgressVisible && (mIndProgress == null || !mIndProgress.isShowing())) return;
    ...
}Не ходите, дети, в Африку гулять
+75
public static int compareXmlGregorianCalendars(XMLGregorianCalendar left, XMLGregorianCalendar right) {
	 int result = left.compare(right);
	 if (result == DatatypeConstants.LESSER)
		 return -1;
	 else if (result == DatatypeConstants.EQUAL)
		 return 0;
	 else if (result == DatatypeConstants.GREATER)
		 return 1;
	 else
		 throw new RuntimeException("Indeterminate result when comparing XMLGregorianCalendars.");
 }
            DatatypeConstants:
        /**
         * <p>Comparison result.</p>
         */
        public static final int LESSER = -1;
        /**
         * <p>Comparison result.</p>
         */
        public static final int EQUAL =  0;
        /**
         * <p>Comparison result.</p>
         */
        public static final int GREATER =  1;
        /**
         * <p>Comparison result.</p>
         */
        public static final int INDETERMINATE =  2;
        
+89
/**
	 * todo - implement check if current value of the processor load is not mode than 90 persends...
	 * 
	 * @return true if higher than 98 persents
	 */
	private boolean isProcessorOverloaded() {
		return false;
	}
+78
public static void create(String title, int width, int height) {
        if (isWindowCreated())
            throw new RuntimeException("Window created.");
        if (title == null)
            throw new NullPointerException("Window title == null.");
        if (width <= 0 || height <= 0)
            throw new IllegalArgumentException("Window size <= 0.");
        if ((window = GLFW.glfwCreateWindow(width, height, title, MemoryUtil.NULL, MemoryUtil.NULL)) == MemoryUtil.NULL)
            throw new RuntimeException("Failed to create the GLFW window.");
    }
+73
public static long inFuture(final long time, final long current, final int period) {
        long newtime = current;
        while (newtime < current) {
            newtime += period;
        }
        return newtime;
    }
            я сегодня продуктивен )
на этот раз...
последовательный инкремент = )
        
+72
public final class DefaultConfig extends TTConfig {
    public DefaultConfig(final int whole, final int pause, final int warn) {
        super(60, 10, 3);
    }
}конфига и ее стандартный вариант (подходящий в 99,9% случаев)
+70
public static List<Defaulter> getDefaulterList() {
	List<Defaulter> defaulters = new ArrayList<Defaulter>();
	for (Map.Entry<Class<?>, Defaulter> defaulterEntry : hash.entrySet()) {
		Defaulter def = defaulterEntry.getValue();
		defaulters.add(def);
	}
	return defaulters;
}
            Всё заменилось одной строкой:
return new ArrayList<Defaulter>(hash.values());
        
+83
mEdit.setText(mEdit.getText());Больше кода => больше бананов.