Author: hqm
Date: 2007-10-24 10:48:10 -0700 (Wed, 24 Oct 2007)
New Revision: 6990
Modified:
openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
Log:
Change 20071023-hqm-a by [EMAIL PROTECTED] on 2007-10-23 23:46:20 EDT
in /cygdrive/c/users/hqm/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: add another check for method redefinition warnings
New Features:
Make thecheck when a view definition overrides a non-overridable method, not
just a in class definition
Bugs Fixed: LPP-3910
Technical Reviewer: dda
QA Reviewer: pbr
Doc Reviewer:
Documentation:
Release Notes:
Details:
The check for redefining non-overridable methods was only being done in class
declarations.
This adds the check into processing of regular view (node) declarations.
Tests:
This should generate a warning about overriding the "call" method, which is
declared
as non-overridable in the base schema file lfc.lzx.
<canvas width="100%" height="100%" debug="true">
<view>
<method name="call" />
</view>
</canvas>
Modified:
openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
===================================================================
---
openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
2007-10-24 17:38:37 UTC (rev 6989)
+++
openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
2007-10-24 17:48:10 UTC (rev 6990)
@@ -1103,6 +1103,7 @@
String name = element.getAttributeValue("name");
String event = element.getAttributeValue("event");
String args = XMLUtils.getAttributeValue(element, "args", "");
+ String override = element.getAttributeValue("override");
if ((name == null || !ScriptCompiler.isIdentifier(name)) &&
(event == null || !ScriptCompiler.isIdentifier(event))) {
@@ -1199,10 +1200,16 @@
}
- /**
- TODO [hqm 2007-10-21]
- WARN if method attributespec has override=false
- **/
+
+ if (!("true".equals(override))) {
+ String classname = element.getParentElement().getName();
+ // Just check method declarations on regular node.
+ // Method declarations inside of class definitions will be already
checked elsewhere,
+ // in the call from ClassCompiler.updateSchema to schema.addElement
+ if (!"class".equals(classname)) {
+ schema.checkMethodDeclaration(element, classname, name, env);
+ }
+ }
attrs.put(name, fndef);
}
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins