Repository: wicket
Updated Branches:
  refs/heads/master a1e5e9964 -> 266a57ce1


WICKET-6374 Exception caused by border extending another border with
<wicket:extend>

Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/266a57ce
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/266a57ce
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/266a57ce

Branch: refs/heads/master
Commit: 266a57ce153c5b65e9701e74b13f1175d6dc3af7
Parents: a1e5e99
Author: Andrea Del Bene <adelb...@apache.org>
Authored: Sat May 20 19:23:54 2017 +0200
Committer: Andrea Del Bene <adelb...@apache.org>
Committed: Sat May 20 19:23:54 2017 +0200

----------------------------------------------------------------------
 .../wicket/markup/html/border/Border.java       | 12 +-------
 .../markup/html/border/ComponentBorderTest.java | 10 +++++++
 .../markup/html/border/ExtedableBorder.html     | 28 ++++++++++++++++++
 .../markup/html/border/ExtedableBorder.java     | 30 ++++++++++++++++++++
 .../markup/html/border/ExtendedBorder.html      | 22 ++++++++++++++
 .../markup/html/border/ExtendedBorder.java      | 30 ++++++++++++++++++++
 6 files changed, 121 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/266a57ce/wicket-core/src/main/java/org/apache/wicket/markup/html/border/Border.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/markup/html/border/Border.java 
b/wicket-core/src/main/java/org/apache/wicket/markup/html/border/Border.java
index b11df1a..a330489 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/border/Border.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/border/Border.java
@@ -16,8 +16,6 @@
  */
 package org.apache.wicket.markup.html.border;
 
-import java.util.Objects;
-
 import org.apache.wicket.Component;
 import org.apache.wicket.DequeueContext;
 import org.apache.wicket.DequeueTagAction;
@@ -36,7 +34,6 @@ import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.panel.BorderMarkupSourcingStrategy;
 import org.apache.wicket.markup.html.panel.IMarkupSourcingStrategy;
 import org.apache.wicket.markup.parser.XmlTag.TagType;
-import org.apache.wicket.markup.parser.filter.WicketTagIdentifier;
 import org.apache.wicket.markup.resolver.IComponentResolver;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.util.lang.Args;
@@ -665,16 +662,9 @@ public abstract class Border extends WebMarkupContainer 
implements IComponentRes
 
        private boolean canDequeueBody(ComponentTag tag)
        {
-               String tagCacheKey = (String)tag.getUserData(
-                       WicketTagIdentifier.MARKUP_CACHE_KEY);
-               String borderCacheKey = 
getAssociatedMarkup().getMarkupResourceStream().getCacheKey();
-               
                boolean isBodyTag = (tag instanceof WicketTag) && 
((WicketTag)tag).isBodyTag();
                
-               //the body tag might belong to an outer body component
-               boolean isBorderBodyTag = Objects.equals(tagCacheKey, 
borderCacheKey);
-               
-               return isBodyTag && isBorderBodyTag;
+               return isBodyTag;
        }
 
        @Override

http://git-wip-us.apache.org/repos/asf/wicket/blob/266a57ce/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ComponentBorderTest.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ComponentBorderTest.java
 
b/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ComponentBorderTest.java
index 8dcb1f1..bc2f2fd 100644
--- 
a/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ComponentBorderTest.java
+++ 
b/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ComponentBorderTest.java
@@ -141,4 +141,14 @@ public class ComponentBorderTest extends WicketTestCase
                //https://issues.apache.org/jira/browse/WICKET-6303
                assertTrue(page.isBehaviorRendered());
        }
+       
+       /**
+        * https://issues.apache.org/jira/browse/WICKET-6374
+        * @throws Exception
+        */
+       @Test
+    public void borderExtendingMarkup() throws Exception
+    {
+        tester.startComponentInPage(ExtendedBorder.class);
+    }
 }

http://git-wip-us.apache.org/repos/asf/wicket/blob/266a57ce/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ExtedableBorder.html
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ExtedableBorder.html
 
b/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ExtedableBorder.html
new file mode 100644
index 0000000..bc2a89c
--- /dev/null
+++ 
b/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ExtedableBorder.html
@@ -0,0 +1,28 @@
+<!--
+    ====================================================================
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml"; 
xmlns:wicket="http://wicket.apache.org";>
+<body>
+<wicket:border>
+       <em>My Border</em>
+       <span>[before body]</span>
+       <wicket:body/>
+       <span>[after body]</span>
+       <span>[before child]</span>
+       <wicket:child/>
+       <span>[after child]</span>
+</wicket:border>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/wicket/blob/266a57ce/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ExtedableBorder.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ExtedableBorder.java
 
b/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ExtedableBorder.java
new file mode 100644
index 0000000..cdd4a81
--- /dev/null
+++ 
b/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ExtedableBorder.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.markup.html.border;
+
+public class ExtedableBorder extends Border
+{
+       /**
+     * 
+     */
+    private static final long serialVersionUID = 1431333408002477444L;
+
+    public ExtedableBorder(final String id)
+       {
+               super(id);
+       }
+}

http://git-wip-us.apache.org/repos/asf/wicket/blob/266a57ce/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ExtendedBorder.html
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ExtendedBorder.html
 
b/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ExtendedBorder.html
new file mode 100644
index 0000000..379f1c3
--- /dev/null
+++ 
b/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ExtendedBorder.html
@@ -0,0 +1,22 @@
+<!--
+    ====================================================================
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml"; 
xmlns:wicket="http://wicket.apache.org";>
+<body>
+<wicket:extend>
+       <em>My Extended Border</em>
+</wicket:extend>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/wicket/blob/266a57ce/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ExtendedBorder.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ExtendedBorder.java
 
b/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ExtendedBorder.java
new file mode 100644
index 0000000..eefd271
--- /dev/null
+++ 
b/wicket-core/src/test/java/org/apache/wicket/markup/html/border/ExtendedBorder.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.markup.html.border;
+
+public class ExtendedBorder extends ExtedableBorder
+{
+       /**
+     * 
+     */
+    private static final long serialVersionUID = -3807276374784563518L;
+
+    public ExtendedBorder(final String id)
+       {
+               super(id);
+       }
+}

Reply via email to