Descargar
Desarrollar
Cuenta
Descargar
Desarrollar
Entrar
Forgot Account/Password
Crear Cuenta
Idioma
Ayuda
Idioma
Ayuda
×
Entrar
Nombre de usuario
Contraseña
×
Forgot Account/Password
Translation Status of Español
Categoría:
Software
Gente
PersonalForge
Magazine
Wiki
Buscar
OSDN
>
Buscar Software
>
Communications
>
BBS
>
monalipse project
>
Ticket List/Search
>
Incidencia #1073
monalipse project
Descripción
Project Summary
Developer Dashboard
Página Web
Developers
Image Gallery
List of RSS Feeds
Activity
Statistics
Historial
Descargas
List of Releases
Stats
Código Fuente
Code Repository list
CVS
Ver Repositorio
Incidencia
Ticket List
Milestone List
Type List
Component List
List of frequently used tickets/RSS
Submit New Ticket
Documents
Communication
Foros
List of Forums
Ayuda (1)
Open Discussion (8)
Mailing Lists
list of ML
Noticias
Incidencia #1073
Ticket List
Submit New Ticket
RSS
Date#parse を消すパッチ
Abrir Fecha:
2003-01-20 19:35
Última actualización:
2003-01-21 12:56
monitor
ON
OFF
Informador:
(Anónimo)
Propietario:
(Ninguno)
Tipo:
Bugs
Estado:
Open
Componente:
(Ninguno)
Hito:
(Ninguno)
Prioridad:
5 - Medium
Gravedad:
5 - Medium
Resolución:
Ninguno
Fichero:
1
Details
Responder
「メソッド parse(String) は型 Date で使用すべきではあり
ません。」がうざい方はどうぞ。
Ticket History (2/2 Histories)
2003-01-20 19:35
Updated by: None
File
302: dateparse.patch
is attached
2003-01-21 12:56
Updated by: None
Comentario
Responder
Logged In: NO
すいません。
実行ファイルも黙ってしまいます。
修正パッチです。
Index: monalipse/server/LinkedObject.java
===================================================================
RCS file:
/cvsroot/monalipse/monalipse.plugin/src/monalipse/server/LinkedObject.java,v
retrieving revision 1.4
diff -u -r1.4 LinkedObject.java
--- monalipse/server/LinkedObject.java 21 Dec 2002
12:43:22 -0000 1.4
+++ monalipse/server/LinkedObject.java 21 Jan 2003 03:53:57
-0000
@@ -15,11 +15,14 @@
import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.UnknownHostException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.logging.Logger;
@@ -29,6 +32,7 @@
import javax.imageio.stream.ImageInputStream;
import monalipse.MonalipsePlugin;
+
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;
import org.eclipse.core.resources.IFile;
@@ -219,12 +223,13 @@
out.close();
logger.finest("complete");
long mod = 0;
- try
- {
- mod =
Date.parse(get.getResponseHeader("Last-Modified").getValue());
- }
- catch (RuntimeException e)
- {
+ try {
+ String s =
get.getResponseHeader("Last-Modified").getValue();
+ DateFormat fmt = new SimpleDateFormat("EEE, d MMM
yyyy HH:mm:ss z", Locale.US);
+ Date d = fmt.parse(s);
+ mod = d.getTime();
+ } catch (Exception e) {
+ e.printStackTrace();
}
final long lastModified = mod;
final byte[] bytes = out.toByteArray();
Index: monalipse/server/giko/ThreadContentProvider.java
===================================================================
RCS file:
/cvsroot/monalipse/monalipse.plugin/src/monalipse/server/giko/ThreadContentProvider.java,v
retrieving revision 1.17
diff -u -r1.17 ThreadContentProvider.java
--- monalipse/server/giko/ThreadContentProvider.java 19 Jan
2003 15:26:47 -0000 1.17
+++ monalipse/server/giko/ThreadContentProvider.java 21 Jan
2003 03:53:59 -0000
@@ -14,10 +14,13 @@
import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.logging.Logger;
import java.util.regex.Matcher;
@@ -883,12 +886,13 @@
contentRange = cin.getRange();
monitor.getRunner().run(null, this);
- try
- {
- serverTime =
Date.parse(method.getResponseHeader("Date").getValue()) / 1000;
- }
- catch (RuntimeException e)
- {
+ try {
+ String s = method.getResponseHeader("Date").getValue();
+ DateFormat fmt = new SimpleDateFormat("EEE, d MMM yyyy
HH:mm:ss z", Locale.US);
+ Date d = fmt.parse(s);
+ serverTime = d.getTime() / 1000;
+ } catch (Exception e) {
+ e.printStackTrace();
}
}
Attachment File List (
1
)
Attachment File List
dateparse.patch
(2KB)
Date#parse を消すパッチ
Editar
Add Comment
You are not logged in.
I you are not logged in, your comment will be treated as an anonymous post. »
Entrar
Add Comment
Vista previa
Submit
ません。」がうざい方はどうぞ。