[CVS nanning] added main() to attributes compiler

Lecando Shared <[email protected]> Mon, 22 Sep 2003 09:36:43 -0500
Newsgroups gmane.comp.java.nanning.devel
Message-ID <[email protected]>
<html>
<head>
<style><!--
  body {background-color:#ffffff;}
  .file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
  .pathname {font-family:monospace; float:right;}
  .fileheader {margin-bottom:.5em;}
  .diff {margin:0;}
  .tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
  .tasklist ul {margin-top:0;margin-bottom:0;}
  tr.alt {background-color:#eeeeee}
  #added {background-color:#ddffdd;}
  #addedchars {background-color:#99ff99;font-weight:bolder;}
  tr.alt #added {background-color:#ccf7cc;}
  #removed {background-color:#ffdddd;}
  #removedchars {background-color:#ff9999;font-weight:bolder;}
  tr.alt #removed {background-color:#f7cccc;}
  #info {color:#888888;}
  #context {background-color:#eeeeee;}
  td {padding-left:.3em;padding-right:.3em;}
  tr.head {border-bottom-width:1px;border-bottom-style:solid;}
  tr.head td {padding:0;padding-top:.2em;}
  .task {background-color:#ffff00;}
  .comment {padding:4px;border:1px dashed #000000;background-color:#ffffd=
d}
  .error {color:red;}
  hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0" rules=3D"cols">
<tr class=3D"head"><td colspan=3D"4">Commit in <b><tt>nanning/src</tt></b=
> on <span id=3D"info">MAIN</span></td></tr>
<tr><td><tt>frameworks/contract/src/main/org/codehaus/nanning/contract/<a=
 href=3D"#file1">ContractInterceptor.java</a></tt></td><td align=3D"right=
" id=3D"added">+3</td><td align=3D"right" id=3D"removed">-2</td><td nowra=
p=3D"nowrap" align=3D"center">1.2 -&gt; 1.3</td></tr>
<tr class=3D"alt"><td><tt>frameworks/prevayler/src/main/org/codehaus/nann=
ing/prevayler/<a href=3D"#file2">Call.java</a></tt></td><td align=3D"righ=
t" id=3D"added">+2</td><td align=3D"right" id=3D"removed">-1</td><td nowr=
ap=3D"nowrap" align=3D"center">1.2 -&gt; 1.3</td></tr>
<tr><td><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;/<a href=3D"#file3">InvokeTransaction.java</a></tt></td><td align=3D=
"right" id=3D"added">+4</td><td align=3D"right" id=3D"removed">-3</td><td=
 nowrap=3D"nowrap" align=3D"center">1.3 -&gt; 1.4</td></tr>
<tr class=3D"alt"><td><tt>main/org/codehaus/nanning/attribute/<a href=3D"=
#file4">AbstractAttributesTest.java</a></tt></td><td align=3D"right" id=3D=
"added">+1</td><td></td><td nowrap=3D"nowrap" align=3D"center">1.2 -&gt; =
1.3</td></tr>
<tr><td><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;/<a href=3D"#file5">AttributesCompiler.java</a></tt></td><td align=3D"=
right" id=3D"added">+13</td><td align=3D"right" id=3D"removed">-3</td><td=
 nowrap=3D"nowrap" align=3D"center">1.2 -&gt; 1.3</td></tr>
<tr class=3D"alt"><td><tt>main/org/codehaus/nanning/config/<a href=3D"#fi=
le6">MixinAspect.java</a></tt></td><td align=3D"right" id=3D"added">+1</t=
d><td align=3D"right" id=3D"removed">-1</td><td nowrap=3D"nowrap" align=3D=
"center">1.1 -&gt; 1.2</td></tr>
<tr><td></td><td align=3D"right" id=3D"added">+24</td><td align=3D"right"=
 id=3D"removed">-10</td><td></td></tr>
</table>
<small id=3D"info">6 modified files</small><br />
<pre class=3D"comment">
added main() to attributes compiler
</pre>
<hr /><a name=3D"file1" /><div class=3D"file">
<span class=3D"pathname">nanning/src/frameworks/contract/src/main/org/cod=
ehaus/nanning/contract<br /></span>
<div class=3D"fileheader"><big><b>ContractInterceptor.java</b></big> <sma=
ll id=3D"info">1.2 -&gt; 1.3</small></div>
<pre class=3D"diff"><small id=3D"info">diff -u -r1.2 -r1.3
--- ContractInterceptor.java	5 Sep 2003 07:56:42 -0000	1.2
+++ ContractInterceptor.java	22 Sep 2003 14:36:39 -0000	1.3
@@ -15,6 +15,7 @@
</small></pre><pre class=3D"diff" id=3D"context"> import org.codehaus.nan=
ning.attribute.Attributes;
 import org.codehaus.nanning.util.Matcher;
 import org.codehaus.nanning.util.RegexpPattern;
</pre><pre class=3D"diff" id=3D"added">+import org.codehaus.nanning.util.=
WrappedException;
</pre><pre class=3D"diff" id=3D"context">=20
 /**
  * TODO document ContractInterceptor.
</pre><pre class=3D"diff"><small id=3D"info">@@ -22,7 +23,7 @@
</small></pre><pre class=3D"diff" id=3D"context">  * you can enable and d=
isable contract-checking in the same way you enable and disable assertion=
s (java -ea and so on).
  *
  * @author &lt;a href=3D"mailto:[email protected]"&gt;Jon Tirs=E9n&lt=
;/a&gt;
</pre><pre class=3D"diff" id=3D"removed">- * @version $Revision: 1.<span =
id=3D"removedchars">2</span> $
</pre><pre class=3D"diff" id=3D"added">+ * @version $Revision: 1.<span id=
=3D"addedchars">3</span> $
</pre><pre class=3D"diff" id=3D"context">  */
 public class ContractInterceptor implements MethodInterceptor {
     private static final Log logger =3D LogFactory.getLog(ContractInterc=
eptor.class);
</pre><pre class=3D"diff"><small id=3D"info">@@ -98,7 +99,7 @@
</small></pre><pre class=3D"diff" id=3D"context">         try {
             return executeExpression(expression, invocation.getProxy(), =
context);
         } catch (Exception e) {
</pre><pre class=3D"diff" id=3D"removed">-            throw new RuntimeEx=
ception("Could not execute: " + expression + e);
</pre><pre class=3D"diff" id=3D"added">+            throw new WrappedExce=
ption("Could not execute: " + expression, e);
</pre><pre class=3D"diff" id=3D"context">         }
     }
=20
</pre></div>
<hr /><a name=3D"file2" /><div class=3D"file">
<span class=3D"pathname">nanning/src/frameworks/prevayler/src/main/org/co=
dehaus/nanning/prevayler<br /></span>
<div class=3D"fileheader"><big><b>Call.java</b></big> <small id=3D"info">=
1.2 -&gt; 1.3</small></div>
<pre class=3D"diff"><small id=3D"info">diff -u -r1.2 -r1.3
--- Call.java	5 Sep 2003 07:56:42 -0000	1.2
+++ Call.java	22 Sep 2003 14:36:39 -0000	1.3
@@ -5,6 +5,7 @@
</small></pre><pre class=3D"diff" id=3D"context"> import java.lang.reflec=
t.Method;
=20
 import org.codehaus.nanning.Invocation;
</pre><pre class=3D"diff" id=3D"added">+import org.codehaus.nanning.util.=
WrappedException;
</pre><pre class=3D"diff" id=3D"context">=20
 public class Call implements Serializable {
     static final long serialVersionUID =3D -3336463259251779539L;
</pre><pre class=3D"diff"><small id=3D"info">@@ -36,7 +37,7 @@
</small></pre><pre class=3D"diff" id=3D"context">         try {
             return interfaceClass.getMethod(methodName, parameterTypes);
         } catch (Exception e) {
</pre><pre class=3D"diff" id=3D"removed">-            throw new RuntimeEx=
ception("did not find method " + methodName + " returning null" + e);
</pre><pre class=3D"diff" id=3D"added">+            throw new WrappedExce=
ption("did not find method " + methodName + " returning null", e);
</pre><pre class=3D"diff" id=3D"context">         }
     }
=20
</pre></div>
<hr /><a name=3D"file3" /><div class=3D"file">
<span class=3D"pathname">nanning/src/frameworks/prevayler/src/main/org/co=
dehaus/nanning/prevayler<br /></span>
<div class=3D"fileheader"><big><b>InvokeTransaction.java</b></big> <small=
 id=3D"info">1.3 -&gt; 1.4</small></div>
<pre class=3D"diff"><small id=3D"info">diff -u -r1.3 -r1.4
--- InvokeTransaction.java	9 Sep 2003 11:10:27 -0000	1.3
+++ InvokeTransaction.java	22 Sep 2003 14:36:39 -0000	1.4
@@ -4,6 +4,7 @@
</small></pre><pre class=3D"diff" id=3D"context"> import org.apache.commo=
ns.logging.LogFactory;
 import org.codehaus.nanning.Invocation;
 import org.codehaus.nanning.AssertionException;
</pre><pre class=3D"diff" id=3D"added">+import org.codehaus.nanning.util.=
WrappedException;
</pre><pre class=3D"diff" id=3D"context"> import org.prevayler.Transactio=
nWithQuery;
=20
 import javax.security.auth.Subject;
</pre><pre class=3D"diff"><small id=3D"info">@@ -36,7 +37,7 @@
</small></pre><pre class=3D"diff" id=3D"context">             outputStrea=
m.flush();
             return bytes.toByteArray();
         } catch (IOException e) {
</pre><pre class=3D"diff" id=3D"removed">-            throw new RuntimeEx=
ception("Could not marshal call" + e);
</pre><pre class=3D"diff" id=3D"added">+            throw new WrappedExce=
ption("Could not marshal call", e);
</pre><pre class=3D"diff" id=3D"context">         }
     }
=20
</pre><pre class=3D"diff"><small id=3D"info">@@ -46,9 +47,9 @@
</small></pre><pre class=3D"diff" id=3D"context">                     new=
 MarshallingInputStream(new ByteArrayInputStream(marshalledCall), new Ide=
ntifyingMarshaller());
             return (AuthenticatedCall) inputStream.readObject();
         } catch (IOException e) {
</pre><pre class=3D"diff" id=3D"removed">-            throw new RuntimeEx=
ception("Could not marshal call" + e);
</pre><pre class=3D"diff" id=3D"added">+            throw new WrappedExce=
ption("Could not marshal call", e);
</pre><pre class=3D"diff" id=3D"context">         } catch (ClassNotFoundE=
xception e) {
</pre><pre class=3D"diff" id=3D"removed">-            throw new RuntimeEx=
ception("Could not marshal call" + e);
</pre><pre class=3D"diff" id=3D"added">+            throw new WrappedExce=
ption("Could not marshal call", e);
</pre><pre class=3D"diff" id=3D"context">         }
     }
=20
</pre></div>
<hr /><a name=3D"file4" /><div class=3D"file">
<span class=3D"pathname">nanning/src/main/org/codehaus/nanning/attribute<=
br /></span>
<div class=3D"fileheader"><big><b>AbstractAttributesTest.java</b></big> <=
small id=3D"info">1.2 -&gt; 1.3</small></div>
<pre class=3D"diff"><small id=3D"info">diff -u -r1.2 -r1.3
--- AbstractAttributesTest.java	10 Aug 2003 16:18:18 -0000	1.2
+++ AbstractAttributesTest.java	22 Sep 2003 14:36:39 -0000	1.3
@@ -31,6 +31,7 @@
</small></pre><pre class=3D"diff" id=3D"context">             try {
                 Attributes.addSearchPath(attributesDir.toURL());
             } catch (MalformedURLException e) {
</pre><pre class=3D"diff" id=3D"added">+                e.printStackTrace=
();
</pre><pre class=3D"diff" id=3D"context">                 fail(e.getMessa=
ge());
             }
         }
</pre></div>
<hr /><a name=3D"file5" /><div class=3D"file">
<span class=3D"pathname">nanning/src/main/org/codehaus/nanning/attribute<=
br /></span>
<div class=3D"fileheader"><big><b>AttributesCompiler.java</b></big> <smal=
l id=3D"info">1.2 -&gt; 1.3</small></div>
<pre class=3D"diff"><small id=3D"info">diff -u -r1.2 -r1.3
--- AttributesCompiler.java	10 Aug 2003 16:18:18 -0000	1.2
+++ AttributesCompiler.java	22 Sep 2003 14:36:39 -0000	1.3
@@ -42,10 +42,10 @@
</small></pre><pre class=3D"diff" id=3D"context">  * tests that executes =
the above Java-code to compile your attributes before=20
  * the actual tests are executed.
  *
</pre><pre class=3D"diff" id=3D"removed">- * &lt;!-- $Id: AttributesCompi=
ler.java,v 1.2 2003/08/10 16:18:18 tirsen Exp $ --&gt;
</pre><pre class=3D"diff" id=3D"added">+ * &lt;!-- $Id: AttributesCompile=
r.java,v 1.3 2003/09/22 14:36:39 lecando Exp $ --&gt;
</pre><pre class=3D"diff" id=3D"context">  *
</pre><pre class=3D"diff" id=3D"removed">- * @author $Author: tirsen $
- * @version $Revision: 1.2 $
</pre><pre class=3D"diff" id=3D"added">+ * @author $Author: lecando $
+ * @version $Revision: 1.3 $
</pre><pre class=3D"diff" id=3D"context">  */
 public class AttributesCompiler extends Task {
     private File src;
</pre><pre class=3D"diff"><small id=3D"info">@@ -114,4 +114,14 @@
</small></pre><pre class=3D"diff" id=3D"context">         }
     }
=20
</pre><pre class=3D"diff" id=3D"added">+    public static void main(Strin=
g[] args) {
+        if (args.length !=3D 2) {
+            System.out.println("Usage: AttributesCompiler &lt;source-dir=
ectory&gt; &lt;destination-directory&gt;");
+            System.exit(0);
+        }
+        AttributesCompiler compiler =3D new AttributesCompiler();
+        compiler.setSrc(new File(args[0]));
+        compiler.setDest(new File(args[1]));
+        compiler.execute();
+    }
</pre><pre class=3D"diff" id=3D"context"> }
</pre></div>
<hr /><a name=3D"file6" /><div class=3D"file">
<span class=3D"pathname">nanning/src/main/org/codehaus/nanning/config<br =
/></span>
<div class=3D"fileheader"><big><b>MixinAspect.java</b></big> <small id=3D=
"info">1.1 -&gt; 1.2</small></div>
<pre class=3D"diff"><small id=3D"info">diff -u -r1.1 -r1.2
--- MixinAspect.java	24 Jul 2003 16:46:11 -0000	1.1
+++ MixinAspect.java	22 Sep 2003 14:36:40 -0000	1.2
@@ -27,7 +27,7 @@
</small></pre><pre class=3D"diff" id=3D"context">                 try {
                     mixinInstance.setTarget(targetClass.newInstance());
                 } catch (Exception e) {
</pre><pre class=3D"diff" id=3D"removed">-                    throw new A=
spectException("could not instantiate target<span id=3D"removedchars">&nb=
sp;"&nbsp;+</span> e);
</pre><pre class=3D"diff" id=3D"added">+                    throw new Asp=
ectException("could not instantiate target<span id=3D"addedchars">",</spa=
n> e);
</pre><pre class=3D"diff" id=3D"context">                 }
             }
             aspectInstance.addMixin(mixinInstance);
</pre></div>
</body></html>