In this section

Site navigation below

The Code Style site has evolved by gradual refinement and accumulation of features and content. This review is part of a fully backdated site log and archive that sheds light on when, why and how particular features were implemented.

This log is sometimes updated several times per week, sometimes with a long overdue backlog of items. Many log entries refer to the Code Style Java package that delivers the servlet services and utilities used to manage this site.

Subscribe to the news feed for this log: RSS news feed

Reverse chronology

28th September 2004

Modified the server side include file for pages with RSS feeds to use an auto-discovery link format. The inclusion substitutes the path of the relevant page.

<link
  rel="alternate"
  href="/servlets/ParseRSS?url=<!--#echo var="DOCUMENT_URI"-->"
  type="application/rss+xml"
  title="RSS 1.0" />
      

27th September 2004

Added the Code Style Java project build directory to the Ant classpath.

26th September 2004

Added overloaded makeSystemId methods to the NetUtilities class, with file path and File arguments respectively and completed coverage testing. This method is more consistent about sources that are known to be files than the blind validateSysemId method, which also checks that files are readable.

Made the arguments in the doPost method of ParseRSS final, removed an unused import from SiteMap, and trimmed the JavaDoc comments for the makeResult method of ResultMarshaller.

25th September 2004

Modified exception handling in the makeResult method of ResultMarshaller to re-cast any SAXParseException wrapped in a ReportingParseException, to output line and column details in the exception message. Developing a unit test for this case revealed the existing test for handling SAXExceptions was working for the wrong reason; the MockXMLReader class was not found on the Ant classpath. Added the build directory to the classpath to correct this case and created a new MockXMLReaderTest suite to check dynamic class loading.

Created a new MockXMLReaderInvalid class, which always throws a SAXParseException with the parse method to simulate an invalid InputSource. Added a test case to ResultMarshaller to check correct handling of this exception and a Hansel coverage decorator to ReportingParseException to complete testing.

Initial performance of the new XSL transformation result cache appears stable after three days operation. Reduced expiry setting on text/html content types to 6 hours to permit more frequent polling.

ExpiresByType text/html "access plus 6 hours"
      

22th September 2004

Production testing of the ResultValue class identified a distinction between Linux and Windows systems that caused one test case to fail. On Linux systems, interim file length is reported before a FileOutputStream is closed. Removed this case from the ResultValueTest class, which is incidental to cache operation via ResultMarshaller.

Tested and released the version 0.4 build of the Code Style Java project to the production host, including the new XSL transformation result proxy and cache.

21th September 2004

Properly implemented the getRemoteHost method in MockServletRequest, which uses setRemoteAddr to specify the host. Made the cookie- and URL-based session features work independently of each other and adapted the ParseFAQTest cases as necessary.

20th September 2004

Extended the filter method in ServletUtilities to escape high value characters to XHTML entities. Split the low value processing into a private filterLatin1 method, and adopted a switch structure with int constants for cases of double quote, less than, more than and ampersand characters.

Abandoned and removed the encodeURL method from ServletUtilities and unit tests.

19th September 2004

Added an isIndex method to the SiteNode interface and an implementation in Section that always returns false. Reverted to the use of the deprecated encodeUrl method of HttpServletResponse in the SiteMap class to overcome blocks in code coverage testing with final Java reflection classes.

18th September 2004

Implemented the doPost method for the ParseRSS servlet for testing and demonstration purposes. Added the XHTML link types top, start and home to the Document class for use in the SiteMap renderMetadata method.

Added an Ant filter property to include the JTidy package in the JServ wrappers classpath. Added a number of new user agents to the robots.txt exclusion list.

14th September 2004

Updated the parse servlet classes to call the new configureTypes method.

12th September 2004

Processed the latest Code Style font survey results and added a number of new browser releases to the browser look-up table: Opera versions 7.51, 7.52, 7.53 and 7.54; OmniWeb 558.26, Firefox 0.9, 0.9.1 and 0.9.1+, Camino 0.8b and 0.8.1 and Mozilla 1.7.1 and 1.8a2.

Added a number of search engine spiders to the general exclusion list in the site robots.txt file: ASPseek/1.2.10, BruinBot, Gigabot/1.0, Jetbot/1.0, NaverBot-1.0, Nutch, Teleport Pro/1.29 and WeBoX/0.97.

11th September 2004

Added answers for various new FAQ questions:

Cascading Style Sheets

DOM menu customisation

Drop-down menus

Java programming

Java servlet "how to"

Media style sheets

Tomcat configuration

Created a server side include note on activating .htaccess configuration to insert in the Apache custom errors articles.

10th September 2004

Removed a relative URL from the private TestSesssion servlet, which was causing problems with Tomcat. Added four spaces indentation to the SiteMap class before XHTML meta and link elements.

7th September 2004

Re-packaged the mock servlet test classes in org.codestyle.servlet and adjusted imports in the ServletUtilitiesTest class for:

6th September 2004

