You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Scott Gray <sc...@hotwaxmedia.com> on 2010/02/02 08:07:56 UTC
Form Widget labels disappearing
After taking an update today, a lot of form widget field labels seem to be missing from various screens. If any committers are aware of any changes they may have made which could have impacted this please take a look and see if it's related to your work.
Here's an example: https://localhost:8443/catalog/control/FindProductConfigItems (only one of the 3 search option fields are presenting a field label)
Here's another: https://localhost:8443/accounting/control/findPayments
Thanks
Scott
HotWax Media
http://www.hotwaxmedia.com
Re: Form Widget labels disappearing
Posted by Jacques Le Roux <ja...@free.fr>.
Could be related: the form widget example page is broken. It was working 2 days ago, no time to look further for now
Jacques
From: "Scott Gray" <sc...@hotwaxmedia.com>
After taking an update today, a lot of form widget field labels seem to be missing from various screens. If any committers are
aware of any changes they may have made which could have impacted this please take a look and see if it's related to your work.
Here's an example: https://localhost:8443/catalog/control/FindProductConfigItems (only one of the 3 search option fields are
presenting a field label)
Here's another: https://localhost:8443/accounting/control/findPayments
Thanks
Scott
HotWax Media
http://www.hotwaxmedia.com
Re: Form Widget labels disappearing
Posted by Adam Heath <do...@brainfood.com>.
Hans Bakker wrote:
> Hi this seems to be caused by r904592
>
> to revert this change:
> svn merge http://svn.apache.org/repos/asf/ofbiz/trunk -r904592:904591
>
> Regards,
> Hans
>
>
> On Mon, 2010-02-01 at 23:07 -0800, Scott Gray wrote:
>> After taking an update today, a lot of form widget field labels seem to be missing from various screens. If any committers are aware of any changes they may have made which could have impacted this please take a look and see if it's related to your work.
>>
>> Here's an example: https://localhost:8443/catalog/control/FindProductConfigItems (only one of the 3 search option fields are presenting a field label)
>> Here's another: https://localhost:8443/accounting/control/findPayments
Scott, you use git now for ofbiz work. Based on Hans' message, you
should try out git bisect. Pick a git revision from a month go(git co
$hash), clean-all/run-install/run/check site, then start git bisect.
I think you will like what it does.
Re: Form Widget labels disappearing
Posted by Hans Bakker <ma...@antwebsystems.com>.
Hi Scott, as this is affecting everybody i thought it was useful for
others to know that....
Regards,
Hans
On Tue, 2010-02-02 at 07:12 -0800, Scott Gray wrote:
> Thanks Hans, but I'm pretty sure you know that I know how to revert :-)
>
> Regards
> Scott
>
> On 2/02/2010, at 12:35 AM, Hans Bakker wrote:
>
> > Hi this seems to be caused by r904592
> >
> > to revert this change:
> > svn merge http://svn.apache.org/repos/asf/ofbiz/trunk -r904592:904591
> >
> > Regards,
> > Hans
> >
> >
> > On Mon, 2010-02-01 at 23:07 -0800, Scott Gray wrote:
> >> After taking an update today, a lot of form widget field labels seem to be missing from various screens. If any committers are aware of any changes they may have made which could have impacted this please take a look and see if it's related to your work.
> >>
> >> Here's an example: https://localhost:8443/catalog/control/FindProductConfigItems (only one of the 3 search option fields are presenting a field label)
> >> Here's another: https://localhost:8443/accounting/control/findPayments
> >>
> >> Thanks
> >> Scott
> >>
> >> HotWax Media
> >> http://www.hotwaxmedia.com
> >>
> >>
> > --
> > Antwebsystems.com: Quality OFBiz services for competitive rates
> >
>
--
Antwebsystems.com: Quality OFBiz services for competitive rates
Re: Form Widget labels disappearing
Posted by Scott Gray <sc...@hotwaxmedia.com>.
Thanks Hans, but I'm pretty sure you know that I know how to revert :-)
Regards
Scott
On 2/02/2010, at 12:35 AM, Hans Bakker wrote:
> Hi this seems to be caused by r904592
>
> to revert this change:
> svn merge http://svn.apache.org/repos/asf/ofbiz/trunk -r904592:904591
>
> Regards,
> Hans
>
>
> On Mon, 2010-02-01 at 23:07 -0800, Scott Gray wrote:
>> After taking an update today, a lot of form widget field labels seem to be missing from various screens. If any committers are aware of any changes they may have made which could have impacted this please take a look and see if it's related to your work.
>>
>> Here's an example: https://localhost:8443/catalog/control/FindProductConfigItems (only one of the 3 search option fields are presenting a field label)
>> Here's another: https://localhost:8443/accounting/control/findPayments
>>
>> Thanks
>> Scott
>>
>> HotWax Media
>> http://www.hotwaxmedia.com
>>
>>
> --
> Antwebsystems.com: Quality OFBiz services for competitive rates
>
Re: Form Widget labels disappearing
Posted by Adrian Crum <ad...@hlmksw.com>.
Adam Heath wrote:
> Jacques Le Roux wrote:
>> Then we should have this kind of advices in the API or the documentation
>> somewhere. We can't expect that future devs will pick this
>> message easily. It would be easier for us to refer to somewhere as well.
>
> Create an annotation that marks such things, then use apt to verify it
> at the source level.
I plan on going through the project code tonight and change the code
that tests getOriginal() for null. After that I will get rid of the
NullExpr class I just created to fix the problem. Then I will clearly
document the FSE methods and what they return. Maybe include some
example uses in the class description.
You used the term contract in a previous thread. I like that term. The
contract with FSE will be clearly defined when I am finished.
-Adrian
Re: Form Widget labels disappearing
Posted by Jacques Le Roux <ja...@free.fr>.
Ha ok (I was quite sure I was missing something because I was not seeing the relation with Debian apt). Sure I will read more, I'm
currently reading *details* about Java 5 types (not as simple as I thought...)
Thanks
Jacques
From: "Adam Heath" <do...@brainfood.com>
> Jacques Le Roux wrote:
>> Mmm, I work on Windows (so do Adrian, AFAIK) and anyway is this not
>> Debian specific?
>
> Er, no. java apt, not debian apt. Go do some more java reading.
>
> APT -> Annotation Processing Tool.
>
Re: Form Widget labels disappearing
Posted by Adam Heath <do...@brainfood.com>.
Jacques Le Roux wrote:
> Mmm, I work on Windows (so do Adrian, AFAIK) and anyway is this not
> Debian specific?
Er, no. java apt, not debian apt. Go do some more java reading.
APT -> Annotation Processing Tool.
Re: Form Widget labels disappearing
Posted by Jacques Le Roux <ja...@free.fr>.
Mmm, I work on Windows (so do Adrian, AFAIK) and anyway is this not Debian specific?
Jacques
PS : my second choice is Ubuntun when I need to work on Linux. Anyway I will have to definitely switch one day, because of this
stupid Windows RAM limit, after 2 years of 4Go use I begin to feel a bit tight (a real wastefulness, not even capable or getting
back unused memory, OK enough rants, it's "my choice" ;o)
From: "Adam Heath" <do...@brainfood.com>
> Jacques Le Roux wrote:
>> Then we should have this kind of advices in the API or the documentation
>> somewhere. We can't expect that future devs will pick this
>> message easily. It would be easier for us to refer to somewhere as well.
>
> Create an annotation that marks such things, then use apt to verify it
> at the source level.
>
Re: Form Widget labels disappearing
Posted by Adam Heath <do...@brainfood.com>.
Jacques Le Roux wrote:
> Then we should have this kind of advices in the API or the documentation
> somewhere. We can't expect that future devs will pick this
> message easily. It would be easier for us to refer to somewhere as well.
Create an annotation that marks such things, then use apt to verify it
at the source level.
Re: FlexibleStringExpander
Posted by Adrian Crum <ad...@hlmksw.com>.
Adam Heath wrote:
> Adrian Crum wrote:
>> Adam Heath wrote:
>>> Adrian Crum wrote:
>>>> FlexibleStringExpander fse =
>>>> FlexibleStringExpander.getInstance("someExpression");
>>>> if (fse != null) {
>>>> // some code
>>>> }
>>> This was always broken. Type foo = new Type(); foo will *never* be
>>> null, period. There are existing places in the code where this new
>>> Type() compared to null takes place, unrelated to FSE.
>> I was trying to provide a simplified example. You are correct - the
>> simplified example would never work to begin with. What the simplified
>> example might really look like:
>>
>> protected FlexibleStringExpander description = null;
>
> Just for reference, the correct fix here would remove the null default
> value, make it final, and remove the condition check below.
Exactly.
Re: FlexibleStringExpander
Posted by Adam Heath <do...@brainfood.com>.
Adrian Crum wrote:
> Adam Heath wrote:
>> Adrian Crum wrote:
>>> FlexibleStringExpander fse =
>>> FlexibleStringExpander.getInstance("someExpression");
>>> if (fse != null) {
>>> // some code
>>> }
>>
>> This was always broken. Type foo = new Type(); foo will *never* be
>> null, period. There are existing places in the code where this new
>> Type() compared to null takes place, unrelated to FSE.
>
> I was trying to provide a simplified example. You are correct - the
> simplified example would never work to begin with. What the simplified
> example might really look like:
>
> protected FlexibleStringExpander description = null;
Just for reference, the correct fix here would remove the null default
value, make it final, and remove the condition check below.
> ...
> public MyClass(String expression) {
> if (expression != null) {
> description = FlexibleStringExpander.getInstance(expression);
> }
> }
> ...
> public String getDescription(Map context) {
> if (description != null) {
> return description.expandString(context);
> }
> ...
> }
>
> -Adrian
>
Re: FlexibleStringExpander
Posted by Adrian Crum <ad...@hlmksw.com>.
Adam Heath wrote:
> Adrian Crum wrote:
>> FlexibleStringExpander fse =
>> FlexibleStringExpander.getInstance("someExpression");
>> if (fse != null) {
>> // some code
>> }
>
> This was always broken. Type foo = new Type(); foo will *never* be
> null, period. There are existing places in the code where this new
> Type() compared to null takes place, unrelated to FSE.
I was trying to provide a simplified example. You are correct - the
simplified example would never work to begin with. What the simplified
example might really look like:
protected FlexibleStringExpander description = null;
...
public MyClass(String expression) {
if (expression != null) {
description = FlexibleStringExpander.getInstance(expression);
}
}
...
public String getDescription(Map context) {
if (description != null) {
return description.expandString(context);
}
...
}
-Adrian
Re: FlexibleStringExpander
Posted by Adam Heath <do...@brainfood.com>.
Adrian Crum wrote:
> FlexibleStringExpander fse =
> FlexibleStringExpander.getInstance("someExpression");
> if (fse != null) {
> // some code
> }
This was always broken. Type foo = new Type(); foo will *never* be
null, period. There are existing places in the code where this new
Type() compared to null takes place, unrelated to FSE.
Re: FlexibleStringExpander (was: Form Widget labels disappearing)
Posted by Jacques Le Roux <ja...@free.fr>.
Thanks Adrian,
When I will get a chance I will consider to document this. I guess at least in the API and I hope to begin a section for stuff like
that in the wiki.
Jacques
From: "Adrian Crum" <ad...@hlmksw.com>
> In August 2008, FlexibleStringExpander class was redesigned to help conserve memory. The main change needed to use the redesigned
> class was to replace
>
> FlexibleStringExpander fse = new FlexibleStringExpander("someExpression");
>
> with
>
> FlexibleStringExpander fse = FlexibleStringExpander.getInstance("someExpression");
>
> The getInstance method was designed to ALWAYS return an instance, even when the method was called with a null or empty argument.
> Doing things this way makes coding simpler - just treat the instance as if it contains something. There is no need to check for
> null or empty expressions.
>
> A simple project-wide search-and-replace was done to use the redesigned class. The problem is, doing that left behind a lot of
> unnecessary code that was needed for the old design.
>
> It would be nice if we could get some of that legacy code cleaned up. Here are a couple of suggested changes...
>
> Replace
>
> FlexibleStringExpander fse = FlexibleStringExpander.getInstance("someExpression");
> if (fse != null) {
> // some code
> }
>
> with
>
> FlexibleStringExpander fse = FlexibleStringExpander.getInstance("someExpression");
> // some code (getInstance never returns null)
>
> Replace
>
> FlexibleStringExpander fse = FlexibleStringExpander.getInstance(var);
> if (fse.getOriginal() != null) {
> // some code
> }
>
> with
>
> FlexibleStringExpander fse = FlexibleStringExpander.getInstance(var);
> if (!fse.isEmpty()) {
> // some code
> }
>
> -Adrian
>
>
> Jacques Le Roux wrote:
>> Then we should have this kind of advices in the API or the documentation somewhere. We can't expect that future devs will pick
>> this
>> message easily. It would be easier for us to refer to somewhere as well.
>>
>> My 2 cts
>>
>> Jacques
>>
>> From: "Adrian Crum" <ad...@hlmksw.com>
>>> I think you're reading too much into what I said.
>>>
>>> I didn't assign blame to anyone else - I'm using this as an opportunity to instruct. I haven't forgotten the history of the
>>> code.
>>> A lot of those unnecessary checks are left over from the older version of FSE that used the new operator. So, for the benefit of
>>> the other developers I'm explaining why that code is no longer necessary.
>>>
>>> And I'm not surprised by framework changes causing unintended side effects. I usually time my framework commits so I have time
>>> available to fix any problems that pop up.
>>>
>>> -Adrian
>>>
>>> David E Jones wrote:
>>>> And that matters because... ?
>>>>
>>>> The problem is that whenever you change the framework there may be unintended side-effects because the way you think it should
>>>> be
>>>> used may not be the way it is being used (or even the way it was originally intended to be used).
>>>>
>>>> Even if you test a lot there is always the risk of this. So, the point is that you shouldn't be surprised by things like this.
>>>>
>>>> Yes, it is disappointing that people fail to use obvious things like an isEmpty method. Whatever the case, if you change how
>>>> the
>>>> code operates you ALWAYS risk these sorts of issues. It's still to say the problem was caused by how the class was being
>>>> used...
>>>> maybe convenient, but not really correct or useful. Yes, if only everyone would always develop things the way that I think they
>>>> should be developed! Well, if that were the case for me, OFBiz would be a lot different right now... :)
>>>>
>>>> -David
>>>>
>>>>
>>>> On Feb 2, 2010, at 11:28 AM, Adrian Crum wrote:
>>>>
>>>>> I looked through some example uses of FlexibleStringExpander and there is a lot of inconsistency. Some client code expects
>>>>> getOriginal() to always return a String - it doesn't check for null. Other code checks for null.
>>>>>
>>>>> The whole point of the null instance was to eliminate all of the checking for this or that. Just use it as if it contains
>>>>> something. If it's empty it will do nothing.
>>>>>
>>>>> -Adrian
>>>>>
>>>>> David E Jones wrote:
>>>>>> There's the fun of changing the framework...
>>>>>> -David
>>>>>> On Feb 2, 2010, at 10:40 AM, Adrian Crum wrote:
>>>>>>> Okay, I found the problem and committed a fix. We really need to go through the framework and fix the code that uses
>>>>>>> FlexibleStringExpander in inappropriate ways.
>>>>>>>
>>>>>>> FlexibleStringExpander.getInstance will ALWAYS return an instance, so there is no need to check if an instance is equal to
>>>>>>> null.
>>>>>>>
>>>>>>> Checking FlexibleStringExpander.getOriginal() for null or empty is bad coding style. There is an isEmpty() method for that.
>>>>>>>
>>>>>>> -Adrian
>>>>>>>
>>>>>>> Adrian Crum wrote:
>>>>>>>> Hans,
>>>>>>>> How is that commit affecting UI labels?
>>>>>>>> -Adrian
>>>>>>>> Hans Bakker wrote:
>>>>>>>>> Hi this seems to be caused by r904592
>>>>>>>>>
>>>>>>>>> to revert this change:
>>>>>>>>> svn merge http://svn.apache.org/repos/asf/ofbiz/trunk -r904592:904591
>>>>>>>>>
>>>>>>>>> Regards,
>>>>>>>>> Hans
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Mon, 2010-02-01 at 23:07 -0800, Scott Gray wrote:
>>>>>>>>>> After taking an update today, a lot of form widget field labels seem to be missing from various screens. If any
>>>>>>>>>> committers
>>>>>>>>>> are aware of any changes they may have made which could have impacted this please take a look and see if it's related to
>>>>>>>>>> your work.
>>>>>>>>>>
>>>>>>>>>> Here's an example: https://localhost:8443/catalog/control/FindProductConfigItems (only one of the 3 search option fields
>>>>>>>>>> are presenting a field label)
>>>>>>>>>> Here's another: https://localhost:8443/accounting/control/findPayments
>>>>>>>>>>
>>>>>>>>>> Thanks
>>>>>>>>>> Scott
>>>>>>>>>>
>>>>>>>>>> HotWax Media
>>>>>>>>>> http://www.hotwaxmedia.com
>>>>>>>>>>
>>>>>>>>>>
>>>>
>>>>
>>>
>>
>>
>
FlexibleStringExpander (was: Form Widget labels disappearing)
Posted by Adrian Crum <ad...@hlmksw.com>.
In August 2008, FlexibleStringExpander class was redesigned to help
conserve memory. The main change needed to use the redesigned class was
to replace
FlexibleStringExpander fse = new FlexibleStringExpander("someExpression");
with
FlexibleStringExpander fse =
FlexibleStringExpander.getInstance("someExpression");
The getInstance method was designed to ALWAYS return an instance, even
when the method was called with a null or empty argument. Doing things
this way makes coding simpler - just treat the instance as if it
contains something. There is no need to check for null or empty expressions.
A simple project-wide search-and-replace was done to use the redesigned
class. The problem is, doing that left behind a lot of unnecessary code
that was needed for the old design.
It would be nice if we could get some of that legacy code cleaned up.
Here are a couple of suggested changes...
Replace
FlexibleStringExpander fse =
FlexibleStringExpander.getInstance("someExpression");
if (fse != null) {
// some code
}
with
FlexibleStringExpander fse =
FlexibleStringExpander.getInstance("someExpression");
// some code (getInstance never returns null)
Replace
FlexibleStringExpander fse = FlexibleStringExpander.getInstance(var);
if (fse.getOriginal() != null) {
// some code
}
with
FlexibleStringExpander fse = FlexibleStringExpander.getInstance(var);
if (!fse.isEmpty()) {
// some code
}
-Adrian
Jacques Le Roux wrote:
> Then we should have this kind of advices in the API or the documentation
> somewhere. We can't expect that future devs will pick this
> message easily. It would be easier for us to refer to somewhere as well.
>
> My 2 cts
>
> Jacques
>
> From: "Adrian Crum" <ad...@hlmksw.com>
>> I think you're reading too much into what I said.
>>
>> I didn't assign blame to anyone else - I'm using this as an
>> opportunity to instruct. I haven't forgotten the history of the code.
>> A lot of those unnecessary checks are left over from the older version
>> of FSE that used the new operator. So, for the benefit of
>> the other developers I'm explaining why that code is no longer necessary.
>>
>> And I'm not surprised by framework changes causing unintended side
>> effects. I usually time my framework commits so I have time
>> available to fix any problems that pop up.
>>
>> -Adrian
>>
>> David E Jones wrote:
>>> And that matters because... ?
>>>
>>> The problem is that whenever you change the framework there may be
>>> unintended side-effects because the way you think it should be
>>> used may not be the way it is being used (or even the way it was
>>> originally intended to be used).
>>>
>>> Even if you test a lot there is always the risk of this. So, the
>>> point is that you shouldn't be surprised by things like this.
>>>
>>> Yes, it is disappointing that people fail to use obvious things like
>>> an isEmpty method. Whatever the case, if you change how the
>>> code operates you ALWAYS risk these sorts of issues. It's still to
>>> say the problem was caused by how the class was being used...
>>> maybe convenient, but not really correct or useful. Yes, if only
>>> everyone would always develop things the way that I think they
>>> should be developed! Well, if that were the case for me, OFBiz would
>>> be a lot different right now... :)
>>>
>>> -David
>>>
>>>
>>> On Feb 2, 2010, at 11:28 AM, Adrian Crum wrote:
>>>
>>>> I looked through some example uses of FlexibleStringExpander and
>>>> there is a lot of inconsistency. Some client code expects
>>>> getOriginal() to always return a String - it doesn't check for null.
>>>> Other code checks for null.
>>>>
>>>> The whole point of the null instance was to eliminate all of the
>>>> checking for this or that. Just use it as if it contains
>>>> something. If it's empty it will do nothing.
>>>>
>>>> -Adrian
>>>>
>>>> David E Jones wrote:
>>>>> There's the fun of changing the framework...
>>>>> -David
>>>>> On Feb 2, 2010, at 10:40 AM, Adrian Crum wrote:
>>>>>> Okay, I found the problem and committed a fix. We really need to
>>>>>> go through the framework and fix the code that uses
>>>>>> FlexibleStringExpander in inappropriate ways.
>>>>>>
>>>>>> FlexibleStringExpander.getInstance will ALWAYS return an instance,
>>>>>> so there is no need to check if an instance is equal to
>>>>>> null.
>>>>>>
>>>>>> Checking FlexibleStringExpander.getOriginal() for null or empty is
>>>>>> bad coding style. There is an isEmpty() method for that.
>>>>>>
>>>>>> -Adrian
>>>>>>
>>>>>> Adrian Crum wrote:
>>>>>>> Hans,
>>>>>>> How is that commit affecting UI labels?
>>>>>>> -Adrian
>>>>>>> Hans Bakker wrote:
>>>>>>>> Hi this seems to be caused by r904592
>>>>>>>>
>>>>>>>> to revert this change:
>>>>>>>> svn merge http://svn.apache.org/repos/asf/ofbiz/trunk
>>>>>>>> -r904592:904591
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>> Hans
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, 2010-02-01 at 23:07 -0800, Scott Gray wrote:
>>>>>>>>> After taking an update today, a lot of form widget field labels
>>>>>>>>> seem to be missing from various screens. If any committers
>>>>>>>>> are aware of any changes they may have made which could have
>>>>>>>>> impacted this please take a look and see if it's related to
>>>>>>>>> your work.
>>>>>>>>>
>>>>>>>>> Here's an example:
>>>>>>>>> https://localhost:8443/catalog/control/FindProductConfigItems
>>>>>>>>> (only one of the 3 search option fields
>>>>>>>>> are presenting a field label)
>>>>>>>>> Here's another:
>>>>>>>>> https://localhost:8443/accounting/control/findPayments
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>> Scott
>>>>>>>>>
>>>>>>>>> HotWax Media
>>>>>>>>> http://www.hotwaxmedia.com
>>>>>>>>>
>>>>>>>>>
>>>
>>>
>>
>
>
Re: Form Widget labels disappearing
Posted by Jacques Le Roux <ja...@free.fr>.
Then we should have this kind of advices in the API or the documentation somewhere. We can't expect that future devs will pick this
message easily. It would be easier for us to refer to somewhere as well.
My 2 cts
Jacques
From: "Adrian Crum" <ad...@hlmksw.com>
>I think you're reading too much into what I said.
>
> I didn't assign blame to anyone else - I'm using this as an opportunity to instruct. I haven't forgotten the history of the code.
> A lot of those unnecessary checks are left over from the older version of FSE that used the new operator. So, for the benefit of
> the other developers I'm explaining why that code is no longer necessary.
>
> And I'm not surprised by framework changes causing unintended side effects. I usually time my framework commits so I have time
> available to fix any problems that pop up.
>
> -Adrian
>
> David E Jones wrote:
>> And that matters because... ?
>>
>> The problem is that whenever you change the framework there may be unintended side-effects because the way you think it should be
>> used may not be the way it is being used (or even the way it was originally intended to be used).
>>
>> Even if you test a lot there is always the risk of this. So, the point is that you shouldn't be surprised by things like this.
>>
>> Yes, it is disappointing that people fail to use obvious things like an isEmpty method. Whatever the case, if you change how the
>> code operates you ALWAYS risk these sorts of issues. It's still to say the problem was caused by how the class was being used...
>> maybe convenient, but not really correct or useful. Yes, if only everyone would always develop things the way that I think they
>> should be developed! Well, if that were the case for me, OFBiz would be a lot different right now... :)
>>
>> -David
>>
>>
>> On Feb 2, 2010, at 11:28 AM, Adrian Crum wrote:
>>
>>> I looked through some example uses of FlexibleStringExpander and there is a lot of inconsistency. Some client code expects
>>> getOriginal() to always return a String - it doesn't check for null. Other code checks for null.
>>>
>>> The whole point of the null instance was to eliminate all of the checking for this or that. Just use it as if it contains
>>> something. If it's empty it will do nothing.
>>>
>>> -Adrian
>>>
>>> David E Jones wrote:
>>>> There's the fun of changing the framework...
>>>> -David
>>>> On Feb 2, 2010, at 10:40 AM, Adrian Crum wrote:
>>>>> Okay, I found the problem and committed a fix. We really need to go through the framework and fix the code that uses
>>>>> FlexibleStringExpander in inappropriate ways.
>>>>>
>>>>> FlexibleStringExpander.getInstance will ALWAYS return an instance, so there is no need to check if an instance is equal to
>>>>> null.
>>>>>
>>>>> Checking FlexibleStringExpander.getOriginal() for null or empty is bad coding style. There is an isEmpty() method for that.
>>>>>
>>>>> -Adrian
>>>>>
>>>>> Adrian Crum wrote:
>>>>>> Hans,
>>>>>> How is that commit affecting UI labels?
>>>>>> -Adrian
>>>>>> Hans Bakker wrote:
>>>>>>> Hi this seems to be caused by r904592
>>>>>>>
>>>>>>> to revert this change:
>>>>>>> svn merge http://svn.apache.org/repos/asf/ofbiz/trunk -r904592:904591
>>>>>>>
>>>>>>> Regards,
>>>>>>> Hans
>>>>>>>
>>>>>>>
>>>>>>> On Mon, 2010-02-01 at 23:07 -0800, Scott Gray wrote:
>>>>>>>> After taking an update today, a lot of form widget field labels seem to be missing from various screens. If any committers
>>>>>>>> are aware of any changes they may have made which could have impacted this please take a look and see if it's related to
>>>>>>>> your work.
>>>>>>>>
>>>>>>>> Here's an example: https://localhost:8443/catalog/control/FindProductConfigItems (only one of the 3 search option fields
>>>>>>>> are presenting a field label)
>>>>>>>> Here's another: https://localhost:8443/accounting/control/findPayments
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Scott
>>>>>>>>
>>>>>>>> HotWax Media
>>>>>>>> http://www.hotwaxmedia.com
>>>>>>>>
>>>>>>>>
>>
>>
>
Re: Form Widget labels disappearing
Posted by Adrian Crum <ad...@hlmksw.com>.
I think you're reading too much into what I said.
I didn't assign blame to anyone else - I'm using this as an opportunity
to instruct. I haven't forgotten the history of the code. A lot of those
unnecessary checks are left over from the older version of FSE that used
the new operator. So, for the benefit of the other developers I'm
explaining why that code is no longer necessary.
And I'm not surprised by framework changes causing unintended side
effects. I usually time my framework commits so I have time available to
fix any problems that pop up.
-Adrian
David E Jones wrote:
> And that matters because... ?
>
> The problem is that whenever you change the framework there may be unintended side-effects because the way you think it should be used may not be the way it is being used (or even the way it was originally intended to be used).
>
> Even if you test a lot there is always the risk of this. So, the point is that you shouldn't be surprised by things like this.
>
> Yes, it is disappointing that people fail to use obvious things like an isEmpty method. Whatever the case, if you change how the code operates you ALWAYS risk these sorts of issues. It's still to say the problem was caused by how the class was being used... maybe convenient, but not really correct or useful.
>
> Yes, if only everyone would always develop things the way that I think they should be developed! Well, if that were the case for me, OFBiz would be a lot different right now... :)
>
> -David
>
>
> On Feb 2, 2010, at 11:28 AM, Adrian Crum wrote:
>
>> I looked through some example uses of FlexibleStringExpander and there is a lot of inconsistency. Some client code expects getOriginal() to always return a String - it doesn't check for null. Other code checks for null.
>>
>> The whole point of the null instance was to eliminate all of the checking for this or that. Just use it as if it contains something. If it's empty it will do nothing.
>>
>> -Adrian
>>
>> David E Jones wrote:
>>> There's the fun of changing the framework...
>>> -David
>>> On Feb 2, 2010, at 10:40 AM, Adrian Crum wrote:
>>>> Okay, I found the problem and committed a fix. We really need to go through the framework and fix the code that uses FlexibleStringExpander in inappropriate ways.
>>>>
>>>> FlexibleStringExpander.getInstance will ALWAYS return an instance, so there is no need to check if an instance is equal to null.
>>>>
>>>> Checking FlexibleStringExpander.getOriginal() for null or empty is bad coding style. There is an isEmpty() method for that.
>>>>
>>>> -Adrian
>>>>
>>>> Adrian Crum wrote:
>>>>> Hans,
>>>>> How is that commit affecting UI labels?
>>>>> -Adrian
>>>>> Hans Bakker wrote:
>>>>>> Hi this seems to be caused by r904592
>>>>>>
>>>>>> to revert this change:
>>>>>> svn merge http://svn.apache.org/repos/asf/ofbiz/trunk -r904592:904591
>>>>>>
>>>>>> Regards,
>>>>>> Hans
>>>>>>
>>>>>>
>>>>>> On Mon, 2010-02-01 at 23:07 -0800, Scott Gray wrote:
>>>>>>> After taking an update today, a lot of form widget field labels seem to be missing from various screens. If any committers are aware of any changes they may have made which could have impacted this please take a look and see if it's related to your work.
>>>>>>>
>>>>>>> Here's an example: https://localhost:8443/catalog/control/FindProductConfigItems (only one of the 3 search option fields are presenting a field label)
>>>>>>> Here's another: https://localhost:8443/accounting/control/findPayments
>>>>>>>
>>>>>>> Thanks
>>>>>>> Scott
>>>>>>>
>>>>>>> HotWax Media
>>>>>>> http://www.hotwaxmedia.com
>>>>>>>
>>>>>>>
>
>
Re: Form Widget labels disappearing
Posted by David E Jones <de...@me.com>.
And that matters because... ?
The problem is that whenever you change the framework there may be unintended side-effects because the way you think it should be used may not be the way it is being used (or even the way it was originally intended to be used).
Even if you test a lot there is always the risk of this. So, the point is that you shouldn't be surprised by things like this.
Yes, it is disappointing that people fail to use obvious things like an isEmpty method. Whatever the case, if you change how the code operates you ALWAYS risk these sorts of issues. It's still to say the problem was caused by how the class was being used... maybe convenient, but not really correct or useful.
Yes, if only everyone would always develop things the way that I think they should be developed! Well, if that were the case for me, OFBiz would be a lot different right now... :)
-David
On Feb 2, 2010, at 11:28 AM, Adrian Crum wrote:
> I looked through some example uses of FlexibleStringExpander and there is a lot of inconsistency. Some client code expects getOriginal() to always return a String - it doesn't check for null. Other code checks for null.
>
> The whole point of the null instance was to eliminate all of the checking for this or that. Just use it as if it contains something. If it's empty it will do nothing.
>
> -Adrian
>
> David E Jones wrote:
>> There's the fun of changing the framework...
>> -David
>> On Feb 2, 2010, at 10:40 AM, Adrian Crum wrote:
>>> Okay, I found the problem and committed a fix. We really need to go through the framework and fix the code that uses FlexibleStringExpander in inappropriate ways.
>>>
>>> FlexibleStringExpander.getInstance will ALWAYS return an instance, so there is no need to check if an instance is equal to null.
>>>
>>> Checking FlexibleStringExpander.getOriginal() for null or empty is bad coding style. There is an isEmpty() method for that.
>>>
>>> -Adrian
>>>
>>> Adrian Crum wrote:
>>>> Hans,
>>>> How is that commit affecting UI labels?
>>>> -Adrian
>>>> Hans Bakker wrote:
>>>>> Hi this seems to be caused by r904592
>>>>>
>>>>> to revert this change:
>>>>> svn merge http://svn.apache.org/repos/asf/ofbiz/trunk -r904592:904591
>>>>>
>>>>> Regards,
>>>>> Hans
>>>>>
>>>>>
>>>>> On Mon, 2010-02-01 at 23:07 -0800, Scott Gray wrote:
>>>>>> After taking an update today, a lot of form widget field labels seem to be missing from various screens. If any committers are aware of any changes they may have made which could have impacted this please take a look and see if it's related to your work.
>>>>>>
>>>>>> Here's an example: https://localhost:8443/catalog/control/FindProductConfigItems (only one of the 3 search option fields are presenting a field label)
>>>>>> Here's another: https://localhost:8443/accounting/control/findPayments
>>>>>>
>>>>>> Thanks
>>>>>> Scott
>>>>>>
>>>>>> HotWax Media
>>>>>> http://www.hotwaxmedia.com
>>>>>>
>>>>>>
Re: Form Widget labels disappearing
Posted by Adrian Crum <ad...@hlmksw.com>.
I looked through some example uses of FlexibleStringExpander and there
is a lot of inconsistency. Some client code expects getOriginal() to
always return a String - it doesn't check for null. Other code checks
for null.
The whole point of the null instance was to eliminate all of the
checking for this or that. Just use it as if it contains something. If
it's empty it will do nothing.
-Adrian
David E Jones wrote:
> There's the fun of changing the framework...
>
> -David
>
>
> On Feb 2, 2010, at 10:40 AM, Adrian Crum wrote:
>
>> Okay, I found the problem and committed a fix. We really need to go through the framework and fix the code that uses FlexibleStringExpander in inappropriate ways.
>>
>> FlexibleStringExpander.getInstance will ALWAYS return an instance, so there is no need to check if an instance is equal to null.
>>
>> Checking FlexibleStringExpander.getOriginal() for null or empty is bad coding style. There is an isEmpty() method for that.
>>
>> -Adrian
>>
>> Adrian Crum wrote:
>>> Hans,
>>> How is that commit affecting UI labels?
>>> -Adrian
>>> Hans Bakker wrote:
>>>> Hi this seems to be caused by r904592
>>>>
>>>> to revert this change:
>>>> svn merge http://svn.apache.org/repos/asf/ofbiz/trunk -r904592:904591
>>>>
>>>> Regards,
>>>> Hans
>>>>
>>>>
>>>> On Mon, 2010-02-01 at 23:07 -0800, Scott Gray wrote:
>>>>> After taking an update today, a lot of form widget field labels seem to be missing from various screens. If any committers are aware of any changes they may have made which could have impacted this please take a look and see if it's related to your work.
>>>>>
>>>>> Here's an example: https://localhost:8443/catalog/control/FindProductConfigItems (only one of the 3 search option fields are presenting a field label)
>>>>> Here's another: https://localhost:8443/accounting/control/findPayments
>>>>>
>>>>> Thanks
>>>>> Scott
>>>>>
>>>>> HotWax Media
>>>>> http://www.hotwaxmedia.com
>>>>>
>>>>>
>
>
Re: Form Widget labels disappearing
Posted by David E Jones <de...@me.com>.
There's the fun of changing the framework...
-David
On Feb 2, 2010, at 10:40 AM, Adrian Crum wrote:
> Okay, I found the problem and committed a fix. We really need to go through the framework and fix the code that uses FlexibleStringExpander in inappropriate ways.
>
> FlexibleStringExpander.getInstance will ALWAYS return an instance, so there is no need to check if an instance is equal to null.
>
> Checking FlexibleStringExpander.getOriginal() for null or empty is bad coding style. There is an isEmpty() method for that.
>
> -Adrian
>
> Adrian Crum wrote:
>> Hans,
>> How is that commit affecting UI labels?
>> -Adrian
>> Hans Bakker wrote:
>>> Hi this seems to be caused by r904592
>>>
>>> to revert this change:
>>> svn merge http://svn.apache.org/repos/asf/ofbiz/trunk -r904592:904591
>>>
>>> Regards,
>>> Hans
>>>
>>>
>>> On Mon, 2010-02-01 at 23:07 -0800, Scott Gray wrote:
>>>> After taking an update today, a lot of form widget field labels seem to be missing from various screens. If any committers are aware of any changes they may have made which could have impacted this please take a look and see if it's related to your work.
>>>>
>>>> Here's an example: https://localhost:8443/catalog/control/FindProductConfigItems (only one of the 3 search option fields are presenting a field label)
>>>> Here's another: https://localhost:8443/accounting/control/findPayments
>>>>
>>>> Thanks
>>>> Scott
>>>>
>>>> HotWax Media
>>>> http://www.hotwaxmedia.com
>>>>
>>>>
Re: Form Widget labels disappearing
Posted by Adrian Crum <ad...@hlmksw.com>.
Okay, I found the problem and committed a fix. We really need to go
through the framework and fix the code that uses FlexibleStringExpander
in inappropriate ways.
FlexibleStringExpander.getInstance will ALWAYS return an instance, so
there is no need to check if an instance is equal to null.
Checking FlexibleStringExpander.getOriginal() for null or empty is bad
coding style. There is an isEmpty() method for that.
-Adrian
Adrian Crum wrote:
> Hans,
>
> How is that commit affecting UI labels?
>
> -Adrian
>
> Hans Bakker wrote:
>> Hi this seems to be caused by r904592
>>
>> to revert this change:
>> svn merge http://svn.apache.org/repos/asf/ofbiz/trunk -r904592:904591
>>
>> Regards,
>> Hans
>>
>>
>> On Mon, 2010-02-01 at 23:07 -0800, Scott Gray wrote:
>>> After taking an update today, a lot of form widget field labels seem
>>> to be missing from various screens. If any committers are aware of
>>> any changes they may have made which could have impacted this please
>>> take a look and see if it's related to your work.
>>>
>>> Here's an example:
>>> https://localhost:8443/catalog/control/FindProductConfigItems (only
>>> one of the 3 search option fields are presenting a field label)
>>> Here's another: https://localhost:8443/accounting/control/findPayments
>>>
>>> Thanks
>>> Scott
>>>
>>> HotWax Media
>>> http://www.hotwaxmedia.com
>>>
>>>
>
Re: Form Widget labels disappearing
Posted by Adrian Crum <ad...@hlmksw.com>.
Hans,
How is that commit affecting UI labels?
-Adrian
Hans Bakker wrote:
> Hi this seems to be caused by r904592
>
> to revert this change:
> svn merge http://svn.apache.org/repos/asf/ofbiz/trunk -r904592:904591
>
> Regards,
> Hans
>
>
> On Mon, 2010-02-01 at 23:07 -0800, Scott Gray wrote:
>> After taking an update today, a lot of form widget field labels seem to be missing from various screens. If any committers are aware of any changes they may have made which could have impacted this please take a look and see if it's related to your work.
>>
>> Here's an example: https://localhost:8443/catalog/control/FindProductConfigItems (only one of the 3 search option fields are presenting a field label)
>> Here's another: https://localhost:8443/accounting/control/findPayments
>>
>> Thanks
>> Scott
>>
>> HotWax Media
>> http://www.hotwaxmedia.com
>>
>>
Re: Form Widget labels disappearing
Posted by Hans Bakker <ma...@antwebsystems.com>.
Hi this seems to be caused by r904592
to revert this change:
svn merge http://svn.apache.org/repos/asf/ofbiz/trunk -r904592:904591
Regards,
Hans
On Mon, 2010-02-01 at 23:07 -0800, Scott Gray wrote:
> After taking an update today, a lot of form widget field labels seem to be missing from various screens. If any committers are aware of any changes they may have made which could have impacted this please take a look and see if it's related to your work.
>
> Here's an example: https://localhost:8443/catalog/control/FindProductConfigItems (only one of the 3 search option fields are presenting a field label)
> Here's another: https://localhost:8443/accounting/control/findPayments
>
> Thanks
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
>
--
Antwebsystems.com: Quality OFBiz services for competitive rates