#17431 closed enhancement (fixed)
Improve readability of code regarding OsmDataLayer.validationErrors and ValidatorTreePanel
Reported by: | GerdP | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 19.03 |
Component: | Core validator | Version: | |
Keywords: | Cc: |
Description
There is a very confusing relation between the field public OsmDataLayer.validationErrors
and the private field ValidatorTreePanel.errors
. In some situations both refer to the same instance of ArrayList, but this is not guaranteed by the code. I assume the reason for this are unit tests.
The content of OsmDataLayer.validationErrors
is directly modified in ValidateUploadHook
and ValidatorErrorExporter.exportData()
reads it.
The content of OsmDataLayer.validationErrors
is also modified when ValidatorTreePanel.errors
refers to the same object. This is controlled in ValidatorDialog
.
My current understanding is that we have a single instance of ValidatorDialog
and ValidatorTreePanel
but possibly multiple instances of OsmDataLayer
, so it seems to be correct to keep the error list in OsmDataLayer.validationErrors
.
Question is why we don't use that field in the validator classes?
Attachments (0)
Change History (3)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I think the current code is a bit clearer.
Question is why we don't use that field in the validator classes?
It makes the unit tests less complicated.
comment:3 by , 6 years ago
Milestone: | → 19.03 |
---|
In 14857/josm: