View Javadoc

1   /*
2    * $Id: Crash.java,v 1.2 2011/01/02 15:04:11 oboehm Exp $
3    *
4    * Copyright (c) 2008 by Oliver Boehm
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express orimplied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   *
18   * (c)reated 24.11.2008 by oliver (ob@oasd.de)
19   */
20  package patterntesting.sample;
21  
22  import java.util.Date;
23  
24  import org.apache.commons.logging.Log;
25  import org.apache.commons.logging.impl.LogFactoryImpl;
26  
27  import patterntesting.runtime.annotation.GuardInitialization;
28  
29  /**
30   * This class will crash while initializing the static part.
31   *
32   * @author <a href="boehm@javatux.de">oliver</a>
33   * @since 24.11.2008
34   * @version $Revision: 1.2 $
35   */
36  @GuardInitialization
37  public final class Crash {
38  
39      /** this initialization will crash. */
40  	protected static final Log log = LogFactoryImpl.getLog((String) null);
41  
42      /** Utility class - no need to instantiate it. */
43  	private Crash() {}
44  
45  	/**
46  	 * Gets the date.
47  	 *
48  	 * @return the date
49  	 */
50  	public static Date getDate() {
51  		return new Date();
52  	}
53  
54  }