diff --git a/gama.annotations/src/gama/annotations/precompiler/doc/DocProcessorAnnotations.java b/gama.annotations/src/gama/annotations/precompiler/doc/DocProcessorAnnotations.java index 786102a0d5..337c3bdac7 100644 --- a/gama.annotations/src/gama/annotations/precompiler/doc/DocProcessorAnnotations.java +++ b/gama.annotations/src/gama/annotations/precompiler/doc/DocProcessorAnnotations.java @@ -1,12 +1,12 @@ /******************************************************************************************************* * - * DocProcessorAnnotations.java, in gama.annotations, is part of the source code of the - * GAMA modeling and simulation platform . + * DocProcessorAnnotations.java, in gama.annotations, is part of the source code of the GAMA modeling and simulation + * platform . * * (c) 2007-2024 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU) * * Visit https://github.com/gama-platform/gama for license information and contacts. - * + * ********************************************************************************************************/ package gama.annotations.precompiler.doc; @@ -20,7 +20,6 @@ import org.w3c.dom.Document; import org.w3c.dom.NodeList; -import gama.annotations.precompiler.IOperatorCategory; import gama.annotations.precompiler.GamlAnnotations.action; import gama.annotations.precompiler.GamlAnnotations.arg; import gama.annotations.precompiler.GamlAnnotations.constant; @@ -37,6 +36,7 @@ import gama.annotations.precompiler.GamlAnnotations.usage; import gama.annotations.precompiler.GamlAnnotations.variable; import gama.annotations.precompiler.GamlAnnotations.vars; +import gama.annotations.precompiler.IOperatorCategory; import gama.annotations.precompiler.doc.utils.TypeConverter; import gama.annotations.precompiler.doc.utils.XMLElements; @@ -51,12 +51,18 @@ public class DocProcessorAnnotations { /** * Gets the doc elt. * - * @param docAnnot the doc annot - * @param doc the doc - * @param mes the mes - * @param eltName the elt name - * @param tc the tc - * @param e the e + * @param docAnnot + * the doc annot + * @param doc + * the doc + * @param mes + * the mes + * @param eltName + * the elt name + * @param tc + * the tc + * @param e + * the e * @return the doc elt */ public static org.w3c.dom.Element getDocElt(final doc docAnnot, final Document doc, final Messager mes, @@ -67,31 +73,44 @@ public static org.w3c.dom.Element getDocElt(final doc docAnnot, final Document d /** * Gets the doc elt. * - * @param docAnnotTab the doc annot tab - * @param doc the doc - * @param mes the mes - * @param eltName the elt name - * @param tc the tc - * @param e the e + * @param docAnnotTab + * the doc annot tab + * @param doc + * the doc + * @param mes + * the mes + * @param eltName + * the elt name + * @param tc + * the tc + * @param e + * the e * @return the doc elt */ public static org.w3c.dom.Element getDocElt(final doc[] docAnnotTab, final Document doc, final Messager mes, final String eltName, final TypeConverter tc, final ExecutableElement e) { // e.getSimpleName() - if (docAnnotTab == null || docAnnotTab.length == 0) { return DocProcessorAnnotations.getDocElt(null, doc, null, - mes, eltName, tc, e); } + if (docAnnotTab == null || docAnnotTab.length == 0) + return DocProcessorAnnotations.getDocElt(null, doc, null, mes, eltName, tc, e); return DocProcessorAnnotations.getDocElt(docAnnotTab[0], doc, null, mes, eltName, tc, e); } /** * Gets the doc elt. * - * @param docAnnot the doc annot - * @param doc the doc - * @param docElement the doc element - * @param mes the mes - * @param eltName the elt name - * @param tc the tc - * @param e the e + * @param docAnnot + * the doc annot + * @param doc + * the doc + * @param docElement + * the doc element + * @param mes + * the mes + * @param eltName + * the elt name + * @param tc + * the tc + * @param e + * the e * @return the doc elt */ public static org.w3c.dom.Element getDocElt(final doc docAnnot, final Document doc, @@ -102,14 +121,12 @@ public static org.w3c.dom.Element getDocElt(final doc docAnnot, final Document d if (docAnnot == null) { // mes.printMessage(Kind.WARNING, "The element __" + eltName + "__ is not documented."); } else { - if (docElt == null) { - docElt = doc.createElement(XMLElements.DOCUMENTATION); - } + if (docElt == null) { docElt = doc.createElement(XMLElements.DOCUMENTATION); } // Parse result final String value = docAnnot.value(); final boolean masterDoc = docAnnot.masterDoc(); - if ( !"".equals(value)) { + if (!"".equals(value)) { if (docElt.getElementsByTagName(XMLElements.RESULT).getLength() != 0) { final org.w3c.dom.Element resultElt = (org.w3c.dom.Element) docElt.getElementsByTagName(XMLElements.RESULT).item(0); @@ -123,9 +140,7 @@ public static org.w3c.dom.Element getDocElt(final doc docAnnot, final Document d } else { final org.w3c.dom.Element resultElt = doc.createElement(XMLElements.RESULT); resultElt.setTextContent(value); - if (masterDoc) { - resultElt.setAttribute(XMLElements.ATT_RES_MASTER, "true"); - } + if (masterDoc) { resultElt.setAttribute(XMLElements.ATT_RES_MASTER, "true"); } docElt.appendChild(resultElt); } } @@ -166,9 +181,7 @@ public static org.w3c.dom.Element getDocElt(final doc docAnnot, final Document d seeAlsoElt.appendChild(seesElt); } } - if (docAnnot.see().length != 0) { - docElt.appendChild(seeAlsoElt); - } + if (docAnnot.see().length != 0) { docElt.appendChild(seeAlsoElt); } // Parse: usages @@ -251,15 +264,9 @@ else if (usage.examples().length == 0) { } } - if (numberOfUsagesWithExamplesOnly != 0) { - docElt.appendChild(usagesExampleElt); - } - if (numberOfUsagesWithoutExample != 0) { - docElt.appendChild(usagesNoExampleElt); - } - if (numberOfUsages != 0) { - docElt.appendChild(usagesElt); - } + if (numberOfUsagesWithExamplesOnly != 0) { docElt.appendChild(usagesExampleElt); } + if (numberOfUsagesWithoutExample != 0) { docElt.appendChild(usagesNoExampleElt); } + if (numberOfUsages != 0) { docElt.appendChild(usagesElt); } } return docElt; @@ -268,46 +275,44 @@ else if (usage.examples().length == 0) { /** * Gets the examples elt. * - * @param examples the examples - * @param doc the doc - * @param e the e - * @param tc the tc + * @param examples + * the examples + * @param doc + * the doc + * @param e + * the e + * @param tc + * the tc * @return the examples elt */ public static org.w3c.dom.Element getExamplesElt(final example[] examples, final Document doc, final ExecutableElement e, final TypeConverter tc) { final org.w3c.dom.Element examplesElt = doc.createElement(XMLElements.EXAMPLES); - for (final example example : examples) { - examplesElt.appendChild(getExampleElt(example, doc, e, tc)); - } + for (final example example : examples) { examplesElt.appendChild(getExampleElt(example, doc, e, tc)); } return examplesElt; } /** * Gets the example elt. * - * @param example the example - * @param doc the doc - * @param e the e - * @param tc the tc + * @param example + * the example + * @param doc + * the doc + * @param e + * the e + * @param tc + * the tc * @return the example elt */ public static org.w3c.dom.Element getExampleElt(final example example, final Document doc, final ExecutableElement e, final TypeConverter tc) { final org.w3c.dom.Element exampleElt = doc.createElement(XMLElements.EXAMPLE); exampleElt.setAttribute(XMLElements.ATT_EXAMPLE_CODE, example.value()); - if (!"".equals(example.var())) { - exampleElt.setAttribute(XMLElements.ATT_EXAMPLE_VAR, example.var()); - } - if (!"".equals(example.equals())) { - exampleElt.setAttribute(XMLElements.ATT_EXAMPLE_EQUALS, example.equals()); - } - if (!"".equals(example.isNot())) { - exampleElt.setAttribute(XMLElements.ATT_EXAMPLE_IS_NOT, example.isNot()); - } - if (!"".equals(example.raises())) { - exampleElt.setAttribute(XMLElements.ATT_EXAMPLE_RAISES, example.raises()); - } + if (!"".equals(example.var())) { exampleElt.setAttribute(XMLElements.ATT_EXAMPLE_VAR, example.var()); } + if (!"".equals(example.equals())) { exampleElt.setAttribute(XMLElements.ATT_EXAMPLE_EQUALS, example.equals()); } + if (!"".equals(example.isNot())) { exampleElt.setAttribute(XMLElements.ATT_EXAMPLE_IS_NOT, example.isNot()); } + if (!"".equals(example.raises())) { exampleElt.setAttribute(XMLElements.ATT_EXAMPLE_RAISES, example.raises()); } exampleElt.setAttribute(XMLElements.ATT_EXAMPLE_IS_TEST_ONLY, "" + example.isTestOnly()); exampleElt.setAttribute(XMLElements.ATT_EXAMPLE_IS_EXECUTABLE, "" + example.isExecutable()); if (!example.isExecutable()) { @@ -317,10 +322,8 @@ public static org.w3c.dom.Element getExampleElt(final example example, final Doc } if (!"".equals(example.returnType())) { exampleElt.setAttribute(XMLElements.ATT_EXAMPLE_TYPE, example.returnType()); - } else { - if (e != null) { - exampleElt.setAttribute(XMLElements.ATT_EXAMPLE_TYPE, tc.getProperType(e.getReturnType().toString())); - } + } else if (e != null) { + exampleElt.setAttribute(XMLElements.ATT_EXAMPLE_TYPE, tc.getProperType(e.getReturnType().toString())); } return exampleElt; } @@ -328,11 +331,16 @@ public static org.w3c.dom.Element getExampleElt(final example example, final Doc /** * Gets the constant elt. * - * @param constant the constant - * @param doc the doc - * @param e the e - * @param mes the mes - * @param tc the tc + * @param constant + * the constant + * @param doc + * the doc + * @param e + * the e + * @param mes + * the mes + * @param tc + * the tc * @return the constant elt */ public static org.w3c.dom.Element getConstantElt(final constant constant, final Document doc, final Element e, @@ -349,28 +357,24 @@ public static org.w3c.dom.Element getConstantElt(final constant constant, final StringBuilder strBuilder = new StringBuilder(); boolean firstPass = true; for (final String n : constant.altNames()) { - + if (firstPass) { firstPass = false; - } - else { - strBuilder.append(","); + } else { + strBuilder.append(","); } strBuilder.append(PREFIX_CONSTANT); strBuilder.append(n); } final String names = strBuilder.toString(); - - if (!"".equals(names)) - constantElt.setAttribute(XMLElements.ATT_CST_NAMES, names); + + if (!"".equals(names)) { constantElt.setAttribute(XMLElements.ATT_CST_NAMES, names); } constantElt.appendChild(getCategories(e, doc, doc.createElement(XMLElements.CATEGORIES), tc)); final org.w3c.dom.Element docConstantElt = getDocElt(constant.doc(), doc, mes, e.getSimpleName().toString(), null, null); - if (docConstantElt != null) { - constantElt.appendChild(docConstantElt); - } + if (docConstantElt != null) { constantElt.appendChild(docConstantElt); } return constantElt; } @@ -378,40 +382,39 @@ public static org.w3c.dom.Element getConstantElt(final constant constant, final /** * Gets the vars elt. * - * @param varsAnnot the vars annot - * @param doc the doc - * @param mes the mes - * @param skillName the skill name - * @param tc the tc + * @param varsAnnot + * the vars annot + * @param doc + * the doc + * @param mes + * the mes + * @param skillName + * the skill name + * @param tc + * the tc * @return the vars elt */ public static org.w3c.dom.Element getVarsElt(final vars varsAnnot, final Document doc, final Messager mes, final String skillName, final TypeConverter tc) { - if (varsAnnot == null) { - return null; - } + if (varsAnnot == null) return null; final org.w3c.dom.Element varsElt = doc.createElement(XMLElements.VARS); for (final variable v : varsAnnot.value()) { final org.w3c.dom.Element varElt = doc.createElement(XMLElements.VAR); varElt.setAttribute(XMLElements.ATT_VAR_NAME, v.name()); - varElt.setAttribute(XMLElements.ATT_VAR_TYPE, tc.getTypeString(Integer.valueOf(v.type()))); + varElt.setAttribute(XMLElements.ATT_VAR_TYPE, tc.getTypeString(v.type())); varElt.setAttribute(XMLElements.ATT_VAR_CONSTANT, "" + v.constant()); final org.w3c.dom.Element docEltVar = DocProcessorAnnotations.getDocElt(v.doc(), doc, mes, "Var " + v.name() + " from " + skillName, tc, null); - if (docEltVar != null) { - varElt.appendChild(docEltVar); - } + if (docEltVar != null) { varElt.appendChild(docEltVar); } StringBuilder strBuilder = new StringBuilder(); - for (int i = 0 ; i < v.depends_on().length; i++ ) { + for (int i = 0; i < v.depends_on().length; i++) { final String dependElement = v.depends_on()[i]; strBuilder.append(dependElement); - if (i < v.depends_on().length - 1) { - strBuilder.append(","); - } + if (i < v.depends_on().length - 1) { strBuilder.append(","); } } - + final String dependsOn = strBuilder.toString(); varElt.setAttribute(XMLElements.ATT_VAR_DEPENDS_ON, dependsOn); varsElt.appendChild(varElt); @@ -422,18 +425,22 @@ public static org.w3c.dom.Element getVarsElt(final vars varsAnnot, final Documen /** * Gets the action elt. * - * @param actionAnnot the action annot - * @param doc the doc - * @param mes the mes - * @param e the e - * @param tc the tc + * @param actionAnnot + * the action annot + * @param doc + * the doc + * @param mes + * the mes + * @param e + * the e + * @param tc + * the tc * @return the action elt */ public static org.w3c.dom.Element getActionElt(final action actionAnnot, final Document doc, final Messager mes, final Element e, final TypeConverter tc) { - if (!(e instanceof ExecutableElement) || actionAnnot == null) { return null; } + if (!(e instanceof final ExecutableElement eltMethod) || actionAnnot == null) return null; - final ExecutableElement eltMethod = (ExecutableElement) e; final org.w3c.dom.Element actionElt = doc.createElement(XMLElements.ACTION); actionElt.setAttribute(XMLElements.ATT_ACTION_NAME, actionAnnot.name()); actionElt.setAttribute(XMLElements.ATT_ACTION_RETURNTYPE, @@ -453,9 +460,7 @@ public static org.w3c.dom.Element getActionElt(final action actionAnnot, final D argElt.setAttribute(XMLElements.ATT_ARG_OPTIONAL, "" + eltArg.optional()); final org.w3c.dom.Element docEltArg = DocProcessorAnnotations.getDocElt(eltArg.doc(), doc, mes, "Arg " + eltArg.name() + " from " + eltMethod.getSimpleName(), tc, null); - if (docEltArg != null) { - argElt.appendChild(docEltArg); - } + if (docEltArg != null) { argElt.appendChild(docEltArg); } argsElt.appendChild(argElt); } @@ -463,9 +468,7 @@ public static org.w3c.dom.Element getActionElt(final action actionAnnot, final D final org.w3c.dom.Element docEltAction = DocProcessorAnnotations.getDocElt(actionAnnot.doc(), doc, mes, eltMethod.getSimpleName().toString(), tc, null); - if (docEltAction != null) { - actionElt.appendChild(docEltAction); - } + if (docEltAction != null) { actionElt.appendChild(docEltAction); } return actionElt; } @@ -473,16 +476,21 @@ public static org.w3c.dom.Element getActionElt(final action actionAnnot, final D /** * Gets the facets elt. * - * @param facetsAnnot the facets annot - * @param doc the doc - * @param mes the mes - * @param statName the stat name - * @param tc the tc + * @param facetsAnnot + * the facets annot + * @param doc + * the doc + * @param mes + * the mes + * @param statName + * the stat name + * @param tc + * the tc * @return the facets elt */ public static org.w3c.dom.Element getFacetsElt(final facets facetsAnnot, final Document doc, final Messager mes, final String statName, final TypeConverter tc) { - if (facetsAnnot == null) { return null; } + if (facetsAnnot == null) return null; final org.w3c.dom.Element facetsElt = doc.createElement(XMLElements.FACETS); @@ -506,9 +514,7 @@ public static org.w3c.dom.Element getFacetsElt(final facets facetsAnnot, final D f.name().equals(facetsAnnot.omissible()) ? "true" : "false"); final org.w3c.dom.Element docFacetElt = DocProcessorAnnotations.getDocElt(f.doc(), doc, mes, "Facet " + f.name() + " from Statement" + statName, tc, null); - if (docFacetElt != null) { - facetElt.appendChild(docFacetElt); - } + if (docFacetElt != null) { facetElt.appendChild(docFacetElt); } facetsElt.appendChild(facetElt); } @@ -518,14 +524,17 @@ public static org.w3c.dom.Element getFacetsElt(final facets facetsAnnot, final D /** * Gets the inside elt. * - * @param insideAnnot the inside annot - * @param doc the doc - * @param tc the tc + * @param insideAnnot + * the inside annot + * @param doc + * the doc + * @param tc + * the tc * @return the inside elt */ public static org.w3c.dom.Element getInsideElt(final inside insideAnnot, final Document doc, final TypeConverter tc) { - if (insideAnnot == null) { return null; } + if (insideAnnot == null) return null; final org.w3c.dom.Element insideElt = doc.createElement(XMLElements.INSIDE); @@ -551,8 +560,10 @@ public static org.w3c.dom.Element getInsideElt(final inside insideAnnot, final D /** * Gets the operator element. * - * @param operators the operators - * @param eltName the elt name + * @param operators + * the operators + * @param eltName + * the elt name * @return the operator element */ public static org.w3c.dom.Element getOperatorElement(final org.w3c.dom.Element operators, final String eltName) { @@ -561,7 +572,7 @@ public static org.w3c.dom.Element getOperatorElement(final org.w3c.dom.Element o final boolean found = false; while (!found && i < nL.getLength()) { final org.w3c.dom.Element elt = (org.w3c.dom.Element) nL.item(i); - if (eltName.equals(elt.getAttribute(XMLElements.ATT_OP_ID))) { return elt; } + if (eltName.equals(elt.getAttribute(XMLElements.ATT_OP_ID))) return elt; i++; } return null; @@ -570,15 +581,19 @@ public static org.w3c.dom.Element getOperatorElement(final org.w3c.dom.Element o /** * Gets the categories. * - * @param e the e - * @param doc the doc - * @param categoriesElt the categories elt - * @param tc the tc + * @param e + * the e + * @param doc + * the doc + * @param categoriesElt + * the categories elt + * @param tc + * the tc * @return the categories */ public static org.w3c.dom.Element getCategories(final Element e, final Document doc, final org.w3c.dom.Element categoriesElt, final TypeConverter tc) { - final ArrayList categories = new ArrayList(); + final ArrayList categories = new ArrayList<>(); String[] categoriesTab = null; final NodeList nL = categoriesElt.getElementsByTagName(XMLElements.CATEGORY); for (int i = 0; i < nL.getLength(); i++) { @@ -594,7 +609,7 @@ public static org.w3c.dom.Element getCategories(final Element e, final Document if (e.getAnnotation(operator.class) != null && e.getAnnotation(operator.class).category().length > 0 || e.getAnnotation(constant.class) != null && e.getAnnotation(constant.class).category().length > 0) { - if (categoriesTab != null) + if (categoriesTab != null) { for (final String categoryName : categoriesTab) { if (!categories.contains(categoryName)) { categories.add(categoryName); @@ -604,13 +619,12 @@ public static org.w3c.dom.Element getCategories(final Element e, final Document categoriesElt.appendChild(catElt); } } - } else { - if (!categories.contains(tc.getProperCategory(e.getEnclosingElement().getSimpleName().toString()))) { - final org.w3c.dom.Element catElt = doc.createElement(XMLElements.CATEGORY); - catElt.setAttribute(XMLElements.ATT_CAT_ID, - tc.getProperCategory(e.getEnclosingElement().getSimpleName().toString())); - categoriesElt.appendChild(catElt); } + } else if (!categories.contains(tc.getProperCategory(e.getEnclosingElement().getSimpleName().toString()))) { + final org.w3c.dom.Element catElt = doc.createElement(XMLElements.CATEGORY); + catElt.setAttribute(XMLElements.ATT_CAT_ID, + tc.getProperCategory(e.getEnclosingElement().getSimpleName().toString())); + categoriesElt.appendChild(catElt); } // We had a particular category that is read from the iterator @@ -626,9 +640,12 @@ public static org.w3c.dom.Element getCategories(final Element e, final Document /** * Gets the categories. * - * @param e the e - * @param doc the doc - * @param tc the tc + * @param e + * the e + * @param doc + * the doc + * @param tc + * the tc * @return the categories */ public static org.w3c.dom.Element getCategories(final Element e, final Document doc, final TypeConverter tc) { @@ -640,15 +657,19 @@ public static org.w3c.dom.Element getCategories(final Element e, final Document /** * Gets the concepts. * - * @param e the e - * @param doc the doc - * @param conceptElt the concept elt - * @param tc the tc + * @param e + * the e + * @param doc + * the doc + * @param conceptElt + * the concept elt + * @param tc + * the tc * @return the concepts */ public static org.w3c.dom.Element getConcepts(final Element e, final Document doc, final org.w3c.dom.Element conceptElt, final TypeConverter tc) { - final ArrayList concepts = new ArrayList(); + final ArrayList concepts = new ArrayList<>(); String[] conceptsTab = null; final NodeList nL = conceptElt.getElementsByTagName(XMLElements.CONCEPT); for (int i = 0; i < nL.getLength(); i++) { @@ -666,9 +687,7 @@ public static org.w3c.dom.Element getConcepts(final Element e, final Document do conceptsTab = e.getAnnotation(species.class).concept(); } else if (e.getAnnotation(symbol.class) != null) { conceptsTab = e.getAnnotation(symbol.class).concept(); - } else if (e.getAnnotation(skill.class) != null) { - conceptsTab = e.getAnnotation(skill.class).concept(); - } + } else if (e.getAnnotation(skill.class) != null) { conceptsTab = e.getAnnotation(skill.class).concept(); } if (e.getAnnotation(operator.class) != null && e.getAnnotation(operator.class).concept().length > 0 || e.getAnnotation(constant.class) != null && e.getAnnotation(constant.class).concept().length > 0 @@ -676,7 +695,7 @@ public static org.w3c.dom.Element getConcepts(final Element e, final Document do || e.getAnnotation(skill.class) != null && e.getAnnotation(skill.class).concept().length > 0 || e.getAnnotation(species.class) != null && e.getAnnotation(species.class).concept().length > 0 || e.getAnnotation(symbol.class) != null && e.getAnnotation(symbol.class).concept().length > 0) { - if (conceptsTab != null) + if (conceptsTab != null) { for (final String conceptName : conceptsTab) { if (!concepts.contains(conceptName)) { concepts.add(conceptName); @@ -686,6 +705,7 @@ public static org.w3c.dom.Element getConcepts(final Element e, final Document do conceptElt.appendChild(catElt); } } + } } // We had a particular category that is red from the iterator diff --git a/gama.core/src/gama/core/common/interfaces/IImageProvider.java b/gama.core/src/gama/core/common/interfaces/IImageProvider.java index 127c04c328..06f7f47862 100644 --- a/gama.core/src/gama/core/common/interfaces/IImageProvider.java +++ b/gama.core/src/gama/core/common/interfaces/IImageProvider.java @@ -1,7 +1,6 @@ /******************************************************************************************************* * - * IImageProvider.java, in gama.core, is part of the source code of the GAMA modeling and simulation platform - * . + * IImageProvider.java, in gama.core, is part of the source code of the GAMA modeling and simulation platform . * * (c) 2007-2024 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU) * @@ -12,8 +11,6 @@ import java.awt.image.BufferedImage; -import javax.annotation.Nonnegative; - import gama.core.common.geometry.Envelope3D; import gama.core.runtime.IScope; @@ -29,7 +26,6 @@ public interface IImageProvider extends IEnvelopeProvider, IAsset { * @param scope * @return */ - @Nonnegative int getRows(IScope scope); /** @@ -38,7 +34,6 @@ public interface IImageProvider extends IEnvelopeProvider, IAsset { * @param scope * @return */ - @Nonnegative int getCols(IScope scope); /** diff --git a/gama.core/src/gama/core/kernel/experiment/IParameter.java b/gama.core/src/gama/core/kernel/experiment/IParameter.java index 06dcc8db68..046b843933 100644 --- a/gama.core/src/gama/core/kernel/experiment/IParameter.java +++ b/gama.core/src/gama/core/kernel/experiment/IParameter.java @@ -12,8 +12,6 @@ import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; - import gama.core.runtime.IScope; import gama.core.runtime.exceptions.GamaRuntimeException; import gama.gaml.types.IType; @@ -177,7 +175,6 @@ public interface ParameterChangeListener { * * @return the enablement */ - @Nonnull default String[] getEnablement() { return EMPTY_STRINGS; } /** @@ -186,7 +183,6 @@ public interface ParameterChangeListener { * * @return the disablement */ - @Nonnull default String[] getDisablement() { return EMPTY_STRINGS; } /** @@ -195,7 +191,6 @@ public interface ParameterChangeListener { * * @return the refreshment */ - @Nonnull default String[] getRefreshment() { return EMPTY_STRINGS; } /** @@ -203,7 +198,6 @@ public interface ParameterChangeListener { * * @return the file extensions */ - @Nonnull default String[] getFileExtensions() { return EMPTY_STRINGS; } /** diff --git a/gama.core/src/gama/core/util/file/IFieldMatrixProvider.java b/gama.core/src/gama/core/util/file/IFieldMatrixProvider.java index 627bf166c3..58cc400f12 100644 --- a/gama.core/src/gama/core/util/file/IFieldMatrixProvider.java +++ b/gama.core/src/gama/core/util/file/IFieldMatrixProvider.java @@ -1,18 +1,14 @@ /******************************************************************************************************* * - * IFieldMatrixProvider.java, in gama.core, is part of the source code of the - * GAMA modeling and simulation platform . + * IFieldMatrixProvider.java, in gama.core, is part of the source code of the GAMA modeling and simulation platform . * * (c) 2007-2024 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU) * * Visit https://github.com/gama-platform/gama for license information and contacts. - * + * ********************************************************************************************************/ package gama.core.util.file; -import javax.annotation.Nonnegative; -import javax.annotation.Nonnull; - import gama.core.runtime.IScope; import gama.core.runtime.exceptions.GamaRuntimeException; import gama.core.util.matrix.GamaField; @@ -36,7 +32,6 @@ public interface IFieldMatrixProvider { * @param scope * @return */ - @Nonnull default IField getField(final IScope scope) { return new GamaField(scope, this); } @@ -58,7 +53,6 @@ default double getNoData(final IScope scope) { * @param scope * @return */ - @Nonnegative int getRows(IScope scope); /** @@ -67,7 +61,6 @@ default double getNoData(final IScope scope) { * @param scope * @return */ - @Nonnegative int getCols(IScope scope); /** @@ -77,7 +70,6 @@ default double getNoData(final IScope scope) { * @return the number of bands. */ - @Nonnegative default int getBandsNumber(final IScope scope) { return 1; } @@ -89,7 +81,6 @@ default int getBandsNumber(final IScope scope) { * @param scope * @return an array of double, possibly empty, never null */ - @Nonnull default double[] getFieldData(final IScope scope) { return getBand(scope, 0); } diff --git a/gama.core/src/gama/core/util/matrix/GamaField.java b/gama.core/src/gama/core/util/matrix/GamaField.java index 5e73507897..b3a2b3621d 100644 --- a/gama.core/src/gama/core/util/matrix/GamaField.java +++ b/gama.core/src/gama/core/util/matrix/GamaField.java @@ -13,7 +13,6 @@ import java.util.Arrays; -import javax.annotation.Nullable; import com.google.common.collect.Iterables; import com.google.common.primitives.Doubles; @@ -148,7 +147,6 @@ public Double getFromIndicesList(final IScope scope, final IList indices) throws * grid coordinates is already taken in charge by matrices */ @Override - @Nullable public Double get(final IScope scope, final GamaPoint p) { computeDimensions(scope); GamaPoint gp = new GamaPoint(p); @@ -262,7 +260,6 @@ public java.lang.Iterable iterable(final IScope scope) { return Iterables.filter(Doubles.asList(getMatrix()), e -> e != noDataValue); } - @Nullable @Override public IShape getCellShapeAt(final IScope scope, final GamaPoint gp) { computeDimensions(scope); diff --git a/gama.core/src/gama/core/util/matrix/IField.java b/gama.core/src/gama/core/util/matrix/IField.java index 05492c3fd0..a55169f282 100644 --- a/gama.core/src/gama/core/util/matrix/IField.java +++ b/gama.core/src/gama/core/util/matrix/IField.java @@ -9,8 +9,6 @@ ********************************************************************************************************/ package gama.core.util.matrix; -import javax.annotation.Nonnull; - import gama.annotations.precompiler.GamlAnnotations.doc; import gama.annotations.precompiler.GamlAnnotations.getter; import gama.annotations.precompiler.GamlAnnotations.setter; @@ -179,7 +177,6 @@ default void setCellSize(final IScope scope, final GamaPoint size) { * a world location (location of an agent, for instance) * @return A list of values at this location. Never null nor empty (as there is at least one band). */ - @Nonnull IList getValuesIntersecting(IScope scope, IShape shape); /** diff --git a/gama.dependencies/META-INF/MANIFEST.MF b/gama.dependencies/META-INF/MANIFEST.MF index e0e0661298..6053b104fa 100644 --- a/gama.dependencies/META-INF/MANIFEST.MF +++ b/gama.dependencies/META-INF/MANIFEST.MF @@ -143,9 +143,6 @@ Export-Package: com.conversantmedia.util.collection, it.geosolutions.jaiext.warp, it.geosolutions.jaiext.zonal, it.geosolutions.rendered.viewer, - javax.annotation, - javax.annotation.concurrent, - javax.annotation.meta, javax.measure, javax.measure.format, javax.measure.quantity, diff --git a/gama.ui.shared/src/gama/ui/shared/parameters/AbstractEditor.java b/gama.ui.shared/src/gama/ui/shared/parameters/AbstractEditor.java index eabf4aad07..ff7f22b8bb 100644 --- a/gama.ui.shared/src/gama/ui/shared/parameters/AbstractEditor.java +++ b/gama.ui.shared/src/gama/ui/shared/parameters/AbstractEditor.java @@ -14,9 +14,6 @@ import java.util.Objects; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; @@ -62,7 +59,7 @@ public abstract class AbstractEditor implements SelectionListener, ModifyList private final int order = ORDER++; /** The listener. */ - @Nullable private final EditorListener listener; + private final EditorListener listener; /** The agent. */ private final IAgent agent; @@ -74,7 +71,7 @@ public abstract class AbstractEditor implements SelectionListener, ModifyList protected String name; /** The param. */ - @Nonnull protected final IParameter param; + protected final IParameter param; /** The different values. */ // Values @@ -104,15 +101,13 @@ public abstract class AbstractEditor implements SelectionListener, ModifyList protected EditorsGroup parent; /** The editor toolbar. */ - @SuppressWarnings("rawtypes") - protected EditorToolbar editorToolbar; + @SuppressWarnings ("rawtypes") protected EditorToolbar editorToolbar; /** The editor label. */ protected EditorLabel editorLabel; /** The editor control. */ - @SuppressWarnings("rawtypes") - protected EditorControl editorControl; + @SuppressWarnings ("rawtypes") protected EditorControl editorControl; /** * Instantiates a new abstract editor. @@ -126,8 +121,7 @@ public abstract class AbstractEditor implements SelectionListener, ModifyList * @param l * the l */ - public AbstractEditor(@Nonnull final IAgent a, @Nonnull final IParameter parameter, - @Nullable final EditorListener l) { + public AbstractEditor(final IAgent a, final IParameter parameter, final EditorListener l) { param = parameter; agent = a; if (agent == null) throw GamaRuntimeException.error("The parameters view cannot be opened.", a.getScope()); @@ -370,7 +364,7 @@ EditorToolbar createEditorToolbar() { * * @return the editor control */ - @SuppressWarnings("rawtypes") + @SuppressWarnings ("rawtypes") EditorControl createEditorControl() { boolean isCombo = param.getAmongValue(getScope()) != null; boolean isEditable = param.isEditable(); @@ -681,6 +675,7 @@ public void dispose() { * @return true, if is disposed * @date 21 févr. 2024 */ + @Override public boolean isDisposed() { if (editorLabel != null && editorLabel.isDisposed() || editorControl != null && editorControl.isDisposed()) return true;