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.
# | Location | File | Last Modified |
---|---|---|---|
1 | build 3.zip\build 3\MHLTH_YS_137_Source\JavaScript\resources\javaJDF-1.8.0\src\com\sun\org\apache\bcel\internal\util | SyntheticRepository.java | Mon Jan 22 14:46:44 2018 UTC |
2 | build 3.zip\build 3\MHLTH_YS_137_Source\JavaScript\resources\javaJDF-1.8.0\src\com\sun\org\apache\bcel\internal\util | SyntheticRepository.java | Wed Sep 12 16:31:05 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 412 |
Changed | 1 | 2 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
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 |
No regular expressions were active.
1 | /* | |
2 | * reserve d comment block | |
3 | * DO NOT REMOVE OR ALTER! | |
4 | */ | |
5 | package co m.sun.org. apache.bce l.internal .util; | |
6 | ||
7 | /* ======= ========== ========== ========== ========== ========== ========== = | |
8 | * The Apa che Softwa re License , Version 1.1 | |
9 | * | |
10 | * Copyrig ht (c) 200 1 The Apac he Softwar e Foundati on. All r ights | |
11 | * reserve d. | |
12 | * | |
13 | * Redistr ibution an d use in s ource and binary for ms, with o r without | |
14 | * modific ation, are permitted provided that the f ollowing c onditions | |
15 | * are met : | |
16 | * | |
17 | * 1. Redi stribution s of sourc e code mus t retain t he above c opyright | |
18 | * noti ce, this l ist of con ditions an d the foll owing disc laimer. | |
19 | * | |
20 | * 2. Redi stribution s in binar y form mus t reproduc e the abov e copyrigh t | |
21 | * noti ce, this l ist of con ditions an d the foll owing disc laimer in | |
22 | * the documentat ion and/or other mat erials pro vided with the | |
23 | * dist ribution. | |
24 | * | |
25 | * 3. The end-user d ocumentati on include d with the redistrib ution, | |
26 | * if a ny, must i nclude the following acknowled gment: | |
27 | * " This produ ct include s software developed by the | |
28 | * Apache Sof tware Foun dation (ht tp://www.a pache.org/ )." | |
29 | * Alte rnately, t his acknow ledgment m ay appear in the sof tware itse lf, | |
30 | * if a nd whereve r such thi rd-party a cknowledgm ents norma lly appear . | |
31 | * | |
32 | * 4. The names "Apa che" and " Apache Sof tware Foun dation" an d | |
33 | * "Apa che BCEL" must not b e used to endorse or promote p roducts | |
34 | * deri ved from t his softwa re without prior wri tten permi ssion. For | |
35 | * writ ten permis sion, plea se contact apache@ap ache.org. | |
36 | * | |
37 | * 5. Prod ucts deriv ed from th is softwar e may not be called "Apache", | |
38 | * "Apa che BCEL", nor may " Apache" ap pear in th eir name, without | |
39 | * prio r written permission of the Ap ache Softw are Founda tion. | |
40 | * | |
41 | * THIS SO FTWARE IS PROVIDED ` `AS IS'' A ND ANY EXP RESSED OR IMPLIED | |
42 | * WARRANT IES, INCLU DING, BUT NOT LIMITE D TO, THE IMPLIED WA RRANTIES | |
43 | * OF MERC HANTABILIT Y AND FITN ESS FOR A PARTICULAR PURPOSE A RE | |
44 | * DISCLAI MED. IN N O EVENT SH ALL THE AP ACHE SOFTW ARE FOUNDA TION OR | |
45 | * ITS CON TRIBUTORS BE LIABLE FOR ANY DI RECT, INDI RECT, INCI DENTAL, | |
46 | * SPECIAL , EXEMPLAR Y, OR CONS EQUENTIAL DAMAGES (I NCLUDING, BUT NOT | |
47 | * LIMITED TO, PROCU REMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |
48 | * USE, DA TA, OR PRO FITS; OR B USINESS IN TERRUPTION ) HOWEVER CAUSED AND | |
49 | * ON ANY THEORY OF LIABILITY, WHETHER I N CONTRACT , STRICT L IABILITY, | |
50 | * OR TORT (INCLUDIN G NEGLIGEN CE OR OTHE RWISE) ARI SING IN AN Y WAY OUT | |
51 | * OF THE USE OF THI S SOFTWARE , EVEN IF ADVISED OF THE POSSI BILITY OF | |
52 | * SUCH DA MAGE. | |
53 | * ======= ========== ========== ========== ========== ========== ========== = | |
54 | * | |
55 | * This so ftware con sists of v oluntary c ontributio ns made by many | |
56 | * individ uals on be half of th e Apache S oftware Fo undation. For more | |
57 | * informa tion on th e Apache S oftware Fo undation, please see | |
58 | * <http:/ /www.apach e.org/>. | |
59 | */ | |
60 | ||
61 | import jav a.io.*; | |
62 | ||
63 | import jav a.util.Map ; | |
64 | import jav a.util.Has hMap; | |
65 | ||
66 | import com .sun.org.a pache.bcel .internal. classfile. *; | |
67 | ||
68 | /** | |
69 | * This re pository i s used in situations where a C lass is cr eated | |
70 | * outside the realm of a Clas sLoader. C lasses are loaded fr om | |
71 | * the fil e systems using the paths spec ified in t he given | |
72 | * class p ath. By de fault, thi s is the v alue retur ned by | |
73 | * ClassPa th.getClas sPath(). | |
74 | * <br> | |
75 | * It is d esigned to be used a s a single ton, howev er it | |
76 | * can als o be used with custo m classpat hs. | |
77 | * | |
78 | /** | |
79 | * Abstrac t definiti on of a cl ass reposi tory. Inst ances may be used | |
80 | * to load classes f rom differ ent source s and may be used in the | |
81 | * Reposit ory.setRep ository me thod. | |
82 | * | |
83 | * @see co m.sun.org. apache.bce l.internal .Repositor y | |
84 | * | |
85 | * @author <A HREF=" mailto:mar kus.dahm@b erlin.de"> M. Dahm</A > | |
86 | * @author David Dix on-Peugh | |
87 | */ | |
88 | public cla ss Synthet icReposito ry impleme nts Reposi tory { | |
89 | private static fin al String DEFAULT_PA TH = Class Path.getCl assPath(); | |
90 | ||
91 | private static Has hMap _inst ances = ne w HashMap( ); // CLAS SPATH X RE POSITORY | |
92 | ||
93 | private ClassPath _path = nu ll; | |
94 | private Ha shMap _loadedCla sses = new HashMap() ; // CLASS NAME X JA DNS SS | |
95 | ||
96 | private SyntheticR epository( ClassPath path) { | |
97 | _path = path; | |
98 | } | |
99 | ||
100 | public s tatic Synt heticRepos itory getI nstance() { | |
101 | return getInstan ce(ClassPa th.SYSTEM_ CLASS_PATH ); | |
102 | } | |
103 | ||
104 | public s tatic Synt heticRepos itory getI nstance(Cl assPath cl assPath) { | |
105 | Synthe ticReposit ory rep = (Synthetic Repository )_instance s.get(clas sPath); | |
106 | ||
107 | if(rep == null) { | |
108 | rep = new Synt heticRepos itory(clas sPath); | |
109 | _ins tances.put (classPath , rep); | |
110 | } | |
111 | ||
112 | return rep; | |
113 | } | |
114 | ||
115 | /** | |
116 | * Store a new Jav aClass ins tance into this Repo sitory. | |
117 | */ | |
118 | public v oid storeC lass(JavaC lass clazz ) { | |
119 | _loade dClasses.p ut(clazz.g etClassNam e(), clazz ); | |
120 | clazz. setReposit ory(this); | |
121 | } | |
122 | ||
123 | /** | |
124 | * Remov e class fr om reposit ory | |
125 | */ | |
126 | public v oid remove Class(Java Class claz z) { | |
127 | _loade dClasses.r emove(claz z.getClass Name()); | |
128 | } | |
129 | ||
130 | /** | |
131 | * Find an already defined ( cached) Ja vaClass ob ject by na me. | |
132 | */ | |
133 | public J avaClass f indClass(S tring clas sName) { | |
134 | return (JavaClas s)_loadedC lasses.get (className ); | |
135 | } | |
136 | ||
137 | /** | |
138 | * Load a JavaClas s object f or the giv en class n ame using | |
139 | * the C LASSPATH e nvironment variable. | |
140 | */ | |
141 | public J avaClass l oadClass(S tring clas sName) | |
142 | throws ClassNotF oundExcept ion | |
143 | { | |
144 | if(cla ssName == null || cl assName.eq uals("")) { | |
145 | thro w new Ille galArgumen tException ("Invalid class name " + class Name); | |
146 | } | |
147 | ||
148 | classN ame = clas sName.repl ace('/', ' .'); // Ju st in case , canonica l form | |
149 | ||
150 | try { | |
151 | retu rn loadCla ss(_path.g etInputStr eam(classN ame), clas sName); | |
152 | } catc h(IOExcept ion e) { | |
153 | thro w new Clas sNotFoundE xception(" Exception while look ing for cl ass " + | |
154 | c lassName + ": " + e. toString() ); | |
155 | } | |
156 | } | |
157 | ||
158 | /** | |
159 | * Try t o find cla ss source via getRes ourceAsStr eam(). | |
160 | * @see Class | |
161 | * @retu rn JavaCla ss object for given runtime cl ass | |
162 | */ | |
163 | public J avaClass l oadClass(C lass clazz ) throws C lassNotFou ndExceptio n { | |
164 | String className = clazz.g etName(); | |
165 | String name = classNa me; | |
166 | int i = name.la stIndexOf( '.'); | |
167 | ||
168 | if(i > 0) { | |
169 | name = name.su bstring(i + 1); | |
170 | } | |
171 | ||
172 | return loadClass (clazz.get ResourceAs Stream(nam e + ".clas s"), class Name); | |
173 | } | |
174 | ||
175 | private JavaClass loadClass( InputStrea m is, Stri ng classNa me) | |
176 | throws ClassNotF oundExcept ion | |
177 | { | |
178 | JavaCl ass clazz = findClas s(classNam e); | |
179 | ||
180 | if(cla zz != null ) { | |
181 | retu rn clazz; | |
182 | } | |
183 | ||
184 | try { | |
185 | if(i s != null) { | |
186 | Cl assParser parser = n ew ClassPa rser(is, c lassName); | |
187 | cl azz = pars er.parse() ; | |
188 | ||
189 | st oreClass(c lazz); | |
190 | ||
191 | re turn clazz ; | |
192 | } | |
193 | } catc h(IOExcept ion e) { | |
194 | thro w new Clas sNotFoundE xception(" Exception while look ing for cl ass " + | |
195 | c lassName + ": " + e. toString() ); | |
196 | } | |
197 | ||
198 | throw new ClassN otFoundExc eption("Sy ntheticRep ository co uld not lo ad " + | |
199 | cla ssName); | |
200 | } | |
201 | ||
202 | /** Clea r all entr ies from c ache. | |
203 | */ | |
204 | public v oid clear( ) { | |
205 | _loade dClasses.c lear(); | |
206 | } | |
207 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.