mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 02:09:59 +07:00
Java: update intention description and example
GitOrigin-RevId: 22b8858e7c822bf1745ca644260703b5b2e7c599
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5b120de0b7
commit
b68439a0b3
@@ -2,12 +2,8 @@ import java.text.*;
|
||||
import java.util.Date;
|
||||
|
||||
class X {
|
||||
private static final ThreadLocal<DateFormat> dateFormat = new ThreadLocal<DateFormat>() {
|
||||
@Override
|
||||
protected DateFormat initialValue() {
|
||||
return new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z");
|
||||
}
|
||||
};
|
||||
private static final ThreadLocal<DateFormat> DATE_FORMAT =
|
||||
ThreadLocal.withInitial(() -> new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z"));
|
||||
|
||||
public String getDateString() {
|
||||
return dateFormat.get().format(new Date());
|
||||
|
||||
@@ -2,7 +2,7 @@ import java.text.*;
|
||||
import java.util.Date;
|
||||
|
||||
public class X {
|
||||
private static DateFormat <spot>dateFormat</spot> = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z");
|
||||
private static final DateFormat <spot>DATE_FORMAT</spot> = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z");
|
||||
|
||||
public String getDateString() {
|
||||
return dateFormat.format(new Date());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
Replaces a field type with a corresponding thread local.
|
||||
Replaces a field type with a corresponding thread local type.
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user