未验证 提交 08a207fb 编写于 作者: 玄坛 提交者: GitHub

Merge pull request #362 from wilsonjuxta/master

fix typo in example code
...@@ -116,8 +116,10 @@ Positive example 3: ...@@ -116,8 +116,10 @@ Positive example 3:
<example> <example>
<![CDATA[ <![CDATA[
public class TimerTaskThread extends Thread { public class TimerTaskThread extends Thread {
public TimerTaskThread(){ public TimerTaskThread() {
super.setName("TimerTaskThread"); … super.setName("TimerTaskThread");
// do something
}
} }
]]> ]]>
</example> </example>
...@@ -134,9 +136,9 @@ Positive example 3: ...@@ -134,9 +136,9 @@ Positive example 3:
<![CDATA[ <![CDATA[
Positive example 1: Positive example 1:
private static final String FORMAT = "yyyy-MM-dd HH:mm:ss"; private static final String FORMAT = "yyyy-MM-dd HH:mm:ss";
public String getFormat(Date date){ public String getFormat(Date date) {
SimpleDateFormat dateFormat = new SimpleDateFormat(FORMAT); SimpleDateFormat dateFormat = new SimpleDateFormat(FORMAT);
return sdf.format(date); return dateFormat.format(date);
} }
]]> ]]>
</example> </example>
...@@ -144,10 +146,11 @@ Positive example 1: ...@@ -144,10 +146,11 @@ Positive example 1:
<![CDATA[ <![CDATA[
Positive example 2: Positive example 2:
private static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public void getFormat(){ public void getFormat() {
synchronized (sdf){ synchronized(SIMPLE_DATE_FORMAT) {
sdf.format(new Date()); SIMPLE_DATE_FORMAT.format(new Date());
….; // do something
}
} }
]]> ]]>
</example> </example>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册