• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
3  *
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  *  * Redistributions of source code must retain the above copyright notice,
10  *    this list of conditions and the following disclaimer.
11  *
12  *  * Redistributions in binary form must reproduce the above copyright notice,
13  *    this list of conditions and the following disclaimer in the documentation
14  *    and/or other materials provided with the distribution.
15  *
16  *  * Neither the name of JSR-310 nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software
18  *    without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 package org.threeten.bp;
33 
34 import java.io.DataInputStream;
35 import java.io.FileInputStream;
36 import java.io.FileNotFoundException;
37 import java.util.ArrayList;
38 import java.util.Collections;
39 import java.util.GregorianCalendar;
40 import java.util.HashMap;
41 import java.util.TreeMap;
42 import java.util.concurrent.ConcurrentHashMap;
43 import java.util.concurrent.locks.ReentrantLock;
44 import java.util.regex.Pattern;
45 import java.util.zip.ZipInputStream;
46 
47 import org.threeten.bp.temporal.TemporalAccessor;
48 
49 /**
50  * Test Class loading.
51  * Use "-verbose:class".
52  */
53 public class ClassLoaderChecker {
54 
55     @SuppressWarnings({ "rawtypes", "unchecked" })
main(String[] args)56     public static void main(String[] args) {
57         Object a = new ConcurrentHashMap();
58         a.toString();
59         a = new ReentrantLock();
60         a.toString();
61         a = Pattern.compile("hello[a-z][^f]{2}").matcher("goo").matches();
62         a.toString();
63         a = new HashMap().entrySet();
64         a.toString();
65         a = new HashMap().values();
66         a.toString();
67         a = new HashMap().keySet();
68         a.toString();
69         a = new TreeMap().entrySet();
70         a.toString();
71         a = new TreeMap().values();
72         a.toString();
73         a = new TreeMap().keySet();
74         a.toString();
75         a = Collections.unmodifiableMap(new HashMap()).entrySet();
76         a.toString();
77         a = Collections.unmodifiableMap(new HashMap()).values();
78         a.toString();
79         a = Collections.unmodifiableMap(new HashMap()).keySet();
80         a.toString();
81         a = Collections.unmodifiableList(new ArrayList());
82         a.toString();
83         a = Collections.unmodifiableList(new ArrayList()).iterator();
84         a.toString();
85         try {
86             a = new DataInputStream(new ZipInputStream(new FileInputStream("/a.zip")));
87         } catch (FileNotFoundException ex) {
88             // ignore
89         }
90         a.toString();
91 
92         System.out.println("************************************************************");
93         a = TemporalAccessor.class;
94 
95         System.out.println("************************************************************");
96         Month.of(5);
97 
98         System.out.println("************************************************************");
99         a = LocalDate.class;
100 
101         System.out.println("************************************************************");
102         LocalDate d = LocalDate.of(2011, 12, 20);
103 
104         System.out.println("************************************************************");
105         LocalTime t = LocalTime.of(12, 20);
106 
107         System.out.println("************************************************************");
108         LocalDateTime ldt = LocalDateTime.of(d, t);
109 
110         System.out.println("************************************************************");
111         a = GregorianCalendar.class;
112 
113         System.out.println("************************************************************");
114         new GregorianCalendar();
115 
116         System.out.println("************************************************************");
117         ldt.atZone(ZoneId.of("Europe/Paris"));
118 
119         System.out.println("************************************************************");
120     }
121 
122 }
123