aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/META-INF
diff options
context:
space:
mode:
authorSasa Zivkov <sasa.zivkov@sap.com>2010-05-19 16:59:28 +0200
committerShawn O. Pearce <spearce@spearce.org>2010-05-19 14:37:16 -0700
commitf3d8a8ecad614906a2c4ec0077cdb24129da6c6d (patch)
tree34d041692beff0f392c27869f49b76c0fc2053e6 /org.eclipse.jgit.test/META-INF
parent2e961989e42b1fe7e8bd9eaa7a3d2e88a0d1d001 (diff)
downloadjgit-f3d8a8ecad614906a2c4ec0077cdb24129da6c6d.tar.gz
jgit-f3d8a8ecad614906a2c4ec0077cdb24129da6c6d.zip
Externalize strings from JGit
The strings are externalized into the root resource bundles. The resource bundles are stored under the new "resources" source folder to get proper maven build. Strings from tests are, in general, not externalized. Only in cases where it was necessary to make the test pass the strings were externalized. This was typically necessary in cases where e.getMessage() was used in assert and the exception message was slightly changed due to reuse of the externalized strings. Change-Id: Ic0f29c80b9a54fcec8320d8539a3e112852a1f7b Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/META-INF')
-rw-r--r--org.eclipse.jgit.test/META-INF/MANIFEST.MF6
1 files changed, 6 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.test/META-INF/MANIFEST.MF
index d5eccecb08..b3799fb51e 100644
--- a/org.eclipse.jgit.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.test/META-INF/MANIFEST.MF
@@ -10,15 +10,21 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
Import-Package: junit.framework;version="[3.8.2,4.0.0)",
junit.textui;version="[3.8.2,4.0.0)",
org.eclipse.jgit.api;version="[0.8.0,0.9.0)",
+ org.eclipse.jgit;version="[0.8.0,0.9.0)",
+ org.eclipse.jgit.awtui;version="[0.8.0,0.9.0)",
+ org.eclipse.jgit.console;version="[0.8.0,0.9.0)",
org.eclipse.jgit.diff;version="[0.8.0,0.9.0)",
org.eclipse.jgit.dircache;version="[0.8.0,0.9.0)",
org.eclipse.jgit.errors;version="[0.8.0,0.9.0)",
org.eclipse.jgit.fnmatch;version="[0.8.0,0.9.0)",
+ org.eclipse.jgit.http.server;version="[0.8.0,0.9.0)",
+ org.eclipse.jgit.iplog;version="[0.8.0,0.9.0)",
org.eclipse.jgit.junit;version="[0.8.0,0.9.0)",
org.eclipse.jgit.lib;version="[0.8.0,0.9.0)",
org.eclipse.jgit.merge;version="[0.8.0,0.9.0)",
org.eclipse.jgit.nls;version="[0.8.0,0.9.0)",
org.eclipse.jgit.patch;version="[0.8.0,0.9.0)",
+ org.eclipse.jgit.pgm;version="[0.8.0,0.9.0)",
org.eclipse.jgit.revplot;version="[0.8.0,0.9.0)",
org.eclipse.jgit.revwalk;version="[0.8.0,0.9.0)",
org.eclipse.jgit.revwalk.filter;version="[0.8.0,0.9.0)",
} /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<chapter id="pitfalls" xreflabel="Pitfalls">
  <title>Pitfalls</title>

  <sect1 id="pitfalls-intro">
    <title>Introduction</title>

    <para>
      This chapter consists of a few AspectJ programs that may lead to
      surprising behavior and how to understand them.
    </para>

  </sect1>

  <sect1 id="pitfalls-infiniteLoops">
    <title>Infinite loops</title>

    <para>
      Here is a Java program with peculiar behavior
    </para>

<programlisting><![CDATA[
public class Main {
    public static void main(String[] args) {
        foo();
        System.out.println("done with call to foo");
    }

    static void foo() {
        try {
            foo();
        } finally {
            foo();
        }
    }
}
]]></programlisting>

    <para>
      This program will never reach the println call, but when it aborts
      may have no stack trace. 
    </para>

    <para>
      This silence is caused by multiple StackOverflowExceptions.  First
      the infinite loop in the body of the method generates one, which the
      finally clause tries to handle.  But this finally clause also
      generates an infinite loop which the current JVMs can't handle
      gracefully leading to the completely silent abort.
    </para>

    <para> 
      The following short aspect will also generate this behavior:
    </para>

<programlisting><![CDATA[
aspect A {
    before(): call(* *(..)) { System.out.println("before"); }
    after():  call(* *(..)) { System.out.println("after"); }
}
]]></programlisting>

    <para>
      Why?  Because the call to println is also a call matched by the
      pointcut <literal>call (* *(..))</literal>. We get no output because
      we used simple after() advice.  If the aspect were changed to
    </para>

<programlisting><![CDATA[
aspect A {
    before(): call(* *(..)) { System.out.println("before"); }
    after() returning:  call(* *(..)) { System.out.println("after"); }
}
]]></programlisting>

    <para>
      Then at least a StackOverflowException with a stack trace would be
      seen.  In both cases, though, the overall problem is advice applying
      within its own body.
    </para> 

    <para>
      There's a simple idiom to use if you ever have a worry that your
      advice might apply in this way.  Just restrict the advice from occurring in
      join points caused within the aspect.  So: 
    </para>

<programlisting><![CDATA[
aspect A {
    before(): call(* *(..)) && !within(A) { System.out.println("before"); }
    after() returning:  call(* *(..)) && !within(A) { System.out.println("after"); }
}
]]></programlisting>

    <para>
      Other solutions might be to more closely restrict the pointcut in
      other ways, for example:  
    </para>

<programlisting><![CDATA[
aspect A {
    before(): call(* MyObject.*(..))  { System.out.println("before"); }
    after() returning:  call(* MyObject.*(..))  { System.out.println("after"); }
}
]]></programlisting>

    <para>
      The moral of the story is that unrestricted generic pointcuts can
      pick out more join points than intended. 
    </para>

  </sect1>
</chapter>