You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Digy (JIRA)" <ji...@apache.org> on 2009/11/11 23:28:39 UTC

[jira] Created: (LUCENENET-231) System.DateTime.Now.Millisecond bug

System.DateTime.Now.Millisecond bug
-----------------------------------

                 Key: LUCENENET-231
                 URL: https://issues.apache.org/jira/browse/LUCENENET-231
             Project: Lucene.Net
          Issue Type: Bug
         Environment: 2.9.0
            Reporter: Digy
         Attachments: CurrentTimeMillis.patch

There are too many places where Java's System.currentTimeMillis() has been ported as  System.DateTime.Now.Millisecond.

I will replace them with a method in SupportClass
{code}
public static long CurrentTimeMillis()
{
    return DateTime.Now.Ticks / 10000;
}
{code}
in SupportClass

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LUCENENET-231) System.DateTime.Now.Millisecond bug

Posted by "Ben Martz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776745#action_12776745 ] 

Ben Martz commented on LUCENENET-231:
-------------------------------------

Just as a general best practice, may I recommend the use of TimeSpan.TicksPerMillisecond instead of an inline value?

> System.DateTime.Now.Millisecond bug
> -----------------------------------
>
>                 Key: LUCENENET-231
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-231
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: 2.9.0
>            Reporter: Digy
>         Attachments: CurrentTimeMillis.patch
>
>
> There are too many places where Java's System.currentTimeMillis() has been ported as  System.DateTime.Now.Millisecond.
> I will replace them with a new method in SupportClass
> {code}
> public static long CurrentTimeMillis()
> {
>     return DateTime.Now.Ticks / 10000;
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LUCENENET-231) System.DateTime.Now.Millisecond bug

Posted by "George Aroush (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776845#action_12776845 ] 

George Aroush commented on LUCENENET-231:
-----------------------------------------

Ugh!  This was my bad.  I scripted out JLCA's "DateTime.Now.Ticks / 10000" variations to "System.DateTime.Now.Millisecond." without giving it full taught.  Sorry about that.

Instead of adding a new function to SupportClass, I rather see this fixed in the core doe directly.  SupportClass is a place to put stuff that if added in the core code will cause either extra noise in the code (large block of code), or code that isn't directly support in .NET.  So, if it's not too much work, I would rather see this fixed without the use of SupportClass.

> System.DateTime.Now.Millisecond bug
> -----------------------------------
>
>                 Key: LUCENENET-231
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-231
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: 2.9.0
>            Reporter: Digy
>         Attachments: CurrentTimeMillis.patch
>
>
> There are too many places where Java's System.currentTimeMillis() has been ported as  System.DateTime.Now.Millisecond.
> I will replace them with a new method in SupportClass
> {code}
> public static long CurrentTimeMillis()
> {
>     return DateTime.Now.Ticks / 10000;
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LUCENENET-231) System.DateTime.Now.Millisecond bug

Posted by "Nicholas Paldino (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776761#action_12776761 ] 

Nicholas Paldino commented on LUCENENET-231:
--------------------------------------------

I agree with Ben, magic number above reeks.

> System.DateTime.Now.Millisecond bug
> -----------------------------------
>
>                 Key: LUCENENET-231
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-231
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: 2.9.0
>            Reporter: Digy
>         Attachments: CurrentTimeMillis.patch
>
>
> There are too many places where Java's System.currentTimeMillis() has been ported as  System.DateTime.Now.Millisecond.
> I will replace them with a new method in SupportClass
> {code}
> public static long CurrentTimeMillis()
> {
>     return DateTime.Now.Ticks / 10000;
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LUCENENET-231) System.DateTime.Now.Millisecond bug

Posted by "Digy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Digy updated LUCENENET-231:
---------------------------

    Description: 
There are too many places where Java's System.currentTimeMillis() has been ported as  System.DateTime.Now.Millisecond.

I will replace them with a new method in SupportClass
{code}
public static long CurrentTimeMillis()
{
    return DateTime.Now.Ticks / 10000;
}
{code}


  was:
