Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public String[] getArrayProperty(String key, final String delimiter, String[] de
if (!m_arrayCache.containsKey(delimiter)) {
synchronized (this) {
if (!m_arrayCache.containsKey(delimiter)) {
m_arrayCache.put(delimiter, this.<String[]>newCache());
m_arrayCache.put(delimiter, this.newCache());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private void processPropertyValues(BeanDefinitionRegistry beanRegistry) {
}

if (!beanName2SpringValueDefinitions.containsKey(beanRegistry)) {
beanName2SpringValueDefinitions.put(beanRegistry, LinkedListMultimap.<String, SpringValueDefinition>create());
beanName2SpringValueDefinitions.put(beanRegistry, LinkedListMultimap.create());
}

Multimap<String, SpringValueDefinition> springValueDefinitions = beanName2SpringValueDefinitions.get(beanRegistry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void register(BeanFactory beanFactory, String key, SpringValue springValu
if (!registry.containsKey(beanFactory)) {
synchronized (LOCK) {
if (!registry.containsKey(beanFactory)) {
registry.put(beanFactory, Multimaps.synchronizedListMultimap(LinkedListMultimap.<String, SpringValue>create()));
registry.put(beanFactory, Multimaps.synchronizedListMultimap(LinkedListMultimap.create()));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @author Jason Song([email protected])
*/
public class HttpRequest {
private String m_url;
private final String m_url;
private Map<String, String> headers;
private int m_connectTimeout;
private int m_readTimeout;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ public void testGetPropertyWithFunction() throws Exception {
public List<String> apply(String s) {
return Splitter.on(",").trimResults().omitEmptyStrings().splitToList(s);
}
}, Lists.<String>newArrayList()), Lists.newArrayList("a", "b", "c"));
}, Lists.newArrayList()), Lists.newArrayList("a", "b", "c"));
assertEquals(defaultConfig.getProperty(someNullKey, new Function<String, List<String>>() {
@Override
public List<String> apply(String s) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata)
if (!StringUtils.isEmpty(context.getEnvironment().getProperty("uat.titan.url"))) {
return true;
}
if (!StringUtils.isEmpty(context.getEnvironment().getProperty("pro.titan.url"))) {
return true;
}
return false;
return !StringUtils.isEmpty(context.getEnvironment().getProperty("pro.titan.url"));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public TitanEntityManager(final TitanSettings settings) {
public DataSource datasource() throws Exception {
Class clazz = Class.forName("com.ctrip.datasource.configure.DalDataSourceFactory");
Object obj = clazz.newInstance();
Method method = clazz.getMethod("createDataSource", new Class[] {String.class, String.class});
Method method = clazz.getMethod("createDataSource", String.class, String.class);
DataSource ds = ((DataSource) method.invoke(obj,
new Object[] {settings.getTitanDbname(), settings.getTitanUrl()}));
Tracer.logEvent("Apollo.Datasource.Titan", settings.getTitanDbname());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class ApolloNotificationMessages {
private Map<String, Long> details;

public ApolloNotificationMessages() {
this(Maps.<String, Long>newTreeMap());
this(Maps.newTreeMap());
}

private ApolloNotificationMessages(Map<String, Long> details) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static Properties readConfigFile(String configPath, Properties defaults)

}
if (sb.length() > 0) {
logger.debug("Reading properties: \n" + sb.toString());
logger.debug("Reading properties: \n" + sb);
} else {
logger.warn("No available properties: {}", configPath);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void load() {

try {
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
List<NetworkInterface> nis = interfaces == null ? Collections.<NetworkInterface>emptyList()
List<NetworkInterface> nis = interfaces == null ? Collections.emptyList()
: Collections.list(interfaces);
//sort the network interfaces according to the index asc
Collections.sort(nis, new Comparator<NetworkInterface>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void main(String[] args) throws IOException {
System.exit(0);
}

System.out.println(annotatedBean.toString());
System.out.println(annotatedBean);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ public SpringBootApolloRefreshConfig(
public void onChange(ConfigChangeEvent changeEvent) {
logger.info("before refresh {}", sampleRedisConfig.toString());
refreshScope.refresh("sampleRedisConfig");
logger.info("after refresh {}", sampleRedisConfig.toString());
logger.info("after refresh {}", sampleRedisConfig);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static void main(String[] args) throws IOException {
System.exit(0);
}

System.out.println(xmlBean.toString());
System.out.println(xmlBean);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public ItemChangeSets resolve(long namespaceId, String configText, List<ItemDTO>
String[] newItems = configText.split(ITEM_SEPARATOR);
Set<String> repeatKeys = new HashSet<>();
if (isHasRepeatKey(newItems, repeatKeys)) {
throw new BadRequestException(String.format("Config text has repeated keys: %s, please check your input.", repeatKeys.toString()));
throw new BadRequestException(String.format("Config text has repeated keys: %s, please check your input.", repeatKeys));
}

ItemChangeSets changeSets = new ItemChangeSets();
Expand Down