Skip to content

Commit

Permalink
Remove <emphasis> to work around DocBook bug
Browse files Browse the repository at this point in the history
It was determined (through painful trial and error) that after the
upgrade to DocBook 5 and the gradle-docbook-reference plugin, that
<emphasis> elements embedded within <programlisting> elements causes
NullPointerExceptions during processing.

This change eliminates these <emphasis> elements to work around the
problem. This means a slight degradation in presentation for the
affected areas of the reference documentation. After some research,
it is not clear what other workarounds may be possible that leave
the text actually emphasized.
  • Loading branch information
cbeams committed Jan 31, 2012
1 parent faa750d commit 7a3aa70
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 42 deletions.
9 changes: 6 additions & 3 deletions src/reference/docbook/aop.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2572,7 +2572,8 @@ public @interface Idempotent {
the value of the <literal>proxy-target-class</literal> attribute of the
<literal>&lt;aop:config&gt;</literal> element to true:</para>

<programlisting language="xml">&lt;aop:config <emphasis role="bold">proxy-target-class="true"</emphasis>&gt;
<!-- removed <emphasis> below to solve NPE problem -->
<programlisting language="xml">&lt;aop:config proxy-target-class="true"&gt;
<lineannotation>&lt;!-- other beans defined here... --&gt;</lineannotation>
&lt;/aop:config&gt;</programlisting>

Expand All @@ -2581,7 +2582,8 @@ public @interface Idempotent {
<literal>&lt;aop:aspectj-autoproxy&gt;</literal> element to
<literal>true</literal>:</para>

<programlisting language="xml">&lt;aop:aspectj-autoproxy <emphasis role="bold">proxy-target-class="true"</emphasis>/&gt;</programlisting>
<!-- removed <emphasis> below to solve NPE problem -->
<programlisting language="xml">&lt;aop:aspectj-autoproxy proxy-target-class="true"/&gt;</programlisting>

<note>
<para>Multiple <literal>&lt;aop:config/&gt;</literal> sections are
Expand Down Expand Up @@ -3596,6 +3598,7 @@ http://www.springframework.org/schema/context
<literal>&lt;context:load-time-weaver/&gt;</literal> element. Find
below an example of doing just that:</para>

<!-- removed <emphasis> below to solve NPE problem -->
<programlisting language="xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand All @@ -3607,7 +3610,7 @@ http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;

&lt;context:load-time-weaver
<emphasis role="bold">weaver-class="org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver"</emphasis>/&gt;
weaver-class="org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver"/&gt;

&lt;/beans&gt;</programlisting>

Expand Down
2 changes: 1 addition & 1 deletion src/reference/docbook/beans-customizing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
}
}</programlisting>

<programlisting language="xml">&lt;beans <emphasis role="bold">default-init-method="init"</emphasis>&gt;
<programlisting language="xml">&lt;beans default-init-method="init"&gt;

&lt;bean id="blogService" class="com.foo.DefaultBlogService"&gt;
&lt;property name="blogDao" ref="blogDao" /&gt;
Expand Down
13 changes: 7 additions & 6 deletions src/reference/docbook/beans-extension-points.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public class InstantiationTracingBeanPostProcessor implements BeanPostProcessor
<lineannotation>// simply return the instantiated bean as-is</lineannotation>
public Object postProcessBeforeInitialization(Object bean, String beanName)
throws BeansException {
return bean; <lineannotation>// we could potentially return <emphasis>any</emphasis> object reference here...</lineannotation>
return bean; <lineannotation>// we could potentially return any object reference here...</lineannotation>
}

public Object postProcessAfterInitialization(Object bean, String beanName)
Expand Down Expand Up @@ -351,10 +351,10 @@ org.springframework.scripting.groovy.GroovyMessenger@272961</programlisting>

&lt;bean id="dataSource" destroy-method="close"
class="org.apache.commons.dbcp.BasicDataSource"&gt;
&lt;property name="driverClassName" value="<emphasis role="bold">${jdbc.driverClassName}</emphasis>"/&gt;
&lt;property name="url" value="<emphasis role="bold">${jdbc.url}</emphasis>"/&gt;
&lt;property name="username" value="<emphasis role="bold">${jdbc.username}</emphasis>"/&gt;
&lt;property name="password" value="<emphasis role="bold">${jdbc.password}</emphasis>"/&gt;
&lt;property name="driverClassName" value="${jdbc.driverClassName}"/&gt;
&lt;property name="url" value="${jdbc.url}"/&gt;
&lt;property name="username" value="${jdbc.username}"/&gt;
&lt;property name="password" value="${jdbc.password}"/&gt;
&lt;/bean&gt;</programlisting>

<para>The actual values come from another file in the standard Java
Expand Down Expand Up @@ -472,7 +472,7 @@ dataSource.url=jdbc:mysql:mydb</programlisting>
already non-null (presumably initialized by the constructors). In this
example...</para>

<programlisting language="java">foo.fred.bob.sammy=123</programlisting>
<programlisting>foo.fred.bob.sammy=123</programlisting>

<para>... the <literal>sammy</literal> property of the
<literal>bob</literal> property of the <literal>fred</literal> property
Expand All @@ -491,6 +491,7 @@ dataSource.url=jdbc:mysql:mydb</programlisting>
configuration element:</para>

<programlisting language="xml">&lt;context:property-override location="classpath:override.properties"/&gt;</programlisting>

</section>
</section>

Expand Down
18 changes: 9 additions & 9 deletions src/reference/docbook/beans-scopes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -404,16 +404,16 @@
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"&gt;

<lineannotation>&lt;!-- an HTTP <interfacename>Session</interfacename>-scoped bean exposed as a proxy --&gt;</lineannotation>
&lt;bean id="userPreferences" class="com.foo.UserPreferences" <emphasis role="bold">scope="session"</emphasis>&gt;
&lt;bean id="userPreferences" class="com.foo.UserPreferences" scope="session"&gt;

<lineannotation>&lt;!-- instructs the container to proxy the surrounding bean --&gt;</lineannotation>
<emphasis role="bold">&lt;aop:scoped-proxy/&gt;</emphasis>
&lt;aop:scoped-proxy/&gt;
&lt;/bean&gt;

<lineannotation>&lt;!-- a singleton-scoped bean <emphasis role="bold">injected with a proxy to the above bean</emphasis> --&gt;</lineannotation>
<lineannotation>&lt;!-- a singleton-scoped bean injected with a proxy to the above bean --&gt;</lineannotation>
&lt;bean id="userService" class="com.foo.SimpleUserService"&gt;

<lineannotation>&lt;!-- a reference to the <emphasis role="bold">proxied</emphasis> <literal>userPreferences</literal> bean --&gt;</lineannotation>
<lineannotation>&lt;!-- a reference to the proxied <literal>userPreferences</literal> bean --&gt;</lineannotation>
&lt;property name="userPreferences" ref="userPreferences"/&gt;

&lt;/bean&gt;
Expand Down Expand Up @@ -489,7 +489,7 @@
objects:</para>

<programlisting language="xml">&lt;bean id="userPreferences" class="com.foo.UserPreferences" scope="session"&gt;
<emphasis role="bold"><literal>&lt;aop:scoped-proxy/&gt;</literal></emphasis>
<literal>&lt;aop:scoped-proxy/&gt;</literal>
&lt;/bean&gt;

&lt;bean id="userManager" class="com.foo.UserManager"&gt;
Expand Down Expand Up @@ -524,7 +524,7 @@

<programlisting language="xml"><lineannotation>&lt;!-- <classname>DefaultUserPreferences</classname> implements the <interfacename>UserPreferences</interfacename> interface --&gt;</lineannotation>
&lt;bean id="userPreferences" class="com.foo.DefaultUserPreferences" scope="session"&gt;
&lt;aop:scoped-proxy <emphasis role="bold">proxy-target-class="false"<literal/></emphasis>/&gt;
&lt;aop:scoped-proxy proxy-target-class="false"<literal/>/&gt;
&lt;/bean&gt;

&lt;bean id="userManager" class="com.foo.UserManager"&gt;
Expand Down Expand Up @@ -633,7 +633,7 @@

<programlisting language="java">
Scope threadScope = new SimpleThreadScope();
beanFactory.registerScope("<emphasis role="bold">thread</emphasis>", threadScope);</programlisting>
beanFactory.registerScope("thread", threadScope);</programlisting>

<para>You then create bean definitions that adhere to the scoping rules of
your custom <interfacename>Scope</interfacename>:</para>
Expand All @@ -657,10 +657,10 @@ beanFactory.registerScope("<emphasis role="bold">thread</emphasis>", threadScope

&lt;bean class="org.springframework.beans.factory.config.CustomScopeConfigurer"&gt;
&lt;property name="scopes"&gt;
&lt;map&gt;<emphasis role="bold">
&lt;map&gt;
&lt;entry key="thread"&gt;
&lt;bean class="org.springframework.context.support.SimpleThreadScope"/&gt;
&lt;/entry&gt;</emphasis>
&lt;/entry&gt;
&lt;/map&gt;
&lt;/property&gt;
&lt;/bean&gt;
Expand Down
2 changes: 1 addition & 1 deletion src/reference/docbook/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ List userList service.getUsernameList();

<xi:include href="beans-classpath-scanning.xml"
xmlns:xi="http://www.w3.org/2001/XInclude"/>

<xi:include href="beans-standard-annotations.xml"
xmlns:xi="http://www.w3.org/2001/XInclude"/>

Expand Down
7 changes: 3 additions & 4 deletions src/reference/docbook/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
<para>This document is a reference guide to Spring Framework features.
If you have any requests, comments, or questions on this document,
please post them on the user mailing list or on the support forums at
<ulink url="http://forum.springsource.org/"></ulink>.<!--Missing link above. PDF shows it as http://forum.springsource.org/--></para>
<ulink url="http://forum.springsource.org/"></ulink>.<!-- Missing link above. PDF shows it as http://forum.springsource.org/ --></para>
</partintro>

<xi:include href="overview.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
Expand Down Expand Up @@ -490,8 +490,6 @@
xmlns:xi="http://www.w3.org/2001/XInclude" />
</part>

<!-- back matter -->

<part id="spring-appendices">
<title>Appendices</title>

Expand All @@ -511,8 +509,9 @@

<xi:include href="spring.tld.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />

<!--
<xi:include href="spring-form.tld.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
-->
</part>
</book>
10 changes: 6 additions & 4 deletions src/reference/docbook/jdbc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2600,6 +2600,7 @@ public class TitlesAfterDateStoredProcedure extends StoredProcedure {
of a <classname>DefaultLobHandler</classname>. You typically set this
value through dependency injection.<!--Rewording ok? (What does what through dependency injection?) TR: Revised.--></para>

<!--
<programlistingco>
<areaspec>
<area coords="8" id="jdbc.lobhandler.variableref" />
Expand Down Expand Up @@ -2631,7 +2632,7 @@ clobReader.close();</programlisting>
<calloutlist>
<callout arearefs="jdbc.lobhandler.variableref">
<para>Pass in the lobHandler that in this example is a plain
<classname>DefaultLobHandler</classname><!--*Here* where?(deleted *Here we*) I don't see this in example.Use the lobHandler to do what? TR: Revised.--></para>
<classname>DefaultLobHandler</classname></para>
</callout>
<callout arearefs="jdbc.lobhandler.setClob">
Expand All @@ -2647,13 +2648,14 @@ clobReader.close();</programlisting>
</callout>
</calloutlist>
</programlistingco>
-->

<para>Now it's time to read the LOB data from the database. Again, you
use a <code>JdbcTemplate</code> with the same instance variable
<code>l</code><code>obHandler </code>and a reference to a
<classname>DefaultLobHandler</classname>.</para>

<para><programlistingco>
<para><!--<programlistingco>
<areaspec>
<area coords="5" id="jdbc.lobhandler.getClob" />
Expand Down Expand Up @@ -2681,10 +2683,10 @@ clobReader.close();</programlisting>
<callout arearefs="jdbc.lobhandler.setBlob">
<para>Using the method <classname>getBlobAsBytes,</classname>
retrieve the contents of the BLOB.<!--MISSING THE NUMBER 2 IN SNIPPET ABOVE. ADD WHERE APPROPRIATE. TR: ?; OK AS IS.--></para>
retrieve the contents of the BLOB.</para>
</callout>
</calloutlist>
</programlistingco></para>
</programlistingco>--></para>
</section>

<section id="jdbc-in-clause">
Expand Down
21 changes: 11 additions & 10 deletions src/reference/docbook/spring.tld.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</para>
<table id="spring.tld.bind.table">
<title>Attributes</title>
<tgroup cols="3">
<tgroup cols="4">
<colspec align="center" colname="Attribute"/>
<colspec align="center" colname="Required"/>
<colspec align="center" colname="Runtime.Expression"/>
Expand Down Expand Up @@ -119,6 +119,7 @@
</tgroup>
</table>
</section>

<section id="spring.tld.escapeBody">
<title>The <literal>escapeBody</literal> tag</title>
<para>
Expand All @@ -128,7 +129,7 @@
</para>
<table id="spring.tld.escapeBody.table">
<title>Attributes</title>
<tgroup cols="3">
<tgroup cols="4">
<colspec align="center" colname="Attribute"/>
<colspec align="center" colname="Required"/>
<colspec align="center" colname="Runtime.Expression"/>
Expand Down Expand Up @@ -185,7 +186,7 @@
</para>
<table id="spring.tld.hasBindErrors.table">
<title>Attributes</title>
<tgroup cols="3">
<tgroup cols="4">
<colspec align="center" colname="Attribute"/>
<colspec align="center" colname="Required"/>
<colspec align="center" colname="Runtime.Expression"/>
Expand Down Expand Up @@ -242,7 +243,7 @@
</para>
<table id="spring.tld.htmlEscape.table">
<title>Attributes</title>
<tgroup cols="3">
<tgroup cols="4">
<colspec align="center" colname="Attribute"/>
<colspec align="center" colname="Required"/>
<colspec align="center" colname="Runtime.Expression"/>
Expand Down Expand Up @@ -284,7 +285,7 @@
</para>
<table id="spring.tld.message.table">
<title>Attributes</title>
<tgroup cols="3">
<tgroup cols="4">
<colspec align="center" colname="Attribute"/>
<colspec align="center" colname="Required"/>
<colspec align="center" colname="Runtime.Expression"/>
Expand Down Expand Up @@ -453,7 +454,7 @@
</para>
<table id="spring.tld.nestedPath.table">
<title>Attributes</title>
<tgroup cols="3">
<tgroup cols="4">
<colspec align="center" colname="Attribute"/>
<colspec align="center" colname="Required"/>
<colspec align="center" colname="Runtime.Expression"/>
Expand Down Expand Up @@ -496,7 +497,7 @@
</para>
<table id="spring.tld.theme.table">
<title>Attributes</title>
<tgroup cols="3">
<tgroup cols="4">
<colspec align="center" colname="Attribute"/>
<colspec align="center" colname="Required"/>
<colspec align="center" colname="Runtime.Expression"/>
Expand Down Expand Up @@ -662,7 +663,7 @@
</para>
<table id="spring.tld.transform.table">
<title>Attributes</title>
<tgroup cols="3">
<tgroup cols="4">
<colspec align="center" colname="Attribute"/>
<colspec align="center" colname="Required"/>
<colspec align="center" colname="Runtime.Expression"/>
Expand Down Expand Up @@ -751,7 +752,7 @@
</para>
<table id="spring.tld.url.table">
<title>Attributes</title>
<tgroup cols="3">
<tgroup cols="4">
<colspec align="center" colname="Attribute"/>
<colspec align="center" colname="Required"/>
<colspec align="center" colname="Runtime.Expression"/>
Expand Down Expand Up @@ -868,7 +869,7 @@
</para>
<table id="spring.tld.eval.table">
<title>Attributes</title>
<tgroup cols="3">
<tgroup cols="4">
<colspec align="center" colname="Attribute"/>
<colspec align="center" colname="Required"/>
<colspec align="center" colname="Runtime.Expression"/>
Expand Down
3 changes: 1 addition & 2 deletions src/reference/docbook/swf-sidebar.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<sidebar xmlns="http://docbook.org/ns/docbook" version="5.0"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xml:id="spring-web-flow-sidebar">
xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Spring Web Flow</title>

<para>Spring Web Flow (SWF) aims to be the best solution for the management
Expand Down
3 changes: 1 addition & 2 deletions src/reference/docbook/view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ productList.url=/WEB-INF/jsp/productlist.jsp</programlisting>
best practice), then you can bind the form to the named variable like
so:</para>

<programlisting language="xml">&lt;form:form <lineannotation><emphasis
role="bold">commandName="user"</emphasis></lineannotation>&gt;
<programlisting language="xml">&lt;form:form commandName="user"&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;First Name:&lt;/td&gt;
Expand Down

0 comments on commit 7a3aa70

Please sign in to comment.