Skip to content
Permalink
Browse files
Resolve Apache Conscious Language Checker findings
The default branch has been renamed from `master` to `main`. Local
clones can be updated to the `main` branch with the following commands:

   git branch -m master main
   git fetch asf
   git branch -u asf/main main
   git remote set-head asf -a

Additionally, the following changes were made:

- Change references to from `master` to `main` branch
- Fix test quotes/strings and typos to avoid false positives
- Links to 3rd party repos are changed to `main` where possible, or to a
  commit hash or tag where not, again to minimize false positives

Findings that are not resolved:

- Dependency license text that contains "his or her"--we probably
  shouldn't modify text from other licenses
- False positive found in "Saxon-HE" dependency

DAFFODIL-2557
  • Loading branch information
stevedlawrence committed Sep 2, 2021
1 parent c8f9b2d commit ba44472a3dfe369fd79442505f163d20d05d5ea5
Showing 14 changed files with 87 additions and 81 deletions.
@@ -19,9 +19,9 @@
<!-- markdownlint-disable line-length -->
<!-- markdownlint-disable no-inline-html -->
[<img src="https://daffodil.apache.org/assets/themes/apache/img/apache-daffodil-logo.svg" height="85" align="left" alt="Apache Daffodil"/>][Website]
[<img src="https://img.shields.io/github/workflow/status/apache/daffodil/CI/master.svg" align="right"/>][GitHub Actions]
[<img src="https://img.shields.io/github/workflow/status/apache/daffodil/CI/main.svg" align="right"/>][GitHub Actions]
<br clear="right" />
[<img src="https://img.shields.io/codecov/c/github/apache/daffodil/master.svg" align="right"/>][CodeCov]
[<img src="https://img.shields.io/codecov/c/github/apache/daffodil/main.svg" align="right"/>][CodeCov]
<br clear="right" />
[<img src="https://img.shields.io/maven-central/v/org.apache.daffodil/daffodil-core_2.12.svg?color=brightgreen&label=version" align="right"/>][Releases]
<br clear="both" />
@@ -106,7 +106,7 @@ Apache Daffodil is licensed under the [Apache License, v2.0].
[Command Line Interface]: https://daffodil.apache.org/cli/
[DFDL specification]: https://daffodil.apache.org/docs/dfdl/
[Daffodil JIRA]: https://issues.apache.org/jira/projects/DAFFODIL/
[Github Actions]: https://github.com/apache/daffodil/actions?query=branch%3Amaster+
[Github Actions]: https://github.com/apache/daffodil/actions?query=branch%3Amain+
[Releases]: http://daffodil.apache.org/releases/
[SBT]: https://www.scala-sbt.org/
[Website]: https://daffodil.apache.org/
@@ -41,7 +41,7 @@ Options:
-n, --dry-run [alt] Run all commands but do not actually publish anything.
Can optionally provide an alternative github repo and
branch of the form "user/repo@branch" instead of the
default "apache/daffodil@master"
default "apache/daffodil@main"
-h, --help Display this help and exit
USAGE
}
@@ -50,7 +50,7 @@ DRY_RUN=false

DAFFODIL_CODE_USER="apache"
DAFFODIL_CODE_REPO="daffodil"
DAFFODIL_CODE_BRANCH="master"
DAFFODIL_CODE_BRANCH="main"

DAFFODIL_SITE_REPO="daffodil-site"

@@ -293,7 +293,7 @@ else
set -x
cd $DAFFODIL_DIST_DIR && svn ci --username $APACHE_USERNAME -m 'Staging Apache Daffodil $VERSION-$PRE_RELEASE'
cd $DAFFODIL_CODE_DIR && git push origin v$VERSION-$PRE_RELEASE
cd $DAFFODIL_SITE_DIR && git push origin master
cd $DAFFODIL_SITE_DIR && git push origin main
EOF
chmod +x /root/complete-release

