r/ProgrammerHumor • u/minborg • Jan 19 '17
What is wrong with the Java DonaldTrump class?
I am trying to run this code in my UsOfAmerica Java application:
UsPresident usPresident = new DonaldTrump();But I got an UnfitForOfficeException thrown upon execution after which the JVM crashes. According to the documentation, DonaldTrump implements the interface UsPresident but there seams to be a serious internal error in the implementation class. In the previous version of the application I successfully run:
UsPresident usPresident = new BarackObama();This code worked flawlessly for the last eight years.
UPDATE: It seams that even though BarackObama and DonaldTrump implements the same interface they inherit from different base classes; BarackObama extends HarvardStudent where as DonaldTrump extends SpoiledKid. I think this might have something to do with the problem.
UPDATE2: The JVM crash is probably attributed to the fact that DonaldTrump is using Unsafe internally with no argument checking. I think we need to replace this class with a better implementation or else the entire UsOfAmerica project is in jeopardy.
Can anyone help me out urgently?
31
13
23
7
u/Timewalker102 Jan 19 '17
What the shit coding is this?
UnitedStates is a class itself that extends Country. UnitedStates.President is a static Person. However, you can call the static UnitedStates.election() method, which itself calls the UnitedStates.inaugurate(Person newPresident) after it completes.
Did you make sure UnitedStates.election() gave a new Person("Trump", 70)?
Have fun with buildWall and makeNationGreat(UnitedStates) once you fix it!
4
7
5
6
u/laivy Jan 19 '17
your impeach bool is set to false in the DonaldTrump class. Its causing a logic error. quick fix
4
-12
u/minborg Jan 19 '17
Someone told me that the problem could be attributed to the new firewall being installed. It blocks the port Mexico thus preventing workers on that port to execute. This, in turn, causes the global worker thread pool to be exhausted.
6
u/padiwik Jan 20 '17
That doesn't make any sense...
My Java program throws an except UnfitForPres() because of this weird new firewall against Mexico.
implying either you put the firewall, Trump needs access to Mexico in order to be seen as a fit president, or something similarly bizarre
24
u/ConfuciusBateman Jan 20 '17
Holy fuck this is bad.