Skip to content

Commit

Permalink
refactor: address JDT warnings "hiding"
Browse files Browse the repository at this point in the history
  • Loading branch information
ivy-rew committed Oct 30, 2023
1 parent bbea83f commit 6078468
Show file tree
Hide file tree
Showing 8 changed files with 180 additions and 193 deletions.
170 changes: 84 additions & 86 deletions doc-factory/src/ch/ivyteam/ivy/addons/docfactory/AsposeDocFactory.java

Large diffs are not rendered by default.

131 changes: 65 additions & 66 deletions doc-factory/src/ch/ivyteam/ivy/addons/docfactory/BaseDocFactory.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -512,16 +512,15 @@ public <T> DocumentTemplate withDocumentWorker(T documentWorker) {

/**
* Allows specifying a Locale for formatting the Numbers and Dates objects
* @param locale
* @param newLocale
* @return The DocumenTemplate which Locale as been set.
*/
@SuppressWarnings("hiding")
public DocumentTemplate useLocale(Locale locale) {
if (locale != null) {
this.locale = locale;
public DocumentTemplate useLocale(Locale newLocale) {
if (newLocale != null) {
this.locale = newLocale;
}
for (TemplateMergeField tmf : this.mergeFields) {
tmf.useLocaleAndResetNumberFormatAndDateFormat(locale);
tmf.useLocaleAndResetNumberFormatAndDateFormat(newLocale);
}
return this;
}
Expand Down Expand Up @@ -956,10 +955,9 @@ public DocumentCreationOptions getDocumentCreationOptions() {
return documentCreationOptions;
}

@SuppressWarnings("hiding")
public DocumentTemplate withDocumentCreationOptions(DocumentCreationOptions documentCreationOptions) {
API.checkNotNull(documentCreationOptions, "documentCreationOptions");
this.documentCreationOptions = documentCreationOptions;
public DocumentTemplate withDocumentCreationOptions(DocumentCreationOptions options) {
API.checkNotNull(options, "options");
this.documentCreationOptions = options;
this.documentFactory.withDocumentCreationOptions(this.documentCreationOptions);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
* with its generateDocument methods.
*
*/
@SuppressWarnings("hiding")
public class AsposeDocFactoryFileGenerator {

private DocumentCreationOptions documentCreationOptions = DocumentCreationOptions.getInstance();
Expand All @@ -55,15 +54,14 @@ public static AsposeDocFactoryFileGenerator getInstance() {
/**
* The DocumentCreationOptions contains diverse options for the final file
* generation (e.g should a PDF be editable ...)
* @param documentCreationOptions the DocumentCreationOptions object, cannot
* @param options the DocumentCreationOptions object, cannot
* be null.
* @return the AsposeDocFactoryFileGenerator object which
* DocumentCreationOptions has been set.
*/
public AsposeDocFactoryFileGenerator withDocumentCreationOptions(
DocumentCreationOptions documentCreationOptions) {
API.checkNotNull(documentCreationOptions, "documentCreationOptions");
this.documentCreationOptions = documentCreationOptions;
public AsposeDocFactoryFileGenerator withDocumentCreationOptions(DocumentCreationOptions options) {
API.checkNotNull(options, "options");
this.documentCreationOptions = options;
return this;
}

Expand All @@ -72,14 +70,14 @@ public AsposeDocFactoryFileGenerator withDocumentCreationOptions(
* this AsposeDocFactoryFileGenerator. If set the
* {@link ch.ivyteam.ivy.addons.docfactory.aspose.DocumentWorker#onGeneratedFile(Document, File)}
* logic will be applied after the file has been generated
* @param documentWorker the
* @param worker the
* {@link ch.ivyteam.ivy.addons.docfactory.aspose.DocumentWorker}
* implementation to set. Null is accepted.
* @return the AsposeDocFactoryFileGenerator object which documentWorker has
* been set.
*/
public AsposeDocFactoryFileGenerator withDocumentWorker(DocumentWorker documentWorker) {
this.documentWorker = documentWorker;
public AsposeDocFactoryFileGenerator withDocumentWorker(DocumentWorker worker) {
this.documentWorker = worker;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,13 @@ public AsposeFieldMergingCallback removeNullValuesLines(boolean removeNullValues
* <ul>
* <li>displayBooleanValuesAsCheckBox
* </ul>
* @param documentCreationOptions the DocumentCreationOptions object. If null
* @param options the DocumentCreationOptions object. If null
* throws an IllegalArgumentException
* @return the current AsposeFieldMergingCallback object
*/
@SuppressWarnings("hiding")
public AsposeFieldMergingCallback withDocumentCreationOptions(
DocumentCreationOptions documentCreationOptions) {
API.checkNotNull(documentCreationOptions, "documentCreationOptions");
this.documentCreationOptions = documentCreationOptions;
public AsposeFieldMergingCallback withDocumentCreationOptions(DocumentCreationOptions options) {
API.checkNotNull(options, "options");
this.documentCreationOptions = options;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ public interface DocumentWorker {
* @param document the aspose words Document upon which the mail merge will be
* performed.
*/
@SuppressWarnings("unused")
default void prepare(Document document) {

default void prepare(@SuppressWarnings("all") Document document) {
}

/**
Expand All @@ -33,9 +32,7 @@ default void prepare(Document document) {
* @param document the aspose words Document upon which the mail merge has
* been performed.
*/
@SuppressWarnings("unused")
default void postCreate(Document document) {

default void postCreate(@SuppressWarnings("all") Document document) {
}

/**
Expand All @@ -58,7 +55,7 @@ default void postCreate(Document document) {
* the result file must exist (file.isFile() must return true). Else
* the DocFactory will throw a DocumentGenerationException.
*/
@SuppressWarnings("unused")
@SuppressWarnings("all")
default File onGeneratedFile(Document document, File generatedFile) {
return generatedFile;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public <T> MailMergeDataSource(java.util.Collection<T> dataSourceObjects) {
// makeListOfChildrenDataSourceInComposite(dataSourceObjects);
}

@SuppressWarnings("unchecked")
@SuppressWarnings("all")
private void makeListOfChildrenDataSourceInComposite(List<CompositeObject> dataSourceObjects) {
this.nestedChildrenDatasources = List.create(MetaType.listOf(MetaType.listOf(CompositeObject.class)));
for (int j = 0; j < dataSourceObjects.size(); j++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import ch.ivyteam.api.API;
import ch.ivyteam.ivy.addons.docfactory.pdf.PdfOptions;

@SuppressWarnings("hiding")
public class DocumentCreationOptions {

private PdfOptions pdfOptions = PdfOptions.getInstance();
Expand All @@ -19,11 +18,11 @@ public static DocumentCreationOptions getInstance() {

/**
* returns the DocumentCreationOptions which {@link PdfOptions} has been set.
* @param pdfOptions the {@link PdfOptions} to set. Cannot be null.
* @param options the {@link PdfOptions} to set. Cannot be null.
*/
public DocumentCreationOptions withPdfOptions(PdfOptions pdfOptions) {
API.checkNotNull(pdfOptions, "the pdfOptions");
this.pdfOptions = pdfOptions;
public DocumentCreationOptions withPdfOptions(PdfOptions options) {
API.checkNotNull(options, "options");
this.pdfOptions = options;
return this;
}

Expand All @@ -48,13 +47,13 @@ public DocumentCreationOptions removeWhiteSpaceInPdfEditableFields(
return this;
}

public DocumentCreationOptions displayBooleanValuesAsCheckBox(boolean displayBooleanValuesAsCheckBox) {
this.displayBooleanValuesAsCheckBox = displayBooleanValuesAsCheckBox;
public DocumentCreationOptions displayBooleanValuesAsCheckBox(boolean checkbox) {
this.displayBooleanValuesAsCheckBox = checkbox;
return this;
}

public DocumentCreationOptions removeBlankPages(boolean removeBlankPages) {
this.removeBlankPages = removeBlankPages;
public DocumentCreationOptions removeBlankPages(boolean remove) {
this.removeBlankPages = remove;
return this;
}

Expand Down

0 comments on commit 6078468

Please sign in to comment.