question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DDFFileParser does not handle resource without a data type ("none")

See original GitHub issue

The specifications of both LWM2M 1.0 and 1.1 have normative listings of resources’ data type. There’s a “none” entry in that listing, which states

No specific data type affected to that resource: it exclusively concerns Executable Resource.

When reading resource model definitions using DDFFileParser, and the resource is specified with <Type></Type>, that resource model still gets Type.STRING as type.

See https://github.com/eclipse/leshan/blob/dea23774923a2abfb09968128802ce3fcde0ab4b/leshan-core/src/main/java/org/eclipse/leshan/core/model/DDFFileParser.java#L134 for the implicit default case, and https://github.com/eclipse/leshan/blob/dea23774923a2abfb09968128802ce3fcde0ab4b/leshan-core/src/main/java/org/eclipse/leshan/core/model/DDFFileParser.java#L158-L180 for the switch case which we “fallthrough” with an empty type.

I would expect either null or an explicit sentinel value such as Type.NONE, where the latter is preferred both since it avoids having to null check, and because it’s name matches the specification(s).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
sbernard31commented, Apr 30, 2020

(fix integrated in master)

0reactions
sbernard31commented, May 5, 2020

Thx for your help 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

DBF Objects — dbfread 2.0.7 documentation - Read the Docs
DBFNotFound will be raised if the file is not found, and MissingMemoFile if the ... this to add new field types or do...
Read more >
dbfread/dbf.py at master - GitHub
Class to read DBF files. """ import os. import sys. import datetime. import platform. import collections. from .ifiles import ifind.
Read more >
dbfread Documentation - Read the Docs
This library reads DBF files and returns the data as native Python data types for further processing. It is primarily intended for batch...
Read more >
Is there a way to process a DBF file in Java without external ...
The original DBF format is pretty simple. So if you only have to read .dbf files, it's not that ...
Read more >
reading data from .dbf file into oracle 8i -- HOW TO LOAD DB...
If not supplied, this pkg -- assumes the column names in the DBASE file -- are the same as the column names in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found