Skip to content

Instantly share code, notes, and snippets.

@thombergs
Last active August 29, 2015 14:11
Show Gist options
  • Save thombergs/e3796f7768cfa793aa2c to your computer and use it in GitHub Desktop.
Save thombergs/e3796f7768cfa793aa2c to your computer and use it in GitHub Desktop.
Code of the Day - funny code snippets from real software projects
try {
...
} catch (final AbstractException ab) {
// Schade, aber nicht tödlich
...
}
// Hiernach folgt MIST!
JPanel thePanel1 = new JPanel();
thePanel1.setLayout(new GridBagLayout());
thePanel1.setBackground(BACKGROUND_COLOR_NORMAL);
thePanel1.setBorder(BorderFactory.createEmptyBorder());
thePanel1.add(taBeschreibung, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 0, 0), 0, 0));
// Hier hört der MIST auf
// GRR
JPanel thePanel2 = new JPanel();
thePanel2.setLayout(new GridBagLayout());
thePanel2.setBackground(BACKGROUND_COLOR_NORMAL);
thePanel2.setBorder(BorderFactory.createEmptyBorder());
thePanel2.add(taMengeUmfang, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 0, 0), 0, 0));
// GRR ENDE
// AUA
JPanel thePanel3 = new JPanel();
thePanel3.setLayout(new GridBagLayout());
thePanel3.setBackground(BACKGROUND_COLOR_NORMAL);
thePanel3.setBorder(BorderFactory.createEmptyBorder());
thePanel3.add(taWeitereAngaben, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 0, 0), 0, 0));
// AUA ENDE
/**
* Diese Klasse ist für die Verschlüsselung von Daten auf einem PipedInputStream mittels
* BouncyCastle zuständig.
*
* @author möchte aufgrund der mangelhaften Qualität anonym bleiben
*/
if (!ret) {
return ret;
}
// Das Feld ist in Ordnung, daher kann es weiter gehen.
return ret;
// FIXME WTF? Im nächsten Schritt haben wir NPE. Also direkt hier ne Exception werfen.
Long item = null;
if (impressumID != null && refContent.equals(BasicKonstanten.CONTENT_IMPR_STATUS_HOT[0].getRef())) {
item = impressumID;
}
if (statusID != null && refContent.equals(BasicKonstanten.CONTENT_IMPR_STATUS_HOT[1].getRef())) {
item = statusID;
}
if (hotlineID != null && refContent.equals(BasicKonstanten.CONTENT_IMPR_STATUS_HOT[2].getRef())) {
item = hotlineID;
}
if (hilfeID != null && refContent.equals(BasicKonstanten.CONTENT_IMPR_STATUS_HOT[3].getRef())) {
item = hilfeID;
}
log.debugValue("item", item);
if (item != null && !"".equals(item)) {
...
}
if (aenderModus == ...) {
setTitle(myTitle + Messages.getString("Dialog.Step3"));
} else {
setTitle(myTitle + Messages.getString("Dialog.Step3"));
}
try{
...
} catch (final Throwable t) {
// Wenns net klappt is doof aber nicht tragisch
}
private static final String[] ZEROS = {"", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000"};
if (CheatMode.isEnabled() || !CheatMode.isEnabled()) {
...
}
ErrorsBuilder eb = new ErrorsBuilder();
Error e = new Error();
e.setId(1531535);
e.setSeverity(Severity.Error);
e.setText("Deine Mutter ist Astronaut");
e.setType(Type.TechnicalError);
eb.add(e);
/*constant specific class bodies delux bitches!*/
/*
* ...
* @throws TechnicalException
* Fehler halt und so...
* @throws BusinessException
* Kacke, wa!
*/
// WTF?! Intergervergleiche stinken!
generalTenderKeyForBackup.setFreigableSchuessel(aktualFreigbaeSchuesse);
// Fehler werfen, weitermachen tut keien Sinn machen...
try{
...
} catch (TechnicalException e) {
// Schade, aber egal !!
}
// TODO wtf ack
boolean isAllShitValid = true;
Component[] components = ...
for (Component thisStupidFuckComponent : components) {
if (isAllShitValid && thisStupidFuckComponent instanceof JTextComponent) {
...
}
}
// Lecker scoping, bitches love scoping...
// FIXME So etwas darf nicht sein!!!
System.exit(1);
// TODO: wir sollten nach dem Jahr 2099 auch noch arbeiten können...
if (year < 2000 || year > 2099) {
displayErrorMessage();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment