Problem with line stippling

I’m having a strange issue with line stippling.

I can successful enable line stippling (glEnable(GL_LINE_STIPPLE), then set a glLineStipple(5, 0x5555) which correctly stipples my line(s).
However, when I then do a glDisable(GL_LINE_STIPPLE), it seems to have no effect, and any subsequent lines are stippled also.

I did a quick test, and it seems that if I do:
glEnable(GL_LINE_STIPPLE)
glLineStipple(…)
glDisable(GL_LINE_STIPPLE)
glBegin
…vertex…
glEnd

I, as expected, get no stippling at all b/c the stippling is disabled prior to the glBegin/End.

However, if i move the glDisable to AFTER the glEnd, I correctly get stippling, but the disable has no effect.

Also, if I don’t do the glEnable() I get no stippling as expected.

However, in a JUnit test, I create a canvas using the canvas factory. I then test glIsEnabled on GL_LINE_STIPPLE, which initially is false, then call glEnable(GL_LINE_STIPPLE) but the value is still false on a subsequent call to glIsEnabled(). Quite strange.

Is there something stupid I’ve missed?

Greg.