Skip to content

Commit

Permalink
Merge pull request #2 from JabRef/master
Browse files Browse the repository at this point in the history
Merging from head master
  • Loading branch information
CyraxSector authored Jun 25, 2019
2 parents 96f4ba1 + 441b764 commit 10e79a0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 21 deletions.
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: koppor
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: koppor
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: https://github.com/JabRef/jabref/wiki/Donations # Replace with a single custom sponsorship URL
4 changes: 4 additions & 0 deletions .github/autoapproval.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from_owner:
- dependabot-preview[bot]
required_labels:
- dependencies
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ dependencies {

compile 'mysql:mysql-connector-java:8.0.16'

compile 'org.postgresql:postgresql:42.2.5'
compile 'org.postgresql:postgresql:42.2.6'

compile 'net.java.dev.glazedlists:glazedlists_java15:1.9.1'

Expand Down Expand Up @@ -166,14 +166,14 @@ dependencies {
testCompile 'org.mockito:mockito-core:2.28.2'
testCompile 'com.github.tomakehurst:wiremock:2.23.2'
testCompile 'org.reflections:reflections:0.9.11'
testCompile 'org.xmlunit:xmlunit-core:2.6.2'
testCompile 'org.xmlunit:xmlunit-matchers:2.6.2'
testCompile 'org.xmlunit:xmlunit-core:2.6.3'
testCompile 'org.xmlunit:xmlunit-matchers:2.6.3'
testRuntime 'com.tngtech.archunit:archunit-junit5-engine:0.10.2'
testCompile 'com.tngtech.archunit:archunit-junit5-api:0.10.2'
testCompile "org.testfx:testfx-core:4.0.+"
testCompile "org.testfx:testfx-junit5:4.0.+"

checkstyle 'com.puppycrawl.tools:checkstyle:8.21'
checkstyle 'com.puppycrawl.tools:checkstyle:8.22'
xjc 'com.sun.xml.bind:jaxb-xjc:2.2.4-1'
jython 'org.python:jython-standalone:2.7.1'
}
Expand Down
18 changes: 3 additions & 15 deletions src/main/java/org/jabref/gui/groups/GroupTreeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.stream.Collectors;

import javax.inject.Inject;

Expand Down Expand Up @@ -280,12 +281,7 @@ private void updateSelection(List<TreeItem<GroupNodeViewModel>> newSelectedGroup
if ((newSelectedGroups == null) || newSelectedGroups.isEmpty()) {
viewModel.selectedGroupsProperty().clear();
} else {
List<GroupNodeViewModel> list = new ArrayList<>();
for (TreeItem<GroupNodeViewModel> model : newSelectedGroups) {
if ((model != null) && (model.getValue() != null) && !(model.getValue().getGroupNode().getGroup() instanceof AllEntriesGroup)) {
list.add(model.getValue());
}
}
List<GroupNodeViewModel> list = newSelectedGroups.stream().filter(model -> model != null && !(model.getValue().getGroupNode().getGroup() instanceof AllEntriesGroup)).map(TreeItem<GroupNodeViewModel>::getValue).collect(Collectors.toList());
viewModel.selectedGroupsProperty().setAll(list);
}
}
Expand All @@ -304,15 +300,7 @@ private Optional<TreeItem<GroupNodeViewModel>> getTreeItemByValue(TreeItem<Group
if (root.getValue().equals(value)) {
return Optional.of(root);
}

for (TreeItem<GroupNodeViewModel> child : root.getChildren()) {
Optional<TreeItem<GroupNodeViewModel>> treeItemByValue = getTreeItemByValue(child, value);
if (treeItemByValue.isPresent()) {
return treeItemByValue;
}
}

return Optional.empty();
return root.getChildren().stream().filter(child -> getTreeItemByValue(child, value).isPresent()).findFirst();
}

private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) {
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/org/jabref/logic/util/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
Expand Down Expand Up @@ -91,7 +91,7 @@ public static Version parse(String version) {
* Grabs all the available releases from the GitHub repository
*/
public static List<Version> getAllAvailableVersions() throws IOException {
URLConnection connection = new URL(JABREF_GITHUB_RELEASES).openConnection();
HttpURLConnection connection = (HttpURLConnection) new URL(JABREF_GITHUB_RELEASES).openConnection();
connection.setRequestProperty("Accept-Charset", "UTF-8");
try (BufferedReader rd = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {

Expand All @@ -102,6 +102,7 @@ public static List<Version> getAllAvailableVersions() throws IOException {
Version version = Version.parse(jsonObject.getString("tag_name").replaceFirst("v", ""));
versions.add(version);
}
connection.disconnect();
return versions;
}
}
Expand Down

0 comments on commit 10e79a0

Please sign in to comment.