Re: About JTextPane, Why "Not equal" ?



Tom Hawtin <use...@xxxxxxxxxxxxxxxxx> wrote:
..As ever, static variables suck big time.

Andrew Thompson wrote:
'For those of us that are a little slower than the rest'
(OK.. me) could you expand a little on that?

Whilst awaiting Tom's answer I shall venture a guess, which if Tom's answer differs I shall almost certainly abandon in favor of his explanation.

Static variables are the global variables of Java. They have implicit effects ignorance of which can lead one to create bugs.

Locale in a String is such a thing - global to all instances of String within a particular run of the JVM unless explicitly specified. This causes portability issues in such code. Likewise, I guess the AttributeSets in a JTextPane are implicit and can lead to surprising portability issues.

I do not know what parts of the JTextPane issue are literally static or global, but I can see the point about implicit characteristics.

Am I close?

-- Lew
.



Relevant Pages

  • Re: Why cant I xor strings?
    ... What's right about accepting 3^7? ... IMO we have implicit subtyping of integers as vectors or column matrices ... >int ^ string, and there isn't. ...
    (comp.lang.python)
  • Re: Question: Given |X|>0 and |Y|>0, can X x Y be empty?
    ... Even more amazing was your reply, "I'm here to learn from my mistakes; ... THERE ARE *NO* implicit assumptions going on here! ... There is nothing going on here beyond string comparison. ... and 2) set theory is going to be presented IN FIRST-ORDER ...
    (sci.logic)
  • Re: Two Questions about "strlen", "strcat" and "strcpy"
    ... The reasoning is that unsigned values have a larger maximum value and ... incremental string concatenation is simplified ... fact calls to strlen, implicit or not, is the real performance ... People may write strcpy() in "hand coded assembly language" if they ...
    (comp.lang.c)
  • Re: Properties
    ... Creates a private field in the same class as the property and appends ... random string to the the name of property and use that for the field. ... really any different than C# having an implicit destructor even if its not ... Instead of declaring the field outside ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Can a variable hold 2 values simultaneously - a string value and a numeric?
    ... > the same type coercion issues. ... string is implicitly coerced to the appropriate type. ... You recommended as a solution to the implicit ... > "the values" and with the format property set to a number would ...
    (comp.databases.ms-access)