There are too many places where Java's System.currentTimeMillis() has been ported as  System.DateTime.Now.Millisecond.

I will replace them with a method in SupportClass
{code}
public static long CurrentTimeMillis()
{
    return DateTime.Now.Ticks / 10000;
}
{code}
in SupportClass


> System.DateTime.Now.Millisecond bug
> -----------------------------------
>
>                 Key: LUCENENET-231
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-231
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: 2.9.0
>            Reporter: Digy
>         Attachments: CurrentTimeMillis.patch
>
>
> There are too many places where Java's System.currentTimeMillis() has been ported as  System.DateTime.Now.Millisecond.
> I will replace them with a new method in SupportClass
> {code}
> public static long CurrentTimeMillis()
> {
>     return DateTime.Now.Ticks / 10000;
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LUCENENET-231) System.DateTime.Now.Millisecond bug

Posted by "Digy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776705#action_12776705 ] 

Digy commented on LUCENENET-231:
--------------------------------

If this patch is excepted, then TestAtomicUpdate (patched with  LUCENENET-223) should be patched also.

DIGY

> System.DateTime.Now.Millisecond bug
> -----------------------------------
>
>                 Key: LUCENENET-231
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-231
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: 2.9.0
>            Reporter: Digy
>         Attachments: CurrentTimeMillis.patch
>
>
> There are too many places where Java's System.currentTimeMillis() has been ported as  System.DateTime.Now.Millisecond.
> I will replace them with a new method in SupportClass
> {code}
> public static long CurrentTimeMillis()
> {
>     return DateTime.Now.Ticks / 10000;
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LUCENENET-231) System.DateTime.Now.Millisecond bug

Posted by "Digy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Digy updated LUCENENET-231:
---------------------------

    Attachment: CurrentTimeMillis.patch

> System.DateTime.Now.Millisecond bug
> -----------------------------------
>
>                 Key: LUCENENET-231
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-231
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: 2.9.0
>            Reporter: Digy
>         Attachments: CurrentTimeMillis.patch
>
>
> There are too many places where Java's System.currentTimeMillis() has been ported as  System.DateTime.Now.Millisecond.
> I will replace them with a new method in SupportClass
> {code}
> public static long CurrentTimeMillis()
> {
>     return DateTime.Now.Ticks / 10000;
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (LUCENENET-231) System.DateTime.Now.Millisecond bug

Posted by "Digy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Digy closed LUCENENET-231.
--------------------------

    Resolution: Fixed
      Assignee: Digy

replaced 
    System.DateTime.Now.Millisecond 
with 
   (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond)
in all documents.

DIGY

> System.DateTime.Now.Millisecond bug
> -----------------------------------
>
>                 Key: LUCENENET-231
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-231
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: 2.9.0
>            Reporter: Digy
>            Assignee: Digy
>         Attachments: CurrentTimeMillis.patch
>
>
> There are too many places where Java's System.currentTimeMillis() has been ported as  System.DateTime.Now.Millisecond.
> I will replace them with a new method in SupportClass
> {code}
> public static long CurrentTimeMillis()
> {
>     return DateTime.Now.Ticks / 10000;
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LUCENENET-231) System.DateTime.Now.Millisecond bug

Posted by "Digy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776698#action_12776698 ] 

Digy commented on LUCENENET-231:
--------------------------------

Example to failing cases:
Index.TestDeletionPolicy.TestExpirationTimeDeletionPolicy
Index.TestDeletionPolicy.TesKeepLastNDeletionPolicyWithCreates 
etc.

There may be others since there are a lof of references to that function.

DIGY



> System.DateTime.Now.Millisecond bug
> -----------------------------------
>
>                 Key: LUCENENET-231
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-231
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: 2.9.0
>            Reporter: Digy
>         Attachments: CurrentTimeMillis.patch
>
>
> There are too many places where Java's System.currentTimeMillis() has been ported as  System.DateTime.Now.Millisecond.
> I will replace them with a new method in SupportClass
> {code}
> public static long CurrentTimeMillis()
> {
>     return DateTime.Now.Ticks / 10000;
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.