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

Replace LinkedFiles backslashes with forward slashes #3364

Closed
wants to merge 2 commits into from

Conversation

Siedlerchr
Copy link
Member

@Siedlerchr Siedlerchr commented Oct 27, 2017

Ensures cross platform compatibility
Fixes #3311

Tested this under windows and it works fine

  • Change in CHANGELOG.md described
  • Tests created for changes
  • Screenshots added (for bigger UI changes)
  • Manually tested changed features in running JabRef
  • Check documentation status (Issue created for outdated help page at help.jabref.org?)
  • If you changed the localization: Did you run gradle localizationUpdate?

Ensures cross platform compatibility
@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Oct 27, 2017
Copy link
Member

@LinusDietz LinusDietz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix itself is fine, I just have one remark regarding a refactoring.

* @return True if it starts with http://, https:// or contains www; false otherwise
*/
public static boolean isOnlineLink(String toCheck) {
return toCheck.startsWith("http://") || toCheck.startsWith("https://") || toCheck.contains("www.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URL validation is quite hard (potentially completely infeasible) in practice.

Is this implementation sufficient for our purposes? I mean "jabref.org" is a valid url, but would isOnlineLink() would return false.

My thoughts are to leave this method in the LinkedFile if it should serve as a "special purpose" link checker. If it should be a general method, in the util package, then the implementation would need to become more elaborate.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not change the detection of urls, I just moved it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's what I mean: if you move it to an util package, it should be a general purpose method that works in 'all' cases.

If it stays in this class (potentially private) it's sufficient if it is good enough to be called in that specific context.

@Siedlerchr
Copy link
Member Author

yes, agree, good point I readded it in the other PR

@tobiasdiez tobiasdiez deleted the linuxLink branch November 5, 2017 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants