• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

common-workflow-language / cwlviewer / #1997

13 May 2026 05:20PM UTC coverage: 70.25% (-0.08%) from 70.334%
#1997

Pull #751

github

kinow
Undo code deletion, but replace string concatenation by log+parameters
Pull Request #751: Bump org.springframework.boot:spring-boot-starter-parent from 3.1.4 to 4.1.0-RC1

119 of 196 new or added lines in 32 files covered. (60.71%)

20 existing lines in 4 files now uncovered.

1712 of 2437 relevant lines covered (70.25%)

0.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

58.33
/src/main/java/org/commonwl/view/researchobject/HashableAgent.java
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one
3
 * or more contributor license agreements.  See the NOTICE file
4
 * distributed with this work for additional information
5
 * regarding copyright ownership.  The ASF licenses this file
6
 * to you under the Apache License, Version 2.0 (the
7
 * "License"); you may not use this file except in compliance
8
 * with the License.  You may obtain a copy of the License at
9
 *
10
 *   http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing,
13
 * software distributed under the License is distributed on an
14
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
 * KIND, either express or implied.  See the License for the
16
 * specific language governing permissions and limitations
17
 * under the License.
18
 */
19

20
package org.commonwl.view.researchobject;
21

22
import java.net.URI;
23
import java.util.Objects;
24
import org.apache.taverna.robundle.manifest.Agent;
25

26
/** An implementation of Agent with added HashCode and Equals methods for use in sets */
27
public class HashableAgent extends Agent {
28

29
  private String name;
30
  private URI orcid;
31
  private URI uri;
32

33
  public HashableAgent() {}
×
34

35
  public HashableAgent(String name, URI orcid, URI uri) {
1✔
36
    this.name = name;
1✔
37
    this.orcid = orcid;
1✔
38
    this.uri = uri;
1✔
39
  }
1✔
40

41
  @Override
42
  public String getName() {
43
    return name;
1✔
44
  }
45

46
  @Override
47
  public void setName(String name) {
48
    this.name = name;
×
49
  }
×
50

51
  @Override
52
  public URI getOrcid() {
53
    return orcid;
1✔
54
  }
55

56
  @Override
57
  public void setOrcid(URI orcid) {
58
    this.orcid = orcid;
×
59
  }
×
60

61
  @Override
62
  public URI getUri() {
63
    return uri;
1✔
64
  }
65

66
  @Override
67
  public void setUri(URI uri) {
68
    this.uri = uri;
×
69
  }
×
70

71
  @Override
72
  public boolean equals(Object o) {
73
    if (this == o) return true;
1✔
74
    if (o == null || getClass() != o.getClass()) return false;
1✔
75

76
    HashableAgent that = (HashableAgent) o;
1✔
77

78
    // ORCID is a unique identifier so if matches, the objects are equal
79
    if (orcid != null && orcid.equals(that.orcid)) return true;
1✔
80

81
    // If no ORCID is present but email is the name, the objects are equal
82
    if (orcid == null && uri != null && uri.equals(that.uri)) return true;
1✔
83

84
    // Default to checking all parameters
NEW
85
    if (!Objects.equals(orcid, that.orcid)) return false;
×
NEW
86
    if (!Objects.equals(name, that.name)) return false;
×
NEW
87
    return Objects.equals(uri, that.uri);
×
88
  }
89

90
  /**
91
   * ORCID is used as hashcode to fall back to comparison if missing
92
   *
93
   * @return The hash code for this object
94
   */
95
  @Override
96
  public int hashCode() {
97
    return orcid != null ? orcid.hashCode() : 0;
1✔
98
  }
99
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc