126. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 9/25/2018 2:13:04 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

126.1 Files compared

# Location File Last Modified
1 build 3.zip\build 3\MHLTH_YS_137_Source\JavaScript\resources\javaJDF-1.8.0\src\com\sun\media\sound Platform.java Mon Jan 22 14:46:50 2018 UTC
2 build 3.zip\build 3\MHLTH_YS_137_Source\JavaScript\resources\javaJDF-1.8.0\src\com\sun\media\sound Platform.java Wed Sep 12 16:28:38 2018 UTC

126.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 400
Changed 1 2
Inserted 0 0
Removed 0 0

126.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

126.4 Active regular expressions

No regular expressions were active.

126.5 Comparison detail

  1   /*
  2    * Copyrig ht (c) 199 9, 2014, O racle and/ or its aff iliates. A ll rights  reserved.
  3    * DO NOT  ALTER OR R EMOVE COPY RIGHT NOTI CES OR THI S FILE HEA DER.
  4    *
  5    * This co de is free  software;  you can r edistribut e it and/o r modify i t
  6    * under t he terms o f the GNU  General Pu blic Licen se version  2 only, a s
  7    * publish ed by the  Free Softw are Founda tion.  Ora cle design ates this
  8    * particu lar file a s subject  to the "Cl asspath" e xception a s provided
  9    * by Orac le in the  LICENSE fi le that ac companied  this code.
  10    *
  11    * This co de is dist ributed in  the hope  that it wi ll be usef ul, but WI THOUT
  12    * ANY WAR RANTY; wit hout even  the implie d warranty  of MERCHA NTABILITY  or
  13    * FITNESS  FOR A PAR TICULAR PU RPOSE.  Se e the GNU  General Pu blic Licen se
  14    * version  2 for mor e details  (a copy is  included  in the LIC ENSE file  that
  15    * accompa nied this  code).
  16    *
  17    * You sho uld have r eceived a  copy of th e GNU Gene ral Public  License v ersion
  18    * 2 along  with this  work; if  not, write  to the Fr ee Softwar e Foundati on,
  19    * Inc., 5 1 Franklin  St, Fifth  Floor, Bo ston, MA 0 2110-1301  USA.
  20    *
  21    * Please  contact Or acle, 500  Oracle Par kway, Redw ood Shores , CA 94065  USA
  22    * or visi t www.orac le.com if  you need a dditional  informatio n or have  any
  23    * questio ns.
  24    */
  25  
  26   package co m.sun.medi a.sound;
  27  
  28   import jav a.security .AccessCon troller;
  29   import jav a.security .Privilege dAction;
  30   import jav a.util.Str ingTokeniz er;
  31  
  32  
  33  
  34   /**
  35    * Audio c onfigurati on class f or exposin g attribut es specifi c to the p latform or  system.
  36    *
  37    * @author  Kara Kytl e
  38    * @author  Florian B omers
  39    */
  40   final clas s Platform  {
  41  
  42  
  43       // STA TIC FINAL  CHARACTERI STICS
  44  
  45       // nat ive librar y we need  to load
  46       privat e static f inal Strin g libNameM ain     =  "jsound";
  47       privat e static f inal Strin g libNameA LSA     =  "jsoundals a";
  48       privat e static f inal Strin g libNameD Sound   =  "jsoundds" ;
  49  
  50       // ext ra libs ha ndling: bi t flags fo r each dif ferent lib rary
  51       public  static fi nal int LI B_MAIN      = 1;
  52       public  static fi nal int LI B_ALSA      = 2;
  53       public  static fi nal int LI B_DSOUND    = 4;
  54  
  55       // bit  field of  the consta nts above.  Willbe se t in loadL ibraries
  56       privat e static i nt loadedL ibs = 0;
  57  
  58       // fea tures: the  main nati ve library  jsound re ports whic h feature  is
  59       // con tained in  which lib
  60       public  static fi nal int FE ATURE_MIDI IO       =  1;
  61       public  static fi nal int FE ATURE_PORT S        =  2;
  62       public  static fi nal int FE ATURE_DIRE CT_AUDIO =  3;
  63  
  64       // SYS TEM CHARAC TERISTICS
  65       // var y accordin g to hardw are archit ecture
  66  
  67       // sig ned8 (use  signed 8-b it values)  is true f or everyth ing we sup port excep t for
  68       // the  solaris s bpro card.
  69       // we' ll leave i t here as  a variable ; in the f uture we m ay need th is in java .
  70       // wai t, is that  true?  i' m not sure .  i think  solaris t akes unsig ned data?
  71       // $$k k: 03.11.9 9: i think  solaris t akes unsig ned 8-bit  or signed  16-bit dat a....
  72       privat e static b oolean sig ned8;
  73  
  74       // int el is litt le-endian.   sparc is  big-endia n.
  75       privat e static b oolean big Endian;
  76  
  77       static  {
  78           if (Printer.t race)Print er.trace(" >> Platfor m.java: st atic");
  79  
  80           lo adLibrarie s();
  81           re adProperti es();
  82       }
  83  
  84  
  85       /**
  86        * Pri vate const ructor.
  87        */
  88       privat e Platform () {
  89       }
  90  
  91  
  92       // MET HODS FOR I NTERNAL IM PLEMENTATI ON USE
  93  
  94  
  95       /**
  96        * Dum my method  for forcin g initiali zation.
  97        */
  98       static  void init ialize() {
  99  
  100           if (Printer.t race)Print er.trace(" Platform:  initialize ()");
  101       }
  102  
  103  
  104       /**
  105        * Det ermine whe ther the s ystem is b ig-endian.
  106        */
  107       static  boolean i sBigEndian () {
  108  
  109           re turn bigEn dian;
  110       }
  111  
  112  
  113       /**
  114        * Det ermine whe ther the s ystem take s signed 8 -bit data.
  115        */
  116       static  boolean i sSigned8()  {
  117  
  118           re turn signe d8;
  119       }
  120  
  121         // PRI D A N E S M   T   ODS
  122  
  123       /**
  124        * Loa d the nati ve library  or librar ies.
  125        */
  126       privat e static v oid loadLi braries()  {
  127           if (Printer.t race)Print er.trace(" >>Platform .loadLibra ries");
  128  
  129           //  load the  main libra ry
  130           Ac cessContro ller.doPri vileged((P rivilegedA ction<Void >) () -> {
  131                System.l oadLibrary (libNameMa in);
  132                return n ull;
  133           }) ;
  134           //  just for  the heck o f it...
  135           lo adedLibs | = LIB_MAIN ;
  136  
  137           //  now try t o load ext ra libs. T hey are de fined at c ompile tim e in the M akefile
  138           //  with the  define EXT RA_SOUND_J NI_LIBS
  139           St ring extra Libs = nGe tExtraLibr aries();
  140           //  the strin g is the l ibraries,  separated  by white s pace
  141           St ringTokeni zer st = n ew StringT okenizer(e xtraLibs);
  142           wh ile (st.ha sMoreToken s()) {
  143                final St ring lib =  st.nextTo ken();
  144                try {
  145                    Acce ssControll er.doPrivi leged((Pri vilegedAct ion<Void>)  () -> {
  146                         System.loa dLibrary(l ib);
  147                         return nul l;
  148                    });
  149  
  150                    if ( lib.equals (libNameAL SA)) {
  151                         loadedLibs  |= LIB_AL SA;
  152                         if (Printe r.debug) P rinter.deb ug("Loaded  ALSA lib  successful ly.");
  153                    } el se if (lib .equals(li bNameDSoun d)) {
  154                         loadedLibs  |= LIB_DS OUND;
  155                         if (Printe r.debug) P rinter.deb ug("Loaded  DirectSou nd lib suc cessfully. ");
  156                    } el se {
  157                         if (Printe r.err) Pri nter.err(" Loaded unk nown lib ' "+lib+"' s uccessfull y.");
  158                    }
  159                } catch  (Throwable  t) {
  160                    if ( Printer.er r) Printer .err("Coul dn't load  library "+ lib+": "+t .toString( ));
  161                }
  162           }
  163       }
  164  
  165  
  166       static  boolean i sMidiIOEna bled() {
  167           re turn isFea tureLibLoa ded(FEATUR E_MIDIIO);
  168       }
  169  
  170       static  boolean i sPortsEnab led() {
  171           re turn isFea tureLibLoa ded(FEATUR E_PORTS);
  172       }
  173  
  174       static  boolean i sDirectAud ioEnabled( ) {
  175           re turn isFea tureLibLoa ded(FEATUR E_DIRECT_A UDIO);
  176       }
  177  
  178       privat e static b oolean isF eatureLibL oaded(int  feature) {
  179           if  (Printer. debug) Pri nter.debug ("Platform : Checking  for featu re "+featu re+"...");
  180           in t required Lib = nGet LibraryFor Feature(fe ature);
  181           bo olean isLo aded = (re quiredLib  != 0) && ( (loadedLib s & requir edLib) ==  requiredLi b);
  182           if  (Printer. debug) Pri nter.debug ("           ...needs  library " +requiredL ib+". Resu lt is load ed="+isLoa ded);
  183           re turn isLoa ded;
  184       }
  185  
  186       // the  following  native me thods are  implemente d in Platf orm.c
  187       privat e native s tatic bool ean nIsBig Endian();
  188       privat e native s tatic bool ean nIsSig ned8();
  189       privat e native s tatic Stri ng nGetExt raLibrarie s();
  190       privat e native s tatic int  nGetLibrar yForFeatur e(int feat ure);
  191  
  192  
  193       /**
  194        * Rea d the requ ired syste m properti es.
  195        */
  196       privat e static v oid readPr operties()  {
  197           //  $$fb 2002 -03-06: im plement ch eck for en dianness i n native.  Facilitate s porting  !
  198           bi gEndian =  nIsBigEndi an();
  199           si gned8 = nI sSigned8() ; // Solar is on Spar c: signed,  all other s unsigned
  200       }
  201   }