auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> private ResourceChangeDetector getChangeDetector() { <END> if (_changeDetector.get() == null) { _changeDetector.set(new ResourceChangeDetector()); } return _changeDetector.get(); }</code><technical_language>this method need synchronized? safe assume maximum of 1 thread running this part of pipeline</technical_language>

Target:
private ResourceChangeDetector getChangeDetector() { if (CHANGE_DETECTOR_THREAD_LOCAL.get() == null) { CHANGE_DETECTOR_THREAD_LOCAL.set(new ResourceChangeDetector()); } return CHANGE_DETECTOR_THREAD_LOCAL.get(); }
Source:
<code>public void acquire( Channel channel ) throws TransportThrottleException { <START> if ( !isDurationAlreadyExceeded( channel ) ) <END> { ThrottleLock lock = channel.attr( LOCK_KEY ).get(); long startTimeMillis = 0; while ( channel.isOpen() && !channel.isWritable() ) { if ( maxLockDuration > 0 ) { long currentTimeMillis = clock.millis(); if ( startTimeMillis == 0 ) { startTimeMillis = currentTimeMillis; } else { if ( currentTimeMillis - startTimeMillis > maxLockDuration ) { setDurationExceeded( channel ); throw new TransportThrottleException( String.format( "Bolt connection [%s] will be closed because the client did not consume outgoing buffers for %s which is not expected.", channel.remoteAddress(), DurationFormatUtils.formatDurationHMS( maxLockDuration ) ) ); } } } try { lock.lock( channel, 1000 ); } catch ( InterruptedException ex ) { Thread.currentThread().interrupt(); } } } }</code><technical_language>nice throw #acquire() is invoked a channel expired duration. Callers close channel TransportThrottleException call #acquire() again</technical_language>

Target:
public void acquire( Channel channel ) throws TransportThrottleException { if ( !isDurationAlreadyExceeded( channel ) ) { ThrottleLock lock = channel.attr( LOCK_KEY ).get(); long startTimeMillis = 0; while ( channel.isOpen() && !channel.isWritable() ) { if ( maxLockDuration > 0 ) { long currentTimeMillis = clock.millis(); if ( startTimeMillis == 0 ) { startTimeMillis = currentTimeMillis; } else { if ( currentTimeMillis - startTimeMillis > maxLockDuration ) { setDurationExceeded( channel ); throw new TransportThrottleException( String.format( "Bolt connection [%s] will be closed because the client did not consume outgoing buffers for %s which is not expected.", channel.remoteAddress(), DurationFormatUtils.formatDurationHMS( maxLockDuration ) ) ); } } } try { lock.lock( channel, 1000 ); } catch ( InterruptedException ex ) { Thread.currentThread().interrupt(); throw new RuntimeException( ex ); } } } }
Source:
<code>public PagedMessage getMessage(int messageNumber) { if (messageNumber < 0) { return null; } <START> long size = lastSeenProducerIndex; <END> if (messageNumber >= size) { while ((size = producerIndex) == RESIZING) { Thread.yield(); } if (messageNumber >= size) { return null; } LAST_PRODUCER_INDEX_UPDATER.lazySet(this, size); } final AtomicChunk<PagedMessage> buffer; final int offset; if (messageNumber >= chunkSize) { offset = messageNumber & chunkMask; buffer = jump(messageNumber, size); } else { offset = messageNumber; buffer = consumerBuffer; } PagedMessage msg; while ((msg = buffer.get(offset)) == null) { Thread.yield(); } return msg; }</code><technical_language>naming of fields is missaligned, some places called size, some others call index, this is hard follow</technical_language>

Target:
public PagedMessage getMessage(int messageNumber) { return messages.get(messageNumber); }
Source:
<code><START> private void autoClose(Object object) { if (object instanceof AutoCloseable) { close((AutoCloseable) object); } else if (object instanceof AtomicBoolean) { toFalse((AtomicBoolean) object); } else if (object instanceof CountDownLatch) { openLatch((CountDownLatch) object); } else if (hasMethod(object.getClass(), "close")) { invokeMethod(object, "close"); <END> } else if (hasMethod(object.getClass(), "disconnect")) { invokeMethod(object, "disconnect"); } else if (hasMethod(object.getClass(), "stop")) { invokeMethod(object, "stop"); } }</code><technical_language>leverage method overloading here. Instead of toFalse((AtomicBoolean)object) close(object) a close(AtomicBoolean) in CompletionUtils</technical_language>

Target:
private void autoClose(Object object) { if (object instanceof AutoCloseable) { close((AutoCloseable) object); } else if (object instanceof AtomicBoolean) { close((AtomicBoolean) object); } else if (object instanceof CountDownLatch) { close((CountDownLatch) object); } else if (hasMethod(object.getClass(), "close")) { invokeMethod(object, "close"); } else if (hasMethod(object.getClass(), "disconnect")) { invokeMethod(object, "disconnect"); } else if (hasMethod(object.getClass(), "stop")) { invokeMethod(object, "stop"); } }
Source:
<code>public void aSynchronizeTimeActionIsPartOfABundledRequest(final Map<String, String> settings) throws Throwable { final BundleRequest request = (BundleRequest) ScenarioContext.Current().get(SCENARIO_CONTEXT_BUNDLE_REQUEST); final SynchronizeTimeRequest action = new SynchronizeTimeRequest(); action.setDeviation(-60); <START> action.setDst(false); <END> request.getActions().getActionList().add(action); this.increaseCount(SCENARIO_CONTEXT_BUNDLE_ACTIONS); }</code><technical_language>Is this test fail next week, summer time kicked in weekend</technical_language>

Target:
public void aSynchronizeTimeActionIsPartOfABundledRequest(final Map<String, String> settings) throws Throwable { final BundleRequest request = (BundleRequest) ScenarioContext.Current().get(SCENARIO_CONTEXT_BUNDLE_REQUEST); final SynchronizeTimeRequest action = this.defaultMapper .map(SynchronizeTimeRequestDataFactory.fromParameterMap(settings), SynchronizeTimeRequest.class); request.getActions().getActionList().add(action); this.increaseCount(SCENARIO_CONTEXT_BUNDLE_ACTIONS); }
Source:
<code>private DescribeAclsResponse createDescribeAclsResponse() { <START> return DescribeAclsResponse.prepareResponse(0, ApiError.NONE, Collections.singleton(new AclBinding( <END> new ResourcePattern(ResourceType.TOPIC, "mytopic", PatternType.LITERAL), new AccessControlEntry("User:ANONYMOUS", "*", AclOperation.WRITE, AclPermissionType.ALLOW)))); }</code><technical_language>this is a serialization/deserialization test, I rely prepareResponse</technical_language>

Target:
private DescribeAclsResponse createDescribeAclsResponse() { DescribeAclsResponseData data = new DescribeAclsResponseData() .setErrorCode(Errors.NONE.code()) .setErrorMessage(Errors.NONE.message()) .setThrottleTimeMs(0) .setResources(Collections.singletonList(new DescribeAclsResource() .setType(ResourceType.TOPIC.code()) .setName("mytopic") .setPatternType(PatternType.LITERAL.code()) .setAcls(Collections.singletonList(new AclDescription() .setHost("*") .setOperation(AclOperation.WRITE.code()) .setPermissionType(AclPermissionType.ALLOW.code()) .setPrincipal("User:ANONYMOUS"))))); return new DescribeAclsResponse(data); }
Source:
<code>private synchronized void initContext(ClientContext ctx, MasterInquireClient masterInquireClient) { mClosed.set(false); mMasterClientContext = MasterClientContext.newBuilder(ctx) .setMasterInquireClient(masterInquireClient).build(); mMetricsEnabled = getClusterConf().getBoolean(PropertyKey.USER_METRICS_COLLECTION_ENABLED); if (mMetricsEnabled) { <START> if (CommonUtils.PROCESS_TYPE.get() != CommonUtils.ProcessType.MASTER) { <END> try { InetSocketAddress masterAddr = masterInquireClient.getPrimaryRpcAddress(); mMasterClientContext.loadConf(masterAddr, true, true); } catch (UnavailableException e) { LOG.error("Failed to get master address during initialization", e); } catch (AlluxioStatusException ae) { LOG.error("Failed to load configuration from " + "meta master during initialization", ae); } } MetricsSystem.startSinks(getClusterConf().get(PropertyKey.METRICS_CONF_FILE)); MetricsHeartbeatContext.addHeartbeat(getClientContext(), masterInquireClient); } mFileSystemMasterClientPool = new FileSystemMasterClientPool(mMasterClientContext); mBlockMasterClientPool = new BlockMasterClientPool(mMasterClientContext); mWorkerGroup = NettyUtils.createEventLoop(NettyUtils.getUserChannel(getClusterConf()), getClusterConf().getInt(PropertyKey.USER_NETWORK_NETTY_WORKER_THREADS), String.format("alluxio-client-nettyPool-%s-%%d", mId), true); mUriValidationEnabled = ctx.getUriValidationEnabled(); }</code><technical_language>sense report client metrics master</technical_language>

Target:
private synchronized void initContext(ClientContext ctx, MasterInquireClient masterInquireClient) { mClosed.set(false); mMasterClientContext = MasterClientContext.newBuilder(ctx) .setMasterInquireClient(masterInquireClient).build(); mMetricsEnabled = getClusterConf().getBoolean(PropertyKey.USER_METRICS_COLLECTION_ENABLED); if (mMetricsEnabled) { MetricsSystem.startSinks(getClusterConf().get(PropertyKey.METRICS_CONF_FILE)); MetricsHeartbeatContext.addHeartbeat(getClientContext(), masterInquireClient); } mFileSystemMasterClientPool = new FileSystemMasterClientPool(mMasterClientContext); mBlockMasterClientPool = new BlockMasterClientPool(mMasterClientContext); mWorkerGroup = NettyUtils.createEventLoop(NettyUtils.getUserChannel(getClusterConf()), getClusterConf().getInt(PropertyKey.USER_NETWORK_NETTY_WORKER_THREADS), String.format("alluxio-client-nettyPool-%s-%%d", mId), true); mUriValidationEnabled = ctx.getUriValidationEnabled(); }
Source:
<code><START> public static <T> T defaultValueForClass(final Class<T> clazz) <END> { if (clazz == Float.class) { return (T) defaultFloatValue(); } else if (clazz == Double.class) { return (T) defaultDoubleValue(); } else if (clazz == Long.class) { return (T) defaultLongValue(); } else if (clazz == String.class) { return (T) defaultStringValue(); } else { return null; } }</code><technical_language>Missing a unit test ensure maintainability</technical_language>

Target:
public static <T> T defaultValueForClass(final Class<T> clazz) { if (clazz == Float.class) { return (T) defaultFloatValue(); } else if (clazz == Double.class) { return (T) defaultDoubleValue(); } else if (clazz == Long.class) { return (T) defaultLongValue(); } else if (clazz == Number.class) { return (T) defaultDoubleValue(); } else if (clazz == String.class) { return (T) defaultStringValue(); } else { return null; } }
Source:
<code>protected ICommand getAfterSetCommand(SetRequest request) { CompositeCommand compositeCommand = new CompositeCommand("Set RTPort Name and Kind"); EStructuralFeature feature = request.getFeature(); if (UMLPackage.eINSTANCE.getTypedElement_Type().equals(feature)) { Object newValue = request.getValue(); EObject elementToEdit = request.getElementToEdit(); if ((newValue instanceof Type) && (elementToEdit instanceof Port)) { Port port = (Port) elementToEdit; if (SystemElementsUtils.isSystemProtocol((Collaboration) newValue)) { ICommand cmd = getSetSAPKindCommand(port); if (null != cmd) { compositeCommand.add(cmd); } } if (Strings.isNullOrEmpty(((Port) elementToEdit).getName()) || NewElementUtil.isCreatedElement(elementToEdit)) { String name = ((Type) newValue).getName(); if (!Strings.isNullOrEmpty(name)) { String newName = NewElementUtil.getUniqueName(port, (Type) newValue); ICommand <START> result = <END> new SetValueCommand(new SetRequest(request.getElementToEdit(), UMLPackage.eINSTANCE.getNamedElement_Name(), newName)); if (null != result) { compositeCommand.add(result); } } } } } return compositeCommand.isEmpty() ? super.getAfterSetCommand(request) : compositeCommand; }</code><technical_language>confusing this intermediary variable named 'result' actual result of method previously named 'result' is renamed</technical_language>

Target:
protected ICommand getAfterSetCommand(SetRequest request) { CompositeCommand compositeCommand = new CompositeCommand("Set RTPort Name and Kind"); EStructuralFeature feature = request.getFeature(); if (UMLPackage.eINSTANCE.getTypedElement_Type().equals(feature)) { Object newValue = request.getValue(); EObject elementToEdit = request.getElementToEdit(); if ((newValue instanceof Type) && (elementToEdit instanceof Port)) { Port port = (Port) elementToEdit; if (SystemElementsUtils.isSystemProtocol((Collaboration) newValue)) { ICommand cmd = getSetSAPKindCommand(port); if (null != cmd) { compositeCommand.add(cmd); } } if (Strings.isNullOrEmpty(((Port) elementToEdit).getName()) || NewElementUtil.isCreatedElement(elementToEdit)) { String name = ((Type) newValue).getName(); if (!Strings.isNullOrEmpty(name)) { String newName = NewElementUtil.getUniqueName(port, (Type) newValue); ICommand setNameCommand = new SetValueCommand(new SetRequest(request.getElementToEdit(), UMLPackage.eINSTANCE.getNamedElement_Name(), newName)); if (null != setNameCommand) { compositeCommand.add(setNameCommand); } } } } } return compositeCommand.isEmpty() ? super.getAfterSetCommand(request) : compositeCommand; }
Source:
<code>public Map destroy(String vmId) { final VM vm = getActiveHost().getRunningVMs().get(vmId); if (vm == null) { log.info("VM not found: " + vmId); throw new RuntimeException("VM not found: " + vmId); } vm.setStatus(VM.VMStatus.PoweringDown); Map resultMap = map(); Map statusMap = map(); <START> new TaskWrapper().addTask(TaskType.SHUTDOWN_VM, 5000l, vm); <END> statusMap.put("message", "Machine destroyed"); statusMap.put("code", "0"); resultMap.put("status", statusMap); return resultMap; }</code><technical_language>create new object time? TaskWrapper instance variable in this class</technical_language>

Target:
public Map destroy(String vmId) { final VM vm = getActiveHost().getRunningVMs().get(vmId); if (vm == null) { log.info("VM not found: " + vmId); throw new RuntimeException("VM not found: " + vmId); } vm.setStatus(VM.VMStatus.PoweringDown); Map resultMap = map(); Map statusMap = map(); TaskWrapper.addTask(TaskType.SHUTDOWN_VM, 5000l, vm); statusMap.put("message", "Machine destroyed"); statusMap.put("code", "0"); resultMap.put("status", statusMap); return resultMap; }
Source:
<code>private JsonObject applyImplicitNested(JsonObject partialResult, List<String> nestedPathHierarchy, ElasticsearchSearchPredicateContext context) { if ( nestedPathHierarchy.isEmpty() ) { return partialResult; } <START> String lastPath = nestedPathHierarchy.remove( 0 ); <END> if ( context.isExplicitNested( lastPath ) ) { return applyImplicitNested( partialResult, nestedPathHierarchy, context ); } JsonObject innerObject = new JsonObject(); PATH_ACCESSOR.set( innerObject, lastPath ); QUERY_ACCESSOR.set( innerObject, applyImplicitNested( partialResult, nestedPathHierarchy, context ) ); JsonObject outerObject = new JsonObject(); outerObject.add( "nested", innerObject ); return outerObject; }</code><technical_language>This line converted a simple loop instead of recursion + a mutable collection. easier read, LinkedList allocation. E.g.: JsonObject result = partialResult; for ( String nestedPath : nestedPathHierarchy ) { if ( context.isNested( nestedPath ) ) { // skip this implicit nested continue; } JsonObject innerObject = new JsonObject(); PATH_ACCESSOR.set( innerObject, lastPath ); QUERY_ACCESSOR.set( innerObject, applyImplicitNested( partialResult, nestedPathHierarchy, context ) ); JsonObject outerObject = new JsonObject(); outerObject.add( "nested", innerObject ); result = outerObject; }</technical_language>

Target:
public static JsonObject applyImplicitNested(JsonObject partialResult, List<String> nestedPathHierarchy, ElasticsearchSearchPredicateContext context) { JsonObject result = partialResult; for ( int i = 0; i < nestedPathHierarchy.size(); i++ ) { String path = nestedPathHierarchy.get( nestedPathHierarchy.size() - 1 - i ); if ( path.equals( context.getNestedPath() ) ) { break; } JsonObject innerObject = new JsonObject(); PATH_ACCESSOR.set( innerObject, path ); QUERY_ACCESSOR.set( innerObject, result ); JsonObject outerObject = new JsonObject(); outerObject.add( "nested", innerObject ); result = outerObject; } return result; }
Source:
<code>protected void executeCommand() { VDSGroup vdsGroup = getVdsGroup(); boolean initSucceeded = true; if (vdsGroup.supportsTrustedService()) { <START> setSucceeded(initTrustedService()); <END> } if (vdsGroup.supportsVirtService()) { initSucceeded = initVirtResources(); } if (initSucceeded && vdsGroup.supportsGlusterService()) { initSucceeded = initGlusterHost(); } setSucceeded(initSucceeded); }</code><technical_language>please initSucceeded instead of setSucceeded (this is a bug fix introduced lately)</technical_language>

Target:
protected void executeCommand() { VDSGroup vdsGroup = getVdsGroup(); boolean initSucceeded = true; if (vdsGroup.supportsTrustedService()) { initSucceeded = initTrustedService(); } if (initSucceeded && vdsGroup.supportsVirtService()) { initSucceeded = initVirtResources(); } if (initSucceeded && vdsGroup.supportsGlusterService()) { initSucceeded = initGlusterHost(); } setSucceeded(initSucceeded); }
Source:
<code>public PluginIsolatedClassloader(String jarDir) throws FreedomoticException { super(Thread.currentThread().getContextClassLoader()); FileFilter jarFilter = (File pathname) -> pathname.getName().endsWith(".jar"); File[] jarFiles = new File(jarDir).listFiles(jarFilter); URL[] urls; if (null != jarFiles) { urls = new URL[jarFiles.length]; for (int i = 0; i < jarFiles.length; i++) { try { urls[i] = jarFiles[i].toURI().toURL(); } catch (MalformedURLException e) { <START> throw new FreedomoticException( <END> "Could not get URL for JAR file: " + jarFiles[i], e); } } } else { urls = new URL[0]; } childClassLoader = new ChildURLClassLoader(urls, this.getParent()); }</code><technical_language>Please FreedomoticRuntimeException</technical_language>

Target:
public PluginIsolatedClassloader(String jarDir) { super(Thread.currentThread().getContextClassLoader()); File[] jarFiles = new File(jarDir).listFiles((File pathname) -> pathname.getName().endsWith(".jar")); URL[] urls; if (null != jarFiles) { urls = new URL[jarFiles.length]; for (int i = 0; i < jarFiles.length; i++) { try { urls[i] = jarFiles[i].toURI().toURL(); } catch (MalformedURLException e) { throw new FreedomoticRuntimeException( "Could not get URL for JAR file: " + jarFiles[i]); } } } else { urls = new URL[0]; } childClassLoader = new ChildURLClassLoader(urls, this.getParent()); }
Source:
<code>public JsonObject getNearestPlace(BigDecimal latitude, BigDecimal longitude) throws IOException, MalformedURLException { JsonObject places = this.getEventPlaces(latitude, longitude); JsonArray features = places.getJsonArray("features"); <START> JsonObject feature = features.get(0).asJsonObject(); <END> return feature; }</code><technical_language>update this work is implemented in GeoserveRegionsService ? i.e. features.getJsonObject(0)</technical_language>

Target:
public JsonObject getNearestPlace(BigDecimal latitude, BigDecimal longitude) throws IOException, MalformedURLException { JsonObject places = this.getEventPlaces(latitude, longitude); JsonObject feature = places.getJsonArray("features").getJsonObject(0); return feature; }
Source:
<code><START> DeferredRequestCreator(RequestCreator creator, ImageView target) { <END> this(creator, target, null); }</code><technical_language>Is this constructor used? delete</technical_language>

Target:
@TestOnly DeferredRequestCreator(RequestCreator creator, ImageView target) { this(creator, target, null); }
Source:
<code>public TestAccumuloDistributedQueries() { <START> super(() -> createAccumuloQueryRunner(ImmutableMap.of()), FeatureSelection.allFeatures().excluding(ADD_COLUMN, DROP_COLUMN, DELETE)); <END> }</code><technical_language>static import allFeatures</technical_language>

Target:
public TestAccumuloDistributedQueries() { super(allFeatures().excluding(ADD_COLUMN, DROP_COLUMN, DELETE_DATA), () -> createAccumuloQueryRunner(ImmutableMap.of())); }
Source:
<code>public MarkerItem getMarkerItem(IMarker marker) { Map<IMarker, MarkerEntry> entryMap = markerToEntryMap; if (entryMap == null) { entryMap = new HashMap<>(); <START> for (MarkerEntry markerEntry : markerEntryArray) { <END> IMarker nextMarker = markerEntry.getMarker(); if (nextMarker != null) { entryMap.put(nextMarker, markerEntry); } } markerToEntryMap = entryMap; } if (entryMap.containsKey(marker)) { return entryMap.get(marker); } return null; }</code><technical_language>loop iterates mutable array, is guarded "this" lock, loop is guarded "this". If fix MT issue here, need guard inconsistent data in array, is changed in synchronized sort* methods. end entries in entryMap elements multiple times while sorting of array. easiest fix original issue is getMarkerItem() synchronized</technical_language>

Target:
public synchronized MarkerItem getMarkerItem(IMarker marker) { if (markerToEntryMap == null) { markerToEntryMap = new HashMap<>(); for (MarkerEntry markerEntry : markerEntryArray) { IMarker nextMarker = markerEntry.getMarker(); if (nextMarker != null) { markerToEntryMap.put(nextMarker, markerEntry); } } } if (markerToEntryMap.containsKey(marker)) { return markerToEntryMap.get(marker); } return null; }
Source:
<code>public static void main(final String[] args) { final CommandLine application = new CommandLine(new MantaCLI()); <START> application.registerConverter(Path.class, s -> Paths.get(s)); <END> List<CommandLine> parsedCommands = null; try { parsedCommands = application.parse(args); } catch (CommandLine.ParameterException ex) { System.err.println(ex.getMessage()); CommandLine.usage(new MantaCLI(), System.err); return; } MantaCLI cli = (MantaCLI) parsedCommands.get(0).getCommand(); if (cli.isHelpRequested) { application.usage(System.out); return; } if (cli.isVersionRequested) { System.out.println("java-manta-client: " + MantaVersion.VERSION); return; } if (parsedCommands.size() == 1) { application.usage(System.err); return; } CommandLine deepest = parsedCommands.get(parsedCommands.size() - 1); MantaSubCommand subcommand = (MantaSubCommand) deepest.getCommand(); if (subcommand.isHelpRequested) { CommandLine.usage(deepest.getCommand(), System.err); return; } if (subcommand.logLevel != null) { Logger root = (Logger)LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); root.setLevel(Level.valueOf(subcommand.logLevel.toString())); } subcommand.run(); }</code><technical_language>nit: this written application.registerConverter(Path.class, Paths::get);</technical_language>

Target:
public static void main(final String[] args) { final CommandLine application = new CommandLine(new MantaCLI()); application.registerConverter(Path.class, Paths::get); List<CommandLine> parsedCommands = null; try { parsedCommands = application.parse(args); } catch (CommandLine.ParameterException ex) { System.err.println(ex.getMessage()); CommandLine.usage(new MantaCLI(), System.err); return; } MantaCLI cli = (MantaCLI) parsedCommands.get(0).getCommand(); if (cli.isHelpRequested) { application.usage(System.out); return; } if (cli.isVersionRequested) { System.out.println("java-manta-client: " + MantaVersion.VERSION); return; } if (parsedCommands.size() == 1) { application.usage(System.err); return; } CommandLine deepest = parsedCommands.get(parsedCommands.size() - 1); MantaSubCommand subcommand = (MantaSubCommand) deepest.getCommand(); if (subcommand.isHelpRequested) { CommandLine.usage(deepest.getCommand(), System.err); return; } if (subcommand.logLevel != null) { Logger root = (Logger)LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); root.setLevel(Level.valueOf(subcommand.logLevel.toString())); } subcommand.run(); }
Source:
<code>public static HTTPMonitoringConfig build() { ConfigProvider configProvider = DataHolder.getInstance().getConfigProvider(); <START> HTTPMonitoringConfig configurationObject = null; <END> if (configProvider == null) { if (DataHolder.getInstance().getBundleContext() != null) { throw new RuntimeException( "Failed to populate HTTPMonitoringConfig Configuration. Config Provider is Null."); } String deploymentYamlPath = System.getProperty(DEPLOYMENT_YAML_SYS_PROPERTY); if (deploymentYamlPath == null || deploymentYamlPath.isEmpty()) { logger.info("System property '" + DEPLOYMENT_YAML_SYS_PROPERTY + "' is not set. Default deployment.yaml file will be used."); deploymentYamlPath = HTTPMonitoringConfig.class.getResource("/deployment.yaml").getPath(); } else if (!Files.exists(Paths.get(deploymentYamlPath))) { String msg = "Couldn't find " + deploymentYamlPath; throw new RuntimeException(msg); } try { configProvider = ConfigProviderFactory.getConfigProvider(Paths.get(deploymentYamlPath), null); DataHolder.getInstance().setConfigProvider(configProvider); } catch (ConfigurationException e) { throw new RuntimeException("Error loading deployment.yaml Configuration", e); } } try { configurationObject = DataHolder.getInstance().getConfigProvider().getConfigurationObject(HTTPMonitoringConfig.class); } catch (ConfigurationException e) { logger.error("Error loading configurations from deployment.yaml", e); configurationObject = new HTTPMonitoringConfig(); } return configurationObject; }</code><technical_language>Redundant null assignment</technical_language>

Target:
public static HTTPMonitoringConfig build() { ConfigProvider configProvider = DataHolder.getInstance().getConfigProvider(); HTTPMonitoringConfig configurationObject; if (configProvider == null) { if (DataHolder.getInstance().getBundleContext() != null) { throw new RuntimeException( "Failed to populate HTTPMonitoringConfig Configuration. Config Provider is Null."); } String deploymentYamlPath = System.getProperty(DEPLOYMENT_YAML_SYS_PROPERTY); if (deploymentYamlPath == null || deploymentYamlPath.isEmpty()) { logger.info("System property '" + DEPLOYMENT_YAML_SYS_PROPERTY + "' is not set. Default deployment.yaml file will be used."); deploymentYamlPath = HTTPMonitoringConfig.class.getResource("/" + DEPLOYMENT_YAML_FILE).getPath(); } else if (!Files.exists(Paths.get(deploymentYamlPath))) { throw new RuntimeException("Couldn't find " + deploymentYamlPath); } try { configProvider = ConfigProviderFactory.getConfigProvider(Paths.get(deploymentYamlPath), null); DataHolder.getInstance().setConfigProvider(configProvider); } catch (ConfigurationException e) { throw new RuntimeException("Error loading deployment.yaml Configuration", e); } } try { configurationObject = DataHolder.getInstance().getConfigProvider().getConfigurationObject(HTTPMonitoringConfig.class); } catch (ConfigurationException e) { throw new RuntimeException( "Error while loading " + HTTPMonitoringConfig.class.getName() + " from config provider", e); } return configurationObject; }
Source:
<code>private boolean sendSlackMessage(String channelName, SlackAttachment attachment) { if (!slackSession.isPresent()) { LOG.debug("No slack session present, not sending message to channel {}", attachment.toString(), channelName); return true; } Optional<SlackChannel> slackChannel = Optional.fromNullable(slackSession.get().findChannelByName(channelName)); if (!slackChannel.isPresent()) { LOG.warn("No slack channel found for name {}", channelName); return false; } SlackMessageHandle<SlackMessageReply> result = slackSession.get().sendMessage(slackChannel.get(), "", attachment); <START> if (!result.getReply().isOk()) { <END> LOG.warn("Failed to send slack message to channel: message: error: {}", channelName, attachment.toString(), result.getReply().getErrorMessage()); return false; } return true; }</code><technical_language>if (result ==null || !result.getReply().isOk()) if check code of library is handling exceptions gracefully: catch (Exception e) { // TODO : improve exception handling e.printStackTrace(); } end a null reply</technical_language>

Target:
private boolean sendSlackMessage(String channelName, SlackAttachment attachment) { if (!slackSession.isPresent()) { LOG.debug("No slack session present, not sending message to channel {}", attachment.toString(), channelName); return true; } Optional<SlackChannel> slackChannel = Optional.fromNullable(slackSession.get().findChannelByName(channelName)); if (!slackChannel.isPresent()) { LOG.warn("No slack channel found for name {}", channelName); return false; } SlackMessageHandle<SlackMessageReply> result = slackSession.get().sendMessage(slackChannel.get(), "", attachment); if (result == null) { LOG.warn("Failed to send slack message to channel: message: slack result was null", channelName, attachment.toString()); return false; } else if (!result.getReply().isOk()) { LOG.warn("Failed to send slack message to channel: message: error: {}", channelName, attachment.toString(), result.getReply().getErrorMessage()); return false; } return true; }
Source:
<code>private void warnAboutProblematicCredentials(GoogleCredentials credentials) { <START> if (credentials != null && <END> (credentials instanceof UserCredentials) && ((UserCredentials)credentials).getClientId().equals(CLOUDSDK_CLIENT_ID)) { LOGGER.log(Level.WARNING, CLOUDSDK_CREDENTIALS_WARNING); } }</code><technical_language>I credentials != null removed next line covers it</technical_language>

Target:
private void warnAboutProblematicCredentials(GoogleCredentials credentials) { if (credentials instanceof UserCredentials && ((UserCredentials)credentials).getClientId().equals(CLOUDSDK_CLIENT_ID)) { LOGGER.log(Level.WARNING, CLOUDSDK_CREDENTIALS_WARNING); } }
Source:
<code>public Subscription schedulePeriodically(final Action0 action, long initialDelay, long period, TimeUnit unit) { final long periodInNanos = unit.toNanos(period); final long startInNanos = TimeUnit.MILLISECONDS.toNanos(now()) + unit.toNanos(initialDelay); final MultipleAssignmentSubscription mas = new MultipleAssignmentSubscription(); final Action0 recursiveAction = new Action0() { long count = 0; @Override public void call() { if (!mas.isUnsubscribed()) { action.call(); long nextTick = startInNanos + (++count * periodInNanos); <START> SerialSubscription s = new SerialSubscription(); <END> mas.set(s); s.set(schedule(this, nextTick - TimeUnit.MILLISECONDS.toNanos(now()), TimeUnit.NANOSECONDS)); } } }; SerialSubscription s = new SerialSubscription(); mas.set(s); s.set(schedule(recursiveAction, initialDelay, unit)); return mas; }</code><technical_language>I is need change this here: initial SerialSubscription safely overwritted result of schedule is reentrant</technical_language>

Target:
public Subscription schedulePeriodically(final Action0 action, long initialDelay, long period, TimeUnit unit) { final long periodInNanos = unit.toNanos(period); final long startInNanos = TimeUnit.MILLISECONDS.toNanos(now()) + unit.toNanos(initialDelay); final MultipleAssignmentSubscription mas = new MultipleAssignmentSubscription(); final Action0 recursiveAction = new Action0() { long count = 0; @Override public void call() { if (!mas.isUnsubscribed()) { action.call(); long nextTick = startInNanos + (++count * periodInNanos); mas.set(schedule(this, nextTick - TimeUnit.MILLISECONDS.toNanos(now()), TimeUnit.NANOSECONDS)); } } }; MultipleAssignmentSubscription s = new MultipleAssignmentSubscription(); mas.set(s); s.set(schedule(recursiveAction, initialDelay, unit)); return mas; }
Source:
<code>public ResponseEntity update(@ApiParam(value = "The name of the user", required = true) @PathVariable String username, @RequestBody @Validated(UserForm.ExistingUser.class) UserForm userToUpdate, BindingResult bindingResult, Authentication authentication, @RequestHeader(HttpHeaders.ACCEPT) String accept) { <START> if (StringUtils.equals(username, "admin")) <END> { return getFailedResponseEntity(HttpStatus.FORBIDDEN, USER_UPDATE_FORBIDDEN, accept); } if (bindingResult.hasErrors()) { throw new RequestBodyValidationException(FAILED_UPDATE_USER, bindingResult); } if (!(authentication.getPrincipal() instanceof UserDetails)) { String message = "Unsupported logged user principal type: " + authentication.getPrincipal().getClass(); return getFailedResponseEntity(HttpStatus.BAD_REQUEST, message, accept); } final UserDetails loggedUser = (UserDetails) authentication.getPrincipal(); if (StringUtils.equals(loggedUser.getUsername(), username)) { return getFailedResponseEntity(HttpStatus.FORBIDDEN, OWN_USER_DELETE_FORBIDDEN, accept); } UserDto user = conversionService.convert(userToUpdate, UserDto.class); userService.updateByUsername(user); return getSuccessfulResponseEntity(SUCCESSFUL_UPDATE_USER, accept); }</code><technical_language>is guarantee admin user. In fact, if XML config is configured authentication provider (let's LDAP), configuration this user is longer present, owner of service decided delete admins "imported" LDAP</technical_language>

Target:
public ResponseEntity update(@ApiParam(value = "The name of the user", required = true) @PathVariable String username, @RequestBody @Validated(UserForm.ExistingUser.class) UserForm userToUpdate, BindingResult bindingResult, Authentication authentication, @RequestHeader(HttpHeaders.ACCEPT) String accept) { if (bindingResult.hasErrors()) { throw new RequestBodyValidationException(FAILED_UPDATE_USER, bindingResult); } if (!(authentication.getPrincipal() instanceof UserDetails)) { String message = "Unsupported logged user principal type: " + authentication.getPrincipal().getClass(); return getFailedResponseEntity(HttpStatus.BAD_REQUEST, message, accept); } final UserDetails loggedUser = (UserDetails) authentication.getPrincipal(); if (StringUtils.equals(loggedUser.getUsername(), username)) { return getFailedResponseEntity(HttpStatus.FORBIDDEN, OWN_USER_DELETE_FORBIDDEN, accept); } UserDto user = conversionService.convert(userToUpdate, UserDto.class); userService.updateByUsername(user); return getSuccessfulResponseEntity(SUCCESSFUL_UPDATE_USER, accept); }
Source:
<code>public VersionView() { Span text = new Span("Version view"); RouterLink back = new RouterLink("return", Login.class); <START> add(text, back); <END> }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') Remove this call a constructor overridable "add" method. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public VersionView() { Span text = new Span("Version view"); RouterLink back = new RouterLink("return", Login.class); back.setId("version-return"); add(text, back); }
Source:
<code>public Status list(ListOptions listOptions) { try { URL requestUrl = getNamespacedUrl(); if(listOptions.getLimit() != null) { requestUrl = new URL(URLUtils.join(requestUrl.toString(), "?limit=" + listOptions.getLimit().toString())); <START> } else if(listOptions.getContinue() != null) { <END> requestUrl = new URL(URLUtils.join(requestUrl.toString(), "?limit=" + listOptions.getLimit().toString() + "&continue=" + listOptions.getContinue())); } Request.Builder requestBuilder = new Request.Builder().get().url(requestUrl); return handleResponse(requestBuilder, Status.class); } catch (InterruptedException | ExecutionException | IOException e) { throw KubernetesClientException.launderThrowable(e); } }</code><technical_language>This good getLimit return null. Url builder in BaseOperation</technical_language>

Target:
public Status list(ListOptions listOptions) { try { HttpUrl.Builder urlBuilder = HttpUrl.get(getNamespacedUrl().toString()).newBuilder(); if(listOptions.getLimit() != null) { urlBuilder.addQueryParameter("limit", listOptions.getLimit().toString()); } if(listOptions.getContinue() != null) { urlBuilder.addQueryParameter("continue", listOptions.getContinue()); } if (listOptions.getResourceVersion() != null) { urlBuilder.addQueryParameter("resourceVersion", listOptions.getResourceVersion()); } if (listOptions.getFieldSelector() != null) { urlBuilder.addQueryParameter("fieldSelector", listOptions.getFieldSelector()); } if (listOptions.getLabelSelector() != null) { urlBuilder.addQueryParameter("labelSelector", listOptions.getLabelSelector()); } if (listOptions.getTimeoutSeconds() != null) { urlBuilder.addQueryParameter("timeoutSeconds", listOptions.getTimeoutSeconds().toString()); } if (listOptions.getAllowWatchBookmarks() != null) { urlBuilder.addQueryParameter("allowWatchBookmarks", listOptions.getAllowWatchBookmarks().toString()); } Request.Builder requestBuilder = new Request.Builder().get().url(urlBuilder.build()); return handleResponse(requestBuilder, Status.class); } catch (InterruptedException | ExecutionException | IOException e) { throw KubernetesClientException.launderThrowable(e); } }
Source:
<code><START> public Map<String, <END> Set<TestInfo>> getTestCollection() { return mTestCollection; }</code><technical_language>this needs public</technical_language>

Target:
private Map<String, Set<TestInfo>> getTestCollection() { return mTestCollection; }
Source:
<code>public Map<String, Optional<byte[]>> getPillKeyStoreByBatch(@Auth final AccessToken accessToken, <START> final Set<String> pillIds) { <END> return pillKeyStore.getBatch(pillIds); }</code><technical_language>want. want map converted a KeyStoreRecord object have</technical_language>

Target:
public Map<String, DeviceKeyStoreRecord> getPillKeyStoreByBatch(@Auth final AccessToken accessToken, final Set<String> pillIds) { return pillKeyStore.getKeyStoreRecordBatch(pillIds); }
Source:
<code>private void putCurrentIndicesToWriteMode() { try { <START> Logger.debug(this.getClass(), "Trying to set the current indices to Write mode"); <END> ESIndexUtil.putCurrentIndicesToWriteMode(); sendMessage("es.index.write.allow.message"); ReindexThread.setCurrentIndexReadOnly(false); this.stop(); } catch (final ESResponseException e) { Logger.info(ESReadOnlyMonitor.class, () -> e.getMessage()); } }</code><technical_language>remember supplier</technical_language>

Target:
private void putCurrentIndicesToWriteMode() { try { Logger.debug(this.getClass(), () -> "Trying to set the current indices to Write mode"); ElasticsearchUtil.setLiveAndWorkingIndicesToWriteMode(); sendMessage("es.index.write.allow.message"); ReindexThread.setCurrentIndexReadOnly(false); this.stop(); } catch (final ElasticsearchResponseException e) { Logger.info(ESReadOnlyMonitor.class, () -> e.getMessage()); } }
Source:
<code><START> public String getDBStackTemplate() throws TemplatingDoesNotSupportedException { <END> return ""; }</code><technical_language>-> is</technical_language>

Target:
public String getDBStackTemplate() throws TemplatingNotSupportedException { return ""; }
Source:
<code>public void testPon(final File tumorBam, final String tumorSample, final File normalBam, final String normalSample) throws Exception { Utils.resetRandomGenerator(); final File ponVcf = createTempFile("pon", ".vcf"); final String[] createPonArgs = { "-I", tumorBam.getAbsolutePath(), "-tumor", tumorSample, "-I", normalBam.getAbsolutePath(), "-normal", normalSample, "-R", b37_reference_20_21, "-L", "20", "-O", ponVcf.getAbsolutePath(), "-artifact_detection_mode" }; runCommandLine(createPonArgs); new Main().instanceMain(makeCommandLineArgs(Arrays.asList("-F", ponVcf.getAbsolutePath()), "IndexFeatureFile")); final File outputVcf = createTempFile("output", ".vcf"); final String[] callWithPonArgs = { "-I", tumorBam.getAbsolutePath(), "-tumor", tumorSample, "-I", normalBam.getAbsolutePath(), "-normal", normalSample, "-normal_panel", ponVcf.getAbsolutePath(), "-R", b37_reference_20_21, "-L", "20", "-O", outputVcf.getAbsolutePath() }; runCommandLine(callWithPonArgs); final Set<String> outputKeys = StreamSupport.stream(new FeatureDataSource<VariantContext>(outputVcf).spliterator(), false) .filter(vc -> vc.getFilters().isEmpty()) <START> .map(vc -> keyForVariant(vc)).collect(Collectors.toSet()); <END> Assert.assertEquals(outputKeys.size(), 0); }</code><technical_language>expect outputKeys empty count() .filter() check equals 0</technical_language>

Target:
public void testPon(final File tumorBam, final String tumorSample, final File normalBam, final String normalSample) throws Exception { Utils.resetRandomGenerator(); final File ponVcf = createTempFile("pon", ".vcf"); final String[] createPonArgs = { "-I", tumorBam.getAbsolutePath(), "-tumor", tumorSample, "-I", normalBam.getAbsolutePath(), "-normal", normalSample, "-R", b37_reference_20_21, "-L", "20", "-O", ponVcf.getAbsolutePath(), "-artifact_detection_mode" }; runCommandLine(createPonArgs); new Main().instanceMain(makeCommandLineArgs(Arrays.asList("-F", ponVcf.getAbsolutePath()), "IndexFeatureFile")); final File outputVcf = createTempFile("output", ".vcf"); final String[] callWithPonArgs = { "-I", tumorBam.getAbsolutePath(), "-tumor", tumorSample, "-I", normalBam.getAbsolutePath(), "-normal", normalSample, "-normal_panel", ponVcf.getAbsolutePath(), "-R", b37_reference_20_21, "-L", "20", "-O", outputVcf.getAbsolutePath() }; runCommandLine(callWithPonArgs); final long numVariants = StreamSupport.stream(new FeatureDataSource<VariantContext>(outputVcf).spliterator(), false) .filter(vc -> vc.getFilters().isEmpty()).count(); Assert.assertEquals(numVariants, 0); }
Source:
<code>public static StashCommentReport extractComments(String jsonBody) throws StashReportExtractionException { StashCommentReport result = new StashCommentReport(); try { JSONObject jsonComments = (JSONObject) new JSONParser().parse(jsonBody); JSONArray jsonValues = (JSONArray) jsonComments.get("values"); if (jsonValues != null) { for (Object obj : jsonValues.toArray()) { JSONObject jsonComment = (JSONObject) obj; long id = (long) jsonComment.get("id"); String message = (String) jsonComment.get("text"); JSONObject jsonAnchor = (JSONObject) jsonComment.get("anchor"); String path = (String) jsonAnchor.get("path"); Long line = (Long) jsonAnchor.get("line"); long version = (long) jsonComment.get("version"); <START> JSONObject jsonAuthor = (JSONObject) jsonComment.get("author"); <END> long authorId = (long) jsonAuthor.get("id"); String name = (String) jsonAuthor.get("name"); String slug = (String) jsonAuthor.get("slug"); String email = (String) jsonAuthor.get("email"); StashUser stashUser = new StashUser(authorId, name, slug, email); StashComment comment = new StashComment(id, message, path, line, stashUser, version); result.add(comment); } } } catch (ParseException e) { throw new StashReportExtractionException(e); } return result; }</code><technical_language>sense extractUser()? <LINK_0> emailAddress insteadof email, no</technical_language>

Target:
public static StashCommentReport extractComments(String jsonBody) throws StashReportExtractionException { StashCommentReport result = new StashCommentReport(); try { JSONObject jsonComments = (JSONObject) new JSONParser().parse(jsonBody); JSONArray jsonValues = (JSONArray) jsonComments.get("values"); if (jsonValues != null) { for (Object obj : jsonValues.toArray()) { JSONObject jsonComment = (JSONObject) obj; long id = (long) jsonComment.get("id"); String message = (String) jsonComment.get("text"); JSONObject jsonAnchor = (JSONObject) jsonComment.get("anchor"); String path = (String) jsonAnchor.get("path"); Long line = (Long) jsonAnchor.get("line"); long version = (long) jsonComment.get("version"); JSONObject jsonAuthor = (JSONObject) jsonComment.get("author"); StashUser stashUser = extractUser(jsonAuthor.toJSONString()); StashComment comment = new StashComment(id, message, path, line, stashUser, version); result.add(comment); } } } catch (ParseException e) { throw new StashReportExtractionException(e); } return result; }
Source:
<code>protected List<User> parseResultSet(ResultSet resultSet) throws DAOException { LinkedList<User> resultList = new LinkedList<>(); try { while (resultSet.next()) { User user = new User(); user.setId(resultSet.getInt("Id")); user.setFirstName(resultSet.getString("FirstName")); user.setLastName(resultSet.getString("LastName")); user.setLogin(resultSet.getString("Login")); user.setPassword(resultSet.getString("Password")); user.setEmail(resultSet.getString("Email")); <START> user.setRoleRef(resultSet.getString("RoleName")); <END> user.setCustomerTypeRef(resultSet.getString("TypeName")); user.setRegionRef(resultSet.getString("RegionName")); user.setStatus(resultSet.getString("Status")); resultList.add(user); } } catch (Exception e) { throw new DAOException(e); } return resultList; }</code><technical_language>rename Ref Reference()</technical_language>

Target:
protected List<User> parseResultSet(ResultSet resultSet) throws DAOException { LinkedList<User> resultList = new LinkedList<>(); try { while (resultSet.next()) { User user = new User(); user.setId(resultSet.getInt("Id")); user.setFirstName(resultSet.getString("FirstName")); user.setLastName(resultSet.getString("LastName")); user.setLogin(resultSet.getString("Login")); user.setPassword(resultSet.getString("Password")); user.setEmail(resultSet.getString("Email")); user.setRoleReference(resultSet.getString("RoleName")); user.setCustomerTypeReference(resultSet.getString("TypeName")); user.setRegionReference(resultSet.getString("RegionName")); user.setStatus(resultSet.getString("Status")); resultList.add(user); } } catch (Exception e) { throw new DAOException(e); } return resultList; }
Source:
<code>public void accept(Event<CcmKeyDeregisterRequest> requestEvent) { CcmKeyDeregisterRequest request = requestEvent.getData(); Selectable result; try { Stack stack = stackService.getByIdWithListsInTransaction(request.getResourceId()); if (Boolean.TRUE.equals(request.getUseCcm())) { LOGGER.debug("De-registering key from CCM. Cluster CRN: {}", stack.getResourceCrn()); try { <START> if (!entitlementService.ccmV2Enabled(request.getAccountId())) { <END> ccmResourceTerminationListener.deregisterCcmSshTunnelingKey(request.getActorCrn(), request.getAccountId(), request.getKeyId(), stack.getMinaSshdServiceId()); } else { ccmV2AgentTerminationListener.deregisterInvertingProxyAgent(stack.getCcmV2AgentCrn()); } } catch (Exception ex) { LOGGER.warn("CCM key deregistration failed", ex); } } else { LOGGER.info("CCM is DISABLED, skipping de-registering of key from CCM. Cluster CRN: {}", stack.getResourceCrn()); } result = new CcmKeyDeregisterSuccess(stack.getId()); } catch (Exception ex) { LOGGER.error("Stack retrieval for CCM key deregistration failed", ex); result = new StackFailureEvent(StackTerminationEvent.CCM_KEY_DEREGISTER_FAILED_EVENT.event(), request.getResourceId(), ex); } eventBus.notify(result.selector(), new Event<>(requestEvent.getHeaders(), result)); }</code><technical_language>CcmKeyDeregisterRequest Tunnel field instead of boolean deprecated. logic depend this</technical_language>

Target:
public void accept(Event<CcmKeyDeregisterRequest> requestEvent) { CcmKeyDeregisterRequest request = requestEvent.getData(); Selectable result; try { Stack stack = stackService.getByIdWithListsInTransaction(request.getResourceId()); try { if (request.getTunnel().useCcmV1()) { LOGGER.debug("De-registering MinaSshdServiceId '{}' from CCM. Cluster CRN: {}", stack.getMinaSshdServiceId(), stack.getResourceCrn()); ccmResourceTerminationListener.deregisterCcmSshTunnelingKey(request.getActorCrn(), request.getAccountId(), request.getKeyId(), stack.getMinaSshdServiceId()); LOGGER.debug("De-registered MinaSshdServiceId '{}' from CCM. Cluster CRN: {}", stack.getMinaSshdServiceId(), stack.getResourceCrn()); } else if (request.getTunnel().useCcmV2()) { LOGGER.debug("De-registering CcmV2AgentCrn '{}' from CCM. Cluster CRN: {}", stack.getCcmV2AgentCrn(), stack.getResourceCrn()); ccmV2AgentTerminationListener.deregisterInvertingProxyAgent(stack.getCcmV2AgentCrn()); LOGGER.debug("De-registered CcmV2AgentCrn '{}' from CCM. Cluster CRN: {}", stack.getCcmV2AgentCrn(), stack.getResourceCrn()); } else { LOGGER.debug("CCM is DISABLED, skipping de-registering of key from CCM. Cluster CRN: {}", stack.getResourceCrn()); } } catch (Exception ex) { LOGGER.warn("CCM key deregistration failed", ex); } result = new CcmKeyDeregisterSuccess(stack.getId()); } catch (Exception ex) { LOGGER.error("Stack retrieval for CCM key deregistration failed", ex); result = new StackFailureEvent(StackTerminationEvent.CCM_KEY_DEREGISTER_FAILED_EVENT.event(), request.getResourceId(), ex); } eventBus.notify(result.selector(), new Event<>(requestEvent.getHeaders(), result)); }
Source:
<code>public void dataCenterWithClusterSelectedItemChanged() { super.dataCenterWithClusterSelectedItemChanged(); if (getModel().getSelectedCluster() != null) { updateCpuProfile(getModel().getSelectedCluster().getId(), getCompatibilityVersion(), vm.getCpuProfileId()); } <START> if (getVm().getStatus().isSuspended() && <END> !getModel().getSelectedCluster().getCompatibilityVersion().equals(getVm().getCompatibilityVersion())) { getModel().getEditingEnabled().setMessage(getModel().constants.suspendedVMsWhenClusterChange()); } }</code><technical_language>SavingState RestoringState</technical_language>

Target:
public void dataCenterWithClusterSelectedItemChanged() { super.dataCenterWithClusterSelectedItemChanged(); if (getModel().getSelectedCluster() != null) { updateCpuProfile(getModel().getSelectedCluster().getId(), getCompatibilityVersion(), vm.getCpuProfileId()); } if (isWithMemoryVolume(getVm()) && !isClusterCompatibleWithMemorySnapshot()) { getModel().getEditingEnabled().setMessage(getModel().constants.suspendedVMsWhenClusterChange()); } }