josef-core (j2ee6) - release notes

Release 3.0.55

org.josef.util.FormatterFactory
The createDecimalFormat(Locale, String) method created a NumberFormat object that was only suitable for parsing Integers.

org.josef.util.Formatter
The existing parseDecimal(String) method does NOT accept an exponent in the input anymore. Previously this method would happily parse 2E34 as valid input. Should you want to parse a decimal value with an exponent, then please use the new parseDecimalAcceptingAnExponent(final String decimalNumber) method.
Another new method parseDecimal(String decimalNumber, String pattern) has been added. You can use this method to use your own pattern for parsing decimal numbers. Note that its use is limited as this method will parse a value of 12345 with a pattern of "#". It will properly take care of parsing decimal numbers with or without grouping symbols in either the decimal number of the pattern.
The test code has been adapted as well.

org.josef.jdbc.Column
Now contains a property named nullable. The order in which the members are added in the toString() method have changed. precision is now used before scale, which is more logical.

org.josef.jdbc.Constraint
Now contains a referencedTableName and referenceColumns that can be used in combination with foreign keys.

org.josef.jdbc.Database
Corrected problems with width, scale and precision. Meta data contains a scale and precision but the Column class uses a width for character columns and a scale and precision for numeric fields. Added a getConstraints and getActualConstraints method.

org.josef.jdbc.DerbyDatabase
Implemented the new getActualConstraint(s) methods by always throwing an UnsupportedOperationException.

org.josef.jdbc.OracleDatabase
Added the getActualConstraints method. The existing getActualConstraint method now also reads referential integrity data.

org.josef.financial
UK sort code files have been upgraded to the 2017-06-12 version.

org.josef.jdbc.OracleDatabase
OracleDatabase did not fetch the primary keys of a table.

Release 3.0.54

org.josef.jpa.SequentialIdGenerator
Now contains a new method to get a new sequential ID and then reserve a number of other id's. So when you know in advance how many id's of a certain sequence you're going to need, you can reserve them all in a single transaction. The signature of the new method is:
public long fetchNextSequentialID(final String sequenceName, final int numberOfIds)

Release 3.0.52

Corrected uploading of sources jar and javadoc jar. Using the deploy phase did not work. Now uses the pacakage phase instead, causing these artefact to always be built.

Release 3.0.51

Improved the way source and javadoc jars are created. These tasks are now only executed when deploying to nexus.

Release 3.0.50

First attempt of creating source and javadoc api.

UKSortCodeRange.txt
Updated with the latest information from here: here.

org.josef.util.Iso3166Country
Changed enum name from CZECH_REPUBLIC to CZECHIA. This caused changes in other files using this enum.

Release 3.0.49

org.josef.util.CodeDescription
org.josef.util.LocalizableEnumeration
Changed the type of the code field from an Object to a Serializable.

org.josef.util.Formatter
Restored the German translations.

org.josef.util.Iso3166Country
Updated the description of the country with code 'CZ'.

org.josef.finance.UKSortCode
The UK sort codes were not properly read from the sort codes text file! Notice that this does not influence the validity of sort code/bank account combinations, only the determination of what sort code belongs to what bank fails.

Release 3.0.48

Merged a lot of changes from trunk.

org.josef.util.security
Added this new security package, containing code for hashing.

org.josef.util.GlobalSettings
Renamed getDatabase to getDatabaseType and added a new getApplicationServerUrl method.

org.josef.web.html.HtmlElement
Added new methods to output formatted HTML.

org.josef.web.html.HtmlRow
Changed return value of some methods to allow for better chaining. Renamed the methods that added a header column.

org.josef.web.html.HtmlTag
Now supports all HTML 5 tags.

org.josef.science.math.CByte
Added constants for stuff like number of bytes in a mega byte. Added function to convert a byte to two hexadecimal characters.

Release 3.0.47

org/josef.util.CodeDescription
Added a method to perform a case insensitive comparison on description.

log4j2.xml
Renamed this file so the log4j2 configuration won't be picked up automatically. This should help other programs that use Josef to supply their own configuration file.

org.josef.finance.UKBankAccountNumber
Updated the check on sortcode/bankaccount to ignore exceptions and to execute the second algorithm in case the first one fails. The different sort codes, and sort code ranges are update to 2016-06-13. All unit tests from the source document are added. Exceptions 1 and 5 have been implmented.

org.josef.finance.UKSortCodeSubstitution
Now uses Strings instead of Integers.

