This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git
The following commit(s) were added to refs/heads/master by this push:
new 9770ec1a Port from Doxia 1 to 2
9770ec1a is described below
commit 9770ec1a9bc82e5fbe698eac2326be26c8bf93d1
Author: Gary D. Gregory <[email protected]>
AuthorDate: Fri Jan 24 08:36:58 2025 -0500
Port from Doxia 1 to 2
---
src/site/xdoc/manual/appendix.xml | 25 ++++++++++--------
src/site/xdoc/manual/application-areas.xml | 28 +++++++++-----------
src/site/xdoc/manual/bcel-api.xml | 42 +++++++++++++-----------------
src/site/xdoc/manual/introduction.xml | 8 +++---
src/site/xdoc/manual/jvm.xml | 15 ++++++-----
5 files changed, 56 insertions(+), 62 deletions(-)
diff --git a/src/site/xdoc/manual/appendix.xml
b/src/site/xdoc/manual/appendix.xml
index c9448a4c..192b1f0e 100644
--- a/src/site/xdoc/manual/appendix.xml
+++ b/src/site/xdoc/manual/appendix.xml
@@ -17,7 +17,9 @@
specific language governing permissions and limitations
under the License.
-->
-<document>
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0
https://maven.apache.org/xsd/xdoc-2.0.xsd">
<properties>
<title>Appendix</title>
<author email="[email protected]">Apache Commons Team</author>
@@ -56,7 +58,7 @@ public class HelloWorld {
<p>
We will sketch here how the above Java class can be created from the
- scratch using the <font face="helvetica,arial">BCEL</font> API. For
+ scratch using the BCEL API. For
ease of reading we will use textual signatures and not create them
dynamically. For example, the signature
</p>
@@ -346,8 +348,8 @@ public class Peephole {
<subsection name="Constant pool UML diagram">
<p align="center">
- <a name="Figure 8">
- <img src="../images/constantpool.gif"/>
+ <a id="Figure-8">
+ <img src="../images/constantpool.gif" alt="Figure 8"/>
<br/>
Figure 8: UML diagram for constant pool classes
</a>
@@ -361,29 +363,30 @@ public class Peephole {
<source>
java org.apache.bcel.verifier.Verifier fully.qualified.class.Name
</source>
-
+ <p>
lets JustIce work standalone.
If you get a "java.lang.OutOfMemoryError", you should increase the
maximum Java heap space. A command like
-
+ </p>
<source>
java -Xmx1887436800 org.apache.bcel.verifier.Verifier f.q.c.Name
</source>
-
+ <p>
will usually resolve the problem. The value above is suitable for
big server machines; if your machine starts swapping to disk, try
to lower the value.
-
+ </p>
<h4>Running a graphics based verifier</h4>
-
+ <p>
If you prefer a graphical application, you should use a command like
-
+ </p>
<source>
java org.apache.bcel.verifier.GraphicalVerifier
</source>
-
+ <p>
to launch one. Again, you may have to resolve a memory issue depending
on the classes to verify.
+ </p>
</subsection>
</section>
</body>
diff --git a/src/site/xdoc/manual/application-areas.xml
b/src/site/xdoc/manual/application-areas.xml
index 0cd8ec6e..d153ef24 100644
--- a/src/site/xdoc/manual/application-areas.xml
+++ b/src/site/xdoc/manual/application-areas.xml
@@ -17,7 +17,9 @@
specific language governing permissions and limitations
under the License.
-->
-<document>
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0
https://maven.apache.org/xsd/xdoc-2.0.xsd">
<properties>
<title>Application areas</title>
<author email="[email protected]">Apache Commons Team</author>
@@ -26,8 +28,7 @@
<body>
<section name="Application areas">
<p>
- There are many possible application areas for <font
- face="helvetica,arial">BCEL</font> ranging from class
+ There are many possible application areas for BCEL ranging from class
browsers, profilers, byte code optimizers, and compilers to
sophisticated run-time analysis tools and extensions to the Java
language.
@@ -35,15 +36,14 @@
<p>
Compilers like the <a
- href="https://barat.sourceforge.net">Barat</a> compiler use <font
- face="helvetica,arial">BCEL</font> to implement a byte code
+ href="https://barat.sourceforge.net">Barat</a> compiler use BCEL
to implement a byte code
generating back end. Other possible application areas are the
static analysis of byte code or examining the run-time behavior of
classes by inserting calls to profiling methods into the
code. Further examples are extending Java with Eiffel-like
assertions, automated delegation, or with the concepts of <a
href="https://www.eclipse.org/aspectj/">Aspect-Oriented
Programming</a>.<br/> A
- list of projects using <font face="helvetica,arial">BCEL</font> can
+ list of projects using BCEL can
be found <a href="../projects.html">here</a>.
</p>
@@ -58,7 +58,7 @@
</p>
<p>
- A possible scenario is described in <a href="#Figure 7">figure
+ A possible scenario is described in <a href="#Figure-7">figure
7</a>:
During run-time the Virtual Machine requests a custom class loader
to load a given class. But before the JVM actually sees the byte
@@ -69,8 +69,8 @@
</p>
<p align="center">
- <a name="Figure 7">
- <img src="../images/classloader.gif"/>
+ <a id="Figure-7">
+ <img src="../images/classloader.gif" alt="Figure 7"/>
<br/>
Figure 7: Class loaders
</a>
@@ -90,8 +90,7 @@
benefit from new features. Such transformations may be executed on
demand and neither interfere with other users, nor alter the
original byte code. In fact, class loaders may even create classes
- <em>ad hoc</em> without loading a file at all.<br/> <font
- face="helvetica,arial">BCEL</font> has already builtin support
for
+ <em>ad hoc</em> without loading a file at all.<br/> BCEL has already
builtin support for
dynamically creating classes, an example is the ProxyCreator class.
</p>
@@ -100,8 +99,7 @@
<subsection name="Example: Poor Man's Genericity">
<p>
The former "Poor Man's Genericity" project that extended Java with
- parameterized classes, for example, used <font
- face="helvetica,arial">BCEL</font> in two places to generate
+ parameterized classes, for example, used BCEL in two places to generate
instances of parameterized classes: During compile-time (with the
standard <tt>javac</tt> with some slightly changed classes) and at
run-time using a custom class loader. The compiler puts some
@@ -113,7 +111,6 @@
class, e.g., <tt>Stack<String></tt>
</p>
- <p>
<ol type="1">
<li> Search for class <tt>Stack</tt>, load it, and check for a
certain class attribute containing additional type
@@ -123,7 +120,6 @@
<li>Replace all occurrences and references to the formal type
<tt>A</tt> with references to the actual type <tt>String</tt>. For
example the method
- </li>
<source>
void push(A obj) { ... }
@@ -136,10 +132,10 @@
<source>
void push(String obj) { ... }
</source>
+ </li>
<li> Return the resulting class to the Virtual Machine.</li>
</ol>
- </p>
</subsection>
</section>
diff --git a/src/site/xdoc/manual/bcel-api.xml
b/src/site/xdoc/manual/bcel-api.xml
index 1bd29466..013a583d 100644
--- a/src/site/xdoc/manual/bcel-api.xml
+++ b/src/site/xdoc/manual/bcel-api.xml
@@ -17,7 +17,9 @@
specific language governing permissions and limitations
under the License.
-->
-<document>
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0
https://maven.apache.org/xsd/xdoc-2.0.xsd">
<properties>
<title>The BCEL API</title>
<author email="[email protected]">Apache Commons Team</author>
@@ -26,14 +28,12 @@
<body>
<section name="The BCEL API">
<p>
- The <font face="helvetica,arial">BCEL</font> API abstracts from
+ The BCEL API abstracts from
the concrete circumstances of the Java Virtual Machine and how to
read and write binary Java class files. The API mainly consists
of three parts:
</p>
- <p>
-
<ol type="1">
<li> A package that contains classes that describe "static"
constraints of class files, i.e., reflects the class file format
and
@@ -55,12 +55,10 @@
href="https://jasmin.sourceforge.net">Jasmin</a> assembly
language.</li>
</ol>
- </p>
<subsection name="JavaClass">
<p>
- The "static" component of the <font
- face="helvetica,arial">BCEL</font> API resides in the package
+ The "static" component of the BCEL API resides in the package
<tt>org.apache.bcel.classfile</tt> and closely represents class
files. All of the binary components and data structures declared
in the <a
@@ -69,14 +67,14 @@
href="#2 The Java Virtual Machine">2</a> are mapped to classes.
<a href="#Figure 3">Figure 3</a> shows an UML diagram of the
- hierarchy of classes of the <font face="helvetica,arial">BCEL
- </font>API. <a href="#Figure 8">Figure 8</a> in the appendix also
+ hierarchy of classes of the BCEL
+ API. <a href="#Figure-8">Figure 8</a> in the appendix also
shows a detailed diagram of the <tt>ConstantPool</tt> components.
</p>
<p align="center">
- <a name="Figure 3">
- <img src="../images/javaclass.gif"/> <br/>
+ <a id="Figure-3">
+ <img src="../images/javaclass.gif" alt=""/> <br/>
Figure 3: UML diagram for the JavaClass API</a>
</p>
@@ -175,7 +173,7 @@ public static void printCode(Method[] methods) {
<h4>Analyzing class data</h4>
<p>
- Last but not least, <font face="helvetica,arial">BCEL</font>
+ Last but not least, BCEL
supports the <em>Visitor</em> design pattern, so one can write
visitor objects to traverse and analyze the contents of a class
file. Included in the distribution is a class
@@ -198,8 +196,8 @@ public static void printCode(Method[] methods) {
</p>
<p align="center">
- <a name="Figure 4">
- <img src="../images/classgen.gif"/>
+ <a id="Figure-4">
+ <img src="../images/classgen.gif" alt="Figure 3"/>
<br/>
Figure 4: UML diagram of the ClassGen API</a>
</p>
@@ -432,8 +430,8 @@ il.dispose(); // Reuse instruction handles of list
</p>
<p align="center">
- <a name="Figure 5">
- <img src="../images/il.gif"/>
+ <a id="Figure-5">
+ <img src="../images/il.gif" alt="Figure 5"/>
<br/>
Figure 5: Instruction list for <tt>readInt()</tt> method</a>
</p>
@@ -449,7 +447,7 @@ il.dispose(); // Reuse instruction handles of list
arithmetic or comparison expressions. You certainly do not want
to rewrite the code that translates such expressions into byte
code in every place they may appear. In order to support this, the
- <font face="helvetica,arial">BCEL</font> API includes a <em>compound
+ BCEL API includes a <em>compound
instruction</em> (an interface with a single
<tt>getInstructionList()</tt> method). Instances of this class
may be used in any place where normal instructions would occur,
@@ -493,8 +491,7 @@ il.append(f.createReturn(type));
When transforming code, for instance during optimization or when
inserting analysis method calls, one typically searches for
certain patterns of code to perform the transformation at. To
- simplify handling such situations <font
- face="helvetica,arial">BCEL </font>introduces a special feature:
+ simplify handling such situations BCEL introduces a special feature:
One can search for given code patterns within an instruction list
using <em>regular expressions</em>. In such expressions,
instructions are represented by their opcode names, e.g.,
@@ -591,13 +588,12 @@ for (Iterator e = f.search(pat, constraint); e.hasNext();
) {
<p>
can be mapped to both of the chunks of byte code shown in <a
- href="#Figure 6">figure 6</a>. The left column represents the
+ href="#Figure-6">figure 6</a>. The left column represents the
unoptimized code while the right column displays the same code
after the peep hole algorithm has been applied:
</p>
- <p align="center"><a name="Figure 6">
- <table>
+ <table align="center" id="Figure-6">
<tr>
<td valign="top"><pre>
5: aload_0
@@ -638,8 +634,6 @@ for (Iterator e = f.search(pat, constraint); e.hasNext(); )
{
</pre></td>
</tr>
</table>
- </a>
- </p>
</subsection>
</section>
</body>
diff --git a/src/site/xdoc/manual/introduction.xml
b/src/site/xdoc/manual/introduction.xml
index 66be7076..fd7b2e71 100644
--- a/src/site/xdoc/manual/introduction.xml
+++ b/src/site/xdoc/manual/introduction.xml
@@ -56,14 +56,14 @@
</p>
<p>
- The <font face="helvetica,arial">BCEL</font> API (Byte Code
+ The BCEL API (Byte Code
Engineering Library), formerly known as JavaClass, is a toolkit
for the static analysis and dynamic creation or transformation of
Java class files. It enables developers to implement the desired
features on a high level of abstraction without handling all the
internal details of the Java class file format and thus
- re-inventing the wheel every time. <font face="helvetica,arial">BCEL
- </font> is written entirely in Java and freely available under the
+ re-inventing the wheel every time. BCEL
+ is written entirely in Java and freely available under the
terms of the <a href="license.html">Apache Software License</a>.
</p>
@@ -71,7 +71,7 @@
This manual is structured as follows: We give a brief description
of the Java Virtual Machine and the class file format in <a
href="jvm.html">section 2</a>. <a href="bcel-api.html">Section
3</a>
- introduces the <font face="helvetica,arial">BCEL</font> API.
+ introduces the BCEL API.
<a href="application-areas.html">Section 4</a> describes some typical
application areas and example projects. The appendix contains code
examples
that are to long to be presented in the main part of this paper. All
examples
diff --git a/src/site/xdoc/manual/jvm.xml b/src/site/xdoc/manual/jvm.xml
index 8ba558d6..529c131a 100644
--- a/src/site/xdoc/manual/jvm.xml
+++ b/src/site/xdoc/manual/jvm.xml
@@ -17,7 +17,9 @@
specific language governing permissions and limitations
under the License.
-->
-<document>
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0
https://maven.apache.org/xsd/xdoc-2.0.xsd">
<properties>
<title>The Java Virtual Machine</title>
<author email="[email protected]">Apache Commons Team</author>
@@ -53,8 +55,8 @@
</p>
<p align="center">
- <a name="Figure 1">
- <img src="../images/jvm.gif"/>
+ <a id="Figure-1">
+ <img src="../images/jvm.gif" alt="Figure 1"/>
<br/>
Figure 1: Compilation and execution of Java classes</a>
</p>
@@ -103,8 +105,8 @@
</p>
<p align="center">
- <a name="Figure 2">
- <img src="../images/classfile.gif"/>
+ <a id="Figure-2">
+ <img src="../images/classfile.gif" alt="Figure 2"/>
<br/>
Figure 2: Java class file format</a>
</p>
@@ -320,8 +322,7 @@
its scope. This makes it difficult to insert or delete code areas
on this level of abstraction, since one has to recompute the
offsets every time and update the referring objects. We will see
- in <a href="bcel-api.html#ClassGen">section 3.3</a> how <font
- face="helvetica,arial">BCEL</font> remedies this restriction.
+ in <a href="bcel-api.html#ClassGen">section 3.3</a> how BCEL remedies
this restriction.
</p>
</subsection>