boolean (PsiExpression expression) { if (!(expression instanceof PsiMethodCallExpression methodCallExpression)) { return false; } final PsiReferenceExpression methodExpression = methodCallExpression.getMethodExpression(); final String methodName = methodExpression.getReferenceName(); if (!HardcodedMethodConstants.GET_CHANNEL.equals(methodName)) { return false; } final PsiExpression qualifier = methodExpression.getQualifierExpression(); if (qualifier == null || TypeUtils.expressionHasTypeOrSubtype(qualifier, "java.net.Socket", "java.net.DatagramSocket", "java.net.ServerSocket", "java.net.SocketInputStream", "java.net.SocketOutputStream", "java.io.FileInputStream", "java.io.FileOutputStream", "java.io.RandomAccessFile", "com.sun.corba.se.pept.transport.EventHandler", "sun.nio.ch.InheritedChannel") == null) { return false; } return TypeUtils.expressionHasTypeOrSubtype(expression, "java.nio.channels.Channel"); }