7. Araxis Merge File Comparison Report

Produced by Araxis Merge on Mon Mar 6 17:40:23 2006 UTC. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a reasonably standards compliant browser such as the latest version of Firefox or Internet Explorer. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

7.1 Files compared

# Location File Last Modified
1 C:\Merge Test Files\4.0.6\catalina\src\share\org\apache\catalina\connector\http10\warp WarpResponse.java Tue Oct 8 15:15:34 2002 UTC
2 Mon Mar 6 17:40:23 2006 UTC
3 Mon Mar 6 17:40:23 2006 UTC
Note: Merge considers the second file to be the common ancestor of the others.

7.2 Comparison summary

Description Between
Files 1 and 2
Between
Files 2 and 3
Relative to
Common Ancestor
Text Blocks Lines Text Blocks Lines Text Blocks Lines
Unchanged 0 0 0 0
Changed 0 0 0 0 0 0
Inserted 0 0 0 0 1 322
Removed 1 322 0 0 0 0
Note: An automatic merge would leave 0 conflict(s).

7.3 Comparison options

Whitespace All differences in whitespace within lines are ignored
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

7.4 Active regular expressions

No regular expressions were active.

7.5 Comparison detail

1   /* ======= ========== ========== ========== ========== ========== ========== ====== *        
2    *                                                                                  *        
3    *                  T he Apache  Software L icense,  V ersion 1.1                   *        
4    *                                                                                  *        
5    *           Copyrigh t (c) 1999 -2001 The  Apache Sof tware Foun dation.           *        
6    *                             A ll rights  reserved.                               *        
7    *                                                                                  *        
8    * ======= ========== ========== ========== ========== ========== ========== ====== *        
9    *                                                                                  *        
10    * Redistr ibution an d use in s ource and  binary for ms,  with  or without  modi- *        
11    * ficatio n, are per mitted pro vided that  the follo wing condi tions are  met:   *        
12    *                                                                                  *        
13    * 1. Redi stribution s of sourc e code  mu st retain  the above  copyright  notice *        
14    *    noti ce, this l ist of con ditions an d the foll owing disc laimer.           *        
15    *                                                                                  *        
16    * 2. Redi stribution s  in bina ry  form   must  repr oduce the   above cop yright *        
17    *    noti ce,  this  list of co nditions   and the fo llowing  d isclaimer  in the *        
18    *    docu mentation  and/or oth er materia ls provide d with the  distribut ion.   *        
19    *                                                                                  *        
20    * 3. The  end-user d ocumentati on  includ ed with th e redistri bution,  i f any, *        
21    *    must  include t he followi ng acknowl egement:                                *        
22    *                                                                                  *        
23    *       " This produ ct include s  softwar e develope d  by the  Apache  So ftware *        
24    *         Foundation  <http://w ww.apache. org/>."                                 *        
25    *                                                                                  *        
26    *    Alte rnately, t his acknow legement m ay appear  in the sof tware itse lf, if *        
27    *    and  wherever s uch third- party ackn owlegement s normally  appear.          *        
28    *                                                                                  *        
29    * 4. The  names  "Th e  Jakarta   Project" ,  "Tomcat ",  and  " Apache  So ftware *        
30    *    Foun dation"  m ust not be  used  to  endorse or  promote   products d erived *        
31    *    from  this  sof tware with out  prior   written   permissio n.  For  w ritten *        
32    *    perm ission, pl ease conta ct <apache @apache.or g>.                          *        
33    *                                                                                  *        
34    * 5. Prod ucts deriv ed from th is softwar e may not  be called  "Apache" n or may *        
35    *    "Apa che" appea r in their  names wit hout prior  written p ermission  of the *        
36    *    Apac he Softwar e Foundati on.                                                *        
37    *                                                                                  *        
38    * THIS SO FTWARE IS  PROVIDED " AS IS" AND  ANY EXPRE SSED OR IM PLIED WARR ANTIES *        
39    * INCLUDI NG, BUT NO T LIMITED  TO,  THE I MPLIED WAR RANTIES OF  MERCHANTA BILITY *        
40    * AND FIT NESS FOR   A PARTICUL AR PURPOSE   ARE DISC LAIMED.  I N NO EVENT  SHALL *        
41    * THE APA CHE  SOFTW ARE  FOUND ATION OR   ITS CONTRI BUTORS  BE  LIABLE  F OR ANY *        
42    * DIRECT,   INDIRECT ,   INCIDE NTAL,  SPE CIAL,  EXE MPLARY,  O R  CONSEQU ENTIAL *        
43    * DAMAGES  (INCLUDIN G,  BUT NO T LIMITED  TO,  PROCU REMENT OF  SUBSTITUTE  GOODS *        
44    * OR SERV ICES;  LOS S OF USE,   DATA,  OR  PROFITS;   OR BUSINE SS INTERRU PTION) *        
45    * HOWEVER  CAUSED AN D  ON ANY   THEORY  O F  LIABILI TY,  WHETH ER IN  CON TRACT, *        
46    * STRICT  LIABILITY,  OR TORT   (INCLUDING  NEGLIGENC E OR OTHER WISE) ARIS ING IN *        
47    * ANY  WA Y  OUT OF   THE  USE  OF  THIS   SOFTWARE,   EVEN  IF   ADVISED   OF THE *        
48    * POSSIBI LITY OF SU CH DAMAGE.                                                    *        
49    *                                                                                  *        
50    * ======= ========== ========== ========== ========== ========== ========== ====== *        
51    *                                                                                  *        
52    * This so ftware  co nsists of  voluntary   contribut ions made   by many i ndivi- *        
53    * duals o n behalf o f the  Apa che Softwa re Foundat ion.  For  more infor mation *        
54    * on the  Apache Sof tware Foun dation, pl ease see < http://www .apache.or g/>.   *        
55    *                                                                                  *        
56    * ======= ========== ========== ========== ========== ========== ========== ====== */        
57   package or g.apache.c atalina.co nnector.wa rp;        
58          
59   import jav a.io.IOExc eption;        
60   import jav a.io.Outpu tStream;        
61   import jav a.io.Print Writer;        
62   import jav a.net.Malf ormedURLEx ception;        
63   import jav a.net.URL;        
64   import jav a.security .AccessCon troller;        
65   import jav a.security .Privilege dAction;        
66   import jav a.text.Sim pleDateFor mat;        
67   import jav a.util.Arr ayList;        
68   import jav a.util.Dat e;        
69   import jav a.util.Has hMap;        
70   import jav a.util.Ite rator;        
71   import jav a.util.Loc ale;        
72   import jav a.util.Tim eZone;        
73   import jav ax.servlet .ServletRe sponse;        
74   import jav ax.servlet .http.Cook ie;        
75   import jav ax.servlet .http.Http ServletReq uest;        
76   import jav ax.servlet .http.Http ServletRes ponse;        
77   import jav ax.servlet .http.Http Session;        
78   //import j avax.servl et.http.Ht tpUtils;        
79   import org .apache.ca talina.Htt pResponse;        
80   import org .apache.ca talina.Glo bals;        
81   import org .apache.ca talina.Log ger;        
82   import org .apache.ca talina.con nector.Htt pResponseB ase;        
83   import org .apache.ca talina.uti l.CookieTo ols;        
84   import org .apache.ca talina.uti l.RequestU til;        
85          
86   public cla ss WarpRes ponse exte nds HttpRe sponseBase  {        
87       /** Th e local st ream */        
88       privat e Stream l ocalstream ;        
89       /** Th e packet u sed for pr ocessing h eaders */        
90       privat e WarpPack et packet;        
91       /** Th e connecti on to whic h we are a ssociated  */        
92       privat e WarpConn ection con nection;        
93          
94       /**        
95        * Cre ate a new  instance o f a <code> WarpRespon se</code>.        
96        */        
97       public  WarpRespo nse() {        
98           su per();        
99           //  A WarpRes ponse is _ always_ as sociated w ith a Stre am        
100           th is.localst ream=new S tream(this );        
101           th is.setStre am(localst ream);        
102       }        
103          
104       /**        
105        * Rec ycle this  <code>Warp Response</ code> inst ance.        
106        */        
107       public  void recy cle() {        
108           //  Recycle o ur parent        
109           su per.recycl e();        
110           //  Recycle t he stream        
111           th is.localst ream.recyc le();        
112           //  Tell the  parent tha t a stream  is alread y in use.        
113           th is.setStre am(localst ream);        
114       }        
115          
116       /**        
117        * Set  the <code >WarpPacke t</code> i nstance us ed to proc ess header s.        
118        */        
119       public  void setP acket(Warp Packet pac ket) {        
120           th is.packet= packet;        
121       }        
122          
123       /**        
124        * Ret urn the <c ode>WarpPa cket</code > instance  used to p rocess hea ders.        
125        */        
126       public  WarpPacke t getPacke t() {        
127           re turn(this. packet);        
128       }        
129          
130       /**        
131        * Ass ociate thi s <code>Wa rpResponse </code> in stance wit h a specif ic        
132        * <co de>WarpCon nection</c ode> insta nce.        
133        */        
134       public  void setC onnection( WarpConnec tion conne ction) {        
135           th is.connect ion=connec tion;        
136       }        
137          
138       /**        
139        * Ret urn the <c ode>WarpCo nnection</ code> asso ciated thi s instance  of        
140        * <co de>WarpRes ponse</cod e>.        
141        */        
142       public  WarpConne ction getC onnection( ) {        
143           re turn(this. connection );        
144       }        
145          
146       /**        
147        * Flu sh output  and finish .        
148        */        
149       public  void fini shResponse ()        
150       throws  IOExcepti on {        
151           su per.finish Response() ;        
152           th is.localst ream.finis h();        
153       }        
154          
155       /**        
156        * Sen d the HTTP  response  headers, i f this has  not alrea dy occurre d.        
157        */        
158       protec ted void s endHeaders () throws  IOExceptio n {        
159           if  (isCommit ted()) ret urn;        
160           if  ("HTTP/0. 9".equals( request.ge tRequest() .getProtoc ol())) {        
161                committe d = true;        
162                return;        
163           }        
164          
165           th is.packet. reset();        
166           th is.packet. setType(Co nstants.TY PE_RES_STA TUS);        
167           th is.packet. writeUnsig nedShort(s tatus);        
168           th is.packet. writeStrin g(message) ;        
169           th is.connect ion.send(t his.packet );        
170          
171           if  (getConte ntType() ! = null) {        
172                this.pac ket.reset( );        
173                this.pac ket.setTyp e(Constant s.TYPE_RES _HEADER);        
174                this.pac ket.writeS tring("Con tent-Type" );        
175                this.pac ket.writeS tring(getC ontentType ());        
176                this.con nection.se nd(this.pa cket);        
177           }        
178           if  (getConte ntLength()  >= 0) {        
179                this.pac ket.reset( );        
180                this.pac ket.setTyp e(Constant s.TYPE_RES _HEADER);        
181                this.pac ket.writeS tring("Con tent-Lengt h");        
182                this.pac ket.writeS tring(Inte ger.toStri ng(getCont entLength( )));        
183                this.con nection.se nd(this.pa cket);        
184           }        
185          
186           sy nchronized  (headers)  {        
187                    Iter ator names  = headers .keySet(). iterator() ;        
188                while (n ames.hasNe xt()) {        
189                    Stri ng name =  (String) n ames.next( );        
190                    Arra yList valu es = (Arra yList) hea ders.get(n ame);        
191                    Iter ator items  = values. iterator() ;        
192                    whil e (items.h asNext())  {        
193                             String  value = ( String) it ems.next() ;        
194                         this.packe t.reset();        
195                         this.packe t.setType( Constants. TYPE_RES_H EADER);        
196                         this.packe t.writeStr ing(name);        
197                         this.packe t.writeStr ing(value) ;        
198                         this.conne ction.send (this.pack et);        
199                         }        
200                }        
201           }        
202          
203           //  Add the s ession ID  cookie if  necessary        
204           Ht tpServletR equest hre q = (HttpS ervletRequ est) reque st.getRequ est();        
205           Ht tpSession  session =  hreq.getSe ssion(fals e);        
206          
207           if  ((session  != null)  && session .isNew() & & (getCont ext() != n ull)        
208                    && g etContext( ).getCooki es()) {        
209                Cookie c ookie = ne w Cookie(G lobals.SES SION_COOKI E_NAME,        
210                                             s ession.get Id());        
211                cookie.s etMaxAge(- 1);        
212                String c ontextPath  = null;        
213                    if ( context !=  null)        
214                         contextPat h = contex t.getPath( );        
215                if ((con textPath ! = null) &&  (contextP ath.length () > 0))        
216                    cook ie.setPath (contextPa th);        
217                else        
218                    cook ie.setPath ("/");        
219                if (hreq .isSecure( ))        
220                    cook ie.setSecu re(true);        
221                addCooki e(cookie);        
222           }        
223          
224           //  Send all  specified  cookies (i f any)        
225           sy nchronized  (cookies)  {        
226                Iterator  items = c ookies.ite rator();        
227                while (i tems.hasNe xt()) {        
228                    Cook ie cookie  = (Cookie)  items.nex t();        
229                    Stri ng name=Co okieTools. getCookieH eaderName( cookie);        
230                    Stri ngBuffer v alue=new S tringBuffe r();        
231                    Cook ieTools.ge tCookieHea derValue(c ookie,valu e);        
232                         this.packe t.reset();        
233                    this .packet.se tType(Cons tants.TYPE _RES_HEADE R);        
234                    this .packet.wr iteString( name);        
235                    this .packet.wr iteString( value.toSt ring());        
236                    this .connectio n.send(thi s.packet);        
237                }        
238           }        
239          
240                this.pac ket.reset( );        
241           th is.packet. setType(Co nstants.TY PE_RES_COM MIT);        
242           th is.connect ion.send(t his.packet );        
243          
244           co mmitted =  true;        
245       }        
246          
247       /**        
248