Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Devrim Gunyel
core
Commits
2eee9b94
Commit
2eee9b94
authored
Mar 11, 2019
by
Piotr Gawron
Browse files
function returns list instead of modifying parameter
parent
c2e88a2f
Changes
1
Show whitespace changes
Inline
Side-by-side
service/src/main/java/lcsb/mapviewer/services/utils/ColorSchemaReader.java
View file @
2eee9b94
...
...
@@ -152,8 +152,8 @@ public class ColorSchemaReader {
String
[]
columns
=
line
.
split
(
"\t"
);
Map
<
ColorSchemaColumn
,
Integer
>
schemaColumns
=
new
HashMap
<>();
List
<
Pair
<
MiriamType
,
Integer
>>
customIdentifiers
=
new
ArrayList
<>();
parseColumns
(
columns
,
schemaColumns
,
customIdentifiers
,
ColorSchemaType
.
GENETIC_VARIANT
);
List
<
Pair
<
MiriamType
,
Integer
>>
customIdentifiers
=
parseColumns
(
columns
,
schemaColumns
,
ColorSchemaType
.
GENETIC_VARIANT
);
Integer
colorColumn
=
schemaColumns
.
get
(
ColorSchemaColumn
.
COLOR
);
Integer
contigColumn
=
schemaColumns
.
get
(
ColorSchemaColumn
.
CONTIG
);
if
(
contigColumn
==
null
)
{
...
...
@@ -481,8 +481,7 @@ public class ColorSchemaReader {
String
[]
columns
=
line
.
split
(
"\t"
);
Map
<
ColorSchemaColumn
,
Integer
>
schemaColumns
=
new
HashMap
<>();
List
<
Pair
<
MiriamType
,
Integer
>>
customIdentifiers
=
new
ArrayList
<>();
parseColumns
(
columns
,
schemaColumns
,
customIdentifiers
,
ColorSchemaType
.
GENERIC
);
List
<
Pair
<
MiriamType
,
Integer
>>
customIdentifiers
=
parseColumns
(
columns
,
schemaColumns
,
ColorSchemaType
.
GENERIC
);
Integer
valueColumn
=
schemaColumns
.
get
(
ColorSchemaColumn
.
VALUE
);
Integer
colorColumn
=
schemaColumns
.
get
(
ColorSchemaColumn
.
COLOR
);
...
...
@@ -680,8 +679,9 @@ public class ColorSchemaReader {
* @throws InvalidColorSchemaException
* thrown when the list of column headers contain invalid value
*/
public
void
parseColumns
(
String
[]
columns
,
Map
<
ColorSchemaColumn
,
Integer
>
schemaColumns
,
List
<
Pair
<
MiriamType
,
Integer
>>
customIdentifiers
,
ColorSchemaType
type
)
throws
InvalidColorSchemaException
{
public
List
<
Pair
<
MiriamType
,
Integer
>>
parseColumns
(
String
[]
columns
,
Map
<
ColorSchemaColumn
,
Integer
>
schemaColumns
,
ColorSchemaType
type
)
throws
InvalidColorSchemaException
{
List
<
Pair
<
MiriamType
,
Integer
>>
result
=
new
ArrayList
<>();
Map
<
String
,
MiriamType
>
acceptableIdentifiers
=
new
HashMap
<>();
Map
<
String
,
MiriamType
>
deprecatedIdentifiers
=
new
HashMap
<>();
for
(
MiriamType
miriamType
:
MiriamType
.
values
())
{
...
...
@@ -701,9 +701,9 @@ public class ColorSchemaReader {
}
if
(!
found
)
{
if
(
acceptableIdentifiers
.
keySet
().
contains
(
columns
[
i
].
toLowerCase
()))
{
customIdentifiers
.
add
(
new
Pair
<>(
acceptableIdentifiers
.
get
(
columns
[
i
].
toLowerCase
()),
i
));
result
.
add
(
new
Pair
<>(
acceptableIdentifiers
.
get
(
columns
[
i
].
toLowerCase
()),
i
));
}
else
if
(
deprecatedIdentifiers
.
keySet
().
contains
(
columns
[
i
].
toLowerCase
()))
{
customIdentifiers
.
add
(
new
Pair
<>(
deprecatedIdentifiers
.
get
(
columns
[
i
].
toLowerCase
()),
i
));
result
.
add
(
new
Pair
<>(
deprecatedIdentifiers
.
get
(
columns
[
i
].
toLowerCase
()),
i
));
}
else
{
String
columnNames
=
""
;
for
(
ColorSchemaColumn
schemaColumn
:
ColorSchemaColumn
.
values
())
{
...
...
@@ -719,6 +719,7 @@ public class ColorSchemaReader {
}
}
}
return
result
;
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment