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
8b9dfa27
Commit
8b9dfa27
authored
16 years ago
by
ribeaudc
Browse files
Options
Downloads
Patches
Plain Diff
[LMS-654] fix: - Unit tests in 'lims' project.
change: - Improve error message in 'EqualsHashUtils'. SVN: 9089
parent
0ca429e2
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
openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/EqualsHashUtils.java
+13
-4
13 additions, 4 deletions
...msx/cisd/openbis/generic/shared/util/EqualsHashUtils.java
with
13 additions
and
4 deletions
openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/EqualsHashUtils.java
+
13
−
4
View file @
8b9dfa27
...
@@ -16,21 +16,30 @@
...
@@ -16,21 +16,30 @@
package
ch.systemsx.cisd.openbis.generic.shared.util
;
package
ch.systemsx.cisd.openbis.generic.shared.util
;
import
ch.systemsx.cisd.common.utilities.MethodUtils
;
/**
/**
* Utility class containing methods useful in defining equals and hashCode methods.
* Utility class containing methods useful in defining equals and hashCode methods.
*
*
* @author Izabela Adamczyk
* @author Izabela Adamczyk
*/
*/
public
class
EqualsHashUtils
public
final
class
EqualsHashUtils
{
{
private
EqualsHashUtils
()
{
// Can not be instantiated.
}
public
static
void
assertDefined
(
final
Object
o
,
final
String
name
)
public
static
void
assertDefined
(
final
Object
o
,
final
String
name
)
{
{
assert
name
!=
null
:
"Unspecified name."
;
if
(
o
==
null
)
if
(
o
==
null
)
{
{
throw
new
IllegalStateException
(
"Field should be defined but is null: "
+
name
final
String
className
=
+
". Equals operation cannot be performed."
);
MethodUtils
.
getMethodOnStack
(
2
).
getDeclaringClass
().
getSimpleName
();
throw
new
IllegalStateException
(
String
.
format
(
"Field name '%s' in class '%s' should be defined but is null."
+
" Equals operation cannot be performed."
,
name
,
className
));
}
}
}
}
}
}
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