Skip to content

Replace LinkedFiles backslashes with forward slashes#3364

Closed
Siedlerchr wants to merge 2 commits into
masterfrom
linuxLink
Closed

Replace LinkedFiles backslashes with forward slashes#3364
Siedlerchr wants to merge 2 commits into
masterfrom
linuxLink

Conversation

@Siedlerchr

@Siedlerchr Siedlerchr commented Oct 27, 2017

Copy link
Copy Markdown
Member

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

@LinusDietz LinusDietz left a comment

Copy link
Copy Markdown
Member

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.

* @param toCheck The String to check
* @return True if it starts with http://, https:// or contains www; false otherwise
*/
public static boolean isOnlineLink(String toCheck) {

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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