Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 27735 Details for
Bug 111270
[formatter] Code Formater fails due to overlapping edits
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Java file that JDT fails to format
SmtpServerParser.java (text/plain), 1.82 KB, created by
Rodrigo Kumpera
on 2005-09-30 18:20:59 EDT
(
hide
)
Description:
Java file that JDT fails to format
Filename:
MIME Type:
Creator:
Rodrigo Kumpera
Created:
2005-09-30 18:20:59 EDT
Size:
1.82 KB
patch
obsolete
>package uol.proxy.parser; > >import java.nio.ByteBuffer; > >import uol.proxy.smtp.SmtpResponse; >/** > * Mensagens SMTP tem o seguinte formato: > * <pre> > * resposta de uma linha só: > * nnn [SP] lalalal [CR] [LF] > * resposta de várias linhas: > * nnn [-] lalalalal [CR] [LF] > * nnn [-] lalalalal [CR] [LF] > * ... > * nnn [SP] lalalalal [CR] [LF] > * > * > * > * */ >public class SmtpServerParser { > private static final int DIGITS = 0; > private static final int LINE_MODE_CHAR = 1; > private static final int SKIP_TO_EOL_AND_FINISH = 2; > private static final int SKIP_TO_EOL = 3; > > int state = DIGITS; > int code; > int pos; > boolean wellFormed = true; > > > public SmtpServerParser() { > } > > //formato: xxx lalal > public SmtpResponse parse(ByteBuffer buffer) { > outer: while (buffer.remaining() > 0) { > char c = (char) buffer.get(); > ++pos; > switch (state) { > case DIGITS: //get number > if(Character.isDigit(c)) { > code = code * 10 + (c - '0'); > } else { > wellFormed = false; > state = SKIP_TO_EOL_AND_FINISH; > } > if(pos == 3) > state = LINE_MODE_CHAR; > break; > case LINE_MODE_CHAR: > if(c == ' ') > state = SKIP_TO_EOL_AND_FINISH; > else if(c == ' ') > state = SKIP_TO_EOL; > else { > wellFormed = false; > state = SKIP_TO_EOL_AND_FINISH; > } > break; > case SKIP_TO_EOL_AND_FINISH: > > > break; > } > } > return null; > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 111270
: 27735