File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
analyzer/src/main/kotlin/managers/utils Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -23,13 +23,12 @@ package org.ossreviewtoolkit.analyzer.managers.utils
23
23
24
24
import com.fasterxml.jackson.core.JsonProcessingException
25
25
import com.fasterxml.jackson.databind.node.ArrayNode
26
- import com.fasterxml.jackson.databind.node.ObjectNode
27
26
28
27
import java.io.File
29
28
import java.nio.file.FileSystems
30
29
import java.nio.file.PathMatcher
31
30
32
- import org.ossreviewtoolkit.model.readValue
31
+ import org.ossreviewtoolkit.model.readJsonFile
33
32
import org.ossreviewtoolkit.utils.AuthenticatedProxy
34
33
import org.ossreviewtoolkit.utils.ProtocolProxyMap
35
34
import org.ossreviewtoolkit.utils.collectMessagesAsString
@@ -176,7 +175,7 @@ private fun getPackageJsonInfo(definitionFiles: Set<File>): Collection<PackageJs
176
175
177
176
private fun isYarnWorkspaceRoot (definitionFile : File ) =
178
177
try {
179
- definitionFile.readValue< ObjectNode >()[ " workspaces" ] != null
178
+ readJsonFile( definitionFile).has( " workspaces" )
180
179
} catch (e: JsonProcessingException ) {
181
180
e.showStackTrace()
182
181
@@ -211,7 +210,7 @@ private fun getYarnWorkspaceSubmodules(definitionFiles: Set<File>): Set<File> {
211
210
212
211
private fun getWorkspaceMatchers (definitionFile : File ): List <PathMatcher > {
213
212
var workspaces = try {
214
- definitionFile.readValue< ObjectNode >()[ " workspaces" ]
213
+ readJsonFile( definitionFile).get( " workspaces" )
215
214
} catch (e: JsonProcessingException ) {
216
215
e.showStackTrace()
217
216
You can’t perform that action at this time.
0 commit comments