@@ -93,15 +93,15 @@ public SpdxItemComparer(Map<SpdxDocument, Map<SpdxDocument, Map<String, String>>
9393 public void addDocumentItem (SpdxDocument spdxDocument ,
9494 SpdxItem spdxItem ) throws SpdxCompareException , InvalidSPDXAnalysisException {
9595 if (this .itemInProgress ) {
96- new SpdxCompareException ("Trying to add a document item while another document item is being added." );
96+ throw new SpdxCompareException ("Trying to add a document item while another document item is being added." );
9797 }
9898 Optional <String > oName = spdxItem .getName ();
9999 if (this .name == null ) {
100100 if (oName .isPresent ()) {
101101 this .name = oName .get ();
102102 }
103103 } else if (oName .isPresent () && !this .name .equals (oName .get ()) && !(this instanceof SpdxSnippetComparer )) {
104- new SpdxCompareException ("Names do not match for item being added to comparer: " +
104+ throw new SpdxCompareException ("Names do not match for item being added to comparer: " +
105105 spdxItem .getName ()+", expecting " +this .name );
106106 }
107107 this .itemInProgress = true ;
@@ -384,7 +384,7 @@ public boolean isLicenseCommmentsEquals() throws SpdxCompareException {
384384 */
385385 protected void checkInProgress () throws SpdxCompareException {
386386 if (itemInProgress ) {
387- new SpdxCompareException ("File compare in progress - can not obtain compare results until compare has completed" );
387+ throw new SpdxCompareException ("File compare in progress - can not obtain compare results until compare has completed" );
388388 }
389389 }
390390
@@ -393,7 +393,7 @@ protected void checkInProgress() throws SpdxCompareException {
393393 */
394394 protected void checkCompareMade () throws SpdxCompareException {
395395 if (this .documentItem .entrySet ().size () < 1 ) {
396- new SpdxCompareException ("Trying to obtain results of a file compare before a file compare has been performed" );
396+ throw new SpdxCompareException ("Trying to obtain results of a file compare before a file compare has been performed" );
397397 }
398398 }
399399
0 commit comments