Summary

  • Fixed 16Bugs Bug #5: RequestDispatcherMimic forward/include was replacing any HttpSession that was “new” rather than “joined”. This fix includes some potentially “breaking” changes, though these are unlikely to affect normal client code.
  • HttpServletResponseMimic.setStatus(int) now defaults to ignoring the incorrect Javadoc statement in Servlet API versions prior to 3.0 that says that this method clears the response buffer (but a new ServletContainerBehaviour option has also been added to allow explicit control over this).
  • Edition/licence message from ObMimic’s “main” method now shows the licence ID where relevant.
  • JDK 8 added to the JDK API versions that can be configured.
  • Minor improvements and corrections to documentation.
  • Tested against full release of JDK 8.
  • Minor additions to the built-in ObCommon packages.

Fix to RequestDispatcher HttpSession handling

  • See 16Bugs Bug #5 for details and explanation.
  • Breaking change: com.openbrace.obmimic.substate.servlet.http.HttpSessionDetails: Property crossContextSessionId renamed to requiredSessionId, and changes to this now trigger notifications to the class’s listeners.
  • com.openbrace.obmimic.substate.servlet.http.HttpSessionDetails: New method retrieveRequiredSession added.
  • Breaking change: com.openbrace.obmimic.substate.servlet.http.HttpSessionDetails: The populateSession method now obtains the HttpSession from the new retrieveRequiredSession method if a non-null requiredSessionId is present (but still obtains the HttpSession from retrieveRequestedSession if requiredSessionId is null).
  • com.openbrace.obmimic.substate.servlet.http.HttpSessionDetails: String representation returned by toString revised to include the requiredSessionId property and label the various properties.
  • com.openbrace.obmimic.support.servlet.DispatchingUtilities: The changeServletContext methods now skip the detailed context-switching processing if the servlet context is not actually changing (on the basis that this is simpler and safer for this most common case, and avoids some minor but subtle implications of cross-context request dispatching when not actually doing a cross-context dispatch).
  • com.openbrace.obmimic.substate.servlet.http.HttpSessionDetails, com.openbrace.obmimic.support.servlet.DispatchingUtilities, com.openbrace.obmimic.mimic.servlet.RequestDispatcherMimic: All relevant javadoc updated to reflect the above changes, and in particular to cover the renaming and revised usage of the requiredSessionId and the revised behaviour of the HttpSessionDetails.populateSession method.
  • MimicStateSummary.html: Updated to reflect renaming of HttpSessionDetails crossContextSessionId property to requiredSessionId.

Change to HttpServletResponseMimic.setStatus(int) behaviour

  • com.openbrace.obmimic.mimic.http.HttpServletResponseMimic: The setStatus(int) method no longer honours the statement in the Servlet API Javadoc prior to Servlet 3.0 that says that this method “clears the buffer”, which is believed to be a mistake in the Servlet API Javadoc and is no longer present in Servlet 3.0 onwards. However, an option has been introduced into the ServletContainerBehaviour to allow control over this (see below). The HttpServletResponseMimic.setStatus(int) Javadoc has been updated accordingly (including a full explanation). Note that this could potentially break any existing code that depends on this method clearing the response buffer, though in practice it seems highly unlikely that any code would depend on that (presumably incorrect) behaviour.
  • com.openbrace.obmimic.substate.servlet.ServletContainerBehaviour: New property “httpServletResponseSetStatusClearsBuffer” added to control whether the HttpServletResponse.setStatus(int) method should clear the response buffer (as per the statement in its Servlet API Javadoc which is believed to be incorrect) when simulating a Servlet API version prior to Servlet 3.0, with default value of false.

Enhancements for JDK 8 API Support

  • com.openbrace.obmimic.api.JdkApiVersionEnum: Enum value JDK_8_0 added to represent JDK 8.
  • com.openbrace.obmimic.mimic.jdk.security.PrincipalMimic: Class-level Javadoc updated to explain that (at least for the time being) the java.security.Principal interface’s “default” implementation is used for its new “implies” method introduced in JDK 8, instead of explicitly “mimicking” this method.

Other Enhancements and Changes

  • com.openbrace.obmimic.config.ObMimic: ObMimic’s “main” method revised so that its message showing the ObMimic version and edition also shows the licence-key file’s licence ID when a “Professional Edition” or “Enterprise Edition” licence-key file is present.

Other Documentation Changes

  • Support.html: Section on “Enterprise Edition” support revised to match current website facilities (in particular, the proposed secure-download area and contact form have been deferred for the time being and until/unless any “Enterprise Edition” customers actually request these or they prove necessary).
  • README.html: Item added into the “Supported Servlet API Versions” section’s to explain that the MimicListeners facilities introduced in 1.0-beta-10 can be used to override the current throwing of UnsupportedOperationExceptions for Servlet 3.0 and 3.1 methods, and the text that precedes this has been revised to clarify the exceptions currently thrown for unsupported Servlet 3.0 and 3.1 methods (so as to indicate the circumstances under which MimicListeners are relevant).
  • javadoc-overview.html: Paragraph added to cover the support for MimicListeners that was introduced in 1.0-beta-10.
  • com.openbrace.obmimic.mimic.servlet.http.HttpServletMimic Javadoc: Expanded the javadoc of the various doXxxx methods to explain the implications of the inherited HttpServlet implementation where this treats the HTTP method as not supported, including how to override these methods to support the various HTTP methods (and how to maintain the HttpServletMimic’s counts if doing so).
  • MimicStateSummary.html: Fixed ServletContextState “container” property to link to the ServletContainer entry instead of being plain text.
  • MimicStateSummary.html: Fixed “target” of links to Javadoc to be “_blank” rather than “_new”.
  • MimicStateSummary.html and MimicStateSummary.js: Fixed the automatic “expand” of sub-component details when linked to from within the page (separate class attributes mistakenly introduced for “subcomponent-link” and “link-within-page” merged, and javascript revised to locate “subcomponent-link” within multiple class names).
  • MimicStateSummary.js: Enhanced so that any direct link to a particular MimicState within MimicStateSummary.html (via a URL with a fragment identifier for the MimicState) automatically “expands” that MimicState’s details. This allows other documentation to directly reference an individual MimicState within MimicStateSummary.html, and following the link then shows the expanded details rather than just the title and an “expand” button.
  • FAQ.html: Fixed a broken link to the Listeners.html how-to guide.
  • FAQ.html: JDK 8 tested against is now the final JDK 8 release rather than an early-access release.
  • EnableProEnt.html “How To”: Minor clarification of wording re ObMimic version numbers and trial/evaluation licences.
  • All pages: Relative link to the respond.min.js script for MSIE versions prior to MSIE 9 has been fixed (superfluous leading “/” removed).
  • EnableProEnt.html: Explanation of the message produced by ObMimic’s “main” method has been updated to reflect the revised message (which now includes the licence ID where applicable).
  • The documentation’s previous built-in images/favicon.ico has been replaced with a revised set of icon files to match the latest OpenBrace website changes (improved favicon image plus improved support for Apple/Android/Win8-specific icons, in particular for use in the copy of this documentation that is built into the OpenBrace website).

Other Changes to Built-In ObCommon Packages

  • Version updated to ObCommon 1.0.000
  • com.openbrace.obcommon.lang.StringUtilities: Methods lengthInUnicodeCodePoints and truncate added for determining length of a string in Unicode code points and for truncating strings to a specified maximum length in Unicode code points.
  • com.openbrace.obcommon.lang.StringUtilities: Public constants MILLIS_IN_SECOND, SECONDS_IN_MINUTE, MINUTES_IN_HOUR, HOURS_IN_DAY, MILLIS_IN_MINUTE, MILLIS_IN_HOUR, MILLIS_IN_DAY added for use throughout ObCommon and ObMimic in place of the various individual values previously used.
  • com.openbrace.obcommon.test.TestCaseUtilities: Method generateExampleStringOfSpecifiedLength added for use in testing.
  • com.openbrace.obcommon.security.DigitalSignature: Method getSignatureAsPropertyFileTextLines added, together with a supporting SIGNATURE_CHARS_PER_PROPERTY_LINE public constant.
  • com.openbrace.obcommon.text.TextUtilities: Method wrapObjectToStringWithQuotes added for use in testing.

Enterprise Edition Changes

  • com.openbrace.obmimic.body.http.HttpServletResponseBodyPre30: Implementation of setStatus(int) revised to match the revised HttpServletResponseMimic Javadoc (response buffer is now cleared only if Servlet API version is prior to 3.0 and the relevant ServletContainerBehaviour’s new “httpServletResponseSetStatusClearsBuffer” property is true).
  • com.openbrace.obmimic.substate.servlet.http.HttpSessionDetailsTest, com.openbrace.obmimic.support.servlet.DispatchingUtilitiesTest, com.openbrace.obmimic.mimic.servlet.RequestDispatcherBodyTest, com.openbrace.obmimic.state.servlet.http.HttpServletResponseStateTest, com.openbrace.obmimic.mimic.servlet.RequestDispatchingOverallTest, com.openbrace.obmimic.mimic.servlet.RequestDispatchingExample1OuterServlet, com.openbrace.obmimic.mimic.servlet.RequestDispatchingExample1ForwardTargetServlet, com.openbrace.obmimic.mimic.servlet.RequestDispatchingExample1IncludeTargetServlet: Test cases revised for the various changes and altered behaviour introduced by the fixes for 16Bugs Bug #5 (as above), plus further enhancements to tests to ensure that they would have detected the original bug (and more generally now provide a more complete check on the identify and content of HttpSessions during request dispatching).
  • build.properties: New property “obmimic.release.shortname” introduced to provide a variant of the ObMimic version identifier that for non-beta versions excludes the final “.nnn” “fix/patch level’ part of the version identifier. This is then used in the default value for the Javadoc’s main title/heading instead of using the full version identifier (whilst is still used in the default value for the Javadoc’s window title, header and footer).
  • com.openbrace.obmimic.mimic.servlet.ServletContextMimicTest, com.openbrace.obmimic.mimic.servlet.ServletRequestMimicTest, com.openbrace.obmimic.mimic.servlet.ServletResponseMimicTest, com.openbrace.obmimic.mimic.servlet.ServletInputStreamMimicTest, com.openbrace.obmimic.mimic.servlet.ServletOutputStreamMimicTest, com.openbrace.obmimic.mimic.servlet.http.HttpServletRequestMimicTest, com.openbrace.obmimic.mimic.servlet.http.HttpServletResponseMimicTest: New tests added to prove/demonstrate that the MimicListeners facilities introduced in 1.0-beta-10 can be used on these mimic classes to override their usual throwing of UnsupportedOperationException from Servlet 3.x methods that are not yet supported.
  • com.openbrace.obmimic.mimic.servlet.http.HttpServletMimic: Fixed the implementations of the doXxxx methods so that they do now increment their respective counts prior to calling the inherited implementation where this is specified by their Javadoc.
  • com.openbrace.obmimic.core.AbstractMimicState: Comparator used within sortIntoLockOrder method now returns -1 or +1 rather than Integer.MIN_VALUE (which can’t be negated) and Integer.MAX_VALUE.
  • com.openbrace.obmimic.state.servlet.ServletOutputStreamState, com.openbrace.obmimic.state.servlet.ServletRequestState: Removed a couple of unnecessary unboxing and immediate re-boxing of integer values.
  • com.openbrace.obcommon.test.InvalidEqualsObject: Minor code refactoring to avoid direct updating of a static field during instance construction.
  • com.openbrace.obmimic.support.servlet.http.HttpFirstLineTest, com.openbrace.obmimic.core.MimicInvocationHandlerTest, com.openbrace.obmimic.wrappers.servlet.WrapperUtilitiesTest: Eliminated various dead code and dead stores from test code.
  • com.openbrace.obmimic.config.ObMimicInstallationTestHelper: The createFile method now explicitly writes files using US-ASCII encoding, and checks that its input is suitable for this.
  • com.openbrace.obmimic.taglet.ApiAmbigiuityTagletTest, com.openbrace.obmimic.substate.servlet.ServletLogTest, com.openbrace.obcommon.io.FileReadableResourceTest, com.openbrace.obcommon.io.URLReadableResourceTest, com.openbrace.obcommon.security.TestHelperKeyStore, com.openbrace.obcommon.io.IOUtilitiesTest: All PrintWriters, PrintStreams, OutputStreamWriters etc have been revised to explicitly specify the encoding to be used (generally US-ASCII), and checking of the expected strings against their output has similarly been revised to explicitly specify the matching encoding.
  • README.html: JDK 8 tested against is now the final JDK 8 release rather than an early-access release.
  • com.openbrace.obcommon.core.LoggingUtilities: Calls to Logger.logrb within logThrow and logCatch now explicitly cast their resource-bundle name argument to a String, so as to disambiguate these calls on JDK 8 which has introduced a new logrb overload that takes a ResourceBundle in place of this String. In addition, the deprecation warnings that would result on JDK 8 from this use of the older string-based variant of the logrb method are suppressed.
  • The newly-added com.openbrace.obcommon.lang.StringUtilities constants are now used for any time-unit conversions instead of the various individual values previously used.
  • com.openbrace.obmimic.config.Messages.properties: To support the revised message from ObMimic’s “main” method, the VERSION_AND_LICENCE_MESSAGE message has been renamed to VERSION_AND_EDITION_MESSAGE (and a new VERSION_EDITION_AND_LICENCE_MESSAGE message added alongside it.
  • Various other test-case classes added and updated to match all of the other changes documented above.