Last active
November 2, 2024 19:21
-
-
Save thombergs/e3796f7768cfa793aa2c to your computer and use it in GitHub Desktop.
Code of the Day - funny code snippets from real software projects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
... | |
} catch (final AbstractException ab) { | |
// Schade, aber nicht tödlich | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!ret) { | |
return ret; | |
} | |
// Das Feld ist in Ordnung, daher kann es weiter gehen. | |
return ret; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FIXME WTF? Im nächsten Schritt haben wir NPE. Also direkt hier ne Exception werfen. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) { | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (aenderModus == ...) { | |
setTitle(myTitle + Messages.getString("Dialog.Step3")); | |
} else { | |
setTitle(myTitle + Messages.getString("Dialog.Step3")); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try{ | |
... | |
} catch (final Throwable t) { | |
// Wenns net klappt is doof aber nicht tragisch | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String[] ZEROS = {"", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000"}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (CheatMode.isEnabled() || !CheatMode.isEnabled()) { | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*constant specific class bodies delux bitches!*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ... | |
* @throws TechnicalException | |
* Fehler halt und so... | |
* @throws BusinessException | |
* Kacke, wa! | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WTF?! Intergervergleiche stinken! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
generalTenderKeyForBackup.setFreigableSchuessel(aktualFreigbaeSchuesse); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fehler werfen, weitermachen tut keien Sinn machen... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try{ | |
... | |
} catch (TechnicalException e) { | |
// Schade, aber egal !! | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO wtf ack |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boolean isAllShitValid = true; | |
Component[] components = ... | |
for (Component thisStupidFuckComponent : components) { | |
if (isAllShitValid && thisStupidFuckComponent instanceof JTextComponent) { | |
... | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Lecker scoping, bitches love scoping... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FIXME So etwas darf nicht sein!!! | |
System.exit(1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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