Package java.util

Examples of java.util.Date.clone()


public class A {
 
  public void doStuff() {
    Date date = new Date();
    date.clone();
  }

}
View Full Code Here


      Map<String,Integer> failureModes = new HashMap<String,Integer>();
      for(Entry<GregorianCalendar,DumpElement> entry : map.entrySet()) {
        GregorianCalendar date = entry.getKey();
        DumpElement element = entry.getValue();
        if(element.pullTimes != null) {
          date = (GregorianCalendar) date.clone();
          date.add(Calendar.DAY_OF_MONTH, -delta);
          System.out.println("Checking "+date.getTime()+" for "+element.date.getTime()+" delta "+delta);
          DumpElement inserted = map.get(date);
          if(inserted == null) {
            System.out.println("No match");
View Full Code Here

    }

    public void testCloneProxyDate() {
        Date orig = (Date) _mgr.newDateProxy(Time.class);
        orig.setTime(1999);
        assertDatesEquals(new Time(orig.getTime()), (Date) orig.clone());
    }

    public void testDateMethodsProxied() throws Exception {
        Class proxy = _mgr.newDateProxy(Date.class).getClass();
        assertDateMethodsProxied(proxy);
View Full Code Here

    Date ts = new Date();

    expectedMap.put("num", 17L);
    expectedMap.put("whatevs", "a string");
    expectedMap.put("exfiltrated", ts.clone());

    expectedStreams.put("Content", new FileProxy("some/bullshit/file.dat"));
    expectedStreams.put("Slack", new BufferProxy(new byte[] {0x02, 0x03, 0x05, 0x08, 0x13, 0x21}));

    inMap.put(createColSpec(17L, "num"), Bytes.toBytes(17L));
View Full Code Here

    }

    public void testCloneProxyDate() {
        Date orig = (Date) _mgr.newDateProxy(Time.class);
        orig.setTime(1999);
        assertDatesEquals(new Time(orig.getTime()), (Date) orig.clone());
    }

    public void testDateMethodsProxied() throws Exception {
        Class proxy = _mgr.newDateProxy(Date.class).getClass();
        assertDateMethodsProxied(proxy);
View Full Code Here

            fail(getName() + ": not performed (could not create test TrustAnchor set)");
        }

        PKIXParameters p = new PKIXParameters(taSet);
        Date currentDate = new Date();
        p.setDate((Date)currentDate.clone());
        Date ret1 = p.getDate();
        // modify Date returned
        ret1.setTime(0L);
        // check that internal Date has not been
        // changed by the above modification
View Full Code Here

    ReliableMessaging rm = CPAUtils.getReliableMessaging(cpa,messageHeader);
    if (rm != null)
    {
      for (int i = 0; i < rm.getRetries().intValue() + 1; i++)
      {
        result.add(new EbMSSendEvent(messageHeader.getMessageData().getMessageId(),(Date)sendTime.clone()));
        rm.getRetryInterval().addTo(sendTime);
      }
    }
    return result;
  }
View Full Code Here

        // No month has more than 6 weeks so 6 is a safe maximum for rows.
        for (int weekOfMonth = 1; weekOfMonth < 7; weekOfMonth++) {
            for (int dayOfWeek = 0; dayOfWeek < 7; dayOfWeek++) {

                // Actually write the day of month
                Day day = new Day((Date) curr.clone());

                if (curr.equals(selectedDate)) {
                    day.addStyleDependentName(CN_SELECTED);
                    selectedDay = day;
                }
View Full Code Here

            fail(getName() + ": not performed (could not create test TrustAnchor set)");
        }

        PKIXParameters p = new PKIXParameters(taSet);
        Date currentDate = new Date();
        p.setDate((Date)currentDate.clone());
        Date ret1 = p.getDate();
        // modify Date returned
        ret1.setTime(0L);
        // check that internal Date has not been
        // changed by the above modification
View Full Code Here

    public TestEntity clone() {
        try {
            TestEntity cloned = getClass().cast(super.clone());
            Date clonedDate = cloned.getCreationDate();
            if (clonedDate != null) {
                cloned.setCreationDate((Date) clonedDate.clone());
            }

            return cloned;
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Failed to clone " + toString() + ": " + e.getMessage());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.