hi Julian,<br>I&#39;ve fixed all the code formatting exceptions flagged by checkFile.sh.<br><br>I had to slightly fix checkFile.sh as it was not working in cygwin due to wrong end of line characters.<br>I did that using a tool called textpad - &quot;save as&quot;, &quot;file format&quot;, &quot;UNIX&quot;.<br>

<br>Also the comments on checkFile.sh say that it&#39;s the same script used by Perforce on check-ins.<br>That&#39;s probably no longer true as Perforce allowed my changes in while checkFile flagged many exceptions.<br>Perhaps the trigger on the Perforce server needs updating?<br>

<br>It&#39;s been fairly time consuming to comply the code formatting rules using Eclipse.<br>With these restrictions changing a large amount of code would be a very daunting perspective.<br><br>I think it&#39;s pretty safe to say that Eclipse is the most widespread Java IDE and that it&#39;s probably worth trying to create an eclipse formatting file to help with this task.<br>

<br>Where can I see your formatting rules in a human readable format?<br><br><br><br>thanks,<br>Michele<br><br><br><div class="gmail_quote">On 25 August 2011 22:15, Michele Rossi <span dir="ltr">&lt;<a href="mailto:michele.rossi@gmail.com">michele.rossi@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<div>I fixed all the exceptions raised by Perforce when attempting to check in and I assumed they were the same checks made by the checkFile script.</div>

<div>Wrong assumption sorry.</div><div><br></div><div>Ok I will run checkFile tomorrow as soon as I get back to work (it&#39;s 22:15 here now).</div>
<div><br></div><div>thanks,</div><div>Michele<div><div></div><div class="h5"><br><div><br><div class="gmail_quote">On 25 August 2011 21:29, Julian Hyde <span dir="ltr">&lt;<a href="mailto:jhyde@pentaho.com" target="_blank">jhyde@pentaho.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Michele,<br>
<br>
Congratulations on your first check in.<br>
<br>
However, it had 17 checkFile exceptions. Can you fix today please.<br>
<font color="#888888"><br>
Julian<br>
</font><div><div></div><div><br>
On Aug 25, 2011, at 12:44 AM, Michele Rossi wrote:<br>
<br>
&gt; <a href="http://p4web.eigenbase.org/@md=d&amp;c=6PU@/14566?ac=10" target="_blank">http://p4web.eigenbase.org/@md=d&amp;c=6PU@/14566?ac=10</a><br>
&gt;<br>
&gt; Change 14566 by mrossi@michele_mondrian on 2011/08/25 00:43:32<br>
&gt;<br>
&gt;       MONDRIAN: fixes to xmla servlet<br>
&gt;<br>
&gt; Affected files ...<br>
&gt;<br>
&gt; ... //open/mondrian/src/main/mondrian/xmla/XmlaHandler.java#80 edit<br>
&gt; ... //open/mondrian/src/main/mondrian/xmla/impl/DefaultXmlaServlet.java#33 edit<br>
&gt; ... //open/mondrian/src/main/mondrian/xmla/impl/Olap4jXmlaServlet.java#4 edit<br>
&gt;<br>
&gt; Differences ...<br>
&gt;<br>
&gt; ==== //open/mondrian/src/main/mondrian/xmla/XmlaHandler.java#80 (ktext) ====<br>
&gt;<br>
&gt; 2c2<br>
&gt; &lt; // $Id: //open/mondrian/src/main/mondrian/xmla/XmlaHandler.java#79 $<br>
&gt; ---<br>
&gt;&gt; // $Id: //open/mondrian/src/main/mondrian/xmla/XmlaHandler.java#80 $<br>
&gt; 27a28,29<br>
&gt;&gt; import java.lang.reflect.InvocationTargetException;<br>
&gt;&gt; import java.lang.reflect.UndeclaredThrowableException;<br>
&gt; 41c43<br>
&gt; &lt;  * @version $Id: //open/mondrian/src/main/mondrian/xmla/XmlaHandler.java#79 $<br>
&gt; ---<br>
&gt;&gt; * @version $Id: //open/mondrian/src/main/mondrian/xmla/XmlaHandler.java#80 $<br>
&gt; 75a78,102<br>
&gt;&gt;        } catch (UndeclaredThrowableException ute) {<br>
&gt;&gt;            //<br>
&gt;&gt;            // Note: this is necessary because we use a dynamic proxy for the<br>
&gt;&gt;            // connection.<br>
&gt;&gt;            // I could not catch and un-wrap the Undeclared Throwable within<br>
&gt;&gt;            // the proxy.<br>
&gt;&gt;            // The exception comes out here and I couldn&#39;t find any better<br>
&gt;&gt;            // ways to deal with it.<br>
&gt;&gt;            //<br>
&gt;&gt;            // The undeclared throwable contains an Invocation Target Exception<br>
&gt;&gt;            // which in turns contains the real exception thrown by the &quot;unwrap&quot;<br>
&gt;&gt;            // method, for example OlapException.<br>
&gt;&gt;            //<br>
&gt;&gt;<br>
&gt;&gt;            Throwable cause = ute.getCause();<br>
&gt;&gt;            if (cause instanceof InvocationTargetException) {<br>
&gt;&gt;                cause = cause.getCause();<br>
&gt;&gt;            }<br>
&gt;&gt;<br>
&gt;&gt;            // this maintains the original behaviour: don&#39;t catch exceptions<br>
&gt;&gt;            // that are not subclasses of SQLException<br>
&gt;&gt;<br>
&gt;&gt;            if (! (cause instanceof SQLException)) {<br>
&gt;&gt;                throw ute;<br>
&gt;&gt;            }<br>
&gt;<br>
&gt; ==== //open/mondrian/src/main/mondrian/xmla/impl/DefaultXmlaServlet.java#33 (ktext) ====<br>
&gt;<br>
&gt; 2c2<br>
&gt; &lt; // $Id: //open/mondrian/src/main/mondrian/xmla/impl/DefaultXmlaServlet.java#32 $<br>
&gt; ---<br>
&gt;&gt; // $Id: //open/mondrian/src/main/mondrian/xmla/impl/DefaultXmlaServlet.java#33 $<br>
&gt; 12c12,18<br>
&gt; &lt; import java.io.*;<br>
&gt; ---<br>
&gt;&gt; import java.io.ByteArrayInputStream;<br>
&gt;&gt; import java.io.ByteArrayOutputStream;<br>
&gt;&gt; import java.io.IOException;<br>
&gt;&gt; import java.io.InputStream;<br>
&gt;&gt; import java.io.OutputStream;<br>
&gt;&gt; import java.io.StringWriter;<br>
&gt;&gt; import java.io.UnsupportedEncodingException;<br>
&gt; 14,15c20,24<br>
&gt; &lt; import java.nio.channels.*;<br>
&gt; &lt; import java.util.*;<br>
&gt; ---<br>
&gt;&gt; import java.nio.channels.Channels;<br>
&gt;&gt; import java.nio.channels.ReadableByteChannel;<br>
&gt;&gt; import java.nio.channels.WritableByteChannel;<br>
&gt;&gt; import java.util.HashMap;<br>
&gt;&gt; import java.util.Map;<br>
&gt; 17,19c26,32<br>
&gt; &lt; import javax.servlet.*;<br>
&gt; &lt; import javax.servlet.http.*;<br>
&gt; &lt; import javax.xml.parsers.*;<br>
&gt; ---<br>
&gt;&gt; import javax.servlet.ServletConfig;<br>
&gt;&gt; import javax.servlet.ServletException;<br>
&gt;&gt; import javax.servlet.http.HttpServletRequest;<br>
&gt;&gt; import javax.servlet.http.HttpServletResponse;<br>
&gt;&gt; import javax.xml.parsers.DocumentBuilder;<br>
&gt;&gt; import javax.xml.parsers.DocumentBuilderFactory;<br>
&gt;&gt; import javax.xml.parsers.ParserConfigurationException;<br>
&gt; 21d33<br>
&gt; &lt; import mondrian.xmla.*;<br>
&gt; 22a35,42<br>
&gt;&gt; import mondrian.xmla.SaxWriter;<br>
&gt;&gt; import mondrian.xmla.XmlaConstants;<br>
&gt;&gt; import mondrian.xmla.XmlaException;<br>
&gt;&gt; import mondrian.xmla.XmlaRequest;<br>
&gt;&gt; import mondrian.xmla.XmlaRequestCallback;<br>
&gt;&gt; import mondrian.xmla.XmlaResponse;<br>
&gt;&gt; import mondrian.xmla.XmlaServlet;<br>
&gt;&gt; import mondrian.xmla.XmlaUtil;<br>
&gt; 25,26c45,51<br>
&gt; &lt; import org.w3c.dom.*;<br>
&gt; &lt; import org.xml.sax.*;<br>
&gt; ---<br>
&gt;&gt; import org.w3c.dom.Attr;<br>
&gt;&gt; import org.w3c.dom.Document;<br>
&gt;&gt; import org.w3c.dom.Element;<br>
&gt;&gt; import org.w3c.dom.Node;<br>
&gt;&gt; import org.w3c.dom.NodeList;<br>
&gt;&gt; import org.xml.sax.InputSource;<br>
&gt;&gt; import org.xml.sax.SAXException;<br>
&gt; 32c57<br>
&gt; &lt;  * @version $Id: //open/mondrian/src/main/mondrian/xmla/impl/DefaultXmlaServlet.java#32 $<br>
&gt; ---<br>
&gt;&gt; * @version $Id: //open/mondrian/src/main/mondrian/xmla/impl/DefaultXmlaServlet.java#33 $<br>
&gt; 45,52d69<br>
&gt; &lt;     /**<br>
&gt; &lt;      * Simba O2X for some reason attempts to create many new xmla sessions<br>
&gt; &lt;      * during the same user interactions. We can mitigate that by creating a<br>
&gt; &lt;      * session id which is a direct hash function of the credentials supplied<br>
&gt; &lt;      * and the remote host IP.<br>
&gt; &lt;      */<br>
&gt; &lt;     private static final String REUSE_SESSION_IDS = &quot;reuseSessionIds&quot;;<br>
&gt; &lt;<br>
&gt; 56d72<br>
&gt; &lt;     private boolean reuseSessionIds = false;<br>
&gt; 61,63d76<br>
&gt; &lt;      *<br>
&gt; &lt;      * &lt;p&gt;NOTE: There is no mechanism to remove entries from this map,<br>
&gt; &lt;      * so it will get larger if the server is up for a long time.&lt;/p&gt;<br>
&gt; 74,76d86<br>
&gt; &lt;         this.reuseSessionIds =<br>
&gt; &lt;             Boolean.parseBoolean(<br>
&gt; &lt;                 servletConfig.getInitParameter(REUSE_SESSION_IDS));<br>
&gt; 79c89<br>
&gt; &lt;     protected DocumentBuilderFactory getDocumentBuilderFactory() {<br>
&gt; ---<br>
&gt;&gt;    protected static DocumentBuilderFactory getDocumentBuilderFactory() {<br>
&gt; 239a250<br>
&gt;&gt;<br>
&gt; 277a289<br>
&gt;&gt;<br>
&gt; 281d292<br>
&gt; &lt;                         context.put(CONTEXT_XMLA_PASSWORD, passwordStr);<br>
&gt; 283,285c294,296<br>
&gt; &lt;                     // [MROSSI] TODO we&#39;d need to inject the HttpServletRequest<br>
&gt; &lt;                     // into this method context.put(&quot;remote_host&quot;,<br>
&gt; &lt;                     // request.getRemoteHost());<br>
&gt; ---<br>
&gt;&gt;<br>
&gt;&gt;                    context.put(CONTEXT_XMLA_PASSWORD, passwordStr);<br>
&gt;&gt;<br>
&gt; 287c298<br>
&gt; &lt;                         LOGGER.error(<br>
&gt; ---<br>
&gt;&gt;                        LOGGER.warn(<br>
&gt; 319d329<br>
&gt; &lt;                     // generate SessionId<br>
&gt; 328,330c338,347<br>
&gt; &lt;                     // extract the SessionId attrs value and put into<br>
&gt; &lt;                     // context<br>
&gt; &lt;                     sessionIdStr = getSessionId(e, context);<br>
&gt; ---<br>
&gt;&gt;                    sessionIdStr = getSessionIdFromRequest(e, context);<br>
&gt;&gt;<br>
&gt;&gt;                    SessionInfo sessionInfo = getSessionInfo(sessionIdStr);<br>
&gt;&gt;<br>
&gt;&gt;                    if (sessionInfo != null) {<br>
&gt;&gt;                        context.put(CONTEXT_XMLA_USERNAME, sessionInfo.user);<br>
&gt;&gt;                        context.put(<br>
&gt;&gt;                                      CONTEXT_XMLA_PASSWORD,<br>
&gt;&gt;                                      sessionInfo.password);<br>
&gt;&gt;                    }<br>
&gt; 338,349c355<br>
&gt; &lt;                     // extract the SessionId attrs value and put into<br>
&gt; &lt;                     // context<br>
&gt; &lt;                     sessionIdStr = getSessionId(e, context);<br>
&gt; &lt;<br>
&gt; &lt;                     SessionInfo sessionInfo =<br>
&gt; &lt;                         getSessionInfo(sessionIdStr);<br>
&gt; &lt;                     if (sessionInfo != null) {<br>
&gt; &lt;                         context.put(CONTEXT_XMLA_USERNAME, sessionInfo.user);<br>
&gt; &lt;                         context.put(<br>
&gt; &lt;                             CONTEXT_XMLA_PASSWORD, sessionInfo.password);<br>
&gt; &lt;                     }<br>
&gt; &lt;                     context.put(CONTEXT_XMLA_SESSION_ID, sessionIdStr);<br>
&gt; ---<br>
&gt;&gt;                    sessionIdStr = getSessionIdFromRequest(e, context);<br>
&gt; 354,355d359<br>
&gt; &lt;                     // remove session info<br>
&gt; &lt;                     removeSessionInfo(sessionIdStr);<br>
&gt; 392a397<br>
&gt;&gt;<br>
&gt; 419,423d423<br>
&gt; &lt;     private void removeSessionInfo(String sessionIdStr) {<br>
&gt; &lt;         synchronized (sessionInfos) {<br>
&gt; &lt;             sessionInfos.remove(sessionIdStr);<br>
&gt; &lt;         }<br>
&gt; &lt;     }<br>
&gt; 425a426<br>
&gt;&gt;<br>
&gt; 432,469c433,438<br>
&gt; &lt;         /*<br>
&gt; &lt;          * Fallback to the default session ID generation algorithm.<br>
&gt; &lt;          */<br>
&gt; &lt;         if (reuseSessionIds) {<br>
&gt; &lt;             // This is how we use the same session id (key to retrieve a<br>
&gt; &lt;             // connection) for requests with the same username coming from<br>
&gt; &lt;             // the same remote host. The password can&#39;t be part of the<br>
&gt; &lt;             // string because if you use Simba and you don&#39;t tick &quot;save<br>
&gt; &lt;             // password&quot; in the login dialog then Simba only sends the<br>
&gt; &lt;             // password with the first session that it opens - after which<br>
&gt; &lt;             // it sends something like the following:<br>
&gt; &lt;             //<br>
&gt; &lt;             // &lt;Header&gt;<br>
&gt; &lt;             //   &lt;Security xmlns=&quot;<a href="http://schemas.xmlsoap.org/ws/2002/04/secext" target="_blank">http://schemas.xmlsoap.org/ws/2002/04/secext</a>&quot;&gt;<br>
&gt; &lt;             //        &lt;UsernameToken&gt;<br>
&gt; &lt;             //            &lt;Username&gt;michele&lt;/Username&gt;<br>
&gt; &lt;             //            &lt;Password Type=&quot;PasswordText&quot;/&gt;<br>
&gt; &lt;             //        &lt;/UsernameToken&gt;<br>
&gt; &lt;             //    &lt;/Security&gt;<br>
&gt; &lt;             //    &lt;BeginSession<br>
&gt; &lt;             //      xmlns=&quot;urn:schemas-microsoft-com:xml-analysis&quot;<br>
&gt; &lt;             //      mustUnderstand=&quot;1&quot;/&gt;<br>
&gt; &lt;             // &lt;/Header&gt;<br>
&gt; &lt;             //<br>
&gt; &lt;             // Note the Password element with no value in it.<br>
&gt; &lt;             String sessionString =<br>
&gt; &lt;                 &quot;session_&quot;<br>
&gt; &lt;                 + context.get(CONTEXT_XMLA_USERNAME)<br>
&gt; &lt;                 + &quot;_&quot;<br>
&gt; &lt;                 + &quot;_&quot;<br>
&gt; &lt;                 + context.get(&quot;remote_host&quot;);<br>
&gt; &lt;             return Long.toString(sessionString.hashCode(), 35);<br>
&gt; &lt;         } else {<br>
&gt; &lt;             // Generate a semi-random new session ID.<br>
&gt; &lt;             return Long.toString(<br>
&gt; &lt;                 -17L * System.nanoTime() + 11L * System.currentTimeMillis(),<br>
&gt; &lt;                 35);<br>
&gt; &lt;         }<br>
&gt; ---<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;        // Generate a pseudo-random new session ID.<br>
&gt;&gt;        return Long.toString(17L * System.nanoTime()<br>
&gt;&gt;                      +<br>
&gt;&gt;                      3L * System.currentTimeMillis(), 35);<br>
&gt; 472c441,443<br>
&gt; &lt;     protected String getSessionId(Element e, Map&lt;String, Object&gt; context)<br>
&gt; ---<br>
&gt;&gt;<br>
&gt;&gt;    private static String getSessionIdFromRequest(Element e,<br>
&gt;&gt;              Map&lt;String, Object&gt; context)<br>
&gt; 485,486c456,458<br>
&gt; &lt;         String value = attr.getValue();<br>
&gt; &lt;         if (value == null) {<br>
&gt; ---<br>
&gt;&gt;<br>
&gt;&gt;        String sessionId = attr.getValue();<br>
&gt;&gt;        if (sessionId == null) {<br>
&gt; 494c466<br>
&gt; &lt;         return value;<br>
&gt; ---<br>
&gt;&gt;        return sessionId;<br>
&gt; 845c817,822<br>
&gt; &lt;         SessionInfo sessionInfo;<br>
&gt; ---<br>
&gt;&gt;        if (sessionId == null) {<br>
&gt;&gt;            return null;<br>
&gt;&gt;        }<br>
&gt;&gt;<br>
&gt;&gt;        SessionInfo sessionInfo = null;<br>
&gt;&gt;<br>
&gt; 848a826<br>
&gt;&gt;<br>
&gt; 851,852c829,831<br>
&gt; &lt;                 &quot;No login credentials for found for session [&quot; + sessionId<br>
&gt; &lt;                 + &quot;]&quot;);<br>
&gt; ---<br>
&gt;&gt;                      &quot;No login credentials for found for session [&quot;<br>
&gt;&gt;                      +<br>
&gt;&gt;                    sessionId + &quot;]&quot;);<br>
&gt; 855,856c834,837<br>
&gt; &lt;                 &quot;Found existing credentials for session id [&quot;<br>
&gt; &lt;                 + sessionId + &quot;], username=[&quot; + sessionInfo.user + &quot;]&quot;);<br>
&gt; ---<br>
&gt;&gt;                      &quot;Found credentials for session id [&quot;<br>
&gt;&gt;                      + sessionId<br>
&gt;&gt;                      + &quot;], username=[&quot; + sessionInfo.user<br>
&gt;&gt;                    + &quot;] in servlet cache&quot;);<br>
&gt; 876c857<br>
&gt; &lt;                         new SessionInfo(sessionId, username, password);<br>
&gt; ---<br>
&gt;&gt;                        new SessionInfo(username, password);<br>
&gt; 882c863<br>
&gt; &lt;                 sessionInfo = new SessionInfo(sessionId, username, password);<br>
&gt; ---<br>
&gt;&gt;                sessionInfo = new SessionInfo(username, password);<br>
&gt; 888c869,871<br>
&gt; &lt;<br>
&gt; ---<br>
&gt;&gt;    /**<br>
&gt;&gt;     * Holds authentication credentials of a XMLA session.<br>
&gt;&gt;     */<br>
&gt; 890d872<br>
&gt; &lt;         final String id;<br>
&gt; 894,895c876,877<br>
&gt; &lt;         public SessionInfo(String id, String user, String password) {<br>
&gt; &lt;             <a href="http://this.id" target="_blank">this.id</a> = id;<br>
&gt; ---<br>
&gt;&gt;        public SessionInfo(String user, String password)<br>
&gt;&gt;        {<br>
&gt; 901d882<br>
&gt; &lt;<br>
&gt;<br>
&gt; ==== //open/mondrian/src/main/mondrian/xmla/impl/Olap4jXmlaServlet.java#4 (ktext) ====<br>
&gt;<br>
&gt; 2c2<br>
&gt; &lt; // $Id: //open/mondrian/src/main/mondrian/xmla/impl/Olap4jXmlaServlet.java#3 $<br>
&gt; ---<br>
&gt;&gt; // $Id: //open/mondrian/src/main/mondrian/xmla/impl/Olap4jXmlaServlet.java#4 $<br>
&gt; 28a29<br>
&gt;&gt; import java.lang.reflect.UndeclaredThrowableException;<br>
&gt; 36c37<br>
&gt; &lt;  * @version $Id: //open/mondrian/src/main/mondrian/xmla/impl/Olap4jXmlaServlet.java#3 $<br>
&gt; ---<br>
&gt;&gt; * @version $Id: //open/mondrian/src/main/mondrian/xmla/impl/Olap4jXmlaServlet.java#4 $<br>
&gt; 415a417<br>
&gt;&gt;<br>
&gt; 422,423c424,427<br>
&gt; &lt;                     if (OlapConnection.class.isAssignableFrom(<br>
&gt; &lt;                             method.getClass()))<br>
&gt; ---<br>
&gt;&gt;                    if (&quot;unwrap&quot;.equals(method.getName())<br>
&gt;&gt;                              ||<br>
&gt;&gt;                            OlapConnection.class.isAssignableFrom(<br>
&gt;&gt;                                    method.getDeclaringClass()))<br>
&gt;<br>
<br>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br>