1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/samples/cloneproblem/build.xml Tue Mar 01 21:28:39 2011 +0100
1.3 @@ -0,0 +1,74 @@
1.4 +<?xml version="1.0" encoding="UTF-8"?>
1.5 +<!-- You may freely edit this file. See commented blocks below for -->
1.6 +<!-- some examples of how to customize the build. -->
1.7 +<!-- (If you delete it and reopen the project it will be recreated.) -->
1.8 +<!-- By default, only the Clean and Build commands use this build script. -->
1.9 +<!-- Commands such as Run, Debug, and Test only use this build script if -->
1.10 +<!-- the Compile on Save feature is turned off for the project. -->
1.11 +<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
1.12 +<!-- in the project's Project Properties dialog box.-->
1.13 +<project name="cloneproblem" default="default" basedir=".">
1.14 + <description>Builds, tests, and runs the project cloneproblem.</description>
1.15 + <import file="nbproject/build-impl.xml"/>
1.16 + <!--
1.17 +
1.18 + There exist several targets which are by default empty and which can be
1.19 + used for execution of your tasks. These targets are usually executed
1.20 + before and after some main targets. They are:
1.21 +
1.22 + -pre-init: called before initialization of project properties
1.23 + -post-init: called after initialization of project properties
1.24 + -pre-compile: called before javac compilation
1.25 + -post-compile: called after javac compilation
1.26 + -pre-compile-single: called before javac compilation of single file
1.27 + -post-compile-single: called after javac compilation of single file
1.28 + -pre-compile-test: called before javac compilation of JUnit tests
1.29 + -post-compile-test: called after javac compilation of JUnit tests
1.30 + -pre-compile-test-single: called before javac compilation of single JUnit test
1.31 + -post-compile-test-single: called after javac compilation of single JUunit test
1.32 + -pre-jar: called before JAR building
1.33 + -post-jar: called after JAR building
1.34 + -post-clean: called after cleaning build products
1.35 +
1.36 + (Targets beginning with '-' are not intended to be called on their own.)
1.37 +
1.38 + Example of inserting an obfuscator after compilation could look like this:
1.39 +
1.40 + <target name="-post-compile">
1.41 + <obfuscate>
1.42 + <fileset dir="${build.classes.dir}"/>
1.43 + </obfuscate>
1.44 + </target>
1.45 +
1.46 + For list of available properties check the imported
1.47 + nbproject/build-impl.xml file.
1.48 +
1.49 +
1.50 + Another way to customize the build is by overriding existing main targets.
1.51 + The targets of interest are:
1.52 +
1.53 + -init-macrodef-javac: defines macro for javac compilation
1.54 + -init-macrodef-junit: defines macro for junit execution
1.55 + -init-macrodef-debug: defines macro for class debugging
1.56 + -init-macrodef-java: defines macro for class execution
1.57 + -do-jar-with-manifest: JAR building (if you are using a manifest)
1.58 + -do-jar-without-manifest: JAR building (if you are not using a manifest)
1.59 + run: execution of project
1.60 + -javadoc-build: Javadoc generation
1.61 + test-report: JUnit report generation
1.62 +
1.63 + An example of overriding the target for project execution could look like this:
1.64 +
1.65 + <target name="run" depends="cloneproblem-impl.jar">
1.66 + <exec dir="bin" executable="launcher.exe">
1.67 + <arg file="${dist.jar}"/>
1.68 + </exec>
1.69 + </target>
1.70 +
1.71 + Notice that the overridden target depends on the jar target and not only on
1.72 + the compile target as the regular run target does. Again, for a list of available
1.73 + properties which you can use, check the target you are overriding in the
1.74 + nbproject/build-impl.xml file.
1.75 +
1.76 + -->
1.77 +</project>
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/samples/cloneproblem/nbproject/build-impl.xml Tue Mar 01 21:28:39 2011 +0100
2.3 @@ -0,0 +1,1033 @@
2.4 +<?xml version="1.0" encoding="UTF-8"?>
2.5 +<!--
2.6 +*** GENERATED FROM project.xml - DO NOT EDIT ***
2.7 +*** EDIT ../build.xml INSTEAD ***
2.8 +
2.9 +For the purpose of easier reading the script
2.10 +is divided into following sections:
2.11 +
2.12 + - initialization
2.13 + - compilation
2.14 + - jar
2.15 + - execution
2.16 + - debugging
2.17 + - javadoc
2.18 + - junit compilation
2.19 + - junit execution
2.20 + - junit debugging
2.21 + - applet
2.22 + - cleanup
2.23 +
2.24 + -->
2.25 +<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="cloneproblem-impl">
2.26 + <fail message="Please build using Ant 1.7.1 or higher.">
2.27 + <condition>
2.28 + <not>
2.29 + <antversion atleast="1.7.1"/>
2.30 + </not>
2.31 + </condition>
2.32 + </fail>
2.33 + <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
2.34 + <!--
2.35 + ======================
2.36 + INITIALIZATION SECTION
2.37 + ======================
2.38 + -->
2.39 + <target name="-pre-init">
2.40 + <!-- Empty placeholder for easier customization. -->
2.41 + <!-- You can override this target in the ../build.xml file. -->
2.42 + </target>
2.43 + <target depends="-pre-init" name="-init-private">
2.44 + <property file="nbproject/private/config.properties"/>
2.45 + <property file="nbproject/private/configs/${config}.properties"/>
2.46 + <property file="nbproject/private/private.properties"/>
2.47 + </target>
2.48 + <target depends="-pre-init,-init-private" name="-init-user">
2.49 + <property file="${user.properties.file}"/>
2.50 + <!-- The two properties below are usually overridden -->
2.51 + <!-- by the active platform. Just a fallback. -->
2.52 + <property name="default.javac.source" value="1.4"/>
2.53 + <property name="default.javac.target" value="1.4"/>
2.54 + </target>
2.55 + <target depends="-pre-init,-init-private,-init-user" name="-init-project">
2.56 + <property file="nbproject/configs/${config}.properties"/>
2.57 + <property file="nbproject/project.properties"/>
2.58 + </target>
2.59 + <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
2.60 + <available file="${manifest.file}" property="manifest.available"/>
2.61 + <condition property="splashscreen.available">
2.62 + <and>
2.63 + <not>
2.64 + <equals arg1="${application.splash}" arg2="" trim="true"/>
2.65 + </not>
2.66 + <available file="${application.splash}"/>
2.67 + </and>
2.68 + </condition>
2.69 + <condition property="main.class.available">
2.70 + <and>
2.71 + <isset property="main.class"/>
2.72 + <not>
2.73 + <equals arg1="${main.class}" arg2="" trim="true"/>
2.74 + </not>
2.75 + </and>
2.76 + </condition>
2.77 + <condition property="manifest.available+main.class">
2.78 + <and>
2.79 + <isset property="manifest.available"/>
2.80 + <isset property="main.class.available"/>
2.81 + </and>
2.82 + </condition>
2.83 + <condition property="do.archive">
2.84 + <not>
2.85 + <istrue value="${jar.archive.disabled}"/>
2.86 + </not>
2.87 + </condition>
2.88 + <condition property="do.mkdist">
2.89 + <and>
2.90 + <isset property="do.archive"/>
2.91 + <isset property="libs.CopyLibs.classpath"/>
2.92 + <not>
2.93 + <istrue value="${mkdist.disabled}"/>
2.94 + </not>
2.95 + </and>
2.96 + </condition>
2.97 + <condition property="manifest.available+main.class+mkdist.available">
2.98 + <and>
2.99 + <istrue value="${manifest.available+main.class}"/>
2.100 + <isset property="do.mkdist"/>
2.101 + </and>
2.102 + </condition>
2.103 + <condition property="do.archive+manifest.available">
2.104 + <and>
2.105 + <isset property="manifest.available"/>
2.106 + <istrue value="${do.archive}"/>
2.107 + </and>
2.108 + </condition>
2.109 + <condition property="do.archive+main.class.available">
2.110 + <and>
2.111 + <isset property="main.class.available"/>
2.112 + <istrue value="${do.archive}"/>
2.113 + </and>
2.114 + </condition>
2.115 + <condition property="do.archive+splashscreen.available">
2.116 + <and>
2.117 + <isset property="splashscreen.available"/>
2.118 + <istrue value="${do.archive}"/>
2.119 + </and>
2.120 + </condition>
2.121 + <condition property="do.archive+manifest.available+main.class">
2.122 + <and>
2.123 + <istrue value="${manifest.available+main.class}"/>
2.124 + <istrue value="${do.archive}"/>
2.125 + </and>
2.126 + </condition>
2.127 + <condition property="manifest.available-mkdist.available">
2.128 + <or>
2.129 + <istrue value="${manifest.available}"/>
2.130 + <isset property="do.mkdist"/>
2.131 + </or>
2.132 + </condition>
2.133 + <condition property="manifest.available+main.class-mkdist.available">
2.134 + <or>
2.135 + <istrue value="${manifest.available+main.class}"/>
2.136 + <isset property="do.mkdist"/>
2.137 + </or>
2.138 + </condition>
2.139 + <condition property="have.tests">
2.140 + <or>
2.141 + <available file="${test.src.dir}"/>
2.142 + </or>
2.143 + </condition>
2.144 + <condition property="have.sources">
2.145 + <or>
2.146 + <available file="${src.dir}"/>
2.147 + </or>
2.148 + </condition>
2.149 + <condition property="netbeans.home+have.tests">
2.150 + <and>
2.151 + <isset property="netbeans.home"/>
2.152 + <isset property="have.tests"/>
2.153 + </and>
2.154 + </condition>
2.155 + <condition property="no.javadoc.preview">
2.156 + <and>
2.157 + <isset property="javadoc.preview"/>
2.158 + <isfalse value="${javadoc.preview}"/>
2.159 + </and>
2.160 + </condition>
2.161 + <property name="run.jvmargs" value=""/>
2.162 + <property name="javac.compilerargs" value=""/>
2.163 + <property name="work.dir" value="${basedir}"/>
2.164 + <condition property="no.deps">
2.165 + <and>
2.166 + <istrue value="${no.dependencies}"/>
2.167 + </and>
2.168 + </condition>
2.169 + <property name="javac.debug" value="true"/>
2.170 + <property name="javadoc.preview" value="true"/>
2.171 + <property name="application.args" value=""/>
2.172 + <property name="source.encoding" value="${file.encoding}"/>
2.173 + <property name="runtime.encoding" value="${source.encoding}"/>
2.174 + <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
2.175 + <and>
2.176 + <isset property="javadoc.encoding"/>
2.177 + <not>
2.178 + <equals arg1="${javadoc.encoding}" arg2=""/>
2.179 + </not>
2.180 + </and>
2.181 + </condition>
2.182 + <property name="javadoc.encoding.used" value="${source.encoding}"/>
2.183 + <property name="includes" value="**"/>
2.184 + <property name="excludes" value=""/>
2.185 + <property name="do.depend" value="false"/>
2.186 + <condition property="do.depend.true">
2.187 + <istrue value="${do.depend}"/>
2.188 + </condition>
2.189 + <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
2.190 + <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
2.191 + <length length="0" string="${endorsed.classpath}" when="greater"/>
2.192 + </condition>
2.193 + <property name="javac.fork" value="true"/>
2.194 + <property name="jar.index" value="false"/>
2.195 + <property name="jar.index.metainf" value="${jar.index}"/>
2.196 + <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
2.197 + </target>
2.198 + <target name="-post-init">
2.199 + <!-- Empty placeholder for easier customization. -->
2.200 + <!-- You can override this target in the ../build.xml file. -->
2.201 + </target>
2.202 + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
2.203 + <fail unless="src.dir">Must set src.dir</fail>
2.204 + <fail unless="test.src.dir">Must set test.src.dir</fail>
2.205 + <fail unless="build.dir">Must set build.dir</fail>
2.206 + <fail unless="dist.dir">Must set dist.dir</fail>
2.207 + <fail unless="build.classes.dir">Must set build.classes.dir</fail>
2.208 + <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
2.209 + <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
2.210 + <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
2.211 + <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
2.212 + <fail unless="dist.jar">Must set dist.jar</fail>
2.213 + </target>
2.214 + <target name="-init-macrodef-property">
2.215 + <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
2.216 + <attribute name="name"/>
2.217 + <attribute name="value"/>
2.218 + <sequential>
2.219 + <property name="@{name}" value="${@{value}}"/>
2.220 + </sequential>
2.221 + </macrodef>
2.222 + </target>
2.223 + <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
2.224 + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
2.225 + <attribute default="${src.dir}" name="srcdir"/>
2.226 + <attribute default="${build.classes.dir}" name="destdir"/>
2.227 + <attribute default="${javac.classpath}" name="classpath"/>
2.228 + <attribute default="${javac.processorpath}" name="processorpath"/>
2.229 + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
2.230 + <attribute default="${includes}" name="includes"/>
2.231 + <attribute default="${excludes}" name="excludes"/>
2.232 + <attribute default="${javac.debug}" name="debug"/>
2.233 + <attribute default="${empty.dir}" name="sourcepath"/>
2.234 + <attribute default="${empty.dir}" name="gensrcdir"/>
2.235 + <element name="customize" optional="true"/>
2.236 + <sequential>
2.237 + <property location="${build.dir}/empty" name="empty.dir"/>
2.238 + <mkdir dir="${empty.dir}"/>
2.239 + <mkdir dir="@{apgeneratedsrcdir}"/>
2.240 + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
2.241 + <src>
2.242 + <dirset dir="@{gensrcdir}" erroronmissingdir="false">
2.243 + <include name="*"/>
2.244 + </dirset>
2.245 + </src>
2.246 + <classpath>
2.247 + <path path="@{classpath}"/>
2.248 + </classpath>
2.249 + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
2.250 + <compilerarg line="${javac.compilerargs}"/>
2.251 + <compilerarg value="-processorpath"/>
2.252 + <compilerarg path="@{processorpath}:${empty.dir}"/>
2.253 + <compilerarg line="${ap.processors.internal}"/>
2.254 + <compilerarg line="${annotation.processing.processor.options}"/>
2.255 + <compilerarg value="-s"/>
2.256 + <compilerarg path="@{apgeneratedsrcdir}"/>
2.257 + <compilerarg line="${ap.proc.none.internal}"/>
2.258 + <customize/>
2.259 + </javac>
2.260 + </sequential>
2.261 + </macrodef>
2.262 + </target>
2.263 + <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
2.264 + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
2.265 + <attribute default="${src.dir}" name="srcdir"/>
2.266 + <attribute default="${build.classes.dir}" name="destdir"/>
2.267 + <attribute default="${javac.classpath}" name="classpath"/>
2.268 + <attribute default="${javac.processorpath}" name="processorpath"/>
2.269 + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
2.270 + <attribute default="${includes}" name="includes"/>
2.271 + <attribute default="${excludes}" name="excludes"/>
2.272 + <attribute default="${javac.debug}" name="debug"/>
2.273 + <attribute default="${empty.dir}" name="sourcepath"/>
2.274 + <attribute default="${empty.dir}" name="gensrcdir"/>
2.275 + <element name="customize" optional="true"/>
2.276 + <sequential>
2.277 + <property location="${build.dir}/empty" name="empty.dir"/>
2.278 + <mkdir dir="${empty.dir}"/>
2.279 + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
2.280 + <src>
2.281 + <dirset dir="@{gensrcdir}" erroronmissingdir="false">
2.282 + <include name="*"/>
2.283 + </dirset>
2.284 + </src>
2.285 + <classpath>
2.286 + <path path="@{classpath}"/>
2.287 + </classpath>
2.288 + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
2.289 + <compilerarg line="${javac.compilerargs}"/>
2.290 + <customize/>
2.291 + </javac>
2.292 + </sequential>
2.293 + </macrodef>
2.294 + </target>
2.295 + <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
2.296 + <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
2.297 + <attribute default="${src.dir}" name="srcdir"/>
2.298 + <attribute default="${build.classes.dir}" name="destdir"/>
2.299 + <attribute default="${javac.classpath}" name="classpath"/>
2.300 + <sequential>
2.301 + <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
2.302 + <classpath>
2.303 + <path path="@{classpath}"/>
2.304 + </classpath>
2.305 + </depend>
2.306 + </sequential>
2.307 + </macrodef>
2.308 + <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
2.309 + <attribute default="${build.classes.dir}" name="destdir"/>
2.310 + <sequential>
2.311 + <fail unless="javac.includes">Must set javac.includes</fail>
2.312 + <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
2.313 + <path>
2.314 + <filelist dir="@{destdir}" files="${javac.includes}"/>
2.315 + </path>
2.316 + <globmapper from="*.java" to="*.class"/>
2.317 + </pathconvert>
2.318 + <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
2.319 + <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
2.320 + <delete>
2.321 + <files includesfile="${javac.includesfile.binary}"/>
2.322 + </delete>
2.323 + <delete>
2.324 + <fileset file="${javac.includesfile.binary}"/>
2.325 + </delete>
2.326 + </sequential>
2.327 + </macrodef>
2.328 + </target>
2.329 + <target name="-init-macrodef-junit">
2.330 + <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
2.331 + <attribute default="${includes}" name="includes"/>
2.332 + <attribute default="${excludes}" name="excludes"/>
2.333 + <attribute default="**" name="testincludes"/>
2.334 + <sequential>
2.335 + <property name="junit.forkmode" value="perTest"/>
2.336 + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
2.337 + <batchtest todir="${build.test.results.dir}">
2.338 + <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
2.339 + <filename name="@{testincludes}"/>
2.340 + </fileset>
2.341 + </batchtest>
2.342 + <classpath>
2.343 + <path path="${run.test.classpath}"/>
2.344 + </classpath>
2.345 + <syspropertyset>
2.346 + <propertyref prefix="test-sys-prop."/>
2.347 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
2.348 + </syspropertyset>
2.349 + <formatter type="brief" usefile="false"/>
2.350 + <formatter type="xml"/>
2.351 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
2.352 + <jvmarg value="-ea"/>
2.353 + <jvmarg line="${run.jvmargs}"/>
2.354 + </junit>
2.355 + </sequential>
2.356 + </macrodef>
2.357 + </target>
2.358 + <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
2.359 + <target name="-profile-pre-init">
2.360 + <!-- Empty placeholder for easier customization. -->
2.361 + <!-- You can override this target in the ../build.xml file. -->
2.362 + </target>
2.363 + <target name="-profile-post-init">
2.364 + <!-- Empty placeholder for easier customization. -->
2.365 + <!-- You can override this target in the ../build.xml file. -->
2.366 + </target>
2.367 + <target name="-profile-init-macrodef-profile">
2.368 + <macrodef name="resolve">
2.369 + <attribute name="name"/>
2.370 + <attribute name="value"/>
2.371 + <sequential>
2.372 + <property name="@{name}" value="${env.@{value}}"/>
2.373 + </sequential>
2.374 + </macrodef>
2.375 + <macrodef name="profile">
2.376 + <attribute default="${main.class}" name="classname"/>
2.377 + <element name="customize" optional="true"/>
2.378 + <sequential>
2.379 + <property environment="env"/>
2.380 + <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
2.381 + <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
2.382 + <jvmarg value="${profiler.info.jvmargs.agent}"/>
2.383 + <jvmarg line="${profiler.info.jvmargs}"/>
2.384 + <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
2.385 + <arg line="${application.args}"/>
2.386 + <classpath>
2.387 + <path path="${run.classpath}"/>
2.388 + </classpath>
2.389 + <syspropertyset>
2.390 + <propertyref prefix="run-sys-prop."/>
2.391 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
2.392 + </syspropertyset>
2.393 + <customize/>
2.394 + </java>
2.395 + </sequential>
2.396 + </macrodef>
2.397 + </target>
2.398 + <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
2.399 + <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
2.400 + <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
2.401 + </target>
2.402 + <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
2.403 + <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
2.404 + <attribute default="${main.class}" name="name"/>
2.405 + <attribute default="${debug.classpath}" name="classpath"/>
2.406 + <attribute default="" name="stopclassname"/>
2.407 + <sequential>
2.408 + <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
2.409 + <classpath>
2.410 + <path path="@{classpath}"/>
2.411 + </classpath>
2.412 + </nbjpdastart>
2.413 + </sequential>
2.414 + </macrodef>
2.415 + <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
2.416 + <attribute default="${build.classes.dir}" name="dir"/>
2.417 + <sequential>
2.418 + <nbjpdareload>
2.419 + <fileset dir="@{dir}" includes="${fix.classes}">
2.420 + <include name="${fix.includes}*.class"/>
2.421 + </fileset>
2.422 + </nbjpdareload>
2.423 + </sequential>
2.424 + </macrodef>
2.425 + </target>
2.426 + <target name="-init-debug-args">
2.427 + <property name="version-output" value="java version "${ant.java.version}"/>
2.428 + <condition property="have-jdk-older-than-1.4">
2.429 + <or>
2.430 + <contains string="${version-output}" substring="java version "1.0"/>
2.431 + <contains string="${version-output}" substring="java version "1.1"/>
2.432 + <contains string="${version-output}" substring="java version "1.2"/>
2.433 + <contains string="${version-output}" substring="java version "1.3"/>
2.434 + </or>
2.435 + </condition>
2.436 + <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
2.437 + <istrue value="${have-jdk-older-than-1.4}"/>
2.438 + </condition>
2.439 + <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
2.440 + <os family="windows"/>
2.441 + </condition>
2.442 + <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
2.443 + <isset property="debug.transport"/>
2.444 + </condition>
2.445 + </target>
2.446 + <target depends="-init-debug-args" name="-init-macrodef-debug">
2.447 + <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
2.448 + <attribute default="${main.class}" name="classname"/>
2.449 + <attribute default="${debug.classpath}" name="classpath"/>
2.450 + <element name="customize" optional="true"/>
2.451 + <sequential>
2.452 + <java classname="@{classname}" dir="${work.dir}" fork="true">
2.453 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
2.454 + <jvmarg line="${debug-args-line}"/>
2.455 + <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
2.456 + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
2.457 + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
2.458 + <jvmarg line="${run.jvmargs}"/>
2.459 + <classpath>
2.460 + <path path="@{classpath}"/>
2.461 + </classpath>
2.462 + <syspropertyset>
2.463 + <propertyref prefix="run-sys-prop."/>
2.464 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
2.465 + </syspropertyset>
2.466 + <customize/>
2.467 + </java>
2.468 + </sequential>
2.469 + </macrodef>
2.470 + </target>
2.471 + <target name="-init-macrodef-java">
2.472 + <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
2.473 + <attribute default="${main.class}" name="classname"/>
2.474 + <attribute default="${run.classpath}" name="classpath"/>
2.475 + <element name="customize" optional="true"/>
2.476 + <sequential>
2.477 + <java classname="@{classname}" dir="${work.dir}" fork="true">
2.478 + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
2.479 + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
2.480 + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
2.481 + <jvmarg line="${run.jvmargs}"/>
2.482 + <classpath>
2.483 + <path path="@{classpath}"/>
2.484 + </classpath>
2.485 + <syspropertyset>
2.486 + <propertyref prefix="run-sys-prop."/>
2.487 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
2.488 + </syspropertyset>
2.489 + <customize/>
2.490 + </java>
2.491 + </sequential>
2.492 + </macrodef>
2.493 + </target>
2.494 + <target name="-init-macrodef-copylibs">
2.495 + <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
2.496 + <attribute default="${manifest.file}" name="manifest"/>
2.497 + <element name="customize" optional="true"/>
2.498 + <sequential>
2.499 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
2.500 + <pathconvert property="run.classpath.without.build.classes.dir">
2.501 + <path path="${run.classpath}"/>
2.502 + <map from="${build.classes.dir.resolved}" to=""/>
2.503 + </pathconvert>
2.504 + <pathconvert pathsep=" " property="jar.classpath">
2.505 + <path path="${run.classpath.without.build.classes.dir}"/>
2.506 + <chainedmapper>
2.507 + <flattenmapper/>
2.508 + <globmapper from="*" to="lib/*"/>
2.509 + </chainedmapper>
2.510 + </pathconvert>
2.511 + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
2.512 + <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
2.513 + <fileset dir="${build.classes.dir}"/>
2.514 + <manifest>
2.515 + <attribute name="Class-Path" value="${jar.classpath}"/>
2.516 + <customize/>
2.517 + </manifest>
2.518 + </copylibs>
2.519 + </sequential>
2.520 + </macrodef>
2.521 + </target>
2.522 + <target name="-init-presetdef-jar">
2.523 + <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
2.524 + <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
2.525 + <j2seproject1:fileset dir="${build.classes.dir}"/>
2.526 + </jar>
2.527 + </presetdef>
2.528 + </target>
2.529 + <target name="-init-ap-cmdline-properties">
2.530 + <property name="annotation.processing.enabled" value="true"/>
2.531 + <property name="annotation.processing.processors.list" value=""/>
2.532 + <property name="annotation.processing.processor.options" value=""/>
2.533 + <property name="annotation.processing.run.all.processors" value="true"/>
2.534 + <property name="javac.processorpath" value="${javac.classpath}"/>
2.535 + <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
2.536 + <condition property="ap.supported.internal" value="true">
2.537 + <not>
2.538 + <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
2.539 + </not>
2.540 + </condition>
2.541 + </target>
2.542 + <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
2.543 + <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
2.544 + <isfalse value="${annotation.processing.run.all.processors}"/>
2.545 + </condition>
2.546 + <condition else="" property="ap.proc.none.internal" value="-proc:none">
2.547 + <isfalse value="${annotation.processing.enabled}"/>
2.548 + </condition>
2.549 + </target>
2.550 + <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
2.551 + <property name="ap.cmd.line.internal" value=""/>
2.552 + </target>
2.553 + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
2.554 + <!--
2.555 + ===================
2.556 + COMPILATION SECTION
2.557 + ===================
2.558 + -->
2.559 + <target name="-deps-jar-init" unless="built-jar.properties">
2.560 + <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
2.561 + <delete file="${built-jar.properties}" quiet="true"/>
2.562 + </target>
2.563 + <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
2.564 + <echo level="warn" message="Cycle detected: cloneproblem was already built"/>
2.565 + </target>
2.566 + <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
2.567 + <mkdir dir="${build.dir}"/>
2.568 + <touch file="${built-jar.properties}" verbose="false"/>
2.569 + <property file="${built-jar.properties}" prefix="already.built.jar."/>
2.570 + <antcall target="-warn-already-built-jar"/>
2.571 + <propertyfile file="${built-jar.properties}">
2.572 + <entry key="${basedir}" value=""/>
2.573 + </propertyfile>
2.574 + </target>
2.575 + <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
2.576 + <target depends="init" name="-check-automatic-build">
2.577 + <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
2.578 + </target>
2.579 + <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
2.580 + <antcall target="clean"/>
2.581 + </target>
2.582 + <target depends="init,deps-jar" name="-pre-pre-compile">
2.583 + <mkdir dir="${build.classes.dir}"/>
2.584 + </target>
2.585 + <target name="-pre-compile">
2.586 + <!-- Empty placeholder for easier customization. -->
2.587 + <!-- You can override this target in the ../build.xml file. -->
2.588 + </target>
2.589 + <target if="do.depend.true" name="-compile-depend">
2.590 + <pathconvert property="build.generated.subdirs">
2.591 + <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
2.592 + <include name="*"/>
2.593 + </dirset>
2.594 + </pathconvert>
2.595 + <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
2.596 + </target>
2.597 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
2.598 + <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
2.599 + <copy todir="${build.classes.dir}">
2.600 + <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
2.601 + </copy>
2.602 + </target>
2.603 + <target if="has.persistence.xml" name="-copy-persistence-xml">
2.604 + <mkdir dir="${build.classes.dir}/META-INF"/>
2.605 + <copy todir="${build.classes.dir}/META-INF">
2.606 + <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
2.607 + </copy>
2.608 + </target>
2.609 + <target name="-post-compile">
2.610 + <!-- Empty placeholder for easier customization. -->
2.611 + <!-- You can override this target in the ../build.xml file. -->
2.612 + </target>
2.613 + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
2.614 + <target name="-pre-compile-single">
2.615 + <!-- Empty placeholder for easier customization. -->
2.616 + <!-- You can override this target in the ../build.xml file. -->
2.617 + </target>
2.618 + <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
2.619 + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
2.620 + <j2seproject3:force-recompile/>
2.621 + <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
2.622 + </target>
2.623 + <target name="-post-compile-single">
2.624 + <!-- Empty placeholder for easier customization. -->
2.625 + <!-- You can override this target in the ../build.xml file. -->
2.626 + </target>
2.627 + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
2.628 + <!--
2.629 + ====================
2.630 + JAR BUILDING SECTION
2.631 + ====================
2.632 + -->
2.633 + <target depends="init" name="-pre-pre-jar">
2.634 + <dirname file="${dist.jar}" property="dist.jar.dir"/>
2.635 + <mkdir dir="${dist.jar.dir}"/>
2.636 + </target>
2.637 + <target name="-pre-jar">
2.638 + <!-- Empty placeholder for easier customization. -->
2.639 + <!-- You can override this target in the ../build.xml file. -->
2.640 + </target>
2.641 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
2.642 + <j2seproject1:jar/>
2.643 + </target>
2.644 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
2.645 + <j2seproject1:jar manifest="${manifest.file}"/>
2.646 + </target>
2.647 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
2.648 + <j2seproject1:jar manifest="${manifest.file}">
2.649 + <j2seproject1:manifest>
2.650 + <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
2.651 + </j2seproject1:manifest>
2.652 + </j2seproject1:jar>
2.653 + <echo level="info">To run this application from the command line without Ant, try:</echo>
2.654 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
2.655 + <property location="${dist.jar}" name="dist.jar.resolved"/>
2.656 + <pathconvert property="run.classpath.with.dist.jar">
2.657 + <path path="${run.classpath}"/>
2.658 + <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
2.659 + </pathconvert>
2.660 + <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
2.661 + </target>
2.662 + <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
2.663 + <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
2.664 + <touch file="${tmp.manifest.file}" verbose="false"/>
2.665 + </target>
2.666 + <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
2.667 + <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
2.668 + <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
2.669 + </target>
2.670 + <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
2.671 + <manifest file="${tmp.manifest.file}" mode="update">
2.672 + <attribute name="Main-Class" value="${main.class}"/>
2.673 + </manifest>
2.674 + </target>
2.675 + <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
2.676 + <basename file="${application.splash}" property="splashscreen.basename"/>
2.677 + <mkdir dir="${build.classes.dir}/META-INF"/>
2.678 + <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
2.679 + <manifest file="${tmp.manifest.file}" mode="update">
2.680 + <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
2.681 + </manifest>
2.682 + </target>
2.683 + <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
2.684 + <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
2.685 + <echo level="info">To run this application from the command line without Ant, try:</echo>
2.686 + <property location="${dist.jar}" name="dist.jar.resolved"/>
2.687 + <echo level="info">java -jar "${dist.jar.resolved}"</echo>
2.688 + </target>
2.689 + <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
2.690 + <delete>
2.691 + <fileset file="${tmp.manifest.file}"/>
2.692 + </delete>
2.693 + </target>
2.694 + <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
2.695 + <target name="-post-jar">
2.696 + <!-- Empty placeholder for easier customization. -->
2.697 + <!-- You can override this target in the ../build.xml file. -->
2.698 + </target>
2.699 + <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
2.700 + <!--
2.701 + =================
2.702 + EXECUTION SECTION
2.703 + =================
2.704 + -->
2.705 + <target depends="init,compile" description="Run a main class." name="run">
2.706 + <j2seproject1:java>
2.707 + <customize>
2.708 + <arg line="${application.args}"/>
2.709 + </customize>
2.710 + </j2seproject1:java>
2.711 + </target>
2.712 + <target name="-do-not-recompile">
2.713 + <property name="javac.includes.binary" value=""/>
2.714 + </target>
2.715 + <target depends="init,compile-single" name="run-single">
2.716 + <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
2.717 + <j2seproject1:java classname="${run.class}"/>
2.718 + </target>
2.719 + <target depends="init,compile-test-single" name="run-test-with-main">
2.720 + <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
2.721 + <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
2.722 + </target>
2.723 + <!--
2.724 + =================
2.725 + DEBUGGING SECTION
2.726 + =================
2.727 + -->
2.728 + <target depends="init" if="netbeans.home" name="-debug-start-debugger">
2.729 + <j2seproject1:nbjpdastart name="${debug.class}"/>
2.730 + </target>
2.731 + <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
2.732 + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
2.733 + </target>
2.734 + <target depends="init,compile" name="-debug-start-debuggee">
2.735 + <j2seproject3:debug>
2.736 + <customize>
2.737 + <arg line="${application.args}"/>
2.738 + </customize>
2.739 + </j2seproject3:debug>
2.740 + </target>
2.741 + <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
2.742 + <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
2.743 + <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
2.744 + </target>
2.745 + <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
2.746 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
2.747 + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
2.748 + <j2seproject3:debug classname="${debug.class}"/>
2.749 + </target>
2.750 + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
2.751 + <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
2.752 + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
2.753 + <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
2.754 + </target>
2.755 + <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
2.756 + <target depends="init" name="-pre-debug-fix">
2.757 + <fail unless="fix.includes">Must set fix.includes</fail>
2.758 + <property name="javac.includes" value="${fix.includes}.java"/>
2.759 + </target>
2.760 + <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
2.761 + <j2seproject1:nbjpdareload/>
2.762 + </target>
2.763 + <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
2.764 + <!--
2.765 + =================
2.766 + PROFILING SECTION
2.767 + =================
2.768 + -->
2.769 + <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
2.770 + <nbprofiledirect>
2.771 + <classpath>
2.772 + <path path="${run.classpath}"/>
2.773 + </classpath>
2.774 + </nbprofiledirect>
2.775 + <profile/>
2.776 + </target>
2.777 + <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
2.778 + <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
2.779 + <nbprofiledirect>
2.780 + <classpath>
2.781 + <path path="${run.classpath}"/>
2.782 + </classpath>
2.783 + </nbprofiledirect>
2.784 + <profile classname="${profile.class}"/>
2.785 + </target>
2.786 + <!--
2.787 + =========================
2.788 + APPLET PROFILING SECTION
2.789 + =========================
2.790 + -->
2.791 + <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
2.792 + <nbprofiledirect>
2.793 + <classpath>
2.794 + <path path="${run.classpath}"/>
2.795 + </classpath>
2.796 + </nbprofiledirect>
2.797 + <profile classname="sun.applet.AppletViewer">
2.798 + <customize>
2.799 + <arg value="${applet.url}"/>
2.800 + </customize>
2.801 + </profile>
2.802 + </target>
2.803 + <!--
2.804 + =========================
2.805 + TESTS PROFILING SECTION
2.806 + =========================
2.807 + -->
2.808 + <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
2.809 + <nbprofiledirect>
2.810 + <classpath>
2.811 + <path path="${run.test.classpath}"/>
2.812 + </classpath>
2.813 + </nbprofiledirect>
2.814 + <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
2.815 + <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
2.816 + <jvmarg value="${profiler.info.jvmargs.agent}"/>
2.817 + <jvmarg line="${profiler.info.jvmargs}"/>
2.818 + <test name="${profile.class}"/>
2.819 + <classpath>
2.820 + <path path="${run.test.classpath}"/>
2.821 + </classpath>
2.822 + <syspropertyset>
2.823 + <propertyref prefix="test-sys-prop."/>
2.824 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
2.825 + </syspropertyset>
2.826 + <formatter type="brief" usefile="false"/>
2.827 + <formatter type="xml"/>
2.828 + </junit>
2.829 + </target>
2.830 + <!--
2.831 + ===============
2.832 + JAVADOC SECTION
2.833 + ===============
2.834 + -->
2.835 + <target depends="init" if="have.sources" name="-javadoc-build">
2.836 + <mkdir dir="${dist.javadoc.dir}"/>
2.837 + <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
2.838 + <classpath>
2.839 + <path path="${javac.classpath}"/>
2.840 + </classpath>
2.841 + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
2.842 + <filename name="**/*.java"/>
2.843 + </fileset>
2.844 + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
2.845 + <include name="**/*.java"/>
2.846 + </fileset>
2.847 + </javadoc>
2.848 + <copy todir="${dist.javadoc.dir}">
2.849 + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
2.850 + <filename name="**/doc-files/**"/>
2.851 + </fileset>
2.852 + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
2.853 + <include name="**/doc-files/**"/>
2.854 + </fileset>
2.855 + </copy>
2.856 + </target>
2.857 + <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
2.858 + <nbbrowse file="${dist.javadoc.dir}/index.html"/>
2.859 + </target>
2.860 + <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
2.861 + <!--
2.862 + =========================
2.863 + JUNIT COMPILATION SECTION
2.864 + =========================
2.865 + -->
2.866 + <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
2.867 + <mkdir dir="${build.test.classes.dir}"/>
2.868 + </target>
2.869 + <target name="-pre-compile-test">
2.870 + <!-- Empty placeholder for easier customization. -->
2.871 + <!-- You can override this target in the ../build.xml file. -->
2.872 + </target>
2.873 + <target if="do.depend.true" name="-compile-test-depend">
2.874 + <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
2.875 + </target>
2.876 + <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
2.877 + <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
2.878 + <copy todir="${build.test.classes.dir}">
2.879 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
2.880 + </copy>
2.881 + </target>
2.882 + <target name="-post-compile-test">
2.883 + <!-- Empty placeholder for easier customization. -->
2.884 + <!-- You can override this target in the ../build.xml file. -->
2.885 + </target>
2.886 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
2.887 + <target name="-pre-compile-test-single">
2.888 + <!-- Empty placeholder for easier customization. -->
2.889 + <!-- You can override this target in the ../build.xml file. -->
2.890 + </target>
2.891 + <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
2.892 + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
2.893 + <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
2.894 + <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
2.895 + <copy todir="${build.test.classes.dir}">
2.896 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
2.897 + </copy>
2.898 + </target>
2.899 + <target name="-post-compile-test-single">
2.900 + <!-- Empty placeholder for easier customization. -->
2.901 + <!-- You can override this target in the ../build.xml file. -->
2.902 + </target>
2.903 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
2.904 + <!--
2.905 + =======================
2.906 + JUNIT EXECUTION SECTION
2.907 + =======================
2.908 + -->
2.909 + <target depends="init" if="have.tests" name="-pre-test-run">
2.910 + <mkdir dir="${build.test.results.dir}"/>
2.911 + </target>
2.912 + <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
2.913 + <j2seproject3:junit testincludes="**/*Test.java"/>
2.914 + </target>
2.915 + <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
2.916 + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
2.917 + </target>
2.918 + <target depends="init" if="have.tests" name="test-report"/>
2.919 + <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
2.920 + <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
2.921 + <target depends="init" if="have.tests" name="-pre-test-run-single">
2.922 + <mkdir dir="${build.test.results.dir}"/>
2.923 + </target>
2.924 + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
2.925 + <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
2.926 + <j2seproject3:junit excludes="" includes="${test.includes}"/>
2.927 + </target>
2.928 + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
2.929 + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
2.930 + </target>
2.931 + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
2.932 + <!--
2.933 + =======================
2.934 + JUNIT DEBUGGING SECTION
2.935 + =======================
2.936 + -->
2.937 + <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
2.938 + <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
2.939 + <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
2.940 + <delete file="${test.report.file}"/>
2.941 + <mkdir dir="${build.test.results.dir}"/>
2.942 + <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
2.943 + <customize>
2.944 + <syspropertyset>
2.945 + <propertyref prefix="test-sys-prop."/>
2.946 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
2.947 + </syspropertyset>
2.948 + <arg value="${test.class}"/>
2.949 + <arg value="showoutput=true"/>
2.950 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
2.951 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
2.952 + </customize>
2.953 + </j2seproject3:debug>
2.954 + </target>
2.955 + <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
2.956 + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
2.957 + </target>
2.958 + <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
2.959 + <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
2.960 + <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
2.961 + </target>
2.962 + <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
2.963 + <!--
2.964 + =========================
2.965 + APPLET EXECUTION SECTION
2.966 + =========================
2.967 + -->
2.968 + <target depends="init,compile-single" name="run-applet">
2.969 + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
2.970 + <j2seproject1:java classname="sun.applet.AppletViewer">
2.971 + <customize>
2.972 + <arg value="${applet.url}"/>
2.973 + </customize>
2.974 + </j2seproject1:java>
2.975 + </target>
2.976 + <!--
2.977 + =========================
2.978 + APPLET DEBUGGING SECTION
2.979 + =========================
2.980 + -->
2.981 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
2.982 + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
2.983 + <j2seproject3:debug classname="sun.applet.AppletViewer">
2.984 + <customize>
2.985 + <arg value="${applet.url}"/>
2.986 + </customize>
2.987 + </j2seproject3:debug>
2.988 + </target>
2.989 + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
2.990 + <!--
2.991 + ===============
2.992 + CLEANUP SECTION
2.993 + ===============
2.994 + -->
2.995 + <target name="-deps-clean-init" unless="built-clean.properties">
2.996 + <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
2.997 + <delete file="${built-clean.properties}" quiet="true"/>
2.998 + </target>
2.999 + <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
2.1000 + <echo level="warn" message="Cycle detected: cloneproblem was already built"/>
2.1001 + </target>
2.1002 + <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
2.1003 + <mkdir dir="${build.dir}"/>
2.1004 + <touch file="${built-clean.properties}" verbose="false"/>
2.1005 + <property file="${built-clean.properties}" prefix="already.built.clean."/>
2.1006 + <antcall target="-warn-already-built-clean"/>
2.1007 + <propertyfile file="${built-clean.properties}">
2.1008 + <entry key="${basedir}" value=""/>
2.1009 + </propertyfile>
2.1010 + </target>
2.1011 + <target depends="init" name="-do-clean">
2.1012 + <delete dir="${build.dir}"/>
2.1013 + <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
2.1014 + </target>
2.1015 + <target name="-post-clean">
2.1016 + <!-- Empty placeholder for easier customization. -->
2.1017 + <!-- You can override this target in the ../build.xml file. -->
2.1018 + </target>
2.1019 + <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
2.1020 + <target name="-check-call-dep">
2.1021 + <property file="${call.built.properties}" prefix="already.built."/>
2.1022 + <condition property="should.call.dep">
2.1023 + <not>
2.1024 + <isset property="already.built.${call.subproject}"/>
2.1025 + </not>
2.1026 + </condition>
2.1027 + </target>
2.1028 + <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
2.1029 + <ant antfile="${call.script}" inheritall="false" target="${call.target}">
2.1030 + <propertyset>
2.1031 + <propertyref prefix="transfer."/>
2.1032 + <mapper from="transfer.*" to="*" type="glob"/>
2.1033 + </propertyset>
2.1034 + </ant>
2.1035 + </target>
2.1036 +</project>
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/samples/cloneproblem/nbproject/genfiles.properties Tue Mar 01 21:28:39 2011 +0100
3.3 @@ -0,0 +1,8 @@
3.4 +build.xml.data.CRC32=2edef413
3.5 +build.xml.script.CRC32=dba6e1dd
3.6 +build.xml.stylesheet.CRC32=28e38971@1.42.0.45
3.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
3.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
3.9 +nbproject/build-impl.xml.data.CRC32=2edef413
3.10 +nbproject/build-impl.xml.script.CRC32=53b45d06
3.11 +nbproject/build-impl.xml.stylesheet.CRC32=7bd59c26@1.42.0.45
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/samples/cloneproblem/nbproject/project.properties Tue Mar 01 21:28:39 2011 +0100
4.3 @@ -0,0 +1,71 @@
4.4 +annotation.processing.enabled=true
4.5 +annotation.processing.enabled.in.editor=false
4.6 +annotation.processing.processor.options=
4.7 +annotation.processing.processors.list=
4.8 +annotation.processing.run.all.processors=true
4.9 +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
4.10 +build.classes.dir=${build.dir}/classes
4.11 +build.classes.excludes=**/*.java,**/*.form
4.12 +# This directory is removed when the project is cleaned:
4.13 +build.dir=build
4.14 +build.generated.dir=${build.dir}/generated
4.15 +build.generated.sources.dir=${build.dir}/generated-sources
4.16 +# Only compile against the classpath explicitly listed here:
4.17 +build.sysclasspath=ignore
4.18 +build.test.classes.dir=${build.dir}/test/classes
4.19 +build.test.results.dir=${build.dir}/test/results
4.20 +# Uncomment to specify the preferred debugger connection transport:
4.21 +#debug.transport=dt_socket
4.22 +debug.classpath=\
4.23 + ${run.classpath}
4.24 +debug.test.classpath=\
4.25 + ${run.test.classpath}
4.26 +# This directory is removed when the project is cleaned:
4.27 +dist.dir=dist
4.28 +dist.jar=${dist.dir}/cloneproblem.jar
4.29 +dist.javadoc.dir=${dist.dir}/javadoc
4.30 +excludes=
4.31 +file.reference.junit-4.4.jar=/home/jarda/src/apidesign/samples/libs/dist/junit-4.4.jar
4.32 +includes=**
4.33 +jar.compress=false
4.34 +javac.classpath=
4.35 +# Space-separated list of extra javac options
4.36 +javac.compilerargs=
4.37 +javac.deprecation=false
4.38 +javac.processorpath=\
4.39 + ${javac.classpath}
4.40 +javac.source=1.6
4.41 +javac.target=1.6
4.42 +javac.test.classpath=\
4.43 + ${javac.classpath}:\
4.44 + ${build.classes.dir}:\
4.45 + ${file.reference.junit-4.4.jar}
4.46 +javac.test.processorpath=\
4.47 + ${javac.test.classpath}
4.48 +javadoc.additionalparam=
4.49 +javadoc.author=false
4.50 +javadoc.encoding=${source.encoding}
4.51 +javadoc.noindex=false
4.52 +javadoc.nonavbar=false
4.53 +javadoc.notree=false
4.54 +javadoc.private=false
4.55 +javadoc.splitindex=true
4.56 +javadoc.use=true
4.57 +javadoc.version=false
4.58 +javadoc.windowtitle=
4.59 +meta.inf.dir=${src.dir}/META-INF
4.60 +mkdist.disabled=true
4.61 +platform.active=default_platform
4.62 +run.classpath=\
4.63 + ${javac.classpath}:\
4.64 + ${build.classes.dir}
4.65 +# Space-separated list of JVM arguments used when running the project
4.66 +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
4.67 +# or test-sys-prop.name=value to set system properties for unit tests):
4.68 +run.jvmargs=
4.69 +run.test.classpath=\
4.70 + ${javac.test.classpath}:\
4.71 + ${build.test.classes.dir}
4.72 +source.encoding=UTF-8
4.73 +src.dir=src
4.74 +test.src.dir=test
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/samples/cloneproblem/nbproject/project.xml Tue Mar 01 21:28:39 2011 +0100
5.3 @@ -0,0 +1,15 @@
5.4 +<?xml version="1.0" encoding="UTF-8"?>
5.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
5.6 + <type>org.netbeans.modules.java.j2seproject</type>
5.7 + <configuration>
5.8 + <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
5.9 + <name>cloneproblem</name>
5.10 + <source-roots>
5.11 + <root id="src.dir"/>
5.12 + </source-roots>
5.13 + <test-roots>
5.14 + <root id="test.src.dir"/>
5.15 + </test-roots>
5.16 + </data>
5.17 + </configuration>
5.18 +</project>
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/samples/cloneproblem/src/org/apidesign/cloneproblem/Interval.java Tue Mar 01 21:28:39 2011 +0100
6.3 @@ -0,0 +1,44 @@
6.4 +package org.apidesign.cloneproblem;
6.5 +
6.6 +import java.util.Date;
6.7 +
6.8 +// BEGIN: interval.api
6.9 +/** Quiz: Anyone can come up with a JUnit test to generate
6.10 + * {@link NullPointerException} directly from the code of
6.11 + * the <code>Interval</code> class?
6.12 + *
6.13 + * @author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
6.14 + */
6.15 +public final class Interval {
6.16 + private final Date from, to;
6.17 +
6.18 + /** Constructs interval between two dates.
6.19 + *
6.20 + * @param from the 'sooner' date
6.21 + * @param to the 'later' date
6.22 + * @throws IllegalArgumentException if <code>from</code> is not less then <code>to</code>
6.23 + */
6.24 + public Interval(Date from, Date to) {
6.25 + if (from == null) {
6.26 + throw new IllegalArgumentException("'from' cannot be null!");
6.27 + }
6.28 + if (to == null) {
6.29 + throw new IllegalArgumentException("'to' cannot be null!");
6.30 + }
6.31 + // shield us from Date's mutability
6.32 + this.from = (Date) from.clone();
6.33 + this.to = (Date)to.clone();
6.34 + if (from.compareTo(to) >= 0) {
6.35 + throw new IllegalArgumentException("'from' must be lower than 'to'!");
6.36 + }
6.37 + }
6.38 +
6.39 + /** The length of the interval in milliseconds
6.40 + *
6.41 + * @return amount of milliseconds between 'from' and 'to' dates.
6.42 + */
6.43 + public long getLength() {
6.44 + return to.getTime() - from.getTime();
6.45 + }
6.46 +}
6.47 +// END: interval.api
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/samples/cloneproblem/test/org/apidesign/cloneproblem/ExploitTest.java Tue Mar 01 21:28:39 2011 +0100
7.3 @@ -0,0 +1,44 @@
7.4 +package org.apidesign.cloneproblem;
7.5 +
7.6 +import java.util.Date;
7.7 +import junit.framework.TestCase;
7.8 +
7.9 +/** Test that would be written by the API hacker.
7.10 + *
7.11 + * @author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
7.12 + */
7.13 +public class ExploitTest extends TestCase {
7.14 + public ExploitTest(String name) {
7.15 + super(name);
7.16 + }
7.17 +
7.18 + public void testExploitOverridableClone() {
7.19 + try {
7.20 + HackedDate now = new HackedDate();
7.21 + HackedDate later = new HackedDate(now.getTime() + 1000);
7.22 +
7.23 + Interval interval = new Interval(now, later);
7.24 + assertEquals("1s", 1000, interval.getLength());
7.25 +
7.26 + fail("And I hoped NullPointerException will be thrown!");
7.27 + } catch (NullPointerException ex) {
7.28 + // success, the quest is to generate NullPointerException!
7.29 + }
7.30 + }
7.31 +
7.32 + // BEGIN: interval.exploit
7.33 + private static class HackedDate extends Date {
7.34 + public HackedDate() {
7.35 + }
7.36 +
7.37 + public HackedDate(long date) {
7.38 + super(date);
7.39 + }
7.40 +
7.41 + @Override
7.42 + public Object clone() {
7.43 + return null;
7.44 + }
7.45 + }
7.46 + // END: interval.exploit
7.47 +}
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/samples/cloneproblem/test/org/apidesign/cloneproblem/IntervalTest.java Tue Mar 01 21:28:39 2011 +0100
8.3 @@ -0,0 +1,63 @@
8.4 +/*
8.5 + * To change this template, choose Tools | Templates
8.6 + * and open the template in the editor.
8.7 + */
8.8 +
8.9 +package org.apidesign.cloneproblem;
8.10 +
8.11 +import java.util.Date;
8.12 +import junit.framework.TestCase;
8.13 +
8.14 +/** The test as would be written by the (not paranoiac) API author.
8.15 + *
8.16 + * @author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
8.17 + */
8.18 +public class IntervalTest extends TestCase {
8.19 +
8.20 + public IntervalTest(String testName) {
8.21 + super(testName);
8.22 + }
8.23 +
8.24 + // BEGIN: interval.test
8.25 + public void testOneSecondInterval() {
8.26 + Date now = new Date();
8.27 + Date later = new Date(now.getTime() + 1000);
8.28 +
8.29 + Interval interval = new Interval(now, later);
8.30 + assertEquals("1s", 1000, interval.getLength());
8.31 + }
8.32 + // END: interval.test
8.33 +
8.34 + public void testLaterCantBeSooner() {
8.35 + Date now = new Date();
8.36 + Date later = new Date(now.getTime() - 1000);
8.37 +
8.38 + try {
8.39 + Interval interval = new Interval(now, later);
8.40 + fail("Shall throw IllegalArgumentException");
8.41 + } catch (IllegalArgumentException ex) {
8.42 + // OK
8.43 + }
8.44 + }
8.45 +
8.46 + public void testDoesNotThrowNPEOnSecondArg() {
8.47 + Date now = new Date();
8.48 + try {
8.49 + Interval interval = new Interval(now, null);
8.50 + fail("Shall throw IllegalArgumentException");
8.51 + } catch (IllegalArgumentException ex) {
8.52 + // OK
8.53 + }
8.54 + }
8.55 +
8.56 + public void testDoesNotThrowNPEOnFirstArg() {
8.57 + Date now = new Date();
8.58 + try {
8.59 + Interval interval = new Interval(null, now);
8.60 + fail("Shall throw IllegalArgumentException");
8.61 + } catch (IllegalArgumentException ex) {
8.62 + // OK
8.63 + }
8.64 + }
8.65 +
8.66 +}