Buggy code:
protected void logAvailableTemplates ( ConfigBag config ) { } protected SshMachineLocation createTemporarySshMachineLocation ( HostAndPort hostAndPort , LoginCredentials creds , ConfigBag config ) { } protected LoginCredentials createUser ( ComputeService computeService , NodeMetadata node , Optional < HostAndPort > hostAndPortOverride , ConfigBag config ) { } protected LoginCredentials initTemplateForCreateUser ( Template template , ConfigBag config ) { } protected static class UserCreation { public final LoginCredentials createdUserCredentials ; public final List < Statement > statements ; public UserCreation ( LoginCredentials creds , List < Statement > statements ) { } } protected JcloudsLocation . UserCreation createUserStatements ( @ Nullable Image image , ConfigBag config ) { } public JcloudsSshMachineLocation rebindMachine ( NodeMetadata metadata ) throws NoMachinesAvailableException { } public JcloudsSshMachineLocation rebindMachine ( Map < ? , ? > flags , NodeMetadata metadata ) throws NoMachinesAvailableException { } public JcloudsSshMachineLocation rebindMachine ( ConfigBag setup ) throws NoMachinesAvailableException { } public JcloudsSshMachineLocation rebindMachine ( Map < ? , ? > flags ) throws NoMachinesAvailableException { } @ Deprecated protected final JcloudsSshMachineLocation registerJcloudsSshMachineLocation ( NodeMetadata node , String vmHostname , Optional < HostAndPort > sshHostAndPort , ConfigBag setup ) throws IOException { } protected JcloudsSshMachineLocation registerJcloudsSshMachineLocation ( ComputeService computeService , NodeMetadata node , LoginCredentials initialCredentials , Optional < HostAndPort > sshHostAndPort , ConfigBag setup ) throws IOException { } @ Deprecated protected final JcloudsSshMachineLocation createJcloudsSshMachineLocation ( NodeMetadata node , String vmHostname , Optional < HostAndPort > sshHostAndPort , ConfigBag setup ) throws IOException { } protected JcloudsSshMachineLocation createJcloudsSshMachineLocation ( ComputeService computeService , NodeMetadata node , String vmHostname , Optional < HostAndPort > sshHostAndPort , ConfigBag setup ) throws IOException { Map < ? , ? > sshConfig = extractSshConfig ( setup , node ) ; String nodeAvailabilityZone = extractAvailabilityZone ( setup , node ) ; String nodeRegion = extractRegion ( setup , node ) ; if ( nodeRegion == null ) { nodeRegion = extractProvider ( setup , node ) ; } String address = ( sshHostAndPort . isPresent ( ) ) ? sshHostAndPort . get ( ) . getHostText ( ) : vmHostname ; try { Networking . getInetAddressWithFixedName ( address ) ; } catch ( Exception e ) { Exceptions . propagateIfFatal ( e ) ; JcloudsLocation . LOG . debug ( ( ( ( ( ( ( ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>resolve<seq2seq4repair_space>reported<seq2seq4repair_space>address<seq2seq4repair_space>'" + address ) + "'<seq2seq4repair_space>for<seq2seq4repair_space>" ) + vmHostname ) + "<seq2seq4repair_space>(" ) + ( setup . getDescription ( ) ) ) + "//" ) + node ) + "),<seq2seq4repair_space>requesting<seq2seq4repair_space>reachable<seq2seq4repair_space>address" ) ) ; if ( computeService == null ) throw Exceptions . propagate ( e ) ; address = JcloudsUtil . getFirstReachableAddress ( computeService . getContext ( ) , node ) ; } if ( JcloudsLocation . LOG . isDebugEnabled ( ) ) JcloudsLocation . LOG . debug ( "creating<seq2seq4repair_space>JcloudsSshMachineLocation<seq2seq4repair_space>representation<seq2seq4repair_space>for<seq2seq4repair_space>{}@{}<seq2seq4repair_space>({}//{})<seq2seq4repair_space>for<seq2seq4repair_space>{}//{}" , new Object [ ] { getUser ( setup ) , address , Entities . sanitize ( sshConfig ) , sshHostAndPort , setup . getDescription ( ) , node } ) ; if ( isManaged ( ) ) { <START_BUG> return getManagementContext ( ) . getLocationManager ( ) . createLocation ( brooklyn . location . LocationSpec . create ( JcloudsSshMachineLocation . class ) . configure ( "displayName" , vmHostname ) . configure ( "address" , address ) . configure ( JcloudsSshMachineLocation . SSH_PORT , ( sshHostAndPort . isPresent ( ) ? sshHostAndPort . get ( ) . getPort ( ) : node . getLoginPort ( ) ) ) . configure ( "user" , getUser ( setup ) ) . configure ( sshConfig ) . configure ( "config" , sshConfig ) . configure ( "jcloudsParent" , this ) . configure ( "node" , node ) . configureIfNotNull ( CLOUD_AVAILABILITY_ZONE_ID , nodeAvailabilityZone ) . configureIfNotNull ( CLOUD_REGION_ID , nodeRegion ) . configure ( CALLER_CONTEXT , setup . get ( CALLER_CONTEXT ) ) . configure ( SshMachineLocation . DETECT_MACHINE_DETAILS , setup . get ( SshMachineLocation . DETECT_MACHINE_DETAILS ) ) . configure ( SshMachineLocation . SCRIPT_DIR , setup . get ( SshMachineLocation . SCRIPT_DIR ) ) . configureIfNotNull ( USE_PORT_FORWARDING , setup . get ( USE_PORT_FORWARDING ) ) . configureIfNotNull ( PORT_FORWARDER , setup . get ( PORT_FORWARDER ) ) . configureIfNotNull ( PORT_FORWARDING_MANAGER , setup . get ( PORT_FORWARDING_MANAGER ) ) ) ; <END_BUG> } else { JcloudsLocation . LOG . warn ( ( ( "Using<seq2seq4repair_space>deprecated<seq2seq4repair_space>JcloudsSshMachineLocation<seq2seq4repair_space>constructor<seq2seq4repair_space>because<seq2seq4repair_space>" + ( this ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>managed" ) ) ; return new JcloudsSshMachineLocation ( MutableMap . builder ( ) . put ( "displayName" , vmHostname ) . put ( "address" , address ) . put ( "port" , ( sshHostAndPort . isPresent ( ) ? sshHostAndPort . get ( ) . getPort ( ) : node . getLoginPort ( ) ) ) . put ( "user" , getUser ( setup ) ) . putAll ( sshConfig ) . put ( "config" , sshConfig ) . put ( "callerContext" , setup . get ( CALLER_CONTEXT ) ) . putIfNotNull ( CLOUD_AVAILABILITY_ZONE_ID . getName ( ) , nodeAvailabilityZone ) . putIfNotNull ( CLOUD_REGION_ID . getName ( ) , nodeRegion ) . put ( USE_PORT_FORWARDING , setup . get ( USE_PORT_FORWARDING ) ) . put ( PORT_FORWARDER , setup . get ( PORT_FORWARDER ) ) . put ( PORT_FORWARDING_MANAGER , setup . get ( PORT_FORWARDING_MANAGER ) ) . build ( ) , this , node ) ; } } protected Map < String , Object > extractSshConfig ( ConfigBag setup , NodeMetadata node ) { } protected String extractAvailabilityZone ( ConfigBag setup , NodeMetadata node ) { } protected String extractRegion ( ConfigBag setup , NodeMetadata node ) { } protected String extractProvider ( ConfigBag setup , NodeMetadata node ) { } protected String extractNodeLocationId ( ConfigBag setup , NodeMetadata node , LocationScope scope ) { } @ Override public void release ( SshMachineLocation machine ) { } protected void releaseSafely ( SshMachineLocation machine ) { } protected void releaseNodeSafely ( NodeMetadata node ) { } protected void releaseNode ( String instanceId ) { } protected void releasePortForwarding ( SshMachineLocation machine ) { }

Fix:
return getManagementContext ( ) . getLocationManager ( ) . createLocation ( brooklyn . location . LocationSpec . create ( JcloudsSshMachineLocation . class ) . configure ( "displayName" , vmHostname ) . configure ( "address" , address ) . configure ( JcloudsSshMachineLocation . SSH_PORT , ( sshHostAndPort . isPresent ( ) ? sshHostAndPort . get ( ) . getPort ( ) : node . getLoginPort ( ) ) ) . configure ( "user" , getUser ( setup ) ) . configure ( sshConfig ) . configure ( "config" , sshConfig ) . configure ( "jcloudsParent" , this ) . configure ( "node" , node ) . configureIfNotNull ( CLOUD_AVAILABILITY_ZONE_ID , nodeAvailabilityZone ) . configureIfNotNull ( CLOUD_REGION_ID , nodeRegion ) . configure ( CALLER_CONTEXT , setup . get ( CALLER_CONTEXT ) ) . configure ( SshMachineLocation . DETECT_MACHINE_DETAILS , setup . get ( SshMachineLocation . DETECT_MACHINE_DETAILS ) ) . configureIfNotNull ( SCRIPT_DIR , setup . get ( SCRIPT_DIR ) ) . configureIfNotNull ( USE_PORT_FORWARDING , setup . get ( USE_PORT_FORWARDING ) ) . configureIfNotNull ( PORT_FORWARDER , setup . get ( PORT_FORWARDER ) ) . configureIfNotNull ( PORT_FORWARDING_MANAGER , setup . get ( PORT_FORWARDING_MANAGER ) ) ) ;