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

eclipse-lyo#636 Add option to not add providers by default #637

Merged
merged 3 commits into from
Oct 21, 2024

Conversation

jhemm2
Copy link
Contributor

@jhemm2 jhemm2 commented Oct 15, 2024

Description

Adds another Constructor the OslcClient to allow custom registration of providers for the Client. This is due to registration of deprecated json providers by default

Checklist

  • [x ] This PR adds an entry to the CHANGELOG. See https://keepachangelog.com/en/1.0.0/ for instructions. Minor edits are exempt. (Minor)
  • This PR was tested on at least one Lyo OSLC server (e.g. manual workflow on Lyo Sample and OSLC RefImpl) or adds unit/integration tests.
  • [ x] This PR does NOT break the API

Issues

Closes #636 ;

(use exactly this syntax to link to issues, one issue per statement only!)

@jhemm2
Copy link
Contributor Author

jhemm2 commented Oct 16, 2024

I made a proposal commit and removed the deprecated dependency. Furthermore, I have refactored the OslcClient to avoid duplicate code and added some unit-tests accordingly. Hth

@@ -9,7 +9,7 @@
### Deprecated

### Removed

- Dependency to deprecated oslc4j-json4j-provider
Copy link
Contributor

@berezovskyi berezovskyi Oct 18, 2024

Choose a reason for hiding this comment

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

- Dependency to deprecated `oslc4j-json4j-provider` from Lyo Client

Copy link
Contributor

Choose a reason for hiding this comment

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

@berezovskyi is good to clarify/update before merging.

@@ -9,7 +9,7 @@
### Deprecated

### Removed

- Dependency to deprecated oslc4j-json4j-provider
Copy link
Contributor

Choose a reason for hiding this comment

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

@berezovskyi is good to clarify/update before merging.

* which is available at http://www.eclipse.org/org/documents/edl-v10.php.
*
* Copyright (c) 2020 Contributors to the Eclipse Foundation See the NOTICE file(s) distributed with this work for
* additional information regarding copyright ownership. This program and the accompanying materials are made available
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be an un-intended change. Please revert.

}

public Response getResource (String url, Map<String, String> requestHeaders, String defaultMediaType,
private final String version;
Copy link
Contributor

Choose a reason for hiding this comment

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

The whole file has been changed.
Main reason is due to white-space changes. But other formatting changes are also introduced.
Please revert such changes unless they are intentional.


public Response getResource(String url, Map<String, String> requestHeaders, String defaultMediaType,
String configurationContext, boolean handleRedirects) {
return doRequest(HttpMethod.GET, url, null, configurationContext, null, defaultMediaType, OSLCConstants.CT_RDF,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a significant refactoring, and looks promising. But I can't easily review it. Too many other (formatting) changes in the way.
If you are confortable with that @berezovskyi, I am fine.

@Jad-el-khoury
Copy link
Contributor

The original change to control the Providers looks good. But noticed other refactoring that I could not review.
Are you happy with them @berezovskyi then I am fine.

but @jhemm2 ! Please fix the unintended changes. I am afraid we will endup with many back-forth changes due to diffferent IDE settings.

@berezovskyi
Copy link
Contributor

Yes, I am fine with the changes.

Reformatting the code touched by the PR is intentional and welcomed/required.

With regards to the settings, there is sn .editorconfig file in the repo that everyone (cough) is expected to apply when reformatting.

But I have two further ideas on my bucket list:

  • add checkstyle to enforce more than just indentation and line limits.
  • do a big bang reformat of the whole codebase - but it will break all pull requests.

@berezovskyi
Copy link
Contributor

berezovskyi commented Oct 21, 2024

Two more bits:

@Jad-el-khoury
Copy link
Contributor

@berezovskyi editorconfig seems to be in place, but not sure if it makes a difference.
go ahead then @jhemm2 !

@Jad-el-khoury
Copy link
Contributor

can @jhemm2 commit to master, or should we do it?

@berezovskyi berezovskyi merged commit f2de1b8 into eclipse-lyo:master Oct 21, 2024
6 checks passed
@berezovskyi
Copy link
Contributor

@Jad-el-khoury not unless @jhemm2 becomes a committer ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecated Json4J Providers still registered. Usage by default cannot be prevented
3 participants