Hello all,

I've just prepared a patch to AspellWrapper.java that can be useful even on JVM 1.4 (avoid an error).

I attach the patch (relative to the release 6.05.03) to this post.

Hope to be useful.
--
By MCM.

Index: AspellWrapper.java
===================================================================
--- AspellWrapper.java	(revision 11330)
+++ AspellWrapper.java	(working copy)
@@ -214,15 +214,23 @@
  	**/
  	private String[] prepareEnv()
  	{
- 		// use LD_LIBRARY_PATH if present into environment
+		// Check if the JVM is 1.4.
+ 		// We must perform this test because only in version 1.4 
+        // of the JVM the getEnv() method was deprecated.
  		String retValue[] = null;
- 		String libraryPath = System.getenv("LD_LIBRARY_PATH");
- 		if (libraryPath == null) {
+ 		if (System.getProperty("java.vm.version").startsWith("1.4")) {
+ 			//We run into a 1.4 jvm, so we can't use the environment variables
  			retValue = new String[0];
  		} else {
- 			retValue = new String[1];
- 			retValue[0] = "LD_LIBRARY_PATH=" + libraryPath;
- 		//System.out.println("MCM: Environment variable found: \""+retValue[0]+"\"");
+ 			// use LD_LIBRARY_PATH if present into environment
+ 			String libraryPath = System.getenv("LD_LIBRARY_PATH");
+ 			if (libraryPath == null) {
+ 				retValue = new String[0];
+ 			} else {
+ 				retValue = new String[1];
+ 				retValue[0] = "LD_LIBRARY_PATH=" + libraryPath;
+ 			//System.out.println("MCM: Environment variable found: \""+retValue[0]+"\"");
+ 			}
  		}
  		return retValue;
  	}
********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Reply via email to