Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java Enterprise Code Formatter

Name: Anonymous 2011-12-09 16:44

    package enterprise
;   class Main
{   public static void main(java.lang.String[]commandLineArgumentArray)
{   java.io.OutputStream output=null
;   java.io.InputStream input=null
;   if(commandLineArgumentArray.length>0)
{   try
{   input=new java.io.FileInputStream(new java.io.File(commandLineArgumentArray[0]))
;  
}   catch(java.io.FileNotFoundException e)
{   e.printStackTrace()
;   java.lang.System.exit(1)
;  
}   if(commandLineArgumentArray.length==1)
{   output=java.lang.System.out
;  
}   else if(commandLineArgumentArray.length==2)
{   try
{   output=new java.io.FileOutputStream(new java.io.File(commandLineArgumentArray[1]))
;  
}   catch(java.io.FileNotFoundException e)
{   e.printStackTrace()
;   java.lang.System.exit(1)
;  
}  
}   else
{   java.io.BufferedWriter stdout=new java.io.BufferedWriter(new java.io.OutputStreamWriter(new java.io.BufferedOutputStream(java.lang.System.out)))
;   int[]message=
{   85,115,97,103,101,58,32,106,97,118,97,32,45,106,97,114,32,101,110,116,101,114,112,114,105,115,101,102,111,114,109,97,116,116,101,114,46,106,97,114,32,91,73,78,80,85,84,32,70,73,76,69,93,32,91,79,85,84,80,85,84,32,70,73,76,69,93,10,77,105,115,115,105,110,103,32,97,114,103,117,109,101,110,116,115,32,100,101,102,97,117,108,116,32,116,111,32,115,116,100,105,110,47,115,116,100,111,117,116,10
}  
;   for(int c:message)
{   try
{   stdout.write(c)
;  
}   catch(java.io.IOException e)
{   e.printStackTrace()
;   java.lang.System.exit(1)
;  
}  
}   try
{   stdout.flush()
;   stdout.close()
;  
}   catch(java.io.IOException e)
{   e.printStackTrace()
;   java.lang.System.exit(1)
;  
}   java.lang.System.exit(1)
;  
}  
}   else if(commandLineArgumentArray.length==0)
{   input=java.lang.System.in
;   output=java.lang.System.out
;  
}   enterprise.JavaCodeFormatterFactory formatterFactory=enterprise.JavaCodeFormatterFactory.getNewFactory()
;   enterprise.EnterpriseJavaCodeFormatter enterpriseFormatter=formatterFactory.getEnterpriseFormatterForInputAndOutputStreams(input,output)
;   try
{   enterpriseFormatter.format()
;   enterpriseFormatter.write()
;   enterpriseFormatter.close()
;  
}   catch(java.io.IOException e)
{   e.printStackTrace()
;   java.lang.System.exit(1)
;  
}   return
;  
}  
}  
;   class JavaCodeFormatterFactory
{   public EnterpriseJavaCodeFormatter getEnterpriseFormatterForInputAndOutputStreams(java.io.InputStream input,java.io.OutputStream output)
{   return new enterprise.EnterpriseJavaCodeFormatter(new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.BufferedInputStream(input))),new java.io.BufferedWriter(new java.io.OutputStreamWriter(new java.io.BufferedOutputStream(output))))
;  
}   public static enterprise.JavaCodeFormatterFactory getNewFactory()
{   return new enterprise.JavaCodeFormatterFactory()
;  
}   private JavaCodeFormatterFactory()
{  
}  
}  
;   class EnterpriseJavaCodeFormatter
{   private java.io.BufferedReader mInput=null
;   private java.io.BufferedWriter mOutput=null
;   private java.lang.StringBuilder mBuffer=null
;   public EnterpriseJavaCodeFormatter(java.io.BufferedReader input,java.io.BufferedWriter output)
{   this.mBuffer=new java.lang.StringBuilder()
;   this.mInput=input
;   this.mOutput=output
;  
}   public void format()throws java.io.IOException
{   int last=-1
;   int next=-2
;   int c=-1
;   this.mBuffer.append((char)32)
;   this.mBuffer.append((char)32)
;   this.mBuffer.append((char)32)
;   this.mBuffer.append((char)32)
;   while((c=this.mInput.read())!=-1)
{   if(next!=-1)
{   this.mInput.mark(1)
;   next=this.mInput.read()
;   this.mInput.reset()
;  
}   if(last==10&&(c==32||c==13||c==9))
{   continue
;  
}   if((c==32||c==9||c==10||c==13)&&((!(last<123&&last>94)&&!(last<91&&last>64))||(!(next<123&&next>94)&&!(next<91&&next>64))))
{   continue
;  
}   if(next==47&&c==47)
{   while((c=this.mInput.read())!=10)
;   last=c
;   continue
;  
}   if(c==47&&next==42)
{   last=-1
;   int temp=c
;   c=this.mInput.read()
;   while((c=this.mInput.read())!=-1)
{   if(c==47&&last==42)
{   break
;  
}   last=c
;  
}   last=temp
;   continue
;  
}   if(c==34)
{   do
{   this.mBuffer.append((char)c)
;  
}   while((c=this.mInput.read())!=34)
;  
}   if(c==59||c==123||c==125)
{   this.mBuffer.append((char)10)
;   this.mBuffer.append((char)c)
;   this.mBuffer.append((char)32)
;   this.mBuffer.append((char)32)
;   this.mBuffer.append((char)32)
;   last=c
;   continue
;  
}   this.mBuffer.append((char)c)
;   last=c
;  
}  
}   public void write()throws java.io.IOException
{   for(int iterator=0
;   iterator<this.mBuffer.length()
;   iterator=iterator+1)
{   this.mOutput.write((int)this.mBuffer.charAt(iterator))
;  
}  
}   public void close()throws java.io.IOException
{   this.mInput.close()
;   this.mOutput.flush()
;   this.mOutput.close()
;  
}   public java.lang.String toString()
{   return this.mBuffer.toString()
;  
}  
}

Name: Anonymous 2011-12-21 18:45

>>40
They ought to go back to /vip/

Name: Anonymous 2011-12-21 18:57

>>41
/vip/ is shit.

Name: Anonymous 2011-12-22 6:43

>>42
You're shit.

Name: Anonymous 2011-12-22 7:53

>>43
You're shit is shit.

Name: Anonymous 2011-12-22 15:37

>>44
That it is.

Name: Anonymous 2011-12-22 15:53

javascript: var rand=Math.floor(Math.random()*9000)+1000; javascript:location.href="https://addons.mozilla.org/en-US/firefox/addon/" + rand + "/";

Name: Anonymous 2011-12-22 18:30

i actually do things like this:
[code]
int foo(int n) {
    int i, j;

    for (i = 0; i < n; i++) {
        for (j = 0; j < n; j++) {
        int bar = i*j;
        printf("%d\n", bar); }}

    printf("done.\n"); }
[code]

Name: Anonymous 2011-12-22 18:51

>>47
awaiting anal destruction due to misuse of bbcode.

Name: Anonymous 2011-12-22 22:06

pubic final int numberOfBalls = 2;

Name: Anonymous 2011-12-23 3:25

>>49
You have two balls. Then you get your balls haxxed. Now you have no balls.

Name: Anonymous 2011-12-23 13:53

>>50
You have two fags. Then they rape you. Now you have three fags.

Name: Anonymous 2011-12-23 14:22

>>42-44
kebab
>>48
kebab
>>50-51
kebab

Name: Fuck off, !Ep8pui8Vw2 2011-12-23 14:39

>>52
Fuck off and die, ``fagstorm''.

Name: Anonymous 2011-12-23 14:44

>>53
kebab

Name: Anonymous 2011-12-23 15:26

DUBS

Name: Anonymous 2012-01-01 19:39

>>52,54
Kebab yourself.

Name: 2012-02-14 13:39

Name: Anonymous 2012-02-14 14:31

ITT HOW TO MAKE SOMETHING THAT ALREADY LOOKS LIKE SHIT LOOK EVEN MORE SHITTY AND INCONSISTENT

Name: Anonymous 2012-02-14 15:11

Learning D would solve this problem.

Name: Anonymous 2012-02-14 15:51

>>58
It only looks better now.

>>59
What problem?

Name: Anonymous 2012-02-14 18:54

>>59
Then you'll have two problems.

Name: Anonymous 2012-02-14 19:48

>>60
no, it looks worse.

You are the only person that has ever been able to take something generally agreed upon as pure shit and then somehow make it worse.

congrats, you win the retard award.

Name: Anonymous 2012-02-15 2:03

>>62
How exactly does it look worse? Does putting the annoying syntax trash like curly braces and semicolons away to the left side somehow not clean up the syntax?

Name: Anonymous 2012-02-15 8:09

>>63
Yes.
Yes, it does.

Name: Anonymous 2012-02-15 12:47

>>63
now remove the parens from lisp to make it less shit

Name: Anonymous 2012-02-15 13:01

>>63
>>64
Stop replying to your own shitty ass thread you moronic java programmer. Go twiddle your dick with basic or python and fuck off

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List