From 0726634768daa495f3686b593af6eebe94dfa871 Mon Sep 17 00:00:00 2001 From: eparovyshnaya Date: Sun, 27 Nov 2022 20:55:08 +0300 Subject: [PATCH] License agreement restrictions must be emitted with restrictive level #1146 describe the [not accepted] state properly --- .../passage/lic/base/restrictions/ExaminationExplained.java | 6 +++++- .../loc/internal/licenses/core/PersistedEncoded.java | 1 + .../emfforms/renderers/ProductVersionKeyRenderer.java | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/base/restrictions/ExaminationExplained.java b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/base/restrictions/ExaminationExplained.java index bb3ff91d6..a077e787b 100644 --- a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/base/restrictions/ExaminationExplained.java +++ b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/base/restrictions/ExaminationExplained.java @@ -132,13 +132,17 @@ private void appendAgreements(StringBuilder out) { Collection agreements = certificate.agreements(); out.append(String.format("Agreements state contains %d entries.\r\n", agreements.size())); //$NON-NLS-1$ agreements.forEach(agreement -> { + boolean accepted = agreement.acceptance().accepted(); out.append("\tagreement [") //$NON-NLS-1$ .append(agreement.definition().path())// .append("]\r\n\tdeclared by [") //$NON-NLS-1$ .append(agreement.origin())// .append("]\r\n\thas [") //$NON-NLS-1$ - .append(agreement.acceptance().accepted() ? "accepted" : "not accepted") //$NON-NLS-1$//$NON-NLS-2$ + .append(accepted ? "accepted" : "not accepted") //$NON-NLS-1$//$NON-NLS-2$ .append("] state.\r\n"); //$NON-NLS-1$ + if (!accepted) { + out.append("\tThis is FATAL!11. Product cannot proceed without the agreement been accepted.\r\n"); //$NON-NLS-1$ + } if (agreement.acceptance().error().isPresent()) { out.append("\terror:\r\n\t") //$NON-NLS-1$ .append(new TroubleExplained(agreement.acceptance().error().get()).get())// diff --git a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/PersistedEncoded.java b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/PersistedEncoded.java index f77544b0d..3dfbdd95f 100644 --- a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/PersistedEncoded.java +++ b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/PersistedEncoded.java @@ -27,6 +27,7 @@ import org.eclipse.passage.loc.internal.licenses.core.i18n.LicensesCoreMessages; import org.eclipse.passage.loc.internal.products.core.ProductKeys; +@SuppressWarnings("restriction") final class PersistedEncoded { private final LicensedProduct product; diff --git a/bundles/org.eclipse.passage.loc.products.emfforms/src/org/eclipse/passage/loc/products/emfforms/renderers/ProductVersionKeyRenderer.java b/bundles/org.eclipse.passage.loc.products.emfforms/src/org/eclipse/passage/loc/products/emfforms/renderers/ProductVersionKeyRenderer.java index 49c62efa3..919b7146b 100644 --- a/bundles/org.eclipse.passage.loc.products.emfforms/src/org/eclipse/passage/loc/products/emfforms/renderers/ProductVersionKeyRenderer.java +++ b/bundles/org.eclipse.passage.loc.products.emfforms/src/org/eclipse/passage/loc/products/emfforms/renderers/ProductVersionKeyRenderer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2020 ArSysOp + * Copyright (c) 2019, 2022 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -32,6 +32,7 @@ import org.eclipse.passage.loc.internal.api.workspace.OperatorWorkspace; import org.eclipse.passage.loc.workbench.emfforms.renderers.FileContentRenderer; +@SuppressWarnings("restriction") public abstract class ProductVersionKeyRenderer extends FileContentRenderer { protected final OperatorWorkspace workspace;