Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
19
Issues
19
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Backend
Commits
d62a988d
Commit
d62a988d
authored
Sep 18, 2018
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accession API: Fixed updating "historic" and "available"
- Allowing for "isHistoric" getter in addition to "getHistoric"
parent
50754f54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/main/java/org/genesys2/server/service/worker/AccessionUploader.java
...org/genesys2/server/service/worker/AccessionUploader.java
+4
-1
No files found.
src/main/java/org/genesys2/server/service/worker/AccessionUploader.java
View file @
d62a988d
...
...
@@ -449,13 +449,16 @@ public class AccessionUploader implements InitializingBean {
private
Method
findGetter
(
Class
<?>
clazz
,
Class
<?>
returnType
,
String
fieldName
)
{
String
getterName
=
"get"
+
WordUtils
.
capitalize
(
fieldName
);
String
getterName2
=
"is"
+
WordUtils
.
capitalize
(
fieldName
);
LOG
.
trace
(
"Looking for getter {}"
,
getterName
);
for
(
Method
method
:
clazz
.
getMethods
())
{
if
(
method
.
getParameterCount
()
==
0
&&
returnType
.
isAssignableFrom
(
method
.
getReturnType
())
&&
method
.
getName
().
equals
(
getterName
))
{
if
(
method
.
getParameterCount
()
==
0
&&
returnType
.
isAssignableFrom
(
method
.
getReturnType
())
&&
(
method
.
getName
().
equals
(
getterName
)
||
method
.
getName
().
equals
(
getterName2
)
))
{
LOG
.
trace
(
"Found getter {}"
,
method
);
return
method
;
}
}
throw
new
RuntimeException
(
"No getter for field "
+
fieldName
+
" in "
+
clazz
.
getName
());
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment