Ticket #630 (closed Feature Request: worksforme)

Opened 11 years ago

Last modified 11 years ago

intialize missing numeric ClientState value with "-1"

Reported by: Malte Owned by: jri
Priority: Minor Milestone:
Component: DeepaMehta Standard Distribution Version: 4.2
Keywords: Cc:
Complexity: 1 Area:
Module: deepamehta-core

Description

Since the DM cookie-values shall (for now) contain a numeric value I would prefer if the ClientState?-Implementation would set them to "-1" if missing/not given with the request (instead of throwing a NumberFormatException? while trying to parse "null").

Change History

comment:1 Changed 11 years ago by Malte

  • Summary changed from make ClientState parsing more robust to intialize missing numeric ClientState value with "-1"

Wrong title, renamed issue from:

"make ClientState? parsing more robust"

to "intialize missing numeric ClientState? value with "-1"

comment:2 Changed 11 years ago by Malte

To clarify what is at stake: This is a question of style.

Depending on your choice I will submit my first "Pull request" (and one you like) to a repo of yours. Thanks for your understanding.

comment:3 Changed 11 years ago by jri

No. The ClientState? values are not restricted to numerics.
This reflects just the situation as is (workspace ID and topicmap ID).
In general a DM application is free to set all kinds of cookie values. Numeric, alphanumeric, even empty values.

The exact semantic of ClientState? is: a ClientState? object represents ALL the cookies send to the DM server. This includes even non-DM cookies (just fixed, see #625).
On the wire cookie values are inherently strings. There is no type information.

comment:4 Changed 11 years ago by Malte

  • Status changed from new to closed
  • Resolution set to worksforme

Thanks, what I do understand better now: A plugin developer may set non-numeric DM-cookies so that the proposed solution here would restrict others and is therefor impractical.

Overall, great, thanks for your quick reply. Then I can close this ticket.

Note: See TracTickets for help on using tickets.