code: private void updateComputer(Node n, Map<String,Computer> byNameMap, Set<Computer> used, boolean automaticSlaveLaunch) {
          Map<Node,Computer> computers = getComputerMap();
          Computer c;
          c = byNameMap.get(n.getNodeName());
          if (c!=null) {
              try {
                  c.setNode(n); // reuse
                  used.add(c);
              } catch (RuntimeException e) {
                  LOGGER.log(Level.WARNING, "Error updating node " + n.getNodeName() + ", continuing", e);
              }
          } else {
              // we always need Computer for the master as a fallback in case there's no other Computer.
              if(n.getNumExecutors()>0 || n==Jenkins.getInstance()) {
                  try {
                      c = n.createComputer();
                  } catch(RuntimeException ex) { // Just in case there is a bogus extension
                      LOGGER.log(Level.WARNING, "Error retrieving computer for node " + n.getNodeName() + ", continuing", ex);
                  }
                  if (c == null) {
                      LOGGER.log(Level.WARNING, "Cannot create computer for node {0}, the {1}#createComputer() method returned null. Skipping this node", 
                              new Object[]{n.getNodeName(), n.getClass().getName()});
                      return;
                  }
                  
                  computers.put(n, c);
                  if (!n.isHoldOffLaunchUntilSave() && automaticSlaveLaunch) {
                      RetentionStrategy retentionStrategy = c.getRetentionStrategy();
                      if (retentionStrategy != null) {
                          // if there is a retention strategy, it is responsible for deciding to start the computer
                          retentionStrategy.start(c);
                      } else {
                          // we should never get here, but just in case, we'll fall back to the legacy behaviour
                          c.connect(true);
                      }
                  }
                  used.add(c);
              } else {
                  // TODO: Maybe it should be allowed, but we would just get NPE in the original logic before JENKINS-43496
                  LOGGER.log(Level.WARNING, "Node {0} has no executors. Cannot update the Computer instance of it", n.getNodeName());
              }
          }
      }
docs: /* =================================================================================================================
  Computer API uses package protection heavily
  ==============================================================================================================