Fix NPE when trying to download restconf provided yang files 04/65804/5
authorTomas Cere <tomas.cere@pantheon.tech>
Tue, 21 Nov 2017 15:45:42 +0000 (16:45 +0100)
committerTomas Cere <tomas.cere@pantheon.tech>
Wed, 22 Nov 2017 13:37:34 +0000 (14:37 +0100)
commit39cf308c4fb81ab696bcc06736361afa0b230f9b
treef2583059202a6d88e26edd7a67bc515d0bcabf9f
parent6b8e4f7ee09ed344969ddad8017a7f41ad89f2d0
Fix NPE when trying to download restconf provided yang files

Restconf throws a NPE when trying to download the provided yang files
due to using Module.getSource() which is deprecated an @Nullable.
Switch this to using DOMSchemaService.
This fixes the NPE only in the rfc8040 implementation,
draft02 still most likely has it.

Change-Id: Ic8fc94a26a1e29e037872dfdc16c97ef19fcf115
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
17 files changed:
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/schema/SchemaExportContext.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYangBodyWriter.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaRetrievalServiceImpl.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/ControllerContext.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/RestconfProviderImpl.java
restconf/restconf-nb-bierman02/src/main/resources/org/opendaylight/blueprint/restconf-config.xml
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/RestConnectorProvider.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/schema/SchemaExportContentYangBodyWriter.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/services/simple/impl/RestconfSchemaServiceImpl.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/services/wrapper/ServiceWrapper.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/services/wrapper/ServicesWrapperImpl.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/utils/parser/ParserIdentifier.java
restconf/restconf-nb-rfc8040/src/main/resources/org/opendaylight/blueprint/restconf-bp.xml
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/RestConnectorProviderTest.java
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/JSONRestconfServiceRfc8040ImplTest.java
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/services/simple/impl/RestconfSchemaServiceTest.java
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/utils/parser/ParserIdentifierTest.java