mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
fix: resource loading failure caused by incorrect parameter order in StringUtils.startsWithIgnoreCase (#5173)
This commit is contained in:
@@ -25,7 +25,7 @@ import org.springframework.util.PropertyPlaceholderHelper;
|
|||||||
public class YamlUtils {
|
public class YamlUtils {
|
||||||
|
|
||||||
public static <T> T resourceYmlToObj(String resource, String prefix, Class<T> clazz) {
|
public static <T> T resourceYmlToObj(String resource, String prefix, Class<T> clazz) {
|
||||||
if (!StringUtils.startsWithIgnoreCase("classpath:", resource)) {
|
if (!StringUtils.startsWithIgnoreCase(resource, "classpath:")) {
|
||||||
resource = "classpath:" + resource;
|
resource = "classpath:" + resource;
|
||||||
}
|
}
|
||||||
ClassPathResource classPathResource = new ClassPathResource(resource);
|
ClassPathResource classPathResource = new ClassPathResource(resource);
|
||||||
|
|||||||
@@ -90,7 +90,6 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>druid</artifactId>
|
<artifactId>druid</artifactId>
|
||||||
<optional>true</optional>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import com.alibaba.otter.canal.parse.CanalEventParser;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 基于manager生成对应的{@linkplain CanalInstance}
|
* 基于manager生成对应的{@linkplain CanalInstance}
|
||||||
*
|
*
|
||||||
* @author jianghang 2012-7-12 下午05:37:09
|
* @author jianghang 2012-7-12 下午05:37:09
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
*/
|
*/
|
||||||
@@ -70,7 +70,7 @@ public class PlainCanalInstanceGenerator implements CanalInstanceGenerator {
|
|||||||
// ================ setter / getter ================
|
// ================ setter / getter ================
|
||||||
|
|
||||||
private BeanFactory getBeanFactory(String springXml) {
|
private BeanFactory getBeanFactory(String springXml) {
|
||||||
if (!StringUtils.startsWithIgnoreCase("classpath:", springXml)) {
|
if (!StringUtils.startsWithIgnoreCase(springXml, "classpath:")) {
|
||||||
springXml = "classpath:" + springXml;
|
springXml = "classpath:" + springXml;
|
||||||
}
|
}
|
||||||
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(springXml);
|
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(springXml);
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class SpringCanalInstanceGenerator implements CanalInstanceGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private BeanFactory getBeanFactory(String springXml) {
|
private BeanFactory getBeanFactory(String springXml) {
|
||||||
if (!StringUtils.startsWithIgnoreCase("classpath:", springXml)) {
|
if (!StringUtils.startsWithIgnoreCase(springXml, "classpath:")) {
|
||||||
springXml = "classpath:" + springXml;
|
springXml = "classpath:" + springXml;
|
||||||
}
|
}
|
||||||
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(springXml);
|
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(springXml);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class TableMetaTSDBBuilder {
|
|||||||
if (applicationContext == null) {
|
if (applicationContext == null) {
|
||||||
synchronized (contexts) {
|
synchronized (contexts) {
|
||||||
if (applicationContext == null) {
|
if (applicationContext == null) {
|
||||||
if (!StringUtils.startsWithIgnoreCase("classpath:", springXml)) {
|
if (!StringUtils.startsWithIgnoreCase(springXml, "classpath:")) {
|
||||||
springXml = "classpath:" + springXml;
|
springXml = "classpath:" + springXml;
|
||||||
}
|
}
|
||||||
applicationContext = new ClassPathXmlApplicationContext(springXml);
|
applicationContext = new ClassPathXmlApplicationContext(springXml);
|
||||||
|
|||||||
Reference in New Issue
Block a user