Corrected the XHTMLtoRSS XSL stylesheet where an rdf:about attribute was being generated instead of rdf:resource in basic transformation mode. Also added the RDF namespace prefix to the rdf:resource attributes in list items for other modes. The unqualified use of rdf:resource has been deprecated.

5th September 2004

Adapted the handleRequest method of the ResultProxy class to catch any IOException getting a new SourceBroker in the getCacheValue method and wrap it in a SourceException, to distinguish cases that occur after the servlet response stream has been committed.

Added a specific test to the ResultCacheTest class for the no argument purge method, and statements to clean up outstanding cache files. Removed the purge calls from the save and load methods of ResultCache because they confuse the purpose and function of the methods and complicate testing unnecessarily. Separate mechanisms must be used to purge the cache as necessary.

Added a new .StackTrace class selector to site style sheets to format paragraphs like preformatted text to allow line wrapping.

4th September 2004

Added statements to the AsbtractSaveSentinel class to extend the thread sleep periods on all instances after completing tests. If any instances run after the tests complete, the Hansel code coverage framework throws an ArrayIndexOutOfBoundsException. Exceptions do not cause the tests to fail but confuse the Ant output with stack traces, e.g.

java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 5 at java.util.Vector.get(Vector.java:694) at org.hansel.ProbeTable.getProbe(ProbeTable.java:138) at org.hansel.ProbeTable.hitB(ProbeTable.java:83) at org.hansel.ProbeTable.hitBranch(ProbeTable.java:87) at org.codestyle.util.AbstractSaveSentinel.run(AbstractSaveSentinel.java:108) at java.lang.Thread.run(Thread.java:479)

Made various debugging modifications to the save method of the ResultCache class and its test suite to isolate this problem, including more detailed checks on the deletion of the cache registry file. Ultimately reinstated the original code after identifying the nature of the Hansel problem.

Added clean-up statements to the AbstractParseServletTest class for outstanding cache files created by the successful getLastModified test.

3rd September 2004

Abandoned all synchronized methods in the ResultCache class and replaced with more focused synchronized statement blocks, which lock on the cache Hashtable. Removed the reset method that was used for testing the former Singleton constructor. Adapted the ResultCacheTest suite to the new multi-instance form and the removed all calls to the reset method.

Made the AbstractSaveSentinel variables concerned with save operations static, since they apply to a single saved resource. All variables concerned with running the save thread are instance variables, since instances are used as the runnable target of the thread and there may be any number of them. The save thread is a daemon, so it dies when an instance is finalised.

Simplified the structure of the public newBroker method of SourceBrokerFactory by dividing it into private newFileBroker and newHttpBroker methods. Adapted SourceBrokerFactoryTest to the newBroker throws IOException cases.

2nd September 2004

Abandoned the Singleton pattern for the ResultCache class, which was becoming increasingly problematic in testing and evidently unnecessary. Changed the boolean instantiated flag to a static int instances counter so that the cache registry is only loaded by the first instance. Also modified the finalize method to decrement the instances counter.

Removed the save thread initialisation block in the ResultCache constructor and made it an instance initialiser block in the AbstractSaveSentinel class. Also changed the File constructor in the save and load methods to the File(File parent, String child) form using the static cacheDir reference.

Simplified save interval assignment in the AbstractSaveSentinel class by using the MINIMUM constant. Added an instance initialiser block to start the save thread, rather than rely on subclasses to implement, as above.

Removed the catch SingletonException block from the AbstractParseServlet getBasicConfig method, since it is no longer thrown by the ResultCache constructor.

1st September 2004

Re-established the prohibition on absolute URL parameters with GET method, that was in the original version of the parse servlets. Applied necessary logic to the individual getCacheKey methods and each class' unit tests.

The new parse servlet test cases required a modification to the MockServletRequest class to test the unlikely case where the getMethod method returns null. Removed initial value assignment from the HTTP method variable so that instances start null. Adapted all clients to assign specific values as necessary.

Complications testing the getLastModified method of AbstractParseServlet via the getCacheValue method of ResultProxy identified the need to pass MalformedURLException cases up the call stack and declare an IOException is thrown by SourceBrokerFactory. Since the newBroker method ensures the HTTP method on all URLs, it is impossible to provoke a MalformedURLException to test how it is handled. The Java URL class only throws MalformedURLException when an unrecognised protocol is specified, and the class is final, so cannot be substituted with a mock object.

Declared the newBroker methods of SourceBrokerFactory to throw an IOException and adapted ResultProxy and AbstractParseServlet to handle this case generically. The ResultProxy getCacheValue method also throws this IOException, which is caught by its handleRequest method and the getLastModified method of AbstractParseServlet. Adapted all clients and test cases to the new scheme.

Previously on Code Style

These backdated pages record detailed changes to the Code Style Web site since July 2000, when development first got underway. Some pages may refer to documents or features that have since changed or are no longer part of the site, but the archive is checked to ensure there are no dead links.

Add this page to your chosen social bookmarking service

Style warning - please read

Home · CSS · Java · Javascript · HTML · Help · Log