@@ -574,8 +574,8 @@ is subject to the terms and conditions of the following licenses.
# and others. All Rights Reserved.
#
# Project: https://github.com/veer66/lao-dictionary
# Dictionary: https://github.com/veer66/lao-dictionary/blob/master/Lao-Dictionary.txt
# License: https://github.com/veer66/lao-dictionary/blob/master/Lao-Dictionary-LICENSE.txt
# Dictionary: https://github.com/veer66/lao-dictionary/blob/2c2344310636f548b09d854362ab2e2e666369e0/Lao-Dictionary.txt
# License: https://github.com/veer66/lao-dictionary/blob/2c2344310636f548b09d854362ab2e2e666369e0/Lao-Dictionary-LICENSE.txt
# (copied below)
#
# This file is derived from the above dictionary, with slight
@@ -758,7 +758,7 @@ is subject to the terms and conditions of the following licenses.
This product bundles 'JLine', including the following files:
- lib/org.jline.jline-<VERSION>.jar
These files are available under a BSD-3-Clause license. For details, see
https://github.com/jline/jline3/blob/master/LICENSE.txt
https://github.com/jline/jline3/blob/jline-parent-3.20.0/LICENSE.txt

Copyright (c) 2002-2018, the original author or authors.
All rights reserved.
@@ -1202,7 +1202,7 @@ is subject to the terms and conditions of the following licenses.
in the version distributed with Saxon is the removal of code that Saxon does not need.)


(This license is published at https://github.com/hrldcpr/pcollections/blob/master/LICENSE)
(This license is published at https://github.com/hrldcpr/pcollections/blob/v3.1.4/LICENSE)

MIT License

@@ -175,16 +175,16 @@ class TestBinaryInput_01 {

@Test
def testBufferBigIntBigEndianExtraction(): Unit = {
val (dis, finfo) = fromString("Something in the way she moves, ", BE, msbFirst)
val (dis, finfo) = fromString("Thirty-two character long string", BE, msbFirst)
val bigInt = getBigInt(finfo, dis, 0, 256)
assertEquals(new JBigInt("37738841482167102822784581157237036764884875846207476558974346160344516471840"),
assertEquals(new JBigInt("38178759144797737047702418052138682097409903778432721523410841200294898527847"),
bigInt)
}

@Test
def testBufferBigIntLittleEndianExtraction(): Unit = {
val (dis, finfo) = fromString("Something in the way she moves, ", LE, msbFirst)
assertEquals(new JBigInt("14552548861771956163454220823873430243364312915206513831353612029437431082835"),
val (dis, finfo) = fromString("Thirty-two character long string", LE, msbFirst)
assertEquals(new JBigInt("46783304350265979503919546124020768339208030665592297039403372142674722777172"),
getBigInt(finfo, dis, 0, 256))
}

@@ -50,16 +50,19 @@ import java.io.ByteArrayOutputStream
class TestJavaIOStreams {
Assert.usage(scala.util.Properties.isJavaAtLeast("1.8"))

val text = """Man is distinguished, not only by his reason, but by this singular passion from
other animals, which is a lust of the mind, that by a perseverance of delight
in the continued and indefatigable generation of knowledge, exceeds the short
vehemence of any carnal pleasure.""".replace("\r\n", "\n").replace("\n", " ")
val text = """Daffodil is an open source implementation of the DFDL
specification that uses these DFDL schemas to parse fixed format data into an
infoset, which is most commonly represented as either XML or JSON. This
allows the use of well-established XML or JSON technologies and libraries to
consume, inspect, and manipulate fixed format data in existing solutions.""".replace("\r\n", "\n").replace("\n", " ")

val b64Text = """TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz
IHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2Yg
dGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu
dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRo
ZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4="""
val b64Text = """RGFmZm9kaWwgaXMgYW4gb3BlbiBzb3VyY2UgaW1wbGVtZW50YXRpb24gb2YgdGhlIERGREwgc3Bl
Y2lmaWNhdGlvbiB0aGF0IHVzZXMgdGhlc2UgREZETCBzY2hlbWFzIHRvIHBhcnNlIGZpeGVkIGZv
cm1hdCBkYXRhIGludG8gYW4gaW5mb3NldCwgd2hpY2ggaXMgbW9zdCBjb21tb25seSByZXByZXNl
bnRlZCBhcyBlaXRoZXIgWE1MIG9yIEpTT04uIFRoaXMgYWxsb3dzIHRoZSB1c2Ugb2Ygd2VsbC1l
c3RhYmxpc2hlZCBYTUwgb3IgSlNPTiB0ZWNobm9sb2dpZXMgYW5kIGxpYnJhcmllcyB0byBjb25z
dW1lLCBpbnNwZWN0LCBhbmQgbWFuaXB1bGF0ZSBmaXhlZCBmb3JtYXQgZGF0YSBpbiBleGlzdGlu
ZyBzb2x1dGlvbnMuCg=="""

val zipped = {
val baos = new ByteArrayOutputStream()
@@ -49,16 +49,19 @@ class TestLimitingJavaIOStreams {
val iso8859 = StandardCharsets.ISO_8859_1
val utf8 = StandardCharsets.ISO_8859_1

val text = """Man is distinguished, not only by his reason, but by this singular passion from
other animals, which is a lust of the mind, that by a perseverance of delight
in the continued and indefatigable generation of knowledge, exceeds the short
vehemence of any carnal pleasure.""".replace("\r\n", "\n").replace("\n", " ")

val b64Text = """TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz
IHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2Yg
dGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu
dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRo
ZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4="""
val text = """Daffodil is an open source implementation of the DFDL
specification that uses these DFDL schemas to parse fixed format data into an
infoset, which is most commonly represented as either XML or JSON. This
allows the use of well-established XML or JSON technologies and libraries to
consume, inspect, and manipulate fixed format data in existing solutions.""".replace("\r\n", "\n").replace("\n", " ")

val b64Text = """RGFmZm9kaWwgaXMgYW4gb3BlbiBzb3VyY2UgaW1wbGVtZW50YXRpb24gb2YgdGhlIERGREwgc3Bl
Y2lmaWNhdGlvbiB0aGF0IHVzZXMgdGhlc2UgREZETCBzY2hlbWFzIHRvIHBhcnNlIGZpeGVkIGZv
cm1hdCBkYXRhIGludG8gYW4gaW5mb3NldCwgd2hpY2ggaXMgbW9zdCBjb21tb25seSByZXByZXNl
bnRlZCBhcyBlaXRoZXIgWE1MIG9yIEpTT04uIFRoaXMgYWxsb3dzIHRoZSB1c2Ugb2Ygd2VsbC1l
c3RhYmxpc2hlZCBYTUwgb3IgSlNPTiB0ZWNobm9sb2dpZXMgYW5kIGxpYnJhcmllcyB0byBjb25z
dW1lLCBpbnNwZWN0LCBhbmQgbWFuaXB1bGF0ZSBmaXhlZCBmb3JtYXQgZGF0YSBpbiBleGlzdGlu
ZyBzb2x1dGlvbnMuCg=="""

val zipped = {
val baos = new ByteArrayOutputStream()
@@ -72,7 +75,7 @@ ZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4="""
val additionalText = "This is text that shouldn't be read."

@Test def testBase64DecodeFromDelimitedStream1(): Unit = {
val data = "cGxlYXN1cmUu" // encoding of "pleasure."
val data = "c29sdXRpb25zLg" // encoding of "solutions."
val terminator = "terminator"
val afterTerminator = "afterTerminator"
val is = IOUtils.toInputStream(data + terminator + afterTerminator,
@@ -81,22 +84,22 @@ ZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4="""
BoundaryMarkLimitingStream(is, terminator, iso8859, targetChunkSize = 4)
val b64 = java.util.Base64.getMimeDecoder().wrap(delimitedStream)
val actualData = IOUtils.toString(b64, iso8859)
assertEquals("pleasure.", actualData)
assertEquals("solutions.", actualData)
// The input stream should have been advanced past the terminator
val actualAfterData = IOUtils.toString(is, iso8859)
assertEquals(afterTerminator, actualAfterData)
}

@Test def testBase64DecodeFromDelimitedStream2(): Unit = {
val data = "cGxlYXN1cmUu" // encoding of "pleasure."
val data = "c29sdXRpb25zLg" // encoding of "solutions."
val terminator = ";;;"
val afterTerminator = "afterTerminator"
val is = IOUtils.toInputStream(data + terminator + afterTerminator, "ascii").asInstanceOf[ByteArrayInputStream]
val delimitedStream =
BoundaryMarkLimitingStream(is, terminator, iso8859, targetChunkSize = 1)
val b64 = java.util.Base64.getMimeDecoder().wrap(delimitedStream)
val actualData = IOUtils.toString(b64, iso8859)
assertEquals("pleasure.", actualData)
assertEquals("solutions.", actualData)
val actualAfterData = IOUtils.toString(is, iso8859)
assertEquals(afterTerminator, actualAfterData)
}
@@ -59,7 +59,7 @@ object PointOfUncertaintyMacros {
// The "body" uses the "param" variable name, and scala doesn't like it
// if we just create a new variable with this name, with a very unclear
// error message. Instead, we need to create a "fresh" variable name to
// hold he new point of uncertainty, and then transform the body so
// hold the new point of uncertainty, and then transform the body so
// that all instances of "param" are replaced with our new fresh name.
val transformer = new Transformer {
override def transform(tree: Tree): Tree = tree match {
@@ -424,7 +424,7 @@ class SpecifiedLengthPrefixedUnparser(
// suspension to resume and unparse the value
val suspension = new PrefixLengthSuspendableOperation(erd, elem, plElem, lengthUnits, prefixedLengthAdjustmentInUnits)

// Run the suspension--we know he suspension will not be able to succeed
// Run the suspension--we know the suspension will not be able to succeed
// since maybeLengthInBits is not defined, but this performs various
// actions to suspend the operation and allow it to be run later
suspension.run(state)
@@ -529,8 +529,8 @@ class InteractiveDebugger(runner: InteractiveDebuggerRunner, eCompilers: Express
}

// This ensures that there are no naming conflicts (e.g. short form names
// conflict). This is really just a sanity check, and really only needs to
// be run whenever names change or new commands are added.
// conflict). This really only needs to be run whenever names change or new
// commands are added.

// Uncomment this and the DebugCommandBase.checkNameConflicts line to do a
// check when changes are made.
@@ -115,7 +115,7 @@ class GZIPFixedOutputStream private (os: java.io.OutputStream) extends java.io.O
if (bytePosition < 0) {
// The bad byte has been fixed, pass all writes directly through to the
// underlying OutputStream. This may be more efficient than the default
// OutputStream write() function, which writes the bytes from his array
// OutputStream write() function, which writes the bytes from this array
// one at a time
os.write(b, off, len)
} else {
@@ -30,7 +30,7 @@ import scala.io.Source

/**
* basic function tests adapted from the Camel Schematron implementation
* https://github.com/apache/camel/blob/master/components/camel-schematron/src/test/java/org/apache/camel/component/schematron
* https://github.com/apache/camel/blob/main/components/camel-schematron/src/test/java/org/apache/camel/component/schematron
*/
class TestBasicValidation {

@@ -94,7 +94,7 @@
The first discriminator evaluates to false, causing immediate backtracking.
The second discriminator is never evaluated.
We speculatively parse innerBranch2, and it is successful.
Exactly he same behavior as multipleDiscriminators1.
Exactly the same behavior as multipleDiscriminators1.
-->
<tdml:parserTestCase name="multipleDiscriminators2" model="multipleDiscriminators" root="root">
<tdml:document>fta</tdml:document>

0 comments on commit ba44472

Please sign in to comment.