// https://docs.sonarqube.org/display/SONARQUBE52/Analyzing+with+SonarQube+Scanner+for+Gradle
// for documentation of properties.
//
- // Some additional properties are currently set in the Jenkins-DSL, see jenksin/create_jobs.groovy
+ // Some additional properties are currently set in the Jenkins-DSL, see jenkins/create_jobs.groovy
//
sonarqube {
properties {
<property name="util.lib" location="${basedir}/lib/util"/>
- <!-- compiler options options -->
+ <!-- compiler options -->
<property name="jdk.version.source" value="1.8" description="JDK version of source code"/>
<property name="jdk.version.class" value="1.8" description="JDK version of generated class files"/>
<property name="compile.debug" value="true"/>
<pathelement location="${main.output.dir}"/>
<pathelement location="${ooxml.test.guava.jar}"/>
<pathelement location="${ooxml.test.opczip.jar}"/>
- <!-- classes are omitted on test cases outside the xml-dsign area to avoid classpath poisioning -->
+ <!-- classes are omitted on test cases outside the xml-dsign area to avoid classpath poisoning -->
<!--path refid="ooxml.xmlsec.classpath"/-->
<!-- Used only for ExtractorFactory, see #57963 -->
<pathelement location="${scratchpad.output.dir}" unless:true="${scratchpad.ignore}"/>
<fail><condition><matches pattern="[1-9][0-9]* Unknown Licens" string="${rat.reportcontent}"/></condition></fail>
</target>
- <!-- Runs the Forbiddens APIs checker against the source code, to -->
+ <!-- Runs the Forbidden APIs checker against the source code, to -->
<!-- spot any cases where we've accidently used methods we shouldn't -->
<!-- See https://github.com/policeman-tools/forbidden-apis for details -->
<!-- of the checks that this can do -->
<target name="test-scratchpad-download-resources">
- <!-- disable font downloading until TestFontRendering works on all plattforms -->
+ <!-- disable font downloading until TestFontRendering works on all platforms -->
<!-- ... eventually copy the files into the resource dirs ... -->
<!--
<mkdir dir="build/scratchpad-test-resources"/>
<tstamp>
<!-- usually overwritten by a command line argument -->
- <!-- for convience this is kept in the same format as in the release-prep call -->
+ <!-- for convenience this is kept in the same format as in the release-prep call -->
<format property="file_date" pattern="yyyyMMdd" locale="US"/>
</tstamp>
</sequential>
</macrodef>
- <!-- TODO: currently this only saves a copy and paste snipplet to a file ...
+ <!-- TODO: currently this only saves a copy and paste snippet to a file ...
would be nice if it really changes changes.xml and download.xml
Doesn't work with Java6 - the https urls can't be accessed via loadChecksum
-->
'adoptopenjdk_hotspot_8u282',
'ibmjdk_1.8.0_261'
)
- // Note H50 is reserved according to its node-descripion
+ // Note H50 is reserved according to its node-description
label('Nodes','H22','H23','H24','H25','H26','H27','H28','H29','H30','H31','H32','H33','H34','H35','H36','H37','H38','H39','H40','H41','H42','H43','H44','H48','lucene1','lucene2','master')
}
steps {
/**
* Use Excel conditional formatting to hide the duplicate values,
* and make the list easier to read. In this example, when the table is sorted by Region,
- * the second (and subsequent) occurences of each region name will have white font colour.
+ * the second (and subsequent) occurrences of each region name will have white font colour.
*/
static void hideDupplicates(Sheet sheet) {
sheet.createRow(0).createCell(0).setCellValue("City");
sheetCF.addConditionalFormatting(regions, rule1);
sheet.getRow(1).createCell(1).setCellValue("<== the second (and subsequent) " +
- "occurences of each region name will have white font colour. " +
+ "occurrences of each region name will have white font colour. " +
"Condition: Formula Is =A2=A1 (White Font)");
}
// It is not wise to have such a wide catch clause - Exception is very
// close to being at the top of the inheritance hierarchy - though it
// will suffice for this example as it is really not possible to recover
- // easilly from an exceptional set of circumstances at this point in the
+ // easily from an exceptional set of circumstances at this point in the
// program. It should however, ideally be replaced with one or more
// catch clauses optimised to handle more specific problems.
catch(Exception ex) {
/**
* Custom listener class for Ants junitlauncher, because it chomps the important running details
*
- * @see <a href="https://bz.apache.org/bugzilla/show_bug.cgi?id=64836">Bug 64836 - junitlaucher poor summary</a>
+ * @see <a href="https://bz.apache.org/bugzilla/show_bug.cgi?id=64836">Bug 64836 - junitlauncher poor summary</a>
**/
public class Junit5Progress implements TestExecutionListener {
private final AtomicInteger numSkippedInTestSet = new AtomicInteger();
DEFAULT_XML_OPTIONS.setCharacterEncoding("UTF-8");
DEFAULT_XML_OPTIONS.setDisallowDocTypeDeclaration(true);
DEFAULT_XML_OPTIONS.setEntityExpansionLimit(1);
- // Piccolo is disabled for POI builts, i.e. JAXP is used for parsing
+ // JAXP is used for parsing
// so only user code using XmlObject/XmlToken.Factory.parse
// directly can bypass the entity check, which is probably unlikely (... and not within our responsibility :))
// DEFAULT_XML_OPTIONS.setLoadEntityBytesLimit(4096);
/**
* @param lowerbound the lower limit of the id-range to manage. Must be greater than or equal to {@link #MIN_ID}.
- * @param upperbound the upper limit of the id-range to manage. Must be less then or equal {@link #MAX_ID}.
+ * @param upperbound the upper limit of the id-range to manage. Must be less than or equal {@link #MAX_ID}.
*/
public IdentifierManager(long lowerbound, long upperbound) {
if (lowerbound > upperbound) {
// pack.originalPackagePath = file.getAbsolutePath();
return pack;
} catch (InvalidFormatException | RuntimeException e) {
- // use revert() to free resources when the packgae is opened read-only
+ // use revert() to free resources when the package is opened read-only
pack.revert();
throw e;
/**
* Add a thumbnail to the package. This method is provided to make easier
* the addition of a thumbnail in a package. You can do the same work by
- * using the traditionnal relationship and part mechanism.
+ * using the traditional relationship and part mechanism.
*
* @param path The full path to the image file.
*/
/**
* Add a thumbnail to the package. This method is provided to make easier
* the addition of a thumbnail in a package. You can do the same work by
- * using the traditionnal relationship and part mechanism.
+ * using the traditional relationship and part mechanism.
*
* @param filename The full path to the image file.
* @param data the image data
// If the specified partis flagged as deleted, we make it
// available
part.setDeleted(false);
- // and delete the old part to replace it thereafeter
+ // and delete the old part to replace it thereafter
this.partList.remove(part._partName);
}
this.partList.put(part._partName, part);
/**
* Replace a content type in this package.<p>
- * A typical scneario to call this method is to rename a template file to the main format, e.g.
+ * A typical scenario to call this method is to rename a template file to the main format, e.g.
* <ul>
* <li>".dotx" to ".docx"</li>
* <li>".dotm" to ".docm"</li>
partURI = new URI(partName);
} catch (URISyntaxException e) {
throw new IllegalArgumentException(
- "partName argmument is not a valid OPC part name !");
+ "partName argument is not a valid OPC part name !");
}
if (checkConformance) {
}
/**
- * Throws an exception if the specified part name ends with a forwar slash
+ * Throws an exception if the specified part name ends with a forward slash
* character '/'. [M1.5]
*
* @param partUri
* The part name to check.
* @throws InvalidFormatException
- * If the specified part name ends with a forwar slash character
+ * If the specified part name ends with a forward slash character
* '/'.
*/
private static void throwExceptionIfPartNameEndsWithForwardSlashChar(
* The part that own this relationships collection. If <b>null</b>
* then this part is considered as the package root.
* @throws InvalidFormatException
- * If an error occurs during the parsing of the relatinships
+ * If an error occurs during the parsing of the relationships
* part fo the specified part.
*/
public PackageRelationshipCollection(OPCPackage container, PackagePart part)
*
* @param partName
* The part name to validate.
- * @return The correspondant part name if valid, else <code>null</code>.
+ * @return The correspondent part name if valid, else <code>null</code>.
* @throws InvalidFormatException
* Throws if the specified part name is not OPC compliant.
* @see #createPartName(URI)
* The part name to validate.
* @param relativePart
* The relative base part.
- * @return The correspondant part name if valid, else <code>null</code>.
+ * @return The correspondent part name if valid, else <code>null</code>.
* @throws InvalidFormatException
* Throws if the specified part name is not OPC compliant.
* @see #createPartName(URI)
* The part name URI to validate.
* @param relativePart
* The relative base part.
- * @return The correspondant part name if valid, else <code>null</code>.
+ * @return The correspondent part name if valid, else <code>null</code>.
* @throws InvalidFormatException
* Throws if the specified part name is not OPC compliant.
* @see #createPartName(URI)
* Source part URI
* @return the full path (as URI) of the relation file
* @throws InvalidOperationException
- * Throws if the specified URI is a relationshp part.
+ * Throws if the specified URI is a relationship part.
*/
public static PackagePartName getRelationshipPartName(
PackagePartName partName) {
value = value.replace('\\', '/');
}
- // URI fragemnts (those starting with '#') are not encoded
+ // URI fragments (those starting with '#') are not encoded
// and may contain white spaces and raw unicode characters
int fragmentIdx = value.indexOf('#');
if(fragmentIdx != -1){
addDefaultContentType(extension, contentType);
}
- // Overriden content types
+ // Overridden content types
NodeList overrideTypes = xmlContentTypetDoc.getDocumentElement().getElementsByTagNameNS(TYPES_NAMESPACE_URI, OVERRIDE_TAG_NAME);
int overrideTypeCount = overrideTypes.getLength();
for (int i = 0; i < overrideTypeCount; i++) {
private String commitmentType = "Created and approved this document";
/**
- * Swtich to enable/disable automatic CRL download - by default the download is with all https hostname
+ * Switch to enable/disable automatic CRL download - by default the download is with all https hostname
* and certificate verifications disabled.
*
* @since POI 5.2.1
}
/**
- * @param xadesIssuerNameNoReverseOrder when true, the issuer DN instead of the issuer X500 prinicpal is used
+ * @param xadesIssuerNameNoReverseOrder when true, the issuer DN instead of the issuer X500 principal is used
*/
public void setXadesIssuerNameNoReverseOrder(boolean xadesIssuerNameNoReverseOrder) {
this.xadesIssuerNameNoReverseOrder = xadesIssuerNameNoReverseOrder;
/**
- * @return the cannonicalization method for XAdES-XL signing.
+ * @return the canonicalization method for XAdES-XL signing.
* Defaults to {@code EXCLUSIVE}
* @see <a href="http://docs.oracle.com/javase/7/docs/api/javax/xml/crypto/dsig/CanonicalizationMethod.html">javax.xml.crypto.dsig.CanonicalizationMethod</a>
*/
}
/**
- * @param xadesCanonicalizationMethod the cannonicalization method for XAdES-XL signing
+ * @param xadesCanonicalizationMethod the canonicalization method for XAdES-XL signing
* @see <a href="http://docs.oracle.com/javase/7/docs/api/javax/xml/crypto/dsig/CanonicalizationMethod.html">javax.xml.crypto.dsig.CanonicalizationMethod</a>
*/
public void setXadesCanonicalizationMethod(String xadesCanonicalizationMethod) {
insertXChild(unsignedSigProps, validationData);
}
} catch (CertificateEncodingException e) {
- throw new MarshalException("unable to create XAdES signatrue", e);
+ throw new MarshalException("unable to create XAdES signature", e);
}
/**
* Check if CRL is to be added, check cached CRLs in config and download if necessary.
- * Can be overriden to suppress the logic
+ * Can be overridden to suppress the logic
* @return empty list, if not found or suppressed, otherwise the list of CRLs as encoded bytes
*/
protected List<byte[]> retrieveCRL(SignatureConfig signatureConfig, X509Certificate holder) throws IOException {
/**
* @return returns bounds as a path in local coordinates, which is
- * userful if you need to transform to global coordinates
+ * useful if you need to transform to global coordinates
*
* Warning: Don't use this for 1d objects, and will fail for
* infinite line objects
try {
return new SVGFormat(textAsShapes);
} catch (Exception | NoClassDefFoundError e) {
- LOG.atError().withThrowable(e).log("Batik is not not added to/working on the module-path. Use classpath mode instead of JPMS. Fallback to PNG.");
+ LOG.atError().withThrowable(e).log("Batik is not added to/working on the module-path. Use classpath mode instead of JPMS. Fallback to PNG.");
return new BitmapFormat("png");
}
}
final String key = lsid + "#" + ( (int) element );
int num;
- if ( !list.isStartAtOverriden( element )
+ if ( !list.isStartAtOverridden( element )
&& numberingState.levels.containsKey( key ) )
{
num = numberingState.levels.get( key );
import org.apache.poi.hwpf.model.StyleSheet;
import org.apache.poi.hwpf.sprm.CharacterSprmCompressor;
import org.apache.poi.hwpf.sprm.ParagraphSprmCompressor;
+import org.apache.poi.util.Removal;
/**
* This class is used to create a list in a Word document. It is used in
public int getStartAt( char level )
{
- if ( isStartAtOverriden( level ) )
+ if ( isStartAtOverridden( level ) )
{
return _lfoData.getRgLfoLvl()[level].getIStartAt();
}
return _ignoreLogicalLeftIdentation;
}
- public boolean isStartAtOverriden( char level )
+ /**
+ * @since POI 5.2.4
+ */
+ public boolean isStartAtOverridden(char level )
+ {
+ ListFormatOverrideLevel lfolvl = _lfoData.getRgLfoLvl().length > level ? _lfoData
+ .getRgLfoLvl()[level] : null;
+
+ return lfolvl != null && lfolvl.getIStartAt() != 0
+ && !lfolvl.isFormatting();
+ }
+
+ /**
+ * @deprecated use {@link #isStartAtOverridden(char)}
+ */
+ @Removal(version = "POI 6.0.0")
+ public boolean isStartAtOverriden(char level )
{
ListFormatOverrideLevel lfolvl = _lfoData.getRgLfoLvl().length > level ? _lfoData
.getRgLfoLvl()[level] : null;
*/
public int createFormat(String formatString) {
- maxformatid = maxformatid >= 0xa4 ? maxformatid + 1 : 0xa4; //Starting value from M$ empircal study.
+ maxformatid = maxformatid >= 0xa4 ? maxformatid + 1 : 0xa4; //Starting value from M$ empirical study.
FormatRecord rec = new FormatRecord(maxformatid, formatString);
int pos = 0;
String fmt = _formats.size() > index ? _formats.get(index) : null;
if (_builtinFormats.length > index && _builtinFormats[index] != null) {
- // It's in the built in range
+ // It's in the built-in range
if (fmt != null) {
- // It's been overriden, use that value
+ // It's been overridden, use that value
return fmt;
} else {
// Standard built in format
/**
* Returns a new byte array with a truncated to the given size.
- * If the hash has less then size bytes, it will be filled with 0x36-bytes
+ * If the hash has less than size bytes, it will be filled with 0x36-bytes
*
* @param hash the to be truncated/filled hash byte array
* @param size the size of the returned byte array
/**
* Returns a new byte array with a truncated to the given size.
- * If the hash has less then size bytes, it will be filled with 0-bytes
+ * If the hash has less than size bytes, it will be filled with 0-bytes
*
* @param hash the to be truncated/filled hash byte array
* @param size the size of the returned byte array
/**
* Apply 2-D transforms before drawing this shape. This includes rotation and flipping.
*
- * @param graphics the graphics whos transform matrix will be modified
+ * @param graphics the graphics whose transform matrix will be modified
*/
public void applyTransform(Graphics2D graphics) {
}
/**
* Apply 2-D transforms before drawing this shape. This includes rotation and flipping.
*
- * @param graphics the graphics whos transform matrix will be modified
+ * @param graphics the graphics whose transform matrix will be modified
*/
@Override
public void applyTransform(Graphics2D graphics) {
/**
* Apply 2-D transforms before drawing this shape. This includes rotation and flipping.
*
- * @param graphics the graphics whos transform matrix will be modified
+ * @param graphics the graphics whose transform matrix will be modified
*/
void applyTransform(Graphics2D graphics);
protected double[] collectValues(ValueEval arg) throws EvaluationException {
double[] values = instance.collectValues(arg);
- /* handle case where MDETERM is operating on an array that that is not completely filled*/
+ /* handle case where MDETERM is operating on an array that is not completely filled*/
if (arg instanceof AreaEval && values.length == 1)
throw new EvaluationException(ErrorEval.VALUE_INVALID);
protected double[] collectValues(ValueEval arg) throws EvaluationException {
double[] values = instance.collectValues(arg);
- /* handle case where MDETERM is operating on an array that that is not completely filled*/
+ /* handle case where MDETERM is operating on an array that is not completely filled*/
if (arg instanceof AreaEval && values.length == 1)
throw new EvaluationException(ErrorEval.VALUE_INVALID);
StringRecord sr = new StringRecord();
sr.setString("NA");
SharedValueManager svm = SharedValueManager.createEmpty();
- // bug 46213 -> String record was supplied but formula record flag is not set
+ // bug 46213 -> String record was supplied but formula record flag is not set
FormulaRecordAggregate fra = new FormulaRecordAggregate(fr, sr, svm);
List<org.apache.poi.hssf.record.Record> vraRecs = new ArrayList<>();
fra.visitContainedRecords(vraRecs::add);
* multiple of 512 bytes)
*
* As yet, this problem remains. One school of thought is
- * not not issue an EOF when we discover the last block
+ * to not issue an EOF when we discover the last block
* is short, but this seems a bit wrong.
* The other is to fix the handling of the last block in
* POIFS, since it seems to be slight wrong
assertEquals(5, row.getCell(5, MissingCellPolicy.CREATE_NULL_AS_BLANK).getColumnIndex());
- // Now change the cell policy on the workbook, check
- // that that is now used if no policy given
+ // Now change the cell policy on the workbook, check that is now used if no policy given
workbook.setMissingCellPolicy(MissingCellPolicy.RETURN_BLANK_AS_NULL);
assertEquals(CellType.STRING, row.getCell(0).getCellType());
// autosize not-evaluated cells, formula cells are sized as if the result is 0
for (int i = 0; i < 6; i++) sheet.autoSizeColumn(i);
- assertTrue(sheet.getColumnWidth(0) < sheet.getColumnWidth(1)); // width of '0' is less then width of '10'
+ assertTrue(sheet.getColumnWidth(0) < sheet.getColumnWidth(1)); // width of '0' is less than width of '10'
assertEquals(sheet.getColumnWidth(1), sheet.getColumnWidth(2)); // 10 and '10' should be sized equally
assertEquals(sheet.getColumnWidth(3), sheet.getColumnWidth(0)); // formula result is unknown, the width is calculated for '0'
assertEquals(sheet.getColumnWidth(4), sheet.getColumnWidth(5)); // 10.0000 and '10.0000'
for (int i = 0; i < 6; i++) sheet.autoSizeColumn(i);
- assertTrue(sheet.getColumnWidth(0) < sheet.getColumnWidth(1)); // width of '0' is less then width of '10'
+ assertTrue(sheet.getColumnWidth(0) < sheet.getColumnWidth(1)); // width of '0' is less than width of '10'
assertEquals(sheet.getColumnWidth(1), sheet.getColumnWidth(2)); // columns 1, 2 and 3 should have the same width
assertEquals(sheet.getColumnWidth(2), sheet.getColumnWidth(3)); // columns 1, 2 and 3 should have the same width
assertEquals(sheet.getColumnWidth(4), sheet.getColumnWidth(5)); // 10.0000 and '10.0000'