Skip to content

Commit 5a53275

Browse files
committed
Update test file to non-proprietary license variant
Switch to use a version that's under https://scancode-licensedb.aboutcode.org/sun-bsd-no-nuclear.html The long history is this: This is code with a complex history as it was also published under a proprietary license at: https://web.archive.org/web/20000823095253/http://java.sun.com/products/jfc/tsc/articles/treetable2/src/MergeSort.java and at: https://web.archive.org/web/20000823094850/http://java.sun.com/products/jfc/tsc/articles/treetable1/src/MergeSort.java and is part of code that was relicensed by Sun following some issues raised many years ago. The earliest relicense is at https://web.archive.org/web/20030709130712/http://java.sun.com:80/products/jfc/tsc/articles/treetable1/src/MergeSort.java The detailed history is found foremost in this Mozilla bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=419491and And also in Mozilla Rhino history at: https://github.com/mozilla/rhino/blob/2c8ae233cda5d6129a140e5572a6dda148afc039/toolsrc/org/mozilla/javascript/tools/debugger/build.xml#L40 and: mozilla/rhino@2e746cd The gist of this is that all versions prior to Mozilla Rhino prior to 1.7R1 contained Sun proprietary binary code injected at build time that was fetched from code listed above and attached to the article at: https://web.archive.org/web/20020520083650/http://java.sun.com/products/jfc/tsc/articles/treetable2/ This meant that use of those versions would have required permission from Sun (now Oracle) to use and distribute these Sun proprietary components. Sun subsequently released and updated the code under a BSD style license, and Rhino 1.7R1 and later further vendored the code now at: https://github.com/mozilla/rhino/tree/6387bac4281ba1c4a8050cd055071615593d214c/toolsrc/org/mozilla/javascript/tools/debugger/treetable Ironically I am tied to the history of this relicensing somehow as seen in comments in at https://bugzilla.mozilla.org/show_bug.cgi?id=419491 More details for the posterity: Circa 1998, Sun employees published an article with some source code attached. The code was under a Sun proprietary license. Circa 2008, at the request of the Mozilla Rhino project (which was using that code) Sun relicensed part of that article attached code under a new BSD license (as explained in https://bugzilla.mozilla.org/show_bug.cgi?id=419491 ). This code was also already relicensed under an earlier version of the article in 2003 under a BSD-style license. This test file (used for testing line endings on old MacOS) was using originally the proprietary-licensed variant. This is NOT part of the released commoncode wheels deployed at runetime and is not an issue per-se since this code was also licensed by SUN under this BSD-style license https://scancode-licensedb.aboutcode.org/sun-bsd-no-nuclear.html This file is therefore updated here to use the sun-bsd-no-nuclear-licensed version and will be deleted afterwards as this is no longer used in commoncode as the read_text_file() function it tested as been removed. Reference: https://web.archive.org/web/20030709130712/http://java.sun.com:80/products/jfc/tsc/articles/treetable1/src/MergeSort.java Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent c7c9fdc commit 5a53275

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

tests/data/fileutils/textfiles/mac_newlines.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
package com.mycompany.test.sort;/* * MergeSort.java * * Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved. * * This software is the confidential and proprietary information of Sun * Microsystems, Inc. ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with Sun. * * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING * THIS SOFTWARE OR ITS DERIVATIVES. * *//** * An implementation of MergeSort, needs to be subclassed to * compare the terms. * * @author Scott Violet */public abstract class MergeSort extends Object { protected Object toSort[]; protected Object swapSpace[]; public void sort(Object array[]) { if(array != null && array.length > 1) { int maxLength; maxLength = array.length; swapSpace = new Object[maxLength]; toSort = array; this.mergeSort(0, maxLength - 1); swapSpace = null; toSort = null; } } public abstract int compareElementsAt(int beginLoc, int endLoc); protected void mergeSort(int begin, int end) { if(begin != end) { int mid; mid = (begin + end) / 2; this.mergeSort(begin, mid); this.mergeSort(mid + 1, end); this.merge(begin, mid, end); } } protected void merge(int begin, int middle, int end) { int firstHalf, secondHalf, count; firstHalf = count = begin; secondHalf = middle + 1; while((firstHalf <= middle) && (secondHalf <= end)) { if(this.compareElementsAt(secondHalf, firstHalf) < 0) swapSpace[count++] = toSort[secondHalf++]; else swapSpace[count++] = toSort[firstHalf++]; } if(firstHalf <= middle) { while(firstHalf <= middle) swapSpace[count++] = toSort[firstHalf++]; } else { while(secondHalf <= end) swapSpace[count++] = toSort[secondHalf++]; } for(count = begin;count <= end;count++) toSort[count] = swapSpace[count]; }}
1+
/* * %W% %E% * * Copyright 1997, 1998 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistribution in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY * DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT OF OR * RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE OR * ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, * SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF * THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. * * You acknowledge that this software is not designed, licensed or * intended for use in the design, construction, operation or * maintenance of any nuclear facility. *//* * originally from https://web.archive.org/web/20000823095253/http://java.sun.com/products/jfc/tsc/articles/treetable2/src/MergeSort.java * and also under this license from * /** * An implementation of MergeSort, needs to be subclassed to provide a * comparator. * * @version %I% %G% * * @author Scott Violet */public abstract class MergeSort extends Object { protected Object toSort[]; protected Object swapSpace[]; public void sort(Object array[]) { if(array != null && array.length > 1) { int maxLength; maxLength = array.length; swapSpace = new Object[maxLength]; toSort = array; this.mergeSort(0, maxLength - 1); swapSpace = null; toSort = null; } } public abstract int compareElementsAt(int beginLoc, int endLoc); protected void mergeSort(int begin, int end) { if(begin != end) { int mid; mid = (begin + end) / 2; this.mergeSort(begin, mid); this.mergeSort(mid + 1, end); this.merge(begin, mid, end); } } protected void merge(int begin, int middle, int end) { int firstHalf, secondHalf, count; firstHalf = count = begin; secondHalf = middle + 1; while((firstHalf <= middle) && (secondHalf <= end)) { if(this.compareElementsAt(secondHalf, firstHalf) < 0) swapSpace[count++] = toSort[secondHalf++]; else swapSpace[count++] = toSort[firstHalf++]; } if(firstHalf <= middle) { while(firstHalf <= middle) swapSpace[count++] = toSort[firstHalf++]; } else { while(secondHalf <= end) swapSpace[count++] = toSort[secondHalf++]; } for(count = begin;count <= end;count++) toSort[count] = swapSpace[count]; }}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
download_url: https://web.archive.org/web/20030709130712/http://java.sun.com:80/products/jfc/tsc/articles/treetable1/src/MergeSort.java
2+
3+
notes:
4+
This is code with a complex history as it was also published under a proprietary license at:
5+
https://web.archive.org/web/20000823095253/http://java.sun.com/products/jfc/tsc/articles/treetable2/src/MergeSort.java
6+
and at:
7+
https://web.archive.org/web/20000823094850/http://java.sun.com/products/jfc/tsc/articles/treetable1/src/MergeSort.java
8+
and is part of code that was relicensed by Sun following some issues raised many years ago.
9+
10+
The earliest relicense is at
11+
https://web.archive.org/web/20030709130712/http://java.sun.com:80/products/jfc/tsc/articles/treetable1/src/MergeSort.java
12+
13+
The detailed history is found foremost in this Mozilla bugzilla:
14+
https://bugzilla.mozilla.org/show_bug.cgi?id=419491and
15+
And also in Mozilla Rhino history at:
16+
https://github.com/mozilla/rhino/blob/2c8ae233cda5d6129a140e5572a6dda148afc039/toolsrc/org/mozilla/javascript/tools/debugger/build.xml#L40
17+
and:
18+
https://github.com/mozilla/rhino/commit/2e746cd5fb4de9a641b10550909997acb508d324
19+
20+
The gist of this is that all versions prior to Mozilla Rhino prior to
21+
1.7R1 contained Sun proprietary binary code injected at build time that
22+
was fetched from code listed above and attached to the article at:
23+
https://web.archive.org/web/20020520083650/http://java.sun.com/products/jfc/tsc/articles/treetable2/
24+
25+
This meant that use of those versions would have required permission
26+
from Sun (now Oracle) to use and distribute these Sun proprietary
27+
components. Sun subsequently released and updated the code under a
28+
BSD style license, and Rhino 1.7R1 and later further vendored the code
29+
now at:
30+
https://github.com/mozilla/rhino/tree/6387bac4281ba1c4a8050cd055071615593d214c/toolsrc/org/mozilla/javascript/tools/debugger/treetable
31+
32+
Ironically I am tied to the history of this relicensing somehow as seen
33+
in comments in at
34+
https://bugzilla.mozilla.org/show_bug.cgi?id=419491
35+
36+
More details for the posterity: Circa 1998, Sun employees published an
37+
article with some source code attached. The code was under a Sun
38+
proprietary license. Circa 2008, at the request of the Mozilla Rhino
39+
project (which was using that code) Sun relicensed part of that article
40+
attached code under a new BSD license (as explained in
41+
https://bugzilla.mozilla.org/show_bug.cgi?id=419491 ).
42+
This code was also already relicensed under an earlier version of the
43+
article in 2003 under a BSD-style license.
44+
45+
This test file (used for testing line endings on old MacOS) was using
46+
originally the proprietary-licensed variant.
47+
This is NOT part of the released commoncode wheels deployed at runetime
48+
and is not an issue per-se since this code was also licensed by SUN
49+
under this BSD-style license
50+
https://scancode-licensedb.aboutcode.org/sun-bsd-no-nuclear.html
51+
52+
This file is therefore updated here to use the
53+
sun-bsd-no-nuclear-licensed version and will be deleted afterwards as
54+
this is no longer used in commoncode as the read_text_file() function
55+
it tested as been removed.
56+

0 commit comments

Comments
 (0)