Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fuchsia.googlesource.com-third_party-tink
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fuchsia-mirror
fuchsia.googlesource.com-third_party-tink
Commits
38e1a96c
Unverified
Commit
38e1a96c
authored
5 years ago
by
przydatek
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Java: Remove e.printStracktrace() in favor of a cause (#207)" (#219)
This reverts commit
6495d823
.
parent
6495d823
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/main/java/com/google/crypto/tink/subtle/EngineFactory.java
+14
-9
14 additions, 9 deletions
...ain/java/com/google/crypto/tink/subtle/EngineFactory.java
with
14 additions
and
9 deletions
java/src/main/java/com/google/crypto/tink/subtle/EngineFactory.java
+
14
−
9
View file @
38e1a96c
...
@@ -155,23 +155,28 @@ public final class EngineFactory<T_WRAPPER extends EngineWrapper<T_ENGINE>, T_EN
...
@@ -155,23 +155,28 @@ public final class EngineFactory<T_WRAPPER extends EngineWrapper<T_ENGINE>, T_EN
}
}
public
T_ENGINE
getInstance
(
String
algorithm
)
throws
GeneralSecurityException
{
public
T_ENGINE
getInstance
(
String
algorithm
)
throws
GeneralSecurityException
{
Exception
cause
=
null
;
for
(
Provider
p
:
this
.
policy
)
{
for
(
Provider
provider
:
this
.
policy
)
{
if
(
tryProvider
(
algorithm
,
p
))
{
try
{
return
this
.
instanceBuilder
.
getInstance
(
algorithm
,
p
);
return
this
.
instanceBuilder
.
getInstance
(
algorithm
,
provider
);
}
catch
(
Exception
e
)
{
if
(
cause
==
null
)
{
cause
=
e
;
}
}
}
}
}
if
(
letFallback
)
{
if
(
letFallback
)
{
return
this
.
instanceBuilder
.
getInstance
(
algorithm
,
null
);
return
this
.
instanceBuilder
.
getInstance
(
algorithm
,
null
);
}
}
throw
new
GeneralSecurityException
(
"No good Provider found."
,
cause
);
throw
new
GeneralSecurityException
(
"No good Provider found."
);
}
}
private
T_WRAPPER
instanceBuilder
;
private
T_WRAPPER
instanceBuilder
;
private
List
<
Provider
>
policy
;
private
List
<
Provider
>
policy
;
private
boolean
letFallback
;
private
boolean
letFallback
;
private
boolean
tryProvider
(
String
algorithm
,
Provider
provider
)
{
try
{
this
.
instanceBuilder
.
getInstance
(
algorithm
,
provider
);
return
true
;
}
catch
(
Exception
e
)
{
// Don't care which one specifically.
e
.
printStackTrace
();
return
false
;
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment