Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Some Codacy Code Convention Issues #4904

Merged
merged 2 commits into from
Apr 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private void initialize() {

generalFileDirectory.textProperty().bindBidirectional(viewModel.generalFileDirectoryPropertyProperty());
userSpecificFileDirectory.textProperty().bindBidirectional(viewModel.userSpecificFileDirectoryProperty());
laTexFileDirectory.textProperty().bindBidirectional(viewModel.LaTexFileDirectoryProperty());
laTexFileDirectory.textProperty().bindBidirectional(viewModel.laTexFileDirectoryProperty());

encoding.itemsProperty().bind(viewModel.encodingsProperty());
encoding.valueProperty().bindBidirectional(viewModel.selectedEncodingProperty());
Expand Down Expand Up @@ -142,7 +142,7 @@ private void storeSettings() {
metaData.setUserFileDirectory(preferencesService.getUser(), text);
}

text = viewModel.LaTexFileDirectoryProperty().getValue();
text = viewModel.laTexFileDirectoryProperty().getValue();
if (text.isEmpty()) {
metaData.clearLaTexFileDirectory(preferencesService.getUser());
} else {
Expand Down Expand Up @@ -180,7 +180,7 @@ private void storeSettings() {

boolean changed = saveOrderConfigChanged || encodingChanged
|| viewModel.generalFileDirChanged() || viewModel.userFileDirChanged()
|| viewModel.protectedValueChanged() || saveActionsChanged || viewModel.LaTexFileDirChanged();
|| viewModel.protectedValueChanged() || saveActionsChanged || viewModel.laTexFileDirChanged();
// ... if so, mark base changed. Prevent the Undo button from removing
// change marking:
if (changed) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public StringProperty userSpecificFileDirectoryProperty() {
return this.userSpecificFileDirectoryProperty;
}

public StringProperty LaTexFileDirectoryProperty() {
public StringProperty laTexFileDirectoryProperty() {
return this.laTexFileDirectoryProperty;
}

Expand Down Expand Up @@ -116,7 +116,7 @@ public boolean userFileDirChanged() {
return !oldUserSpecificFileDir.equals(userSpecificFileDirectoryProperty.getValue());
}

public boolean LaTexFileDirChanged() {
public boolean laTexFileDirChanged() {
return !oldLaTexFileDir.equals(laTexFileDirectoryProperty.getValue());
}

Expand Down
30 changes: 13 additions & 17 deletions src/main/java/org/jabref/logic/auxparser/DefaultAuxParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@
/**
* LaTeX Aux to BibTeX Parser
* <p>
* Extracts a subset of BibTeX entries from a BibDatabase that are included in an AUX file.
* Also supports nested AUX files (latex \\include).
* Extracts a subset of BibTeX entries from a BibDatabase that are included in an AUX file. Also supports nested AUX
* files (latex \\include).
*
* There exists no specification of the AUX file.
* Every package, class or document can write to the AUX file.
* The AUX file consists of LaTeX macros and is read at the \begin{document} and again at the \end{document}.
* There exists no specification of the AUX file. Every package, class or document can write to the AUX file. The AUX
* file consists of LaTeX macros and is read at the \begin{document} and again at the \end{document}.
*
* BibTeX citation: \citation{x,y,z}
* Biblatex citation: \abx@aux@cite{x,y,z}
* Nested AUX files: \@input{x}
* BibTeX citation: \citation{x,y,z} Biblatex citation: \abx@aux@cite{x,y,z} Nested AUX files: \@input{x}
*/
public class DefaultAuxParser implements AuxParser {
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultAuxParser.class);
Expand Down Expand Up @@ -128,15 +125,14 @@ private void matchCitation(AuxParserResult result, String line) {
*/
private void resolveTags(AuxParserResult result) {
for (String key : result.getUniqueKeys()) {
Optional<BibEntry> entry = masterDatabase.getEntryByKey(key);

if (result.getGeneratedBibDatabase().getEntryByKey(key).isPresent()) {
// do nothing, key has already been processed
} else if (entry.isPresent()) {
insertEntry(entry.get(), result);
resolveCrossReferences(entry.get(), result);
} else {
result.getUnresolvedKeys().add(key);
if (!result.getGeneratedBibDatabase().getEntryByKey(key).isPresent()) {
Optional<BibEntry> entry = masterDatabase.getEntryByKey(key);
if (entry.isPresent()) {
insertEntry(entry.get(), result);
resolveCrossReferences(entry.get(), result);
} else {
result.getUnresolvedKeys().add(key);
}
}
}

Expand Down