Release 3.0.46

Switched to using Log4J version 2.

org.josef.util.rpn.RpnCalc
Is now thread safe. As a result the test can now be run in the same vm (reuseForks) setting in the pom.xml file.

Release 3.0.45

No changes to core but there have been changes in the tag lib.

Release 3.0.44

org.josef.web.servlet.GZipFilter
When the client accepted compression but the response was below the threshold, the response was output twice! Thanks to Gert Jan for writing a unit test for this case. I added unit tests for all other combinations of compression and response size.

Release 3.0.43

org.josef.web.servlet.GZipFilter
Added this class that supports compressing responses. It can be used to compress html/xml/jsf output. Use it to compress the output of web/rest services. Just add the next lines to your web.xml file.


  <filter>
    <filter-name>GZipFilter</filter-name>
    <filter-class>org.josef.web.servlet.GZipFilter</filter-class>
    <init-param>
      <param-name>threshold</param-name>
      <param-value>2048</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>GZipFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  

This code will compress all responses larger than 2K.

Release 3.0.42

org.josef.util.Formatter
Corrected a problem where an incorrect year was shown with a thousand separator.

Release 3.0.42

org.josef.util.Formatter
Added a method to parse a date using a pattern. Previously the method parseDateTime(...) had to be used to parse a date with a pattern. When parsing a date, the resulting year must have a length of 4 digits. Previously dates like: 1/1/015 and 1/1/20015 would simply be accepted. Note: In some programs you may need to parse such dates and this can be done by calling setFourDigitYear(false) on your formatter.

org.josef.util.FormatterFactory
Added some new factory methods (that were moved from the Formatter class). The rule is that if a formatter needs a patter of some kind, then FormatterFactory can create it for you.

Release 3.0.41

org.josef.util.Formatter
Now properly rounds integers (provided the latest jdk is used).

Changed English description of: BQ=Bonaire, Sint Eustatius and Saba, as suggested by ISO3166 committee.

org.josef.web.html.*
Added some classes from the trunk to aid in writing html code from a servlet for example. Josef now has two ways to write html code.
1) AbstractHtmlWriter/HtmlStringWriter
2) HtmlElement/HtmlAttribute/HtmlTable/HtmlRow
1) Is for simple sequential output only.
2) Is for more complicated output where you create a kind of DOM tree.

For example:
HtmlElement root = new HtmlElement(); Will create the following structure:


    <html>
      <head>
      </head>
      <body>
      </body>
    </html>
  

You can easily add other elements with attributes and or content to this tree and then convert the tree to html.

Release 3.0.40

Lots of changes were merged from the trunk. In the trunk changes were made to be able to run a mvn site command.

org.josef.util.Nationality*.properties
Some error were corrected here, related to Israel, Italy and Chaad. Some had incorrect codes and they have been fixed now.

Release 3.0.39

org.josef.util.ParameterName
Introduced this new class which contains all parameter names of methods from the util package, that are used in a CDebug.checkParameter...(...) statement. Usage of this class voids duplicate strings.

org.josef.util.Formatter
The parseDecimal method did not add a message when group separators were used incorrectly. An empty message was returned in the InvalidArgumentException.

Release 3.0.38

org.josef.util.Formatter
The parseDateTime(String, String) method now correctly parses short date/times and date only input.

Release 3.0.37

org.josef.util.FormatterFactory
Now contains a new createDateFormat method that is now used by: formatDate(final Date date, final String pattern). Previously the formatDate used a standard SimpleDateFormat object that did not take localized pattern characters into account, resulting in an exception, stating that 'jjjj' is not a valid pattern character.

Added a new resource bundle key to get a localized pattern for a date/time that includes hours, minutes and seconds. Corrected an error in the Dutch localized pattern characters that caused milliseconds to be displayed instead of the number of seconds.

org.josef.util.CReflection
Instead of the "old" IllegalAccessException, InvocationTargetException and NoSuchMethodException the more generic ReflectiveOperationException is used. This results in cleaner code.

Release 3.0.36

org.josef.util.DnsUtil
Added this class.

org.josef.util.MailServer
Added this class.

Release 3.0.35

org.josef.web.QueryString
New class that lets you build a query string from name/value pairs.

org.josef.web.QueryStringUtil
Now properly decodes query string parameters. The method getQueryStringParameters(String) now accepts a query string instead of a url. To get the query string, just use: getQueryString(final String url).

Release 3.0.34

No changes made to core.

Release 3.0.33

org.josef.util.AbstractLocalizedException
org.josef.util.AbstractLocalizedRuntimeException
Are now both localizable. When passed as a method argument to Formatter.format(...), an exception will now at least use the proper locale for translation.

Release 3.0.32

org.josef.util.Formatter
Will now parse date/times using both the standard and short pattern. It also will accept a date only, using 00:00 as the time. So this is valid: 01012001 1123, 01/01/2001 11:23 or 01012001

org.josef.util.FormatterFactory
Added a new createDefaultShortDateTimeFormat method. Properties were already in place.

org.josef.jdbc.JdbcUtil
Removed createCommaSeparatedValues and quoteSqlValue methods as they were already present in SqlStatementUtil.

org.josef.jdbc.SqlStatementUtil
Slightly adjusted the quoteSqlValue method to take dates into account.

Release 3.0.31

org.josef.jdbc.CodeDescriptionCallback
org.josef.jdbc.Column
org.josef.jdbc.Constraint (was ConstraintVO in jxpfw)
org.josef.jdbc.ConstraintType
org.josef.jdbc.DerbyDatabase
org.josef.jdbc.OracleDatabase
org.josef.jdbc.Table
Moved these classes from jxpfw to Josef.

Release 3.0.29

Iso3166Country
Changed some countries due to ISO updates. UNITED_STATES for example was changed to UNITED_STATES_OF_AMERICA.

Release 3.0.28

org.josef.util.Version
Dropped this class since the target jar contains the pom.xml file, which in turn contains the version information.

org.josef.util.CComparator
Added a compareStringsIgnoringCase method from jxpfw's AbstractComparator.

Release 3.0.27

org.josef.util.Message
Moved from jxpfw.

org.josef.util.CArguments
org.josef.util.ArgumentsHandler
These classes were moved from jxpfw.

org.josef.util.appserver.ApplicationServer
Updated the different WebLogic versions.

Release 3.0.26

org.josef.util.CResourceBundle
CResourceBundle should now work with resource bundle names (Strings), even when they are passed in from a class that uses a class loader different from Josef's CResourceBundle class loader.

org.josef.util.CReflection
Now has a new getCallingClass() method.

org.josef.util.CClassLoader
New class that is used in testing CResourceBundle with different class loaders. You may want to use this class for unit testing as well.

org.josef.util.ClassUtil
ClassUtil now has a new getClassLoaderOfCallingClass() method.

org.josef.util.CResourceBundle
Should now work with resource bundle names (Strings) even when they are passed in from a class that uses a class loader different from Josef's CResourceBundle class loader.

Release 3.0.25

org.josef.util.CResourceBundle
Moved the getString(String, String, Object []) method to: getMessage(String, Object...). This getMessage is now the only method that formats its message arguments. The getString(String) and getString(String, String) simply return a String, without looking at {0} parameters to substitute.

org.josef.util.Formatter
The format method now accepts an empty messagePattern since this is often used in properties files. For example: suffix=
This indicates an empty suffix which should just be accepted. Previously this resulted in an exception.

Release 3.0.24

org.josef.util.CResourceBundle
Added extra constructor to be backwards compatible with jxpfw.

org.josef.util.UniqueLongGenerator
Moved from jxpfw.

org.josef.util.Formatter
formatDateTime(Date, String pattern) did not use the: FormatterFactory.createDateTimeFormat(...) method so it did not allow for localized patterns.

Release 3.0.23

org.josef.util.InvalidStateException
Now extends InvalidArgumentException. Not because this is a good idea but since this was the structure in jxpfw. Keep in mind that InvalidStateException should be used when validating an object containing multiple attributes and InvalidArgumentException should be used when a single argument is incorrect.

org.josef.util.Formatter
Now disallows incorrect placing of grouping separators. Previously a"n English value of "1.1" or a Dutch value of "1,1" resulted in a value of "11". Additionally the formatted result of a decimal now contains the grouping separator when applicable. Note: This requires just a little bit of extra space in the GUI.

org.josef.util.Iso3166Country
Changed CAPE_VERDE to CABO_VERDE as required by ISO 3166 standards. This forced me to change other classes that used this enumeration as well.

org.josef.finance.IbanOfCountry
Added this class to check whether a country supports IBAN payments or not. Usage: IbanOfCountry.valueOf(Iso3166Country.BELGIUM);
This either returns the IbanOfCountry instance or null when the country does not support IBAN payments.

Release 3.0.22

org.josef.jdbc.JdbcUtil
Now contains the following methods: encode, createCommaSeparatedValues and quoteSqlValue. The encode method can be used on individual columns to prevent SQL injection. Note: This is only applicable to creating your own dynamic SQL statements. Preferably use SQL bind parameters which are inherently safe.

org.josef.util.Formatter
org.josef.util.FormatterFactory
Added a parseDateTime method that accepts a pattern. This pattern can either be a non localized pattern like: dd-MM-yyy hh:mm, but it can also be a localized pattern like: dd-mm-jjjj UU:MM for example. See: Formatter*.properies for the allowable characters in a localized pattern for a particular locale. The FormatterFactory class is responsible for creating the SimpleDateFormat.

Release 3.0.21

org.josef.util.Mask
Contained a bug where some values where accepted instead of being rejected. Due to the fact that the method: fromUnmaskedValue did not check whether a character was valid for the corresponding mask character.

org.josef.util.ZipCodeOfCountry
Added a method to get the unmasked value from a masked value. Added a method to get the masked value from the unmasked value. These methods aid in converting a String to and from a zip code without using a JSF converter.

Release 3.0.20

org.josef.util.CResourceBundle
Added a constructor that accepts a resource bundle name as it's only parameter. This name is converted to a ResourceBundle and then added to the list of ResourceBundles. This new constructor should aid in removing CResourceBunlde from jxpfw.

Release 3.0.19

org.josef.util.xml.XmlUtil
Maintained the convenience methods for a simple marshal/unmarshal. For more complex situations the MarshallParameters and UnmarshallParameters classes must be used. See javadoc for proper usage. The parameter classes support escaping/unescaping of xml and attributes for example. Since the parameter classes are besed upon the builder pattern, they can easily be enhanced to support other options.

Release 3.0.18

org.josef.util.xml.XmlUtil
By default marshalling and unmarshalling escapes. Extra methods have been added to avoid escaping/unescaping.

org.josef.finance.UKBankAccountNumber
Now only support accounts containing 6 to 8 digits. Previously UK Bank Account Numbers could contain 9 or 10 digits as well. The problem is that BACS can only work with 8 digit bank account numbers.

Release 3.0.17

org.josef.util.CLocale
Did not handle a valid combination of language and variant, that is without a country. For example: "nl__linux".

Release 3.0.16

org.josef.util.Localizable
org.josef.util.Formatter
Created this new interface which is implemented by LocalizableEnumeration. The formatter class now formats and localizes arguments of type Localizable.

Release 3.0.15

Moved to m2eclipse. This is work in progress but in the near future, ant files and possibly maven eclipse support will be dropped. Currently all .settings, .project and .classpath files and directories have been removed from subversion, so the choice for m2eclipse is quite definitive.

org.josef.ejb.ServiceLocator
Effectively did not cache at all. This has now been solved.

Release 3.0.14

org.josef.web.CCookie
Instead of a time zone offset, the actual time zone text is used. This should solve the problems with DST (daylight savings time).

Release 3.0.13

org.josef.util.Formatter
Now correctly uses a time zone to format the combination of a date and time.

org.josef.util.FormatterFactory
The createDefaultDateTimeFormat now accepts a time zone. When you use this method and don't need a time zone, please pass: TimeZone.getDefault() as a parameter.

Release 3.0.12

Release 3.0.11

org.josef.hist
Added missing NationalityType properties for portal team. In the future org.josef.util.Nationality should be used.

org.josef.web.servlet.EncodeParameterFilter
Added this new servlet based filter to encode request parameters. Birt 4.2.1 for example does not encode its report parameters, making it vulnerable to client side attacks.

Release 3.0.10

org.josef.hist
Added NationalityType for portal team. This solves a circular dependency.

org.josef.util.CDate
Added new getMaximumDayOfYear(int year) method as suggested by Pieter.

org.josef.util.Nationality
Renamed from NationalityOfCountry. This class is nowhere near being finished.

org.josef.util.csv.CsvFileReader
Added another constructor accepting a Charset as suggested by Maarten van Steenbergen.

org.josef.science.math.CLong
Added a round method to round on tens, hundreds, thousands et cetera.

org.josef.science.math.CDouble
Added a round method to round numbers up.

Release 3.0.9

No changes made that are worth mentioning.

Release 3.0.8

org.josef.science.math.ModuloCheck
Now correctly accepts a Dutch Social Security Number (Burger Service Nummer) of 8 digits. Previously a leading zero digit had to be supplied by the user.

org.josef.util.ZipCodeOfCountry
Added support for a lot more countries. Added a set of countries that do not use zip codes. The valueOf(Iso3166Country) method does not throw an IllegalArgumentException anymore. Instead null is returned for countries that do not use zip codes and UNKNOWN_ZIP_CODE_OF_COUNTRY is returned for a country that does use zip codes, but Josef does not support them yet.

Release 3.0.7

org.josef.finance.UKBankAccountNumber
Solved StringIndexOutOfBoundsException at UKBankAccountNumber's createEightDigitBankAccountNumber method.

Release 3.0.6

org.josef.finance.UKSortCodeRange
Fixed NPE.

org.josef.util.ClassUtil
The isToStringOverridden method now actually checks, using reflection, of the toString() method has been overridden or not. Previously the result of calling toString() was parsed to determine whether toString was overridden.

org.josef.util.ObjectUtil
Added an isEqual(Object, Object) method. In the process some classes were changed to use this new method.

org.josef.finance.UKSortCode
org.josef.finance.UKSortCodeRange
org.josef.finance.UKSortCodeSubstitution
All three classes read a text file using class.getResource. This works fine when Josef is used stand alone but fails when josef is packaged in a jar and this jar in turn is placed in WEB-INF\lib to be part of a larger project. The solution was to use class.getResourceAsStream instead.

org.josef.finance.UKBankAccountNumber
Added a separate public static method to verify the bank account number only. That is to say: without the sort code.

org.josef.util.CEnumeration
In getDescripiton(...), a test is added to determine if the supplied constant is a LocalizableEnumeration. When this is the case, the getCode() method is used on this constant to determine the resource bundle's key, instead of using the name of the enumerated constant.

org.josef.ejbutil.ServiceLocator
Caching the initial context caused problems with rest services. It looked like the portal user was used in the context instead of the user mentioned in the jndi.properties file. Dropping this cache solved the problem. Since this cache is only used for the first lookup, the performance penalty should be minimal.

Release 3.0.5

Added Formatter_en_GB.properties. Since the date pattern for the UK is different from the US. The UK uses dd/MM/yyyy instead of MM/dd/yyyy which is used in the US.

Switched to openjpa version 2.2.1.

org.josef.util.args.CommandLineProcessor
This existing class can be used to process command line arguments in a new way. This class has been revamped totally. The Argument and Arguments classes in the same package are dropped. Reflection made these classes obsolete. Now also handles options taking multiple arguments and verifies that mandatory options contain their mandatory arguments. The javadoc now describes the usage of this class.

org.josef.web.HttpStatus
New utility class that groups HttpStatus codes. Used in REST services for example.

Release 3.0.4

Switched back to using openjpa since other projects depending upon Josef excluded Josef's dependency upon the open jpa libraries.

Release 3.0.3

Now depends upon openjpa-all instead of openjpa. This change was made since other projects depending upon Josef use this artifact as well and this prevents two openjpa libraries to occur in ear files et cetera.

Release 3.0.2

Now depends upon JPA 2.2.1

org.josef.util.Util
Added a new method useDefaultValueWhenValueIsNull(value, defaultValue) that returns the defaultValue when the supplied value is null, otherwise it returns the value. Can be used in situations where the data of one object is copied into another object and you don't want to either clutter your code with lots of if statements or with separate methods for each setter.

assembly/sig.xml
Updated to reflect jxpfw's structure.

Release 3.0.1

org.josef.util.BiDirectionalMap
New class that maps one enumeration to another enumeration and vice versa.

org.josef.util.EnumMapper
New class by Rens, that maps one enumeration to another enumeration and vice versa.

org.josef.web.html
Added a new AbstractHtmlWriter class and a concrete HtmlStringWriter implementation.

org.josef.web.html
Added a new HtmlTag class containing html tag constants to avoid String duplication in classes that generate html.

org.josef.web.html
Added a new HtmlTag class containing html tag constants to avoid String duplication in classes that generate html.

Added a new org.josef.util.xml.XmlReader utility class to read xml data from both a file and an InputStream.

Added a new org.josef.webQueryStringUtil class to process query strings. Use this class to get the query string from a url and to add query string parameters to a url.

Release 3.0.0

This is the first "official" release of Josef for J2EE6. It has been compiled with JDK 1.7 against J2EE6 libraries.

This release uses some JDK 1.7 concepts, like catching multiple exceptions on a single line et cetera.