1 /* 2 * @(#)NullPointerException.java 1.20 05/11/17 3 * 4 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 * 7 * Port to the D Programming language: 8 * Jacob Carlborg <jacob.carlborg@gmail.com> 9 */ 10 module mambo.exception.NullPointerException; 11 12 import tango.core.Exception; 13 14 /** 15 * Thrown when an application attempts to use <code>null</code> in a 16 * case where an object is required. These include: 17 * <ul> 18 * <li>Calling the instance method of a <code>null</code> object. 19 * <li>Accessing or modifying the field of a <code>null</code> object. 20 * <li>Taking the length of <code>null</code> as if it were an array. 21 * <li>Accessing or modifying the slots of <code>null</code> as if it 22 * were an array. 23 * <li>Throwing <code>null</code> as if it were a <code>Throwable</code> 24 * value. 25 * </ul> 26 * <p> 27 * Applications should throw instances of this class to indicate 28 * other illegal uses of the <code>null</code> object. 29 * 30 * @author unascribed 31 * @version 1.20, 11/17/05 32 * @since JDK1.0 33 */ 34 public class NullPointerException : Exception 35 { 36 37 /** 38 * Constructs a <code>NullPointerException</code> with no detail message. 39 * 40 * Params: 41 * file = the file where the exception occurred 42 * line = the line where the exception occurred 43 */ 44 public this (string file, size_t line) 45 { 46 super("Null Pointer Exception"); 47 } 48 49 /** 50 * 51 * Constructs a <code>NullPointerException</code> with the specified 52 * detail message. 53 * 54 * Params: 55 * s = the detail message. 56 * file = the file where the exception occurred 57 * line = the line where the exception occurred 58 */ 59 public this (string s, string file, size_t line) 60 { 61 super(s); 62 } 63 }