Skip to content

Commit

Permalink
ROCKETMQ-18 Fix the conflicts between code and check style.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouxinyu committed Dec 28, 2016
1 parent 388ba7a commit 853b167
Show file tree
Hide file tree
Showing 175 changed files with 494 additions and 534 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public boolean initialize() throws CloneNotSupportedException {
this.messageStore =
new DefaultMessageStore(this.messageStoreConfig, this.brokerStatsManager, this.messageArrivingListener,
this.brokerConfig);
this.brokerStats = new BrokerStats((DefaultMessageStore)this.messageStore);
this.brokerStats = new BrokerStats((DefaultMessageStore) this.messageStore);
//load plugin
MessageStorePluginContext context = new MessageStorePluginContext(messageStoreConfig, brokerStatsManager, messageArrivingListener, brokerConfig);
this.messageStore = MessageStoreFactory.build(context, this.messageStore);
Expand All @@ -219,7 +219,7 @@ public boolean initialize() throws CloneNotSupportedException {

if (result) {
this.remotingServer = new NettyRemotingServer(this.nettyServerConfig, this.clientHousekeepingService);
NettyServerConfig fastConfig = (NettyServerConfig)this.nettyServerConfig.clone();
NettyServerConfig fastConfig = (NettyServerConfig) this.nettyServerConfig.clone();
fastConfig.setListenPort(nettyServerConfig.getListenPort() - 2);
this.fastRemotingServer = new NettyRemotingServer(fastConfig, this.clientHousekeepingService);
this.sendMessageExecutor = new BrokerFixedThreadPoolExecutor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public static BrokerController createBrokerController(String[] args) {
}

messageStoreConfig.setHaListenPort(nettyServerConfig.getListenPort() + 1);
LoggerContext lc = (LoggerContext)LoggerFactory.getILoggerFactory();
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(lc);
lc.reset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public int hashCode() {
result = prime * result + ((channel == null) ? 0 : channel.hashCode());
result = prime * result + ((clientId == null) ? 0 : clientId.hashCode());
result = prime * result + ((language == null) ? 0 : language.hashCode());
result = prime * result + (int)(lastUpdateTimestamp ^ (lastUpdateTimestamp >>> 32));
result = prime * result + (int) (lastUpdateTimestamp ^ (lastUpdateTimestamp >>> 32));
result = prime * result + version;
return result;
}
Expand All @@ -81,7 +81,7 @@ public boolean equals(Object obj) {
return false;
if (getClass() != obj.getClass())
return false;
ClientChannelInfo other = (ClientChannelInfo)obj;
ClientChannelInfo other = (ClientChannelInfo) obj;
if (channel == null) {
if (other.channel != null)
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public BrokerFastFailure(final BrokerController brokerController) {

public static RequestTask castRunnable(final Runnable runnable) {
try {
FutureTaskExt object = (FutureTaskExt)runnable;
return (RequestTask)object.getRunnable();
FutureTaskExt object = (FutureTaskExt) runnable;
return (RequestTask) object.getRunnable();
} catch (Throwable e) {
log.error(String.format("castRunnable exception, %s", runnable.getClass().getName()), e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public synchronized void addPullRequest(final List<PullRequest> many) {

public synchronized List<PullRequest> cloneListAndClear() {
if (!this.pullRequestList.isEmpty()) {
List<PullRequest> result = (ArrayList<PullRequest>)this.pullRequestList.clone();
List<PullRequest> result = (ArrayList<PullRequest>) this.pullRequestList.clone();
this.pullRequestList.clear();
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private RegisterBrokerResult registerBroker(
switch (response.getCode()) {
case ResponseCode.SUCCESS: {
RegisterBrokerResponseHeader responseHeader =
(RegisterBrokerResponseHeader)response.decodeCommandCustomHeader(RegisterBrokerResponseHeader.class);
(RegisterBrokerResponseHeader) response.decodeCommandCustomHeader(RegisterBrokerResponseHeader.class);
RegisterBrokerResult result = new RegisterBrokerResult();
result.setMasterAddr(responseHeader.getMasterAddr());
result.setHaServerAddr(responseHeader.getHaServerAddr());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public final static MessageStore build(MessageStorePluginContext context, Messag
String pluginClass = pluginClasses[i];
try {
@SuppressWarnings("unchecked")
Class<AbstractPluginMessageStore> clazz = (Class<AbstractPluginMessageStore>)Class.forName(pluginClass);
Class<AbstractPluginMessageStore> clazz = (Class<AbstractPluginMessageStore>) Class.forName(pluginClass);
Constructor<AbstractPluginMessageStore> construct = clazz.getConstructor(MessageStorePluginContext.class, MessageStore.class);
messageStore = construct.newInstance(context, messageStore);
} catch (Throwable e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,12 @@ protected SendMessageRequestHeader parseRequestHeader(RemotingCommand request)
switch (request.getCode()) {
case RequestCode.SEND_MESSAGE_V2:
requestHeaderV2 =
(SendMessageRequestHeaderV2)request
(SendMessageRequestHeaderV2) request
.decodeCommandCustomHeader(SendMessageRequestHeaderV2.class);
case RequestCode.SEND_MESSAGE:
if (null == requestHeaderV2) {
requestHeader =
(SendMessageRequestHeader)request
(SendMessageRequestHeader) request
.decodeCommandCustomHeader(SendMessageRequestHeader.class);
} else {
requestHeader = SendMessageRequestHeaderV2.createSendMessageRequestHeaderV1(requestHeaderV2);
Expand All @@ -305,7 +305,7 @@ public void executeSendMessageHookAfter(final RemotingCommand response, final Se
try {
if (response != null) {
final SendMessageResponseHeader responseHeader =
(SendMessageResponseHeader)response.readCustomHeader();
(SendMessageResponseHeader) response.readCustomHeader();
context.setMsgId(responseHeader.getMsgId());
context.setQueueId(responseHeader.getQueueId());
context.setQueueOffset(responseHeader.getQueueOffset());
Expand Down
Loading

0 comments on commit 853b167

Please sign in to comment.