You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/04/18 08:20:36 UTC

[GitHub] [pulsar] gaozhangmin opened a new pull request, #15198: [fix][test]Fix cannot resolve method addLast error

gaozhangmin opened a new pull request, #15198:
URL: https://github.com/apache/pulsar/pull/15198

   
   
   ### Motivation
   Cannot resolve method 'addLast(java.lang.String, org.apache.pulsar.client.api.MockBrokerService.MockServerCnx)' 
   
   ### Modifications
   Cast `MockServerCnx` to ChannelHandler
   
   
   
   ### Documentation
   
   Check the box below or label this PR directly.
   
   Need to update docs? 
   
   - [ ] `doc-required` 
   (Your PR needs to update docs and you will update later)
     
   - [x] `no-need-doc` 
   (Please explain why)
     
   - [ ] `doc` 
   (Your PR contains doc changes)
   
   - [ ] `doc-added`
   (Docs have been already added)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] michaeljmarshall commented on a diff in pull request #15198: [fix][test]Fix cannot resolve method addLast error

Posted by GitBox <gi...@apache.org>.
michaeljmarshall commented on code in PR #15198:
URL: https://github.com/apache/pulsar/pull/15198#discussion_r854763467


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarChannelInitializer.java:
##########
@@ -144,7 +145,7 @@ protected void initChannel(SocketChannel ch) throws Exception {
         // auto-read.
         ch.pipeline().addLast("flowController", new FlowControlHandler());
         ServerCnx cnx = newServerCnx(pulsar, listenerName);
-        ch.pipeline().addLast("handler", cnx);
+        ch.pipeline().addLast("handler", (ChannelHandler) cnx);

Review Comment:
   @gaozhangmin - are you able to provide a screenshot of the error message? My IntelliJ does not report this error, either.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] gaozhangmin commented on a diff in pull request #15198: [fix][test]Fix cannot resolve method addLast error

Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on code in PR #15198:
URL: https://github.com/apache/pulsar/pull/15198#discussion_r857223217


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarChannelInitializer.java:
##########
@@ -144,7 +145,7 @@ protected void initChannel(SocketChannel ch) throws Exception {
         // auto-read.
         ch.pipeline().addLast("flowController", new FlowControlHandler());
         ServerCnx cnx = newServerCnx(pulsar, listenerName);
-        ch.pipeline().addLast("handler", cnx);
+        ch.pipeline().addLast("handler", (ChannelHandler) cnx);

Review Comment:
   I also use  IntelliJ IDEA 2022.1  @michaeljmarshall  @nodece 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] github-actions[bot] commented on pull request #15198: [fix][test]Fix cannot resolve method addLast error

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #15198:
URL: https://github.com/apache/pulsar/pull/15198#issuecomment-1101182899

   @gaozhangmin:Thanks for your contribution. For this PR, do we need to update docs?
   (The [PR template contains info about doc](https://github.com/apache/pulsar/blob/master/.github/PULL_REQUEST_TEMPLATE.md#documentation), which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] gaozhangmin closed pull request #15198: [fix][test]Fix cannot resolve method addLast error

Posted by GitBox <gi...@apache.org>.
gaozhangmin closed pull request #15198: [fix][test]Fix cannot resolve method addLast error
URL: https://github.com/apache/pulsar/pull/15198


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] nodece commented on pull request #15198: [fix][test]Fix cannot resolve method addLast error

Posted by GitBox <gi...@apache.org>.
nodece commented on PR #15198:
URL: https://github.com/apache/pulsar/pull/15198#issuecomment-1101208769

   I notice the Pulsar have many similar codes, could you fix these code?
   
   It should be working, but the IDEA will tell us there are errror here.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] nodece commented on a diff in pull request #15198: [fix][test]Fix cannot resolve method addLast error

Posted by GitBox <gi...@apache.org>.
nodece commented on code in PR #15198:
URL: https://github.com/apache/pulsar/pull/15198#discussion_r854772584


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarChannelInitializer.java:
##########
@@ -144,7 +145,7 @@ protected void initChannel(SocketChannel ch) throws Exception {
         // auto-read.
         ch.pipeline().addLast("flowController", new FlowControlHandler());
         ServerCnx cnx = newServerCnx(pulsar, listenerName);
-        ch.pipeline().addLast("handler", cnx);
+        ch.pipeline().addLast("handler", (ChannelHandler) cnx);

Review Comment:
   <img width="1066" alt="image" src="https://user-images.githubusercontent.com/16235121/164374413-a5715d3d-a1ae-475c-b2f7-22f591a134b7.png">
   
   
   I have the same issue, this is my screenshot on IntelliJ IDEA 2022.1 (Ultimate Edition)
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] Jason918 commented on a diff in pull request #15198: [fix][test]Fix cannot resolve method addLast error

Posted by GitBox <gi...@apache.org>.
Jason918 commented on code in PR #15198:
URL: https://github.com/apache/pulsar/pull/15198#discussion_r852031995


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarChannelInitializer.java:
##########
@@ -144,7 +145,7 @@ protected void initChannel(SocketChannel ch) throws Exception {
         // auto-read.
         ch.pipeline().addLast("flowController", new FlowControlHandler());
         ServerCnx cnx = newServerCnx(pulsar, listenerName);
-        ch.pipeline().addLast("handler", cnx);
+        ch.pipeline().addLast("handler", (ChannelHandler) cnx);

Review Comment:
   Sorry, I didn't get this. `ServerCnx` extends `ChannelInboundHandlerAdapter`, why is this necessary?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] michaeljmarshall commented on a diff in pull request #15198: [fix][test]Fix cannot resolve method addLast error

Posted by GitBox <gi...@apache.org>.
michaeljmarshall commented on code in PR #15198:
URL: https://github.com/apache/pulsar/pull/15198#discussion_r854781050


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarChannelInitializer.java:
##########
@@ -144,7 +145,7 @@ protected void initChannel(SocketChannel ch) throws Exception {
         // auto-read.
         ch.pipeline().addLast("flowController", new FlowControlHandler());
         ServerCnx cnx = newServerCnx(pulsar, listenerName);
-        ch.pipeline().addLast("handler", cnx);
+        ch.pipeline().addLast("handler", (ChannelHandler) cnx);

Review Comment:
   Thanks for sharing @nodece. I am running with IntelliJ IDEA 2021.3.3 (Ultimate Edition). I wonder why we're seeing this discrepancy.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] BewareMyPower commented on a diff in pull request #15198: [fix][test]Fix cannot resolve method addLast error

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on code in PR #15198:
URL: https://github.com/apache/pulsar/pull/15198#discussion_r857242077


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarChannelInitializer.java:
##########
@@ -144,7 +145,7 @@ protected void initChannel(SocketChannel ch) throws Exception {
         // auto-read.
         ch.pipeline().addLast("flowController", new FlowControlHandler());
         ServerCnx cnx = newServerCnx(pulsar, listenerName);
-        ch.pipeline().addLast("handler", cnx);
+        ch.pipeline().addLast("handler", (ChannelHandler) cnx);

Review Comment:
   <img width="1066" alt="image" src="https://user-images.githubusercontent.com/18204803/165018011-7e4bcf71-4395-4d6d-9246-b133a7ae5e30.png">
   
   It looks like a bug of Idea, both `PulsarDecoder` and my customized `Decoder` extend the same class `ChannelInboundHandlerAdapter`, while inheriting `Decoder` works well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] gaozhangmin commented on pull request #15198: [fix][test]Fix cannot resolve method addLast error

Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on PR #15198:
URL: https://github.com/apache/pulsar/pull/15198#issuecomment-1101260129

   > I notice the Pulsar have many similar codes, could you fix these code?
   > 
   > It should be working, but the IDEA will tell us there are error here.
   
   I only find one of this kind error.  @nodece 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] gaozhangmin commented on a diff in pull request #15198: [fix][test]Fix cannot resolve method addLast error

Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on code in PR #15198:
URL: https://github.com/apache/pulsar/pull/15198#discussion_r852058572


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarChannelInitializer.java:
##########
@@ -144,7 +145,7 @@ protected void initChannel(SocketChannel ch) throws Exception {
         // auto-read.
         ch.pipeline().addLast("flowController", new FlowControlHandler());
         ServerCnx cnx = newServerCnx(pulsar, listenerName);
-        ch.pipeline().addLast("handler", cnx);
+        ch.pipeline().addLast("handler", (ChannelHandler) cnx);

Review Comment:
   Solve the error hints by the IDEA. @Jason918 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] BewareMyPower commented on pull request #15198: [fix][test]Fix cannot resolve method addLast error

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on PR #15198:
URL: https://github.com/apache/pulsar/pull/15198#issuecomment-1108031234

   I think it's a issue of Intellij Idea, there is no need to add a cast in code.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] nodece commented on pull request #15198: [fix][test]Fix cannot resolve method addLast error

Posted by GitBox <gi...@apache.org>.
nodece commented on PR #15198:
URL: https://github.com/apache/pulsar/pull/15198#issuecomment-1108104195

   Clone the Pulsar repo to a new folder, then use the IDEA to open this new project, it is working. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] gaozhangmin closed pull request #15198: [fix][test]Fix cannot resolve method addLast error

Posted by GitBox <gi...@apache.org>.
gaozhangmin closed pull request #15198: [fix][test]Fix cannot resolve method addLast error
URL: https://github.com/apache/pulsar/pull/15198


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] gaozhangmin commented on pull request #15198: [fix][test]Fix cannot resolve method addLast error

Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on PR #15198:
URL: https://github.com/apache/pulsar/pull/15198#issuecomment-1101290624

   @nodece PTAL again, Thanks for pointing it out


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] Jason918 commented on a diff in pull request #15198: [fix][test]Fix cannot resolve method addLast error

Posted by GitBox <gi...@apache.org>.
Jason918 commented on code in PR #15198:
URL: https://github.com/apache/pulsar/pull/15198#discussion_r852097786


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarChannelInitializer.java:
##########
@@ -144,7 +145,7 @@ protected void initChannel(SocketChannel ch) throws Exception {
         // auto-read.
         ch.pipeline().addLast("flowController", new FlowControlHandler());
         ServerCnx cnx = newServerCnx(pulsar, listenerName);
-        ch.pipeline().addLast("handler", cnx);
+        ch.pipeline().addLast("handler", (ChannelHandler) cnx);

Review Comment:
   <img width="708" alt="image" src="https://user-images.githubusercontent.com/2770146/163811188-d1b8f381-0742-4cd8-bd60-b587454403d5.png">
   
   No errors in my local IDEA, my version: IntelliJ IDEA 2021.2.4 (Ultimate Edition)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] github-actions[bot] commented on pull request #15198: [fix][test]Fix cannot resolve method addLast error

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #15198:
URL: https://github.com/apache/pulsar/pull/15198#issuecomment-1101184800

   @gaozhangmin:Thanks for providing doc info!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org