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

Description states support for Java6 #90

Closed
tonysgi opened this issue Feb 1, 2017 · 7 comments
Closed

Description states support for Java6 #90

tonysgi opened this issue Feb 1, 2017 · 7 comments

Comments

@tonysgi
Copy link

tonysgi commented Feb 1, 2017

I was looking at upgrading from the 1.1.2 since I saw the following in the description:

"This is version 2.0.0, compatible with java6 / java7 / java8"

But after importing the projects into eclipse I saw an error that java.util.Objects was not found due to it being part of java7+.

Is there indeed support for java6 or does this warrant a correction in the description?

@pitbulk
Copy link
Contributor

pitbulk commented Feb 1, 2017

Hi @tonysgi

The toolkit tried to be compatible with java6 too.

It seems that we introduced a java7 dependency when used java.util.Objects to compare objects.

We should fix that and replace it with a solution that uses java.util.Objects when available, or a custom compare method.

Can you remove the imports and its use, instead of:

!Objects.equals(responseInResponseTo, requestId)

use

!responseInResponseTo.equals(requestId)

and let me know if there are more Java 7 dependencies?

@tonysgi
Copy link
Author

tonysgi commented Feb 1, 2017

Thanks.

So I made the changes and the items that are left are:

HttpRequest.java

HttpRequest that = (HttpRequest) o; return Objects.equals(requestURL, that.requestURL) && Objects.equals(parameters, that.parameters);

and

public int hashCode() { return Objects.hash(requestURL, parameters); }

In Util.java in the validateXML method:

validator.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, ""); validator.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");

The above has errors:

ACCESS_EXTERNAL_DTD cannot be resolved or is not a field
ACCESS_EXTERNAL_SCHEMA cannot be resolved or is not a field

@pitbulk
Copy link
Contributor

pitbulk commented Feb 1, 2017

On HttpRequest.java you will need to replace the way requestURL is compared.

Related to the Objects.hash, maybe replace it by String.hashCode ?

Ty, it seems ACCESS_EXTERNAL_DTD and ACCESS_EXTERNAL_SCHEMA were introduced in Java 7.0 also.

@rr2013
Copy link

rr2013 commented Apr 7, 2017

Hi tonysgi,

do you have the updated java 1.6 compatible java-saml library ? did you face any other issues? could you please share so that i can also use? thank you.

@andreivas
Copy link

Hello everyone,

Was anyone able to make a saml compatible with Java 1.6 by any chance?

Thanks

@scottescue
Copy link

@pitbulk Are you still willing to accept a PR that removes the Java 1.7 language features? If so, I'd like to finish this out.

@mguessan
Copy link

Just in case someone is interested, I had to compile java-saml under JDK 6 for an old WebSphere instance.

Fork is available at:
https://github.com/mguessan/java-saml

@pitbulk pitbulk closed this as completed Sep 30, 2020
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

No branches or pull requests

6 participants