Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
87b03c9b
Commit
87b03c9b
authored
17 years ago
by
ribeaudc
Browse files
Options
Downloads
Patches
Plain Diff
change:
- improve error messages SVN: 2353
parent
1e13be08
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/source/java/ch/systemsx/cisd/common/utilities/ClassUtils.java
+5
-4
5 additions, 4 deletions
...ce/java/ch/systemsx/cisd/common/utilities/ClassUtils.java
with
5 additions
and
4 deletions
common/source/java/ch/systemsx/cisd/common/utilities/ClassUtils.java
+
5
−
4
View file @
87b03c9b
...
...
@@ -154,7 +154,7 @@ public final class ClassUtils
* <code>Properties</code> argument is expected. Otherwise the default constructor will used.
* @return an instance of type <code>interfaze</code>.
*/
public
static
<
T
>
T
create
(
Class
<
T
>
superClazz
,
String
className
,
Properties
properties
)
public
static
<
T
>
T
create
(
final
Class
<
T
>
superClazz
,
final
String
className
,
final
Properties
properties
)
{
assert
superClazz
!=
null
:
"Missing super class"
;
assert
className
!=
null
:
"Missing class name"
;
...
...
@@ -162,8 +162,9 @@ public final class ClassUtils
try
{
final
Class
<?>
clazz
=
Class
.
forName
(
className
);
assert
clazz
.
isInterface
()
==
false
:
clazz
+
" can not be instanciated"
;
assert
superClazz
.
isAssignableFrom
(
clazz
)
:
clazz
+
" does not implements/extends "
+
superClazz
.
getName
();
assert
clazz
.
isInterface
()
==
false
:
"'"
+
clazz
+
"' can not be instanciated as it is an interface."
;
assert
superClazz
.
isAssignableFrom
(
clazz
)
:
"'"
+
clazz
+
"' does not implements/extends '"
+
superClazz
.
getName
()
+
"'."
;
if
(
properties
==
null
)
{
return
createInstance
(
clazz
);
...
...
@@ -173,7 +174,7 @@ public final class ClassUtils
return
createInstance
(
constructor
,
properties
);
}
catch
(
Exception
ex
)
{
throw
new
ConfigurationFailureException
(
"Cannot instanitate class "
+
className
,
ex
);
throw
new
ConfigurationFailureException
(
"Cannot instanitate class
'
"
+
className
+
"'."
,
ex
);
}
}
...
...
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