You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Marat Radchenko (JIRA)" <ji...@apache.org> on 2008/02/12 08:32:07 UTC

[jira] Created: (WICKET-1340) Bogus LocalizedImageResource#isStateless()

Bogus LocalizedImageResource#isStateless()
------------------------------------------

                 Key: WICKET-1340
                 URL: https://issues.apache.org/jira/browse/WICKET-1340
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.1, 1.3.0-final
            Reporter: Marat Radchenko
         Attachments: ImageTest.java

Image without resource/resource reference should be stateless.

Bug is located in LocalizedImageResource#isStateless(), which should read "return resourceReference == null;"

Test case is attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1340) Bogus LocalizedImageResource#isStateless()

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568545#action_12568545 ] 

Johan Compagner commented on WICKET-1340:
-----------------------------------------

better would be:

1> an Image is statefull it the LocalizedImageResource doesnt have a ResourceReference (to a null or to a current resource)

2> if Image is empty then most likely a ResourceReference is generated (and <1> applies) but a Resource could be generated in one spefic case (ImageFactory) then it is statefull

> Bogus LocalizedImageResource#isStateless()
> ------------------------------------------
>
>                 Key: WICKET-1340
>                 URL: https://issues.apache.org/jira/browse/WICKET-1340
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-final, 1.3.1
>            Reporter: Marat Radchenko
>            Assignee: Johan Compagner
>             Fix For: 1.3.2
>
>         Attachments: Image2Test.java, ImageTest.java
>
>
> Image without resource/resource reference should be stateless.
> Bug is located in LocalizedImageResource#isStateless(), which should read "return resourceReference == null;"
> Test case is attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1340) Bogus LocalizedImageResource#isStateless()

Posted by "Marat Radchenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marat Radchenko updated WICKET-1340:
------------------------------------

    Attachment: ImageTest.java

> Bogus LocalizedImageResource#isStateless()
> ------------------------------------------
>
>                 Key: WICKET-1340
>                 URL: https://issues.apache.org/jira/browse/WICKET-1340
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-final, 1.3.1
>            Reporter: Marat Radchenko
>         Attachments: ImageTest.java
>
>
> Image without resource/resource reference should be stateless.
> Bug is located in LocalizedImageResource#isStateless(), which should read "return resourceReference == null;"
> Test case is attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (WICKET-1340) Bogus LocalizedImageResource#isStateless()

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johan Compagner closed WICKET-1340.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3.2

ok that made it more clear what you tried to test.
it should be fixed now in head.

> Bogus LocalizedImageResource#isStateless()
> ------------------------------------------
>
>                 Key: WICKET-1340
>                 URL: https://issues.apache.org/jira/browse/WICKET-1340
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-final, 1.3.1
>            Reporter: Marat Radchenko
>            Assignee: Johan Compagner
>             Fix For: 1.3.2
>
>         Attachments: Image2Test.java, ImageTest.java
>
>
> Image without resource/resource reference should be stateless.
> Bug is located in LocalizedImageResource#isStateless(), which should read "return resourceReference == null;"
> Test case is attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (WICKET-1340) Bogus LocalizedImageResource#isStateless()

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johan Compagner closed WICKET-1340.
-----------------------------------

    Resolution: Invalid
      Assignee: Johan Compagner

this is not true.

an Image is statefull if it doesn't have a ResourceReference
If it does have a resource reference then it is a shared resources with a shared resource reference url and then it is stateless.

Look at the method: protected void onComponentTag(final ComponentTag tag) of Image if the image doesn't have a RR then 
it will generate a callback to itself and that mean statefull

> Bogus LocalizedImageResource#isStateless()
> ------------------------------------------
>
>                 Key: WICKET-1340
>                 URL: https://issues.apache.org/jira/browse/WICKET-1340
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-final, 1.3.1
>            Reporter: Marat Radchenko
>            Assignee: Johan Compagner
>         Attachments: ImageTest.java
>
>
> Image without resource/resource reference should be stateless.
> Bug is located in LocalizedImageResource#isStateless(), which should read "return resourceReference == null;"
> Test case is attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (WICKET-1340) Bogus LocalizedImageResource#isStateless()

Posted by "Marat Radchenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marat Radchenko reopened WICKET-1340:
-------------------------------------


Sadly I have to reopen this issue. Please find attached testcase (Image2Test.java). It tries to prove what you say (and fails...).

I cannot find any way to create a stateless Image. Could you show me an example?

> Bogus LocalizedImageResource#isStateless()
> ------------------------------------------
>
>                 Key: WICKET-1340
>                 URL: https://issues.apache.org/jira/browse/WICKET-1340
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-final, 1.3.1
>            Reporter: Marat Radchenko
>            Assignee: Johan Compagner
>         Attachments: Image2Test.java, ImageTest.java
>
>
> Image without resource/resource reference should be stateless.
> Bug is located in LocalizedImageResource#isStateless(), which should read "return resourceReference == null;"
> Test case is attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1340) Bogus LocalizedImageResource#isStateless()

Posted by "Marat Radchenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marat Radchenko updated WICKET-1340:
------------------------------------

    Attachment: Image2Test.java

Sorry, mistyped your name

> Bogus LocalizedImageResource#isStateless()
> ------------------------------------------
>
>                 Key: WICKET-1340
>                 URL: https://issues.apache.org/jira/browse/WICKET-1340
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-final, 1.3.1
>            Reporter: Marat Radchenko
>            Assignee: Johan Compagner
>         Attachments: Image2Test.java, ImageTest.java
>
>
> Image without resource/resource reference should be stateless.
> Bug is located in LocalizedImageResource#isStateless(), which should read "return resourceReference == null;"
> Test case is attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1340) Bogus LocalizedImageResource#isStateless()

Posted by "Marat Radchenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568502#action_12568502 ] 

Marat Radchenko commented on WICKET-1340:
-----------------------------------------

> And if an Image doesn't have a resourceReference but only a Resource then it generates a callback link so that it will serve the Resource itself.

I understand case with Resource. However empty image (that takes url from template) doesn't have any resource. And it doesn't generate callback to itself.

If image is empty then LocalizedImageResource searches for src attribute on tag and invokes LocalizedImageResource#loadStaticImage. Which sets ResourceReference! So empty image turns into image with ResourceReference (which is stateless as you say).

> Bogus LocalizedImageResource#isStateless()
> ------------------------------------------
>
>                 Key: WICKET-1340
>                 URL: https://issues.apache.org/jira/browse/WICKET-1340
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-final, 1.3.1
>            Reporter: Marat Radchenko
>            Assignee: Johan Compagner
>             Fix For: 1.3.2
>
>         Attachments: Image2Test.java, ImageTest.java
>
>
> Image without resource/resource reference should be stateless.
> Bug is located in LocalizedImageResource#isStateless(), which should read "return resourceReference == null;"
> Test case is attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1340) Bogus LocalizedImageResource#isStateless()

Posted by "Marat Radchenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marat Radchenko updated WICKET-1340:
------------------------------------

    Attachment: Image2Test.java

> Bogus LocalizedImageResource#isStateless()
> ------------------------------------------
>
>                 Key: WICKET-1340
>                 URL: https://issues.apache.org/jira/browse/WICKET-1340
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-final, 1.3.1
>            Reporter: Marat Radchenko
>            Assignee: Johan Compagner
>         Attachments: Image2Test.java, ImageTest.java
>
>
> Image without resource/resource reference should be stateless.
> Bug is located in LocalizedImageResource#isStateless(), which should read "return resourceReference == null;"
> Test case is attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1340) Bogus LocalizedImageResource#isStateless()

Posted by "Marat Radchenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marat Radchenko updated WICKET-1340:
------------------------------------

    Attachment:     (was: Image2Test.java)

> Bogus LocalizedImageResource#isStateless()
> ------------------------------------------
>
>                 Key: WICKET-1340
>                 URL: https://issues.apache.org/jira/browse/WICKET-1340
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-final, 1.3.1
>            Reporter: Marat Radchenko
>            Assignee: Johan Compagner
>         Attachments: Image2Test.java, ImageTest.java
>
>
> Image without resource/resource reference should be stateless.
> Bug is located in LocalizedImageResource#isStateless(), which should read "return resourceReference == null;"
> Test case is attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1340) Bogus LocalizedImageResource#isStateless()

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568477#action_12568477 ] 

Johan Compagner commented on WICKET-1340:
-----------------------------------------

I fixed the message for testResource, deleted the testEmpty because when i thought about it that one didn't make any sense.
Because the empty one is completely depending on the markup the image has.

improved the javadoc: "@return true if it has a resourceReference. (it points to a shared resource)"

stateless is not about variables or that kind of stuff.
A component is statefull if it generates a callback link to itself. And if an Image doesn't have a resourceReference but only a Resource then it generates a callback link so that it will serve the Resource itself.

> Bogus LocalizedImageResource#isStateless()
> ------------------------------------------
>
>                 Key: WICKET-1340
>                 URL: https://issues.apache.org/jira/browse/WICKET-1340
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-final, 1.3.1
>            Reporter: Marat Radchenko
>            Assignee: Johan Compagner
>             Fix For: 1.3.2
>
>         Attachments: Image2Test.java, ImageTest.java
>
>
> Image without resource/resource reference should be stateless.
> Bug is located in LocalizedImageResource#isStateless(), which should read "return resourceReference == null;"
> Test case is attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (WICKET-1340) Bogus LocalizedImageResource#isStateless()

Posted by "Marat Radchenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568534#action_12568534 ] 

slonopotamus edited comment on WICKET-1340 at 2/13/08 4:26 AM:
------------------------------------------------------------------

Ok, let's sum up.

1) Image should be stateful if it has Resource [either in LocalizedImageResource or in model].
2) Otherwise (if it has ResourceReference [either in LocalizedImageResource or in model]) it should be stateless.
3) If image is empty (it doesn't have R/RR in model and it doesn't have R/RR in LocalizedImageResource) then it cannot become stateful because in this case src tag attribute will be used and RR will be created so image will be the same as in 2.

Right?

      was (Author: slonopotamus):
    Ok, let's sum up.

Image should be stateful if it has Resource [either in LocalizedImageResource or in model]. Otherwise (if it has ResourceReference [either in LocalizedImageResource or in model]) it should be stateless. Right?
  
> Bogus LocalizedImageResource#isStateless()
> ------------------------------------------
>
>                 Key: WICKET-1340
>                 URL: https://issues.apache.org/jira/browse/WICKET-1340
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-final, 1.3.1
>            Reporter: Marat Radchenko
>            Assignee: Johan Compagner
>             Fix For: 1.3.2
>
>         Attachments: Image2Test.java, ImageTest.java
>
>
> Image without resource/resource reference should be stateless.
> Bug is located in LocalizedImageResource#isStateless(), which should read "return resourceReference == null;"
> Test case is attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1340) Bogus LocalizedImageResource#isStateless()

Posted by "Marat Radchenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568461#action_12568461 ] 

Marat Radchenko commented on WICKET-1340:
-----------------------------------------

Just some thoughts:

1) Wrong assersion messages:
testEmpty -> "image withOUT resource reference should be statefull"
testResource -> "image with resource should be statefull"

2) Confusing javadoc in LocalizedImageResource#isStateless(). It says:
@return If it is stateless (if resource is null)

But current implementation checks if resource is NOT null.

3) I still doesn't understand why rr-less image is statefull. What's it's state? It doesn't have any variables defined -> no state. And image with rr has state - it contains knowledge about what exact resource this image references.
Look at your test case. Empty images has state, but non-empty image doesn't have state. This is very confusing.

So I strongly recommend you to take a deep breath and thing about this issue once more.

> Bogus LocalizedImageResource#isStateless()
> ------------------------------------------
>
>                 Key: WICKET-1340
>                 URL: https://issues.apache.org/jira/browse/WICKET-1340
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-final, 1.3.1
>            Reporter: Marat Radchenko
>            Assignee: Johan Compagner
>             Fix For: 1.3.2
>
>         Attachments: Image2Test.java, ImageTest.java
>
>
> Image without resource/resource reference should be stateless.
> Bug is located in LocalizedImageResource#isStateless(), which should read "return resourceReference == null;"
> Test case is attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1340) Bogus LocalizedImageResource#isStateless()

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568511#action_12568511 ] 

Johan Compagner commented on WICKET-1340:
-----------------------------------------

if you are looking through the code
then do look through ALL the code, there is one case that a resource is made
But this is why i removed the test with just the id constructor
Because testing it doesn't make any sense without markup that specifices more stuff.

> Bogus LocalizedImageResource#isStateless()
> ------------------------------------------
>
>                 Key: WICKET-1340
>                 URL: https://issues.apache.org/jira/browse/WICKET-1340
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-final, 1.3.1
>            Reporter: Marat Radchenko
>            Assignee: Johan Compagner
>             Fix For: 1.3.2
>
>         Attachments: Image2Test.java, ImageTest.java
>
>
> Image without resource/resource reference should be stateless.
> Bug is located in LocalizedImageResource#isStateless(), which should read "return resourceReference == null;"
> Test case is attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1340) Bogus LocalizedImageResource#isStateless()

Posted by "Marat Radchenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568534#action_12568534 ] 

Marat Radchenko commented on WICKET-1340:
-----------------------------------------

Ok, let's sum up.

Image should be stateful if it has Resource [either in LocalizedImageResource or in model]. Otherwise (if it has ResourceReference [either in LocalizedImageResource or in model]) it should be stateless. Right?

> Bogus LocalizedImageResource#isStateless()
> ------------------------------------------
>
>                 Key: WICKET-1340
>                 URL: https://issues.apache.org/jira/browse/WICKET-1340
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-final, 1.3.1
>            Reporter: Marat Radchenko
>            Assignee: Johan Compagner
>             Fix For: 1.3.2
>
>         Attachments: Image2Test.java, ImageTest.java
>
>
> Image without resource/resource reference should be stateless.
> Bug is located in LocalizedImageResource#isStateless(), which should read "return resourceReference == null;"
> Test case is attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.