Thank you,
but you agree that it is strange that a utility method is non-static, 
causing any static context not to be able to exploit it, for example when a 
utiity class is created to support common functions missing in CodenameOne 
for portability or lightweightness.
Regards
Il giorno lunedì 25 gennaio 2021 alle 03:29:39 UTC+1 Shai Almog ha scritto:

> It's L10NManager.getInstance().format(...)
>
> On Sunday, January 24, 2021 at 1:10:43 PM UTC+2 P5music wrote:
>
>> Of course
>> I meant that L10NManager.format is the replacement for the String.format 
>> method that CodenameOne does not have.
>>
>>
>> Il giorno domenica 24 gennaio 2021 alle 12:09:15 UTC+1 P5music ha scritto:
>>
>>> I am purging my source code from methods CodenameOne does not have.
>>>
>>> The last one is L10NManager.format()
>>> used like
>>> L10NManager.format( seconds,5)
>>>
>>> I put it in some static methods in my utility class
>>> and
>>> the compiler complains that non-static methods cannot be called from 
>>> static context.
>>> This is strange, probably wrong, for a method like L10NManager.format
>>> However I moved that methods in the only place where they are used, that 
>>> is non-static, and they were changed to be non-static too. I checked the 
>>> "static" word and it is not present on methods of the class.
>>> But
>>> the compiler is complaining about the same issue
>>> java: non-static method format(double,int) cannot be referenced from a 
>>> static context
>>> that is certainly wrong because nothing is static there.
>>> Thanks in advance
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/4f6a1d8e-9a5e-4e6f-ab56-94ddd7f9bbbfn%40googlegroups.com.

Reply via email to