Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2018-06-28 19:06:13 -0400
committerRyan D. Brooks2018-07-10 19:19:47 -0400
commit3d42eb8f08893ea6cfd5fb7fc01bfdbea165ad51 (patch)
tree519caa6675185994d30f260886b965e45ef69625
parentf4d06bd70208a4dbf457a139c0ba09b94396068d (diff)
downloadorg.eclipse.osee-3d42eb8f08893ea6cfd5fb7fc01bfdbea165ad51.tar.gz
org.eclipse.osee-3d42eb8f08893ea6cfd5fb7fc01bfdbea165ad51.tar.xz
org.eclipse.osee-3d42eb8f08893ea6cfd5fb7fc01bfdbea165ad51.zip
refactor: Delete unnecessary DataRightId class
-rw-r--r--plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/DataRightsOperationsImpl.java13
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRight.java13
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightAnchor.java10
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightId.java45
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightResult.java23
5 files changed, 12 insertions, 92 deletions
diff --git a/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/DataRightsOperationsImpl.java b/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/DataRightsOperationsImpl.java
index 1455f87974..cfb53c967c 100644
--- a/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/DataRightsOperationsImpl.java
+++ b/plugins/org.eclipse.osee.define.rest/src/org/eclipse/osee/define/rest/DataRightsOperationsImpl.java
@@ -30,11 +30,9 @@ import org.eclipse.osee.framework.core.enums.DataRightsClassification;
import org.eclipse.osee.framework.core.model.datarights.DataRight;
import org.eclipse.osee.framework.core.model.datarights.DataRightAnchor;
import org.eclipse.osee.framework.core.model.datarights.DataRightEntry;
-import org.eclipse.osee.framework.core.model.datarights.DataRightId;
import org.eclipse.osee.framework.core.model.datarights.DataRightInput;
import org.eclipse.osee.framework.core.model.datarights.DataRightResult;
import org.eclipse.osee.framework.core.util.PageOrientation;
-import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.data.ArtifactReadable;
@@ -138,7 +136,7 @@ public class DataRightsOperationsImpl implements DataRightsOperations {
DataRightAnchor anchor = new DataRightAnchor();
anchor.setSetDataRightFooter(isSetDataRightFooter);
anchor.setId(currentArtifact.getId());
- anchor.setDataRightId(dataRight.getId());
+ anchor.setDataRight(dataRight);
anchors.add(anchor);
previousArtifact = currentArtifact;
@@ -169,22 +167,13 @@ public class DataRightsOperationsImpl implements DataRightsOperations {
for (String footer : footers) {
String[] enumToFooter = footer.split("\\n", 2);
if (enumToFooter.length == 2) {
- DataRightId id = new DataRightId();
- id.setId(GUID.create());
-
DataRight dataRight = new DataRight();
- dataRight.setId(id);
dataRight.setContent(enumToFooter[1].trim());
-
toReturn.put(enumToFooter[0].trim(), dataRight);
}
}
} else {
- DataRightId id = new DataRightId();
- id.setId(GUID.create());
-
DataRight dataRight = new DataRight();
- dataRight.setId(id);
dataRight.setContent(DataRightResult.UNSPECIFIED);
toReturn.put("Unspecified", dataRight);
}
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRight.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRight.java
index 6a8d94d1ec..05a536936a 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRight.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRight.java
@@ -14,18 +14,8 @@ package org.eclipse.osee.framework.core.model.datarights;
* @author Angel Avila
*/
public class DataRight {
-
- private DataRightId id;
private String content;
- public DataRightId getId() {
- return id;
- }
-
- public void setId(DataRightId id) {
- this.id = id;
- }
-
public String getContent() {
return content;
}
@@ -33,5 +23,4 @@ public class DataRight {
public void setContent(String content) {
this.content = content;
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightAnchor.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightAnchor.java
index df25e54938..040b895856 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightAnchor.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightAnchor.java
@@ -18,7 +18,7 @@ import org.eclipse.osee.framework.core.data.ArtifactId;
public class DataRightAnchor {
private ArtifactId id;
- private DataRightId dataRightId;
+ private DataRight dataRight;
private boolean isSetDataRightFooter = false;
private boolean isContinuous = false;
@@ -30,12 +30,12 @@ public class DataRightAnchor {
this.id = id;
}
- public DataRightId getDataRightId() {
- return dataRightId;
+ public DataRight getDataRight() {
+ return dataRight;
}
- public void setDataRightId(DataRightId rightId) {
- this.dataRightId = rightId;
+ public void setDataRight(DataRight dataRight) {
+ this.dataRight = dataRight;
}
public boolean isSetDataRightFooter() {
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightId.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightId.java
deleted file mode 100644
index 88edb599e1..0000000000
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightId.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2014 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.core.model.datarights;
-
-/**
- * @author Angel Avila
- */
-public class DataRightId {
-
- private String id;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- @Override
- public int hashCode() {
- return id.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof DataRightId) {
- return ((DataRightId) obj).id.equals(id);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return "DataRightId [id=" + id + "]";
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightResult.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightResult.java
index 71d7107653..89c065a68f 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightResult.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/datarights/DataRightResult.java
@@ -29,11 +29,7 @@ public class DataRightResult {
"<w:ftr w:type=\"odd\"><w:p><w:pPr><w:pStyle w:val=\"para8pt\"/><w:jc w:val=\"center\"/></w:pPr><w:r><w:rPr><w:rStyle w:val=\"PageNumber\"/></w:rPr><w:fldChar w:fldCharType=\"begin\"/></w:r><w:r><w:rPr><w:rStyle w:val=\"PageNumber\"/></w:rPr><w:instrText> PAGE </w:instrText></w:r><w:r><w:rPr><w:rStyle w:val=\"PageNumber\"/></w:rPr><w:fldChar w:fldCharType=\"separate\"/></w:r><w:r><w:rPr><w:rStyle w:val=\"PageNumber\"/><w:noProof/></w:rPr><w:t>5</w:t></w:r><w:r><w:rPr><w:rStyle w:val=\"PageNumber\"/></w:rPr><w:fldChar w:fldCharType=\"end\"/></w:r></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr><w:t>UNSPECIFIED - PLEASE TAG WITH CORRECT DATA RIGHTS ATTRIBUTE!!!</w:t></w:r></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr><w:t>Contract No.: </w:t></w:r></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr><w:t>Contractor Name: The Boeing Company</w:t></w:r></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr><w:t>Contractor Address: 5000 E. McDowell Road; Mesa, AZ 85215-9797 </w:t></w:r></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr><w:t></w:t></w:r></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr><w:t>The Government's rights to use, modify, reproduce, release, perform, display, or disclose this software are restricted by paragraph (b)(3) of the Rights in Noncommercial Computer Software and Noncommercial Computer Software Documentation clause contained in the above identified contract. Any reproduction of computer software or portions thereof marked with this legend must also reproduce the markings. Any person, other than the Government, who has been provided access to such software must promptly notify the above named Contractor. </w:t></w:r></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr></w:p><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" w:line-rule=\"auto\"/><w:jc w:val=\"both\"/><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:cs=\"Arial\"/><w:sz w:val=\"16\"/></w:rPr><w:t>Copyright (c) 2017 – The Boeing Company</w:t></w:r></w:p></w:ftr>";
private List<DataRightAnchor> dataRightAnchors;
-
private List<DataRight> dataRights;
-
- private Map<DataRightId, DataRight> dataRightIdToDataRight;
-
private Map<ArtifactId, DataRightAnchor> idToAnchor;
public Collection<DataRightAnchor> getDataRightAnchors() {
@@ -74,13 +70,10 @@ public class DataRightResult {
boolean isContinuous = anchor.isContinuous();
if (isSetDataRightFooter) {
// set footer section since next footer differs
- DataRightId key = anchor.getDataRightId();
- if (key != null) {
- DataRight dataRight = dataRightIdToDataRight.get(key);
- if (dataRight != null) {
- footer = normalize(dataRight.getContent());
- footer = String.format(ReportConstants.NEW_PAGE_TEMPLATE, footer + page_adds);
- }
+ DataRight dataRight = anchor.getDataRight();
+ if (dataRight != null) {
+ footer = normalize(dataRight.getContent());
+ footer = String.format(ReportConstants.NEW_PAGE_TEMPLATE, footer + page_adds);
}
} else if (!isContinuous) {
// set page break since next footer differs;
@@ -99,21 +92,15 @@ public class DataRightResult {
}
public void reset() {
- dataRightIdToDataRight = null;
idToAnchor = null;
}
private void checkInitialized() {
- if (dataRightIdToDataRight == null || idToAnchor == null) {
- dataRightIdToDataRight = new HashMap<>();
+ if (idToAnchor == null) {
idToAnchor = new HashMap<>();
for (DataRightAnchor anchor : dataRightAnchors) {
idToAnchor.put(anchor.getId(), anchor);
}
-
- for (DataRight dataRight : dataRights) {
- dataRightIdToDataRight.put(dataRight.getId(), dataRight);
- }
}
}
} \ No newline at end of file

Back to the top