Skip to content

Commit

Permalink
Minor changes to version number, for comments in the Normalizer utility
Browse files Browse the repository at this point in the history
class, and one change to the MarcPermissiveStreamReader
  • Loading branch information
haschart committed Aug 15, 2013
1 parent cea8d48 commit 543e9a1
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 10 deletions.
5 changes: 2 additions & 3 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ _Crosswalking: Processing MARC in XML Environments with MARC4J_ is a concise boo

h2. Download

New! Latest release (MARC4J 2.5RC1):
New! Latest release (MARC4J 2.6.0):

* "marc4j-2.5RC1.jar":http://github.com/marc4j/marc4j/blob/master/releases/marc4j_2.5RC1.jar
* "marc4j-2.5.1-beta.jar":http://github.com/marc4j/marc4j/blob/master/releases/marc4j-2.5.1.beta.jar
* "marc4j-2.6.0.jar":https://github.com/marc4j/marc4j/blob/master/releases/marc4j-2.6.0.jar

Check here for changes.

Expand Down
4 changes: 3 additions & 1 deletion build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ build.test-classes.dir=${build.dir}/test-classes
build.generated-src.dir=generated-src
dist.dir=dist
apidoc.dir=${build.dir}/apidoc
version=2.5.1-beta
specversion=2.6
implversion=0
version=${specversion}.${implversion}
project.name=marc4j
jar.name=${project.name}-${version}.jar
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<manifest>
<section name="org/marc4j">
<attribute name="Specification-Title" value="marc4j"/>
<attribute name="Specification-Version" value="2.5"/>
<attribute name="Specification-Version" value="${specversion}"/>
<attribute name="Specification-Vendor" value="org.marc4j"/>

<attribute name="Implementation-Title" value="marc4j"/>
Expand Down
2 changes: 1 addition & 1 deletion ivy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<dependencies>
<dependency org="junit" name="junit" rev="4.11+" conf="test->default"/>
<dependency org="com.ibm.icu" name="icu4j" rev="50+"/>
<!-- <dependency org="com.ibm.icu" name="icu4j" rev="50+"/> -->
<dependency org="org.slf4j" name="slf4j-api" rev="1.7+"/>
<dependency org="org.slf4j" name="slf4j-log4j12" rev="1.7+" conf="test->default"/>
</dependencies>
Expand Down
Binary file added releases/marc4j-2.6.0.jar
Binary file not shown.
15 changes: 11 additions & 4 deletions src/org/marc4j/MarcPermissiveStreamReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public class MarcPermissiveStreamReader implements MarcReader {

private ErrorHandler errors;
static String validSubfieldCodes = "abcdefghijklmnopqrstuvwxyz0123456789";

static String upperCaseSubfieldsProperty = "org.marc4j.MarcPermissiveStreamReader.upperCaseSubfields";
/**
* Constructs an instance with the specified input stream with possible additional functionality
* being enabled by setting permissive and/or convertToUTF8 to true.
Expand Down Expand Up @@ -1094,10 +1094,17 @@ else if (permissive && validSubfieldCodes.indexOf(code) == -1)
{
if (code >= 'A' && code <= 'Z')
{
code = Character.toLowerCase(code);
errors.addError(ErrorHandler.MINOR_ERROR,
if ( Boolean.parseBoolean(System.getProperty(upperCaseSubfieldsProperty, "false")) == false)
{
code = Character.toLowerCase(code);
errors.addError(ErrorHandler.MINOR_ERROR,
"Subfield tag is an invalid uppercase character, changing it to lower case.");
}
}
else // the System Property org.marc4j.MarcPermissiveStreamReader.upperCaseSubfields is defined to allow upperCaseSubfields
{
// therefore do nothing and be happy
}
}
else if (code > 0x7f)
{
code = data[0];
Expand Down
13 changes: 13 additions & 0 deletions src/org/marc4j/util/Normalizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
*
* @author rh9ec
*
* This class is a shim interface to handle the normalization of unicode characters.
* This functionality is available in java 1.6+ and newer, via the java.text.Normalizer class.
* If for some reason that class is not available, this code will attempt to fall back to using either the
* class com.ibm.icu.text.Normalizer from the icu4j library or to using the
* class com.solrmarc.icu.text.Normalizer which is based on (an older version) of the preceding
* and which is included as a part of SolrMarc.
* Since Java 1.6 is now officially "end-of-lifed" it should be a reasonable assumption that users are
* not using a version of java that is even older than that, and this shim interface class can be deprecated.
*/

public class Normalizer
{
Expand Down

0 comments on commit 543e9a1

Please sign in to comment.