Incorporating Patrick's changes. I am not reall sure about the changes after the war, it is really 'or' it cannot be 'and'. I will change that when I do the reading through the whole chapter.
1.1 --- a/samples/composition/build.xml Sat Jun 14 09:59:25 2008 +0200
1.2 +++ b/samples/composition/build.xml Sat Jun 14 09:59:27 2008 +0200
1.3 @@ -12,6 +12,18 @@
1.4 <antcall target="-build-one">
1.5 <param name="version" value="api2.0"/>
1.6 </antcall>
1.7 + <antcall target="-build-one">
1.8 + <param name="version" value="api2.0-compat"/>
1.9 + </antcall>
1.10 + <antcall target="-build-one">
1.11 + <param name="version" value="api2.0-property"/>
1.12 + </antcall>
1.13 + <antcall target="-build-one">
1.14 + <param name="version" value="api2.0-enum"/>
1.15 + </antcall>
1.16 + <antcall target="-build-one">
1.17 + <param name="version" value="api2.0-runtime"/>
1.18 + </antcall>
1.19
1.20 <antcall target="-build-one">
1.21 <param name="version" value="test"/>
1.22 @@ -28,6 +40,22 @@
1.23 <antcall target="-run-one">
1.24 <param name="version" value="api2.0"/>
1.25 </antcall>
1.26 + <echo level="info" message="Running the Implementation against Version 2.0 with compatible extension of the API. This should succeed."/>
1.27 + <antcall target="-run-one">
1.28 + <param name="version" value="api2.0-compat"/>
1.29 + </antcall>
1.30 + <echo level="info" message="Running the Implementation against Version 2.0 with property guarded extension of the API. This should succeed."/>
1.31 + <antcall target="-run-one">
1.32 + <param name="version" value="api2.0-property"/>
1.33 + </antcall>
1.34 + <echo level="info" message="Running the Implementation against Version 2.0 with enum guarded extension of the API. This should succeed."/>
1.35 + <antcall target="-run-one">
1.36 + <param name="version" value="api2.0-enum"/>
1.37 + </antcall>
1.38 + <echo level="info" message="Running the Implementation against Version 2.0 with runtime check in the API. This should succeed."/>
1.39 + <antcall target="-run-one">
1.40 + <param name="version" value="api2.0-runtime"/>
1.41 + </antcall>
1.42 </target>
1.43
1.44 <!-- support methods -->
2.1 --- a/samples/composition/nbproject/project.xml Sat Jun 14 09:59:25 2008 +0200
2.2 +++ b/samples/composition/nbproject/project.xml Sat Jun 14 09:59:27 2008 +0200
2.3 @@ -23,11 +23,35 @@
2.4 <encoding>UTF-8</encoding>
2.5 </source-folder>
2.6 <source-folder>
2.7 + <label>src-api2.0-compat</label>
2.8 + <type>java</type>
2.9 + <location>src-api2.0-compat</location>
2.10 + <encoding>UTF-8</encoding>
2.11 + </source-folder>
2.12 + <source-folder>
2.13 + <label>src-api2.0-property</label>
2.14 + <type>java</type>
2.15 + <location>src-api2.0-property</location>
2.16 + <encoding>UTF-8</encoding>
2.17 + </source-folder>
2.18 + <source-folder>
2.19 <label>test</label>
2.20 <type>java</type>
2.21 <location>src-test</location>
2.22 <encoding>UTF-8</encoding>
2.23 </source-folder>
2.24 + <source-folder>
2.25 + <label>src-api2.0-enum</label>
2.26 + <type>java</type>
2.27 + <location>src-api2.0-enum</location>
2.28 + <encoding>UTF-8</encoding>
2.29 + </source-folder>
2.30 + <source-folder>
2.31 + <label>src-api2.0-runtime</label>
2.32 + <type>java</type>
2.33 + <location>src-api2.0-runtime</location>
2.34 + <encoding>UTF-8</encoding>
2.35 + </source-folder>
2.36 </folders>
2.37 <ide-actions>
2.38 <action name="build">
2.39 @@ -39,6 +63,9 @@
2.40 <action name="test">
2.41 <target>test</target>
2.42 </action>
2.43 + <action name="run">
2.44 + <target>test</target>
2.45 + </action>
2.46 <action name="rebuild">
2.47 <target>clean</target>
2.48 <target>build</target>
2.49 @@ -55,6 +82,22 @@
2.50 <location>src-api2.0</location>
2.51 </source-folder>
2.52 <source-folder style="packages">
2.53 + <label>API Version 2.0, in compatible style</label>
2.54 + <location>src-api2.0-compat</location>
2.55 + </source-folder>
2.56 + <source-folder style="packages">
2.57 + <label>API Version 2.0, with property</label>
2.58 + <location>src-api2.0-property</location>
2.59 + </source-folder>
2.60 + <source-folder style="packages">
2.61 + <label>API Version 2.0, with enum</label>
2.62 + <location>src-api2.0-enum</location>
2.63 + </source-folder>
2.64 + <source-folder style="packages">
2.65 + <label>API Version 2.0, with runtime inspection</label>
2.66 + <location>src-api2.0-runtime</location>
2.67 + </source-folder>
2.68 + <source-folder style="packages">
2.69 <label>Usage of the API</label>
2.70 <location>src-test</location>
2.71 </source-folder>
2.72 @@ -65,6 +108,7 @@
2.73 <context-menu>
2.74 <ide-action name="build"/>
2.75 <ide-action name="rebuild"/>
2.76 + <ide-action name="run"/>
2.77 <ide-action name="clean"/>
2.78 <ide-action name="test"/>
2.79 </context-menu>
2.80 @@ -80,6 +124,22 @@
2.81 <source-level>1.5</source-level>
2.82 </compilation-unit>
2.83 <compilation-unit>
2.84 + <package-root>src-api2.0-compat</package-root>
2.85 + <source-level>1.5</source-level>
2.86 + </compilation-unit>
2.87 + <compilation-unit>
2.88 + <package-root>src-api2.0-enum</package-root>
2.89 + <source-level>1.5</source-level>
2.90 + </compilation-unit>
2.91 + <compilation-unit>
2.92 + <package-root>src-api2.0-property</package-root>
2.93 + <source-level>1.5</source-level>
2.94 + </compilation-unit>
2.95 + <compilation-unit>
2.96 + <package-root>src-api2.0-runtime</package-root>
2.97 + <source-level>1.5</source-level>
2.98 + </compilation-unit>
2.99 + <compilation-unit>
2.100 <package-root>src-test</package-root>
2.101 <classpath mode="compile">src-api1.0:../libs/dist/junit-4.4.jar</classpath>
2.102 <source-level>1.5</source-level>
3.1 --- a/samples/deadlock/test/org/apidesign/deadlock/startuplock/CLIHandlerBlockingTest.java Sat Jun 14 09:59:25 2008 +0200
3.2 +++ b/samples/deadlock/test/org/apidesign/deadlock/startuplock/CLIHandlerBlockingTest.java Sat Jun 14 09:59:27 2008 +0200
3.3 @@ -52,5 +52,5 @@
3.4 public void close() throws SecurityException {
3.5 }
3.6 } // end of H
3.7 +}
3.8 // END: test.capture.logs
3.9 -}
3.10 \ No newline at end of file
4.1 --- a/samples/delegatingwriter/test/org/apidesign/delegatingwriter/BufferedWriterOnCDImageTest.java Sat Jun 14 09:59:25 2008 +0200
4.2 +++ b/samples/delegatingwriter/test/org/apidesign/delegatingwriter/BufferedWriterOnCDImageTest.java Sat Jun 14 09:59:27 2008 +0200
4.3 @@ -82,7 +82,7 @@
4.4 public int length() {
4.5 return end - start;
4.6 }
4.7 -// END: writer.bigseq
4.8 +// FINISH: writer.bigseq
4.9
4.10 public char charAt(int index) {
4.11 int ch = index % ('Z' - 'A' + 1);
5.1 --- a/samples/delegatingwriter/test/org/apidesign/delegatingwriter/CountingWriter.java Sat Jun 14 09:59:25 2008 +0200
5.2 +++ b/samples/delegatingwriter/test/org/apidesign/delegatingwriter/CountingWriter.java Sat Jun 14 09:59:27 2008 +0200
5.3 @@ -27,7 +27,7 @@
5.4 counter += csq.length();
5.5 return this;
5.6 }
5.7 -// END: writer.CountingWriter
5.8 +// FINISH: writer.CountingWriter
5.9
5.10 @Override
5.11 public Writer append(CharSequence csq, int start, int end) throws IOException {
6.1 --- a/samples/delegatingwriter/test/org/apidesign/delegatingwriter/CryptoWriter.java Sat Jun 14 09:59:25 2008 +0200
6.2 +++ b/samples/delegatingwriter/test/org/apidesign/delegatingwriter/CryptoWriter.java Sat Jun 14 09:59:27 2008 +0200
6.3 @@ -62,7 +62,7 @@
6.4 }
6.5 return (char)(c + 1);
6.6 }
6.7 -// END: writer.CryptoWriter
6.8 +// FINISH: writer.CryptoWriter
6.9
6.10 /* delegates to write(cbuf, 0, cbuf.length)
6.11 public void write(char[] cbuf) throws IOException {
7.1 --- a/samples/differentreturntype/src-api1.0/api/API.java Sat Jun 14 09:59:25 2008 +0200
7.2 +++ b/samples/differentreturntype/src-api1.0/api/API.java Sat Jun 14 09:59:27 2008 +0200
7.3 @@ -5,7 +5,7 @@
7.4 public abstract class API {
7.5 // BEGIN: theory.binary.differentreturntype.api
7.6 public static Icon getIcon() {
7.7 + return null; // compute something
7.8 + }
7.9 // END: theory.binary.differentreturntype.api
7.10 - return null;
7.11 - }
7.12 }
8.1 --- a/samples/differentreturntype/src-api2.0/api/API.java Sat Jun 14 09:59:25 2008 +0200
8.2 +++ b/samples/differentreturntype/src-api2.0/api/API.java Sat Jun 14 09:59:27 2008 +0200
8.3 @@ -5,7 +5,7 @@
8.4 public abstract class API {
8.5 // BEGIN: theory.binary.differentreturntype.api2
8.6 public static ImageIcon getIcon() {
8.7 -// END: theory.binary.differentreturntype.api2
8.8 return null;
8.9 }
8.10 +// END: theory.binary.differentreturntype.api2
8.11 }
9.1 --- a/samples/insertsuperclass/src-api2.0/api/HelloClass.java Sat Jun 14 09:59:25 2008 +0200
9.2 +++ b/samples/insertsuperclass/src-api2.0/api/HelloClass.java Sat Jun 14 09:59:27 2008 +0200
9.3 @@ -2,6 +2,6 @@
9.4
9.5 // BEGIN: design.insert.superclass2
9.6 public abstract class HelloClass extends SimpleHelloClass {
9.7 -// END: design.insert.superclass2
9.8 +// FINISH: design.insert.superclass2
9.9 public abstract String sayHelloTo(String who);
9.10 }
10.1 --- a/samples/javabeans/test/org/apidesign/javabeans/use/toomany/MyHighlightsContainer.java Sat Jun 14 09:59:25 2008 +0200
10.2 +++ b/samples/javabeans/test/org/apidesign/javabeans/use/toomany/MyHighlightsContainer.java Sat Jun 14 09:59:27 2008 +0200
10.3 @@ -25,5 +25,5 @@
10.4 public HighlightsSequence getHighlights(int start, int end) {
10.5 return null; // implement
10.6 }
10.7 +}
10.8 // END: javabeans.with.MyHighlightsContainer
10.9 -}
10.10 \ No newline at end of file
11.1 --- a/samples/messagedigest/src-new-api/org/apidesign/spi/security/Digestor.java Sat Jun 14 09:59:25 2008 +0200
11.2 +++ b/samples/messagedigest/src-new-api/org/apidesign/spi/security/Digestor.java Sat Jun 14 09:59:27 2008 +0200
11.3 @@ -17,7 +17,7 @@
11.4 protected abstract Data create(String algorithm);
11.5 protected abstract void update(Data data, ByteBuffer input);
11.6
11.7 -// END: day.end.bridges.Digestor
11.8 +// FINISH: day.end.bridges.Digestor
11.9
11.10
11.11 static {
12.1 --- a/samples/primitiveconstants/src-impl/impl/Impl.java Sat Jun 14 09:59:25 2008 +0200
12.2 +++ b/samples/primitiveconstants/src-impl/impl/Impl.java Sat Jun 14 09:59:27 2008 +0200
12.3 @@ -8,7 +8,7 @@
12.4 throw new IllegalStateException("Wrong API version error!");
12.5 }
12.6 }
12.7 -// END: theory.binary.constants.impl
12.8 +// FINISH: theory.binary.constants.impl
12.9
12.10 public static void main(String[] args) {
12.11 System.err.println("main expects version: " + API.VERSION);
13.1 --- a/samples/privilegedcreator/test/accessprotectedmethod/MyDocument.java Sat Jun 14 09:59:25 2008 +0200
13.2 +++ b/samples/privilegedcreator/test/accessprotectedmethod/MyDocument.java Sat Jun 14 09:59:27 2008 +0200
13.3 @@ -11,7 +11,7 @@
13.4 final void writeLockAccess() {
13.5 writeLock();
13.6 }
13.7 -// END: public.accessor
13.8 +// FINISH: public.accessor
13.9
13.10 @Override
13.11 public Element getDefaultRootElement() {