Skip to content

Commit 5d82167

Browse files
authored
Report duplicate and overlapping database indices (#6989)
1 parent f88b3aa commit 5d82167

14 files changed

Lines changed: 168 additions & 114 deletions

File tree

.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ api/src/org/labkey/api/assay/AssaySaveHandler.java -text
253253
api/src/org/labkey/api/assay/AssaySchema.java -text
254254
api/src/org/labkey/api/assay/AssayService.java -text
255255
api/src/org/labkey/api/assay/AssayTableMetadata.java -text
256-
api/src/org/labkey/api/assay/AssayUploadFileResolver.java -text
257256
api/src/org/labkey/api/assay/AssayUploadXarContext.java -text
258257
api/src/org/labkey/api/assay/AssayUrls.java -text
259258
api/src/org/labkey/api/assay/AssayView.java -text
@@ -618,7 +617,6 @@ api/src/org/labkey/api/exceptions/TableNotFoundException.java -text
618617
api/src/org/labkey/api/exp/AbstractParameter.java -text
619618
api/src/org/labkey/api/exp/api/AbstractExperimentDataHandler.java -text
620619
api/src/org/labkey/api/exp/api/AbstractProtocolInputCriteria.java -text
621-
api/src/org/labkey/api/exp/api/AssayDomainType.java -text
622620
api/src/org/labkey/api/exp/api/AssayJSONConverter.java -text
623621
api/src/org/labkey/api/exp/api/DataType.java -text
624622
api/src/org/labkey/api/exp/api/DefaultExperimentDataHandler.java -text

api/src/org/labkey/api/action/ConfirmAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public final ModelAndView handleRequest() throws Exception
7777
ModelAndView mv = getSuccessView(form);
7878
if (null != mv)
7979
return mv;
80-
throw new RedirectException(getSuccessURL(form));
80+
throw new RedirectException(getSuccessURL(form), false);
8181
}
8282
}
8383
else

api/src/org/labkey/api/settings/LookAndFeelProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ public Boolean isDiscussionEnabledStored()
277277

278278
public String getUnsubstitutedLogoHref()
279279
{
280-
return lookupStringValue(logoHref, AppProps.getInstance().getHomePageUrl().replaceAll("^" + AppProps.getInstance().getContextPath(), "\\${contextPath}"));
280+
return lookupStringValue(logoHref, AppProps.getInstance().getHomePageActionURL().getLocalURIString().replaceAll("^" + AppProps.getInstance().getContextPath(), "\\${contextPath}"));
281281
}
282282

283283
public String getUnsubstitutedLogoHrefStored()

api/src/org/labkey/api/view/HttpView.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -594,13 +594,12 @@ protected void renderInternal(Object model, PrintWriter out) throws IOException
594594

595595
public static HttpView<?> redirect(URLHelper url, boolean allowAbsoluteUrl)
596596
{
597-
String redirectUrl = (!allowAbsoluteUrl || url.isLocalUri(getRootContext())) ? url.getLocalURIString() : url.getURIString();
598-
throw new RedirectException(redirectUrl);
597+
throw new RedirectException(url, allowAbsoluteUrl);
599598
}
600599

601600
public static HttpView<?> redirect(ActionURL url)
602601
{
603-
throw new RedirectException(url.getLocalURIString());
602+
throw new RedirectException(url);
604603
}
605604

606605
/**

api/src/org/labkey/api/view/PermanentRedirectException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
import jakarta.servlet.http.HttpServletResponse;
77

8-
/** Use when we want search engines, browsers, etc to assume that the redirecting URL is defunct and the target URL should be used going forward */
8+
/** Use when we want search engines, browsers, etc. to assume that the redirecting URL is defunct and the target URL should be used going forward */
99
public class PermanentRedirectException extends RedirectException
1010
{
1111
public PermanentRedirectException(@NotNull URLHelper url)
1212
{
13-
super(url);
13+
super(url, false);
1414
}
1515

1616
@Override

api/src/org/labkey/api/view/RedirectException.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,18 @@ public class RedirectException extends RuntimeException implements SkipMothershi
2929
{
3030
private final String _url;
3131

32+
@Deprecated // Call the variant that takes allowAbsoluteUrl
3233
public RedirectException(@NotNull URLHelper url)
34+
{
35+
this(url, false);
36+
}
37+
38+
public RedirectException(@NotNull URLHelper url, boolean allowAbsoluteUrl)
39+
{
40+
this(!allowAbsoluteUrl || url.isLocalUri(HttpView.getRootContext()) ? url.getLocalURIString() : url.getURIString());
41+
}
42+
43+
public RedirectException(@NotNull ActionURL url)
3344
{
3445
this(url.getLocalURIString());
3546
}

core/src/org/labkey/core/login/termsOfUse.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
4343
// Redirect immediately if terms are blank or null
4444
if (HtmlString.isBlank(termsHtml))
45-
throw new RedirectException(returnUrl);
45+
throw new RedirectException(returnUrl, false);
4646
4747
ActionURL formURL = urlFor(AgreeToTermsAction.class);
4848
%>

core/src/org/labkey/core/thumbnail/ThumbnailCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static CacheableWriter getThumbnailWriter(ThumbnailProvider provider, Ima
5454
URLHelper redirectURL = ThumbnailUtil.getStaticThumbnailURL(provider, imageType);
5555

5656
if (null != redirectURL)
57-
throw new RedirectException(redirectURL);
57+
throw new RedirectException(redirectURL, false);
5858
}
5959

6060
return dynamic;

core/src/org/labkey/core/webdav/DavController.java

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818

1919
package org.labkey.core.webdav;
2020

21+
import jakarta.servlet.ServletException;
22+
import jakarta.servlet.http.HttpServletRequest;
23+
import jakarta.servlet.http.HttpServletResponse;
24+
import jakarta.servlet.http.HttpServletResponseWrapper;
25+
import jakarta.servlet.http.HttpSession;
26+
import jakarta.servlet.http.Part;
2127
import org.apache.commons.beanutils.ConversionException;
2228
import org.apache.commons.collections4.IteratorUtils;
2329
import org.apache.commons.io.FileUtils;
@@ -72,7 +78,28 @@
7278
import org.labkey.api.settings.LookAndFeelProperties;
7379
import org.labkey.api.settings.OptionalFeatureService;
7480
import org.labkey.api.test.TestWhen;
75-
import org.labkey.api.util.*;
81+
import org.labkey.api.util.CSRFException;
82+
import org.labkey.api.util.CSRFUtil;
83+
import org.labkey.api.util.ConfigurationException;
84+
import org.labkey.api.util.DateUtil;
85+
import org.labkey.api.util.ErrorRenderer;
86+
import org.labkey.api.util.ExceptionUtil;
87+
import org.labkey.api.util.FileStream;
88+
import org.labkey.api.util.FileUtil;
89+
import org.labkey.api.util.GUID;
90+
import org.labkey.api.util.HeartBeat;
91+
import org.labkey.api.util.HttpUtil;
92+
import org.labkey.api.util.MemTracker;
93+
import org.labkey.api.util.PageFlowUtil;
94+
import org.labkey.api.util.Pair;
95+
import org.labkey.api.util.Path;
96+
import org.labkey.api.util.ResponseHelper;
97+
import org.labkey.api.util.ShutdownListener;
98+
import org.labkey.api.util.StringUtilsLabKey;
99+
import org.labkey.api.util.URIUtil;
100+
import org.labkey.api.util.URLHelper;
101+
import org.labkey.api.util.UnexpectedException;
102+
import org.labkey.api.util.XmlBeansUtil;
76103
import org.labkey.api.util.logging.LogHelper;
77104
import org.labkey.api.view.ActionURL;
78105
import org.labkey.api.view.DefaultModelAndView;
@@ -115,14 +142,7 @@
115142
import org.xml.sax.SAXException;
116143
import org.xml.sax.helpers.DefaultHandler;
117144

118-
import jakarta.servlet.ServletException;
119-
import jakarta.servlet.http.HttpServletRequest;
120-
import jakarta.servlet.http.HttpServletResponse;
121-
import jakarta.servlet.http.HttpServletResponseWrapper;
122-
import jakarta.servlet.http.HttpSession;
123-
import jakarta.servlet.http.Part;
124145
import javax.xml.parsers.DocumentBuilder;
125-
import javax.xml.parsers.DocumentBuilderFactory;
126146
import javax.xml.parsers.ParserConfigurationException;
127147
import javax.xml.parsers.SAXParser;
128148
import javax.xml.parsers.SAXParserFactory;
@@ -194,8 +214,6 @@
194214

195215

196216
/**
197-
* User: matthewb
198-
* Date: Oct 3, 2007
199217
* Derived from Tomcat's WebdavServlet
200218
*/
201219
public class DavController extends SpringActionController
@@ -873,7 +891,7 @@ public final WebdavStatus doMethod() throws DavException, IOException
873891
throw x;
874892
// NOTE: AppProps.getInstance().getSiteWelcomePageUrlString() is handled before we even get here. See WebdavServlet.
875893
if (c.isRoot())
876-
throw new RedirectException(AppProps.getInstance().getHomePageUrl());
894+
throw new RedirectException(AppProps.getInstance().getHomePageActionURL());
877895
throw new RedirectException(c.getStartURL(getUser()));
878896
}
879897
}

devtools/src/org/labkey/devtools/DevtoolsContainerListener.java

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)