From 02a2c23bd31397036cee5f8e5122311a590b7dec Mon Sep 17 00:00:00 2001 From: Johann Werner Date: Mon, 9 Jul 2012 23:31:48 +0200 Subject: [PATCH 1/6] remove checks for WO54 and reflection for pre WO54 APIs --- .../er/directtoweb/ERD2WDirectAction.java | 10 +-- .../extensions/appserver/ERXApplication.java | 67 +++---------------- .../appserver/ERXResourceManager.java | 3 +- .../appserver/ERXSecureDefaultAdaptor.java | 8 +-- .../er/extensions/appserver/ERXSession.java | 36 ++-------- .../er/extensions/appserver/ERXWOContext.java | 30 +++------ .../extensions/appserver/ERXWOContext54.java | 12 ++-- .../appserver/ERXWOServletContext.java | 25 +++---- .../appserver/ERXWOServletContext54.java | 16 +---- .../extensions/components/ERXDynamicURL.java | 20 ++---- .../components/_private/ERXHyperlink.java | 24 ++----- .../components/_private/ERXSubmitButton.java | 18 +---- .../components/_private/ERXWOFileUpload.java | 5 ++ .../components/_private/ERXWOText.java | 3 + .../javascript/ERXJSValidationErrors.java | 8 +-- .../er/extensions/eof/ERXModelGroup.java | 14 +--- .../er/extensions/foundation/ERXPatcher.java | 10 +-- .../statistics/ERXStatisticsStore.java | 14 ++-- .../Sources/ognl/webobjects/WOOgnl.java | 35 +--------- .../Sources/er/openid/EROpenIDManager.java | 35 ++-------- 20 files changed, 82 insertions(+), 311 deletions(-) diff --git a/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/ERD2WDirectAction.java b/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/ERD2WDirectAction.java index 98e4d1a380d..4abf7788fdb 100644 --- a/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/ERD2WDirectAction.java +++ b/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/ERD2WDirectAction.java @@ -241,14 +241,8 @@ public NSDictionary primaryKeyFromRequest(EOEditingContext ec, String entityName public WOComponent previousPageFromRequest() { String cid = context().request().stringFormValueForKey(contextIDKey); - if(cid == null) return context().page(); - WOComponent comp = session().restorePageForContextID(cid); - // (ak) we need to put the component to sleep again - // Michael Bushkov: WO5.4.3 tracks all awakened components so no need to call this manually - if(comp != null && !ERXApplication.isWO54()) { - comp._sleepInContext(comp.context()); - } - return comp; + if (cid == null) return context().page(); + return session().restorePageForContextID(cid); } public String keyPathFromRequest() { diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java index 8fca86961b1..a50d182b66b 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java @@ -160,9 +160,6 @@ * @property er.extensions.ERXApplication.allowMultipleDevInstances */ public abstract class ERXApplication extends ERXAjaxApplication implements ERXGracefulShutdown.GracefulApplication { - - private static Boolean isWO54 = null; - /** logging support */ public static final Logger log = Logger.getLogger(ERXApplication.class); @@ -490,10 +487,7 @@ else if (fixedJar.matches(projectPattern) || fixedJar.matches(".*?/erfoundation. jarLibs += jar + File.pathSeparator; } String bundle = jar.replaceAll(".*?[/\\\\](\\w+)\\.framework.*", "$1"); - String excludes = "(JavaVM)"; - if (isWO54()) { - excludes = "(JavaVM|JavaWebServicesSupport|JavaEODistribution|JavaWebServicesGeneration|JavaWebServicesClient)"; - } + String excludes = "(JavaVM|JavaWebServicesSupport|JavaEODistribution|JavaWebServicesGeneration|JavaWebServicesClient)"; if (bundle.matches("^\\w+$") && !bundle.matches(excludes)) { String info = jar.replaceAll("(.*?[/\\\\]\\w+\\.framework/Resources/).*", "$1Info.plist"); if (new File(info).exists()) { @@ -649,9 +643,6 @@ private NSBundle mainBundle() { * * @param n */ - - - public void bundleDidLoad(NSNotification n) { NSBundle bundle = (NSBundle) n.object(); if (allFrameworks.contains(bundle.name())) { @@ -1048,19 +1039,6 @@ public static void setup(String[] argv) { ClassLoader loader = AppClassLoader.getAppClassLoader(); Thread.currentThread().setContextClassLoader(loader); } - if (!ERXApplication.isWO54()) { - Class arrayClass = NSMutableArray.class; - try { - Field f = arrayClass.getField("ERX_MARKER"); - } - catch (NoSuchFieldException e) { - System.err.println("No ERX_MARKER field in NSMutableArray found. \nThis means your class path is incorrect. Adjust it so that ERExtensions come before JavaFoundation."); - System.exit(1); - } - catch (Exception e) { - e.printStackTrace(); - } - } ERXConfigurationManager.defaultManager().setCommandLineArguments(argv); ERXFrameworkPrincipal.setUpFrameworkPrincipalClass(ERXExtensions.class); // NSPropertiesCoordinator.loadProperties(); @@ -1076,19 +1054,10 @@ public static void setup(String[] argv) { public void installPatches() { ERXPatcher.installPatches(); if (contextClassName().equals("WOContext")) { - if (ERXApplication.isWO54()) { - setContextClassName("ERXWOContext54"); - } - else { - setContextClassName(ERXWOContext.class.getName()); - } + setContextClassName(ERXWOContext.class.getName()); } if (contextClassName().equals("WOServletContext") || contextClassName().equals("com.webobjects.jspservlet.WOServletContext")) { - if (ERXApplication.isWO54()) { - setContextClassName("ERXWOServletContext54"); - } else { - setContextClassName(ERXWOServletContext.class.getName()); - } + setContextClassName(ERXWOServletContext.class.getName()); } ERXPatcher.setClassForName(ERXWOForm.class, "WOForm"); @@ -1112,20 +1081,7 @@ public void installPatches() { // Fix for 3190479 URI encoding should always be UTF8 // See http://www.w3.org/International/O-URL-code.html - // For WO 5.1.x users, please comment this statement to compile. com.webobjects.appserver._private.WOURLEncoder.WO_URL_ENCODING = CharEncoding.UTF_8; - - // WO 5.1 specific patches - if (ERXProperties.webObjectsVersionAsDouble() < 5.2d) { - // ERXWOText contains a patch for WOText to not include the value - // attribute (#2948062). Fixed in WO 5.2 - ERXPatcher.setClassForName(ERXWOText.class, "WOText"); - - } - // ERXWOFileUpload returns a better warning than throwing a - // ClassCastException. - // Fixed in WO 5.2 - // ERXPatcher.setClassForName(ERXWOFileUpload.class, "WOFileUpload"); } @Override @@ -2286,18 +2242,11 @@ public boolean useSessionStoreDeadlockDetection() { * Returns true if this app is running in WO 5.4. * * @return true if this app is running in WO 5.4 + * @deprecated Wonder is used with WO 5.4 only */ + @Deprecated public static boolean isWO54() { - if (ERXApplication.isWO54 == null) { - try { - Method getWebObjectsVersionMethod = WOApplication.class.getMethod("getWebObjectsVersion", new Class[0]); - ERXApplication.isWO54 = Boolean.TRUE; - } - catch (Exception e) { - ERXApplication.isWO54 = Boolean.FALSE; - } - } - return ERXApplication.isWO54.booleanValue(); + return true; } /** @@ -2863,7 +2812,7 @@ public void setDebugEnabledForComponent(boolean debugEnabled, String componentNa * Returns whether or not binding debugging is enabled for the given component * * @param componentName the component name - * @return whether or not binding debugging is enabled for the given componen + * @return whether or not binding debugging is enabled for the given component */ public boolean debugEnabledForComponent(String componentName) { return _debugComponents.containsObject(componentName); @@ -2881,7 +2830,7 @@ public void clearDebugEnabledForAllComponents() { * @return the request handler key for ajax. */ public static String erAjaxRequestHandlerKey() { - return ERXApplication.isWO54() ? "ja": "ajax"; + return "ja"; } /** diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXResourceManager.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXResourceManager.java index 7b159f0c99a..5e353939ec1 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXResourceManager.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXResourceManager.java @@ -172,8 +172,7 @@ public String urlForResourceNamed(String name, String bundleName, NSArray nsdictio _action = _associations.removeObjectForKey("action"); _actionClass = _associations.removeObjectForKey("actionClass"); _directActionName = _associations.removeObjectForKey("directActionName"); - - // hack for 5.4 - if (ERXApplication.isWO54()) { - _class = (WOAssociation) nsdictionary.valueForKey("class"); - } - else { - _class = _associations.removeObjectForKey("class"); - } - - // hack for 5.4 - if (ERXApplication.isWO54()) { - _id = (WOAssociation) nsdictionary.valueForKey("id"); - } - else { - _id = _associations.removeObjectForKey("id"); - } + _class = (WOAssociation) nsdictionary.valueForKey("class"); + _id = (WOAssociation) nsdictionary.valueForKey("id"); if(_action != null && _action.isValueConstant()) throw new WODynamicElementCreationException("<" + getClass().getName() + ">'action' is a constant."); diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXWOFileUpload.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXWOFileUpload.java index 8e4b17628d8..f71c7c4290d 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXWOFileUpload.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXWOFileUpload.java @@ -7,6 +7,7 @@ import com.webobjects.appserver.WORequest; import com.webobjects.appserver.WOResponse; import com.webobjects.appserver._private.WODynamicElementCreationException; +import com.webobjects.appserver._private.WOFileUpload; import com.webobjects.foundation.NSDictionary; import er.extensions.appserver.ERXBrowserFactory; @@ -21,7 +22,11 @@ * * * @author ak on Wed Oct 09 2002 + * @project ERExtensions + * @deprecated use {@link WOFileUpload} as parent class */ +// CHECKME is that class obsolete as the cause of its presence was a bug fixed in WO 5.2 or should some logic be maintained? +@Deprecated public class ERXWOFileUpload extends com.webobjects.appserver._private.WOFileUpload { /** logging support */ diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXWOText.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXWOText.java index e30d1c587fd..87952183734 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXWOText.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXWOText.java @@ -13,7 +13,10 @@ * But use WOText instead. * * @author ak on Tue Oct 15 2002 + * @project ERExtensions + * @deprecated use {@link ERXPatcher.DynamicElementsPatches.Text} as parent class instead */ +@Deprecated public class ERXWOText extends ERXPatcher.DynamicElementsPatches.Text { /** * Public constructor diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/javascript/ERXJSValidationErrors.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/javascript/ERXJSValidationErrors.java index 18e9692e80a..a668ac27be6 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/javascript/ERXJSValidationErrors.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/javascript/ERXJSValidationErrors.java @@ -98,14 +98,8 @@ public void awake() { } catch (NSValidation.ValidationException ex1) { _errors = ex1.getMessage(); } finally { - if(eo != null && eo.editingContext() != null) + if (eo != null && eo.editingContext() != null) { eo.editingContext().unlock(); - if(page != null) { - // we cheat here because calling sleep() is not enough... - // Michael Bushkov: WO5.4.3 tracks all awakened components so no need to call this manually - if (!ERXApplication.isWO54()) { - page._sleepInContext(page.context()); - } } } } diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXModelGroup.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXModelGroup.java index c3d51bb6f00..dea82fd02df 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXModelGroup.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXModelGroup.java @@ -1244,7 +1244,7 @@ else if (attribute.prototype().entity() == prototypeEntity) { } } - private static final NSArray _prototypeKeys = new NSArray(new Object[] { "externalType", "columnName", "readOnly", ERXApplication.isWO54()?"className":"valueClassName", "valueType", "width", "precision", "scale", "writeFormat", "readFormat", "userInfo", "serverTimeZone", "valueFactoryMethodName", "adaptorValueConversionMethodName", "factoryMethodArgumentType", "allowsNull", "parameterDirection", "_internalInfo" }); + private static final NSArray _prototypeKeys = new NSArray(new Object[] { "externalType", "columnName", "readOnly", "className", "valueType", "width", "precision", "scale", "writeFormat", "readFormat", "userInfo", "serverTimeZone", "valueFactoryMethodName", "adaptorValueConversionMethodName", "factoryMethodArgumentType", "allowsNull", "parameterDirection", "_internalInfo" }); public static NSArray _prototypeKeys() { return _prototypeKeys; @@ -1259,18 +1259,6 @@ public static int _enumForKey(String key) { } public static boolean _isKeyEnumOverriden(EOAttribute att, int key) { - if (!ERXApplication.isWO54()) { - // 5.4 - API changed - try { - Method isKeyEnumOverriddenMethod = att.getClass().getMethod("_isKeyEnumOverriden", new Class[] { int.class }); - Boolean isKeyEnumOverridden = (Boolean)isKeyEnumOverriddenMethod.invoke(att, new Object[] { Integer.valueOf(key) }); - return isKeyEnumOverridden.booleanValue(); - } - catch (Exception e) { - throw new RuntimeException("_isKeyEnumOverridden failed.", e); - } - } - boolean result = false; if(att.prototype() != null) { Map characteristics = (Map) NSKeyValueCoding.Utility.valueForKey(att, "overwrittenCharacteristics"); diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXPatcher.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXPatcher.java index 6c315b72fc3..f51b478e526 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXPatcher.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXPatcher.java @@ -128,9 +128,6 @@ public static synchronized void installPatches() { if (ERXProperties.booleanForKeyWithDefault("er.extensions.WOSwitchComponent.patch", true)) { ERXPatcher.setClassForName(ERXSwitchComponent.class, "WOSwitchComponent"); } - if (!ERXApplication.isWO54() || ERXProperties.booleanForKey("er.extensions.WOConditional.patch")) { - ERXPatcher.setClassForName(ERXWOConditional.class, "WOConditional"); - } // RM XHTML strict compliance ERXPatcher.setClassForName(DynamicElementsPatches.JavaScript.class, "WOJavaScript"); @@ -311,18 +308,13 @@ public void appendToResponse(WOResponse woresponse, WOContext wocontext) { } } - // WO 5.4: 5.4 returns false for this - protected boolean hasContent() { - return !ERXApplication.isWO54(); - } - // WO 5.4: 5.4 already does this, but for 5.3, if you want to use WOImage's with // PDF generation, you need XHTML output protected void _appendOpenTagToResponse(WOResponse response, WOContext context) { response.appendContentCharacter('<'); response.appendContentString(elementName()); appendAttributesToResponse(response, context); - if(!hasContent() || ERXResponse.isXHTML(response)) { + if(!hasContent() || ERXResponse.isXHTML(response)) { // CHECKME do we need to check isXHTML? response.appendContentString(" /"); } response.appendContentCharacter('>'); diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/statistics/ERXStatisticsStore.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/statistics/ERXStatisticsStore.java index de28f0be5ce..67ce565897b 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/statistics/ERXStatisticsStore.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/statistics/ERXStatisticsStore.java @@ -327,15 +327,13 @@ private Map getCurrentThreadNames(Set keySet) { public NSDictionary statistics() { NSDictionary stats = super.statistics(); - if (ERXApplication.isWO54()) { - NSMutableDictionary fixed = stats.mutableClone(); - for (Enumeration enumerator = stats.keyEnumerator(); enumerator.hasMoreElements();) { - Object key = enumerator.nextElement(); - Object value = stats.objectForKey(key); - fixed.setObjectForKey(fix(value), key); - } - stats = fixed; + NSMutableDictionary fixed = stats.mutableClone(); + for (Enumeration enumerator = stats.keyEnumerator(); enumerator.hasMoreElements();) { + Object key = enumerator.nextElement(); + Object value = stats.objectForKey(key); + fixed.setObjectForKey(fix(value), key); } + stats = fixed; return stats; } diff --git a/Frameworks/Core/WOOgnl/Sources/ognl/webobjects/WOOgnl.java b/Frameworks/Core/WOOgnl/Sources/ognl/webobjects/WOOgnl.java index 22edde60a1e..1d048631c37 100644 --- a/Frameworks/Core/WOOgnl/Sources/ognl/webobjects/WOOgnl.java +++ b/Frameworks/Core/WOOgnl/Sources/ognl/webobjects/WOOgnl.java @@ -26,6 +26,7 @@ import com.webobjects.appserver._private.WOBindingNameAssociation; import com.webobjects.appserver._private.WOConstantValueAssociation; import com.webobjects.appserver._private.WOKeyValueAssociation; +import com.webobjects.appserver.parser.WOComponentTemplateParser; import com.webobjects.foundation.NSArray; import com.webobjects.foundation.NSDictionary; import com.webobjects.foundation.NSMutableArray; @@ -126,19 +127,6 @@ public Hashtable newDefaultContext() { return h; } - // Borrowed from ERXApplication, but we can't depend on ERX - private boolean isWO54() { - boolean isWO54; - try { - WOApplication.class.getMethod("getWebObjectsVersion", new Class[0]); - isWO54 = true; - } - catch (Exception e) { - isWO54 = false; - } - return isWO54; - } - public void configureWOForOgnl() { // Configure runtime. // Configure foundation classes. @@ -152,25 +140,8 @@ public void configureWOForOgnl() { OgnlRuntime.setElementsAccessor(NSSet.class, e); // Register template parser if (hasProperty("ognl.active", "true")) { - String parserClassName; - if (isWO54()) { - parserClassName = System.getProperty("ognl.parserClassName", "ognl.helperfunction.WOHelperFunctionParser54"); - try { - Class.forName("com.webobjects.appserver.parser.WOComponentTemplateParser").getMethod("setWOHTMLTemplateParserClassName", String.class).invoke(null, parserClassName); - } - catch (Exception e1) { - throw new RuntimeException("Failed to set the template parser to WOHelperFunctionParser54.", e1); - } - } - else { - parserClassName = System.getProperty("ognl.parserClassName", "ognl.helperfunction.WOHelperFunctionParser53"); - try { - Class.forName("com.webobjects.appserver._private.WOParser").getMethod("setWOHTMLTemplateParserClassName", String.class).invoke(null, parserClassName); - } - catch (Exception e1) { - throw new RuntimeException("Failed to set the template parser to WOHelperFunctionParser53.", e1); - } - } + String parserClassName = System.getProperty("ognl.parserClassName", "ognl.helperfunction.WOHelperFunctionParser54"); + WOComponentTemplateParser.setWOHTMLTemplateParserClassName(parserClassName); if (hasProperty("ognl.inlineBindings", "false")) { WOHelperFunctionTagRegistry.setAllowInlineBindings(true); } diff --git a/Frameworks/Misc/EROpenID/Sources/er/openid/EROpenIDManager.java b/Frameworks/Misc/EROpenID/Sources/er/openid/EROpenIDManager.java index f51b9800488..39ade054264 100644 --- a/Frameworks/Misc/EROpenID/Sources/er/openid/EROpenIDManager.java +++ b/Frameworks/Misc/EROpenID/Sources/er/openid/EROpenIDManager.java @@ -147,37 +147,10 @@ public void responseReceived(VerificationResult verification, EROResponse eroRes public String returnToUrl(WORequest request, WOContext context) { String returnToUrl; boolean requireSecureReturnURL = ERXProperties.booleanForKeyWithDefault("er.openid.requireSecureReturnURL", true); - if (ERXApplication.isWO54()) { - try { - if (requireSecureReturnURL) { - Method directActionURLForActionNamedMethod = context.getClass().getMethod("directActionURLForActionNamed", new Class[] { String.class, NSDictionary.class, boolean.class, boolean.class }); - returnToUrl = (String) directActionURLForActionNamedMethod.invoke(context, new Object[] { "ERODirectAction/openIDResponse", null, Boolean.TRUE, Boolean.TRUE }); - } - else { - returnToUrl = context.directActionURLForActionNamed("ERODirectAction/openIDResponse", new NSDictionary()); - } - } - catch (Exception e) { - throw new RuntimeException("directActionURLForActionNamed failed.", e); - } - } - else { - context.generateCompleteURLs(); - try { - if (requireSecureReturnURL) { - Method _directActionURLMethod = context.getClass().getMethod("_directActionURL", new Class[] { String.class, NSDictionary.class, boolean.class }); - returnToUrl = (String) _directActionURLMethod.invoke(context, new Object[] { "ERODirectAction/openIDResponse", null, Boolean.TRUE }); - } - else { - returnToUrl = context.directActionURLForActionNamed("ERODirectAction/openIDResponse", new NSDictionary()); - } - } - catch (Exception e) { - throw new RuntimeException("_directActionURL failed.", e); - } - finally { - context.generateRelativeURLs(); - } + if (requireSecureReturnURL) { + returnToUrl = context.directActionURLForActionNamed("ERODirectAction/openIDResponse", null, true, true); + } else { + returnToUrl = context.directActionURLForActionNamed("ERODirectAction/openIDResponse", NSDictionary.EmptyDictionary); } EROpenIDManager.log.debug("Return to URL: " + returnToUrl); return returnToUrl; From 4e3a2010f60e8f122fa70f08d8c8ff361af50cdf Mon Sep 17 00:00:00 2001 From: Johann Werner Date: Wed, 22 Aug 2012 00:13:17 +0200 Subject: [PATCH 2/6] remove or deprecate methods that are for pre WO 5.4.3 --- .../Sources/er/directtoweb/ERD2WModel.java | 13 --- .../Sources/er/extensions/ERXExtensions.java | 94 ------------------- .../extensions/appserver/ERXApplication.java | 1 + .../ERXDirectActionRequestHandler.java | 3 +- .../er/extensions/appserver/ERXResponse.java | 17 ---- .../extensions/eof/ERXEOControlUtilities.java | 6 -- .../extensions/foundation/ERXProperties.java | 8 ++ 7 files changed, 11 insertions(+), 131 deletions(-) diff --git a/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/ERD2WModel.java b/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/ERD2WModel.java index 5e1f30c1c0f..0c137151a74 100644 --- a/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/ERD2WModel.java +++ b/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/ERD2WModel.java @@ -741,19 +741,6 @@ protected void uniqueQualifiers(NSArray rules) { } } - //AK: this is probably never called in WO > 5.2 - public Vector modelFilesInBundles () { - Vector modelFiles = super.modelFilesInBundles(); - if (!_hasAddedExtraModelFiles) { - NSArray additionalModelURLs = additionalModelURLs(); - for (URL url : additionalModelURLs) { - modelFiles.add(url.getFile()); - } - _hasAddedExtraModelFiles = true; - } - return modelFiles; - } - private boolean _hasAddedExtraModelFiles=false; /** diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/ERXExtensions.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/ERXExtensions.java index fdcfff418fa..74ca240718e 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/ERXExtensions.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/ERXExtensions.java @@ -376,33 +376,6 @@ public void configureAdaptorContext(NSNotification n) { ERXExtensions.configureAdaptorContext(); } - /** - * This method is called every time a session times - * out. It allows us to release references to all the - * editing contexts that were created when that particular - * session was active. - * Not used in WO 5.2+ - * @param n notification that contains the session ID. - * @deprecated not needed anymore in WO 5.4 - */ - @Deprecated - public void sessionDidTimeOut(NSNotification n) { - String sessionID=(String)n.object(); - ERXExtensions.sessionDidTimeOut(sessionID); - } - - /** - * This is needed for WO pre-5.2 when ec's were not - * retained by their eos. Not called in 5.2+ systems. - * @param n notification posted when an ec is created - * @deprecated not needed anymore in WO 5.4 - */ - @Deprecated - public void editingContextDidCreate(NSNotification n) { - EOEditingContext ec = (EOEditingContext)n.object(); - ERXExtensions.retainEditingContextForCurrentSession(ec); - } - /** * This method is called for the following notification * {@link EOSharedEditingContext#DefaultSharedEditingContextWasInitializedNotification} @@ -517,73 +490,6 @@ public static void setAdaptorLogging(boolean onOff) { adaptorEnabled = targetState; } - /** - * Retaining the editing contexts explicitly until the session that was active - * when they were created goes away - * this hopefully will go some way towards avoiding the 'attempted to send' - * message to EO whose EditingContext is gone. Only used in pre-5.2 systems. - */ - @Deprecated - private static NSMutableDictionary _editingContextsPerSession; - - /** - * This method is called when a session times out. - * Calling this method will release references to - * all editing contexts that were created when this - * session was active. This method is only called in - * pre-WO 5.2 versions of WebObjects. - * @param sessionID of the session that timed out - * @deprecated not needed anymore in WO 5.4 - */ - @Deprecated - public static void sessionDidTimeOut(String sessionID) { - if (sessionID != null) { - if (_editingContextsPerSession != null) { - if (_log.isDebugEnabled()) { - NSArray a=(NSArray)_editingContextsPerSession.objectForKey(sessionID); - _log.debug("Session "+sessionID+" is timing out "); - _log.debug("Found "+ ((a == null) ? 0 : a.count()) + " editing context(s)"); - } - NSArray ecs = (NSArray)_editingContextsPerSession.removeObjectForKey(sessionID); - // Just helping things along. - if (ecs != null && ecs.count() > 0) { - for (Enumeration ecEnumerator = ecs.objectEnumerator(); ecEnumerator.hasMoreElements();) { - ((EOEditingContext)ecEnumerator.nextElement()).dispose(); - } - } - } - } - } - - /** - * Retains an editing context for the current session. This is only needed or - * used for versions of WO pre-5.2. If you use ERXEC to create your editing - * contexts then you never need to call this method yourself. - * @param ec to be retained. - * @deprecated not needed anymore in WO 5.4 - */ - @Deprecated - public static void retainEditingContextForCurrentSession(EOEditingContext ec) { - WOSession s= ERXSession.session(); - if (s != null) { - if (_editingContextsPerSession == null) { - _editingContextsPerSession = new NSMutableDictionary(); - } - NSMutableArray a = (NSMutableArray)_editingContextsPerSession.objectForKey(s.sessionID()); - if (a == null) { - a = new NSMutableArray(); - _editingContextsPerSession.setObjectForKey(a, s.sessionID()); - if (_log.isDebugEnabled()) - _log.debug("Creating array for "+s.sessionID()); - } - a.addObject(ec); - if (_log.isDebugEnabled()) - _log.debug("Added new ec to array for "+s.sessionID()); - } else if (_log.isDebugEnabled()) { - _log.debug("Editing Context created with null session."); - } - } - /** * Removes all of the HTML tags from a given string. * Note: this is a very simplistic implementation diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java index a50d182b66b..f103c9d73bc 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java @@ -1806,6 +1806,7 @@ public WOResponse reportException(Throwable exception, WOContext context, NSDict */ // NOTE: if you use WO 5.1, comment out this method, otherwise it won't // compile. + // CHECKME this was created for WO 5.2, do we still need this for 5.4.3? @Override public WOResponse handleActionRequestError(WORequest aRequest, Exception exception, String reason, WORequestHandler aHandler, String actionClassName, String actionName, Class actionClass, WOAction actionInstance) { WOContext context = actionInstance != null ? actionInstance.context() : null; diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXDirectActionRequestHandler.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXDirectActionRequestHandler.java index 65d4acc707b..d4d527797d1 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXDirectActionRequestHandler.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXDirectActionRequestHandler.java @@ -76,6 +76,7 @@ public WOResponse handleRequest(WORequest request) { if (ERXWOResponseCache.sharedInstance().isEnabled()) { try { // Caching scheme for 5.2 applications. Will uncomment once we are building 5.2 only ERExtensions + // CHECKME Object[] actionClassAndName = getRequestActionClassAndNameForPath(getRequestHandlerPathForRequest(request)); //Object[] actionClassAndName = null; if (actionClassAndName != null && actionClassAndName.length == 3) { @@ -110,7 +111,7 @@ public WOResponse handleRequest(WORequest request) { if (app.sessionStore().restoreSessionWithID(request.sessionID(), request) == null) { response = generateRequestRefusal(request); // AK: should be a permanent redirect, as the session is gone for good. - // However, the adaptor checks explictely on 302 so we return that... + // However, the adaptor checks explicitly on 302 so we return that... // It shouldn't matter which instance we go to now. response.setStatus(302); } diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXResponse.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXResponse.java index 3d3b3a440fa..13d44ec20c5 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXResponse.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXResponse.java @@ -205,23 +205,6 @@ public static ERXResponse popPartial() { return response; } - /** - * The original _appendTagAttributeAndValue would skip null values, but not - * blank values, which would produce html like <div style = "">. This - * implementation also skips blank values. - * - * @param name attribute name - * @param value attribute value - * @param escape true if value should be escaped - */ - // REMOVEME as of WO5.4.3 this seems not necessary anymore - @Override - public void _appendTagAttributeAndValue(String name, String value, boolean escape) { - if (value != null) { - super._appendTagAttributeAndValue(name, value, escape); - } - } - /** * Overridden to not call super if trying to download an attachment * to IE. diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXEOControlUtilities.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXEOControlUtilities.java index 5e3525fa2d0..c83e460b707 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXEOControlUtilities.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXEOControlUtilities.java @@ -196,12 +196,6 @@ public static T editableInstanceOfObject(T eo, if(ec == null) throw new IllegalArgumentException("EO must live in an EC"); boolean isNewObject = ERXEOControlUtilities.isNewObject(eo); - - // Check for old EOF bug and do nothing as we can't localInstance - // anything here - if (ERXProperties.webObjectsVersionAsDouble() < 5.21d && isNewObject) { - return eo; - } T localObject = eo; diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXProperties.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXProperties.java index 52eb0eebe1c..dc1c3990a08 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXProperties.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXProperties.java @@ -347,8 +347,10 @@ public static String valueFromPlistBundleWithKey(NSBundle bundle, String plist, * @see #webObjectsVersionAsDouble * @see ERXStringUtilities#removeExtraDotsFromVersionString * + * @deprecated Wonder is used with WO 5.4 only */ @SuppressWarnings("javadoc") + @Deprecated public static String webObjectsVersion() { if (_webObjectsVersion == null) { _webObjectsVersion = versionStringForFrameworkNamed("JavaWebObjects"); @@ -383,8 +385,10 @@ public static String webObjectsVersion() { * * @see #webObjectsVersion * + * @deprecated Wonder is used with WO 5.4 only */ @SuppressWarnings("javadoc") + @Deprecated public static double webObjectsVersionAsDouble() { if (_webObjectsVersionDouble == 0.0d) { String woVersionString = ERXStringUtilities.removeExtraDotsFromVersionString(webObjectsVersion()); @@ -417,8 +421,10 @@ public static double webObjectsVersionAsDouble() { * * @return true もし、バージョン番号が5.2以上であれば * + * @deprecated Wonder is used with WO 5.4 only */ @SuppressWarnings("javadoc") + @Deprecated public static boolean webObjectsVersionIs52OrHigher() { if(ERXProperties.booleanForKey("er.extensions.ERXProperties.checkOldVersions")) { return webObjectsVersionAsDouble() >= 5.2d; @@ -439,8 +445,10 @@ public static boolean webObjectsVersionIs52OrHigher() { * * @return true もし、バージョン番号が5.22以上であれば * + * @deprecated Wonder is used with WO 5.4 only */ @SuppressWarnings("javadoc") + @Deprecated public static boolean webObjectsVersionIs522OrHigher() { if(ERXProperties.booleanForKey("er.extensions.ERXProperties.checkOldVersions")) { String webObjectsVersion = webObjectsVersion(); From 0e3b5b02fa0654d642d57c39fd2f326cc97e1c83 Mon Sep 17 00:00:00 2001 From: Johann Werner Date: Fri, 2 Nov 2012 23:05:12 +0100 Subject: [PATCH 3/6] remove old WO5.3 code from WOOgnl --- Frameworks/Core/WOOgnl/.classpath | 2 -- Frameworks/Core/WOOgnl/Libraries/.gitignore | 0 Frameworks/Core/WOOgnl/Libraries/WOOgnl53.jar | Bin 1133 -> 0 bytes Frameworks/Core/WOOgnl/Libraries/WOOgnl54.jar | Bin 1295 -> 0 bytes .../WOHelperFunctionParser54.java | 0 .../WOHelperFunctionParser53.java | 34 ------------------ 6 files changed, 36 deletions(-) create mode 100644 Frameworks/Core/WOOgnl/Libraries/.gitignore delete mode 100644 Frameworks/Core/WOOgnl/Libraries/WOOgnl53.jar delete mode 100644 Frameworks/Core/WOOgnl/Libraries/WOOgnl54.jar rename Frameworks/Core/WOOgnl/{Sources_WO54 => Sources}/ognl/helperfunction/WOHelperFunctionParser54.java (100%) delete mode 100755 Frameworks/Core/WOOgnl/Sources_WO53/ognl/helperfunction/WOHelperFunctionParser53.java diff --git a/Frameworks/Core/WOOgnl/.classpath b/Frameworks/Core/WOOgnl/.classpath index 276980adc8d..2518444e737 100755 --- a/Frameworks/Core/WOOgnl/.classpath +++ b/Frameworks/Core/WOOgnl/.classpath @@ -1,8 +1,6 @@ - - diff --git a/Frameworks/Core/WOOgnl/Libraries/.gitignore b/Frameworks/Core/WOOgnl/Libraries/.gitignore new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Frameworks/Core/WOOgnl/Libraries/WOOgnl53.jar b/Frameworks/Core/WOOgnl/Libraries/WOOgnl53.jar deleted file mode 100644 index 009a246203b5b9a59376c1994a278e7699d4517a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1133 zcmWIWW@Zs#-~ht*&3Tp#NI-;vg~8V~#8KDN&rRRg(a+P(H8@1i*X`da28PeRXHNTg z>*`(P_14uocjo-&AcHH$51u}H%ES=h&Cao@p6Q)5&?reD4uD(meiNz%MnKv8^t>GX zjMSWh)S|S~yyTM1{5<_|e-E&L8&n`5v8Xt;$kbRbIVZ8Wcxp(rzi^=s+J(=xI}ST11HNN;hTBiPb zAwBI}%)Xy#e)WI-&GBhzcihSaVtJT# zSGg6i+lJhH5O>#M>g1ovZ(V|Q&zfB^^`P{cIvU*lF*WScETdy$udUoH*dS3P|w{4wIrH;G%oz=^l)Vp?W==H01DZ$lT zOdak5haCi*O~n7-(UfqBDJisXQgCva6K=GcXY&7p|L^elI%rm=uI`I8sawq7Hc#og z?%Am~{#&)Rdixq%OqKb1QOnug^-79__p)`r!RfS7D zr|YJD`zm^6&f{sO?~ObK9`k&zE6RD3_bi{q--stZdcE%P)17|$dyn|cb2DgD=UQec zeS~M>H{-r*E0kv(Hh$Fft!8rgY8MMoV1(gZ#_X zbTm#RG&TyhiNgz_!YV9+r{vO!W|Q;)qgD&ed4ozn_!ho=Ixg~ zON}23r|+0;cl<%4$opF7M_T^VSuQz0T|8xZ_%pBT${!gHZ>s5G==abt?3r{$ZK->O z&qkj&Vv&qoxlDcI6ny; znKAzZ69dCMHc)*`(P_14uocjo-&AcHH$51u}H%ES=h&Cao@p6Q)5&?reD4uD%wfo6dbP&Pk3FGoKk zHK!o8D6KRvxg;|`Pe0t>11#VM6$nTyDo!mjHPK7XNh~g28hSTaI#lF;ER#-WW0cpy z8^@Y5R39emvT3tz^yu8Em+5X)^6N>A+4R(zXYZZ4%X`Cp{@?VHE01nS{(jL@A9B1n zKk20a(``fk>hqT0=M>jJH~zop&u4vx@_@|-2R10|HQ2!KazQ9-zwEA!`p&;U9$qCF zva88G#?@)<6dfL;HM=%t%6HrDEZ4YWv8i&k>vVUgo4SkLuFc+bbJ9YN$GbANG0AoJ zF}H;%*tX44p6Xt9$5z11)2n@(vaSCLBj;bg+c;X>&05ZS^7Z++U%PXF|8K?Ido#7) z81dwtYTICNDnY$4}ytdmmIOz2o3`H>dbS{|?y? z7dD$S%eg*vy6_6GuApMA^xgaG z?Y9VP+kZLLsgka>UH^7s^X!-_WoA!IVOoEW+4#BlMa ze|2}YqwRMr zT3YBTW|z1k?%SViP8Ij>{yV!ueC75Rr6;x~KK=A}>FUeLRnrrHovFE=5_55D#nPp} zi%hwt<iHlv6xHj1&p#Dtcn#bO!ICW>`3c6kq;t`&5a^AXA36j!PYWo%i?y69G z#qK5ddTCPIhkb0jjux16UMLQl?8q7ax_$MQOXn&h)+f2Gc&{q8^xw<{=OTQcJd)|z zwYn@Ndgr1?uVZJuH$UhtWtWyAxa38A5kuzQMZB)jjpsyaFQ2&ZH~NU~rIqzBKfaNd z_$?~DU*f9gue28|$2@99g59`+mc?E-{o5%MRr0L+Gk5pSgLeY*ez3e3oB#Nk@Y(qf z_TD!vewBCT!A`exYAcSflb(LHkNM0a=4PdS{=(Y|ryeUWV&gG&4>=XUDq@(iqEaUy zW>(Y@p`*u3PEYzLJE?cVH>0Uvf|) Date: Fri, 2 Nov 2012 23:05:36 +0100 Subject: [PATCH 4/6] those samples are already in the Properties file --- .../WOOgnl/Documentation/Properties.sample | 21 ------------------- 1 file changed, 21 deletions(-) delete mode 100644 Frameworks/Core/WOOgnl/Documentation/Properties.sample diff --git a/Frameworks/Core/WOOgnl/Documentation/Properties.sample b/Frameworks/Core/WOOgnl/Documentation/Properties.sample deleted file mode 100644 index 740372bfb12..00000000000 --- a/Frameworks/Core/WOOgnl/Documentation/Properties.sample +++ /dev/null @@ -1,21 +0,0 @@ -## If you want to use OGNL but not enable it automatically in your bindings, you can set this to -## false. Default is true. -ognl.active=true - -## If you want to enable the helper function parser (which now is misnamed and does a bunch of other things), -## you can set this to true. Default is false. See README-HelperFunctions.txt for more information about -## helper functions. -ognl.helperFunctions=false - -## If you want to enable inline binding syntax (i.e. .. ), then set -## this to true. This requires ognl.helperFunctions=true. Default is false. -ognl.inlineBindings=false - -## If you want to enable inline bindings on non-WO tags (like
..
), you can enable this and -## the parser will automatically turn these tags into WOGenericContainers. This requires that ognl.helperFunctions=true -## and ognl.inlineBindings=true. The default is false. -ognl.parseStandardTags=false - -## If you want OGNL exceptions to actually throw exceptions on failures (rather than just warn), set -## this to true. Default is false. -ognl.webobjects.WOAssociation.shouldThrowExceptions=false \ No newline at end of file From acd5f739de214381f58adf5909c5ae1582f924cd Mon Sep 17 00:00:00 2001 From: Johann Werner Date: Fri, 2 Nov 2012 23:07:29 +0100 Subject: [PATCH 5/6] remove code for WO5.3 compatibility --- .../Ajax/Sources/er/ajax/AjaxResponse.java | 26 ++++------------- .../er/coolcomponents/CCSubmitLink.java | 7 ++--- .../com/webobjects/eoaccess/ERXEntity.java | 2 +- .../com/webobjects/eoaccess/ERXModel.java | 29 ++----------------- .../extensions/appserver/ERXApplication.java | 5 ++-- .../appserver/ajax/ERXAjaxContext.java | 2 +- .../er/extensions/foundation/ERXPatcher.java | 12 -------- 7 files changed, 13 insertions(+), 70 deletions(-) diff --git a/Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxResponse.java b/Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxResponse.java index 03ac5abe81b..35cd9076fdb 100644 --- a/Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxResponse.java +++ b/Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxResponse.java @@ -60,20 +60,12 @@ public WOResponse generateResponse() { String originalSenderID = _context.senderID(); _context._setSenderID(""); try { - CharSequence content; - //AK: don't ask... - // MS: 5.3 vs 5.4 field type of _content - if (((Object)_content) instanceof StringBuffer) { - content = (StringBuffer)(Object)_content; - ERXKeyValueCodingUtilities.takePrivateValueForKey(this, new StringBuffer(), "_content"); - } else { - content = (StringBuilder)(Object) _content; - ERXKeyValueCodingUtilities.takePrivateValueForKey(this, new StringBuilder(), "_content"); - } + CharSequence originalContent = _content; + _content = new StringBuilder(); NSMutableDictionary userInfo = AjaxUtils.mutableUserInfo(_request); userInfo.setObjectForKey(Boolean.TRUE, AjaxResponse.AJAX_UPDATE_PASS); WOActionResults woactionresults = WOApplication.application().invokeAction(_request, _context); - _content.append(content); + _content.append(originalContent); if (_responseAppenders != null) { Enumeration responseAppendersEnum = _responseAppenders.objectEnumerator(); while (responseAppendersEnum.hasMoreElements()) { @@ -81,16 +73,8 @@ public WOResponse generateResponse() { responseAppender.appendToResponse(this, _context); } } - int length; - if (((Object)_content) instanceof StringBuffer) { - StringBuffer buffer = (StringBuffer)(Object)_content; - length = buffer.length(); - } else { - StringBuilder builder = (StringBuilder)(Object) _content; - length = builder.length(); - } - if (length == 0) { - setStatus(HTTP_STATUS_INTERNAL_ERROR); + if (_contentLength() == 0) { + setStatus(HTTP_STATUS_INTERNAL_ERROR); Ajax.log.warn("You performed an Ajax update, but no response was generated. A common cause of this is that you spelled your updateContainerID wrong. You specified a container ID '" + AjaxUpdateContainer.updateContainerID(_request) + "'."); } } diff --git a/Frameworks/Ajax/ERCoolComponents/Sources/er/coolcomponents/CCSubmitLink.java b/Frameworks/Ajax/ERCoolComponents/Sources/er/coolcomponents/CCSubmitLink.java index a18ba6709fb..9dc276bf919 100644 --- a/Frameworks/Ajax/ERCoolComponents/Sources/er/coolcomponents/CCSubmitLink.java +++ b/Frameworks/Ajax/ERCoolComponents/Sources/er/coolcomponents/CCSubmitLink.java @@ -51,22 +51,19 @@ public CCSubmitLink(WOContext context) { super(context); } - @SuppressWarnings("deprecation") + @Override public WOActionResults invokeAction(WORequest request, WOContext context) { String formValue = (String) request.formValueForKey(fieldName()); if (fieldName().equals(formValue)) { // Tell context that an action was performed. If this is // not done, the form's default action will be called also. // *note* Uses undocumented method of WOContext. - // - // deprecated call required to maintain WO5.3 compatibility. - // change to context.setActionInvoked(true) once move to - // WO5.4+ is complete -davidleber context.setActionInvoked(true); } return super.invokeAction(request, context); } + @Override public void appendToResponse(WOResponse response, WOContext context) { // Check if the link is in a form so we know if we need to // use the link and a hidden field to submit the form. diff --git a/Frameworks/Core/ERExtensions/Sources/com/webobjects/eoaccess/ERXEntity.java b/Frameworks/Core/ERExtensions/Sources/com/webobjects/eoaccess/ERXEntity.java index caf5e06fc15..e0d5ab7a3fa 100644 --- a/Frameworks/Core/ERExtensions/Sources/com/webobjects/eoaccess/ERXEntity.java +++ b/Frameworks/Core/ERExtensions/Sources/com/webobjects/eoaccess/ERXEntity.java @@ -80,7 +80,7 @@ public EOAttribute anyAttributeNamed(String name) { * @see com.webobjects.eoaccess.EOEntity#hasExternalName() * @since 5.4.1 */ - //@Override introduced with 5.4.1 + @Override public boolean hasExternalName() { // (ldeck) radar://6592526 fix for 5.4.3 regression which assumed that any parent entity that is abstract has no external name! return externalName() != null && externalName().trim().length() > 0; diff --git a/Frameworks/Core/ERExtensions/Sources/com/webobjects/eoaccess/ERXModel.java b/Frameworks/Core/ERExtensions/Sources/com/webobjects/eoaccess/ERXModel.java index 84b7e0c0257..2b08f8cae4c 100644 --- a/Frameworks/Core/ERExtensions/Sources/com/webobjects/eoaccess/ERXModel.java +++ b/Frameworks/Core/ERExtensions/Sources/com/webobjects/eoaccess/ERXModel.java @@ -67,36 +67,11 @@ * @author ldeck */ public class ERXModel extends EOModel { - public static Object _ERXGlobalModelLock; + // Expose EOModel._EOGlobalModelLock so that ERXModelGroup can lock on it + public static Object _ERXGlobalModelLock = EOModel._EOGlobalModelLock; private static final Logger log = Logger.getLogger(ERXModel.class); - static { - // Expose EOModel._EOGlobalModelLock so that ERXModelGroup can lock on it - try { - _ERXGlobalModelLock = EOModel._EOGlobalModelLock; - } - catch (NoSuchFieldError e) { - // MS: It just so happens that this occurs really early on in the startup process, and this API changed in WO 5.3 vs WO 5.4. We catch this - // failure explicitly and give the user a slightly better error message. - try { - String eomodelLockClassName = EOModel.class.getDeclaredField("_EOGlobalModelLock").getType().getSimpleName(); - if ("ReentrantLock".equals(eomodelLockClassName)) { - throw new RuntimeException("You're using WebObjects 5.4 with the WebObjects 5.3 version of Project Wonder. You need to download the 5.4 version of Project Wonder for your application to work properly."); - } - else if ("NSRecursiveLock".equals(eomodelLockClassName)) { - throw new RuntimeException("You're using WebObjects 5.3 with the WebObjects 5.4 version of Project Wonder. You need to download the 5.3 version of Project Wonder for your application to work properly."); - } - else { - throw new RuntimeException("You have the wrong version of Project Wonder for the version of WebObjects that you're using. You need to download the appropriate version of Project Wonder for your application to work properly."); - } - } - catch (NoSuchFieldException e2) { - throw e; - } - } - - } /** * Utility to add attributes to the prototype cache. As the attributes are chosen by name, replace already * existing ones. diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java index f103c9d73bc..24611cae252 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java @@ -1430,7 +1430,7 @@ public void run() { * Creates the request object for this loop. Calls _createRequest(). For WO * 5.3. */ - @SuppressWarnings("all") // Suppress @Override warning for 5.4 + @Deprecated public WORequest createRequest(String aMethod, String aURL, String anHTTPVersion, NSDictionary someHeaders, NSData aContent, NSDictionary someInfo) { return _createRequest(aMethod, aURL, anHTTPVersion, someHeaders, aContent, someInfo); } @@ -1439,8 +1439,7 @@ public WORequest createRequest(String aMethod, String aURL, String anHTTPVersion * Creates the request object for this loop. Calls _createRequest(). For WO * 5.4. */ - @SuppressWarnings("all") - // Suppress @Override warning for 5.3 + @Override public WORequest createRequest(String method, String aurl, String anHTTPVersion, Map> someHeaders, NSData content, Map someInfo) { return _createRequest(method, aurl, anHTTPVersion, (someHeaders != null ? new NSDictionary(someHeaders, true) : null), content, (someInfo != null ? new NSDictionary(someInfo, true) : null)); } diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ajax/ERXAjaxContext.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ajax/ERXAjaxContext.java index 01c4ae5603d..b372877ddad 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ajax/ERXAjaxContext.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ajax/ERXAjaxContext.java @@ -29,7 +29,7 @@ public ERXAjaxContext(WORequest request) { super(request); } - // @Override no override for 5.4/5.3 compatibility + @Override public boolean wasFormSubmitted() { return _wasFormSubmitted(); } diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXPatcher.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXPatcher.java index f51b478e526..536c3a2832e 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXPatcher.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXPatcher.java @@ -307,18 +307,6 @@ public void appendToResponse(WOResponse woresponse, WOContext wocontext) { woresponse.appendContentString(newResponse.contentString()); } } - - // WO 5.4: 5.4 already does this, but for 5.3, if you want to use WOImage's with - // PDF generation, you need XHTML output - protected void _appendOpenTagToResponse(WOResponse response, WOContext context) { - response.appendContentCharacter('<'); - response.appendContentString(elementName()); - appendAttributesToResponse(response, context); - if(!hasContent() || ERXResponse.isXHTML(response)) { // CHECKME do we need to check isXHTML? - response.appendContentString(" /"); - } - response.appendContentCharacter('>'); - } } public static class ActiveImage extends WOActiveImage { From b5c6b7825699fd65a4702aa4da4de7f8a10de14c Mon Sep 17 00:00:00 2001 From: Johann Werner Date: Mon, 12 Nov 2012 21:05:32 +0100 Subject: [PATCH 6/6] WO5.4.3 already uses UTF-8 encoding for URIs --- .../Sources/er/extensions/appserver/ERXApplication.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java index 24611cae252..3753d394e81 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java @@ -1078,10 +1078,6 @@ public void installPatches() { } // ERXPatcher.setClassForName(ERXSubmitButton.class, "WOSubmitButton"); - - // Fix for 3190479 URI encoding should always be UTF8 - // See http://www.w3.org/International/O-URL-code.html - com.webobjects.appserver._private.WOURLEncoder.WO_URL_ENCODING = CharEncoding.UTF_8; } @Override