Throw new notCoolException()



  •  I think this might qualify as a representative line, though I don't know what the rest of the source is like...

     

    [code]if (booTbl[2]) if (booTbl[1]) if (booTbl[0]) if (!s.contains(arg[0].charAt(0))) if (!s.contains(arg[0].charAt(1))) if (!s.contains(arg[0].charAt(2))) if (!s.contains(arg[0].charAt(3))) return false; else return true; else return true; else return true; else return true; else if (!s.contains(arg[1].charAt(0))) if (!s.contains(arg[1].charAt(1))) if (!s.contains(arg[1].charAt(2))) if (!s.contains(arg[1].charAt(3))) return false; else return true; else return true; else return true; else return true; else if (!s.contains(arg[2].charAt(0))) if (!s.contains(arg[2].charAt(1))) if (!s.contains(arg[2].charAt(2))) if (!s.contains(arg[2].charAt(3))) return false; else return true; else return true; else return true; else return true; else throw new notCoolException();[/code]

    Line 35 of my main method.

    It's supposed to check the boolean array (booTbl) to see which argument (args[]) should be used.

    if boo2 is true, it checks the next boo else crash
    if boo1 is true, it checks the next boo else use arg2
    if boo0 is true, it chooses arg0 else use arg1

    returns true if any of the first 4 characters in the arg are in s.

    notCoolException() is an exception made for this program.



  • right click > format code

    Solved!

    Or was that right click > shoot original developer in the head?



  • throw new BrainParserException("EEEEEEK!");

    Is this an entry for some new Java Obfuscated Code Contest?



  •  not cool d00d, not cool



  •                 arg_num = 0;
    if (!booTbl[0]) arg_num = 1;
    if (!booTbl[1]) arg_num = 2;
    if (!booTbl[2]) throw new notCoolException();
    
    for (char_num = 0; char_num < 4; ++char_num) {
      if (s.contains(arg[arg_num].charAt(char_num))) return true;
    }
    
    return false;
    

    Of course, refactoring the syntax merely reveals the inherent weirdness of the logic. Smells like the program is re-inventing flag-parsing logic in a non-generalized form.



  • @anthetos said:

    notCoolException() is an exception made for this program
     

    pls send teh codez. 



  • @cconroy said:

    @anthetos said:

    notCoolException() is an exception made for this program
     

    pls send teh codez. 

    public class notCoolException {

    public notCoolException() {

    super.setMessage("d00000d! This is, like, not c0000l d0000000d!!!!");

    }


Log in to reply