auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private ConfigurationObject getConfigurationObject(final List<GetResult> resultList) throws ProtocolAdapterException { final DataObject resultData = resultList.get(0).resultData(); LOGGER.info("Configuration object current complex data: {}", this.dlmsHelperService.getDebugInfo(resultData)); final LinkedList<DataObject> linkedList = resultData.value(); final DataObject GprsOperationModeData = linkedList.get(0); GprsOperationModeType gprsOperationMode = null; if (((Number) GprsOperationModeData.value()).longValue() == 1) { gprsOperationMode = GprsOperationModeType.ALWAYS_ON; } else { gprsOperationMode = GprsOperationModeType.TRIGGERED; } final DataObject flagsData = linkedList.get(1); if (flagsData == null) { throw new ProtocolAdapterException("DataObject expected to contain a configuration object is null."); } if (!(flagsData.value() instanceof BitString)) { throw new ProtocolAdapterException("Value in DataObject is not a BitString: " + resultData.value().getClass().getName()); } final byte[] flagByteArray = ((BitString) flagsData.value()).bitString(); return new ConfigurationObject(gprsOperationMode, new ConfigurationFlags( this.configurationObjectHelperService.toConfigurationFlags(flagByteArray))); }

Target:
private ConfigurationObject getConfigurationObject(final List<GetResult> resultList) throws ProtocolAdapterException { final DataObject resultData = resultList.get(0).resultData(); LOGGER.info("Configuration object current complex data: {}", this.dlmsHelperService.getDebugInfo(resultData)); final LinkedList<DataObject> linkedList = resultData.value(); if (linkedList == null || linkedList.isEmpty()) { throw new ProtocolAdapterException( "Expected data in result while retrieving current configuration object, but got nothing"); } final DataObject GprsOperationModeData = linkedList.get(0); if (GprsOperationModeData == null) { throw new ProtocolAdapterException( "Expected Gprs operation mode data in result while retrieving current configuration object, but got nothing"); } GprsOperationModeType gprsOperationMode = null; if (((Number) GprsOperationModeData.value()).longValue() == 1) { gprsOperationMode = GprsOperationModeType.ALWAYS_ON; } else if (((Number) GprsOperationModeData.value()).longValue() == 2) { gprsOperationMode = GprsOperationModeType.TRIGGERED; } final DataObject flagsData = linkedList.get(1); if (flagsData == null) { throw new ProtocolAdapterException( "Expected flag bit data in result while retrieving current configuration object, but got nothing"); } if (!(flagsData.value() instanceof BitString)) { throw new ProtocolAdapterException("Value in DataObject is not a BitString: " + resultData.value().getClass().getName()); } final byte[] flagByteArray = ((BitString) flagsData.value()).bitString(); return new ConfigurationObject(gprsOperationMode, new ConfigurationFlags( this.configurationObjectHelperService.toConfigurationFlags(flagByteArray))); }
Source:
protected void executeCommand() { initConnectionList(true); Set<StorageType> storageTypes = Collections.emptySet(); for (Map.Entry<StorageType, List<StorageServerConnections>> connectionToType : getConnectionsTypeMap().entrySet()) { disconnectStorageByType(connectionToType.getKey(), connectionToType.getValue()); storageTypes.add(connectionToType.getKey()); } for (StorageType storageType : storageTypes) { if (!StorageHelperDirector.getInstance().getItem(storageType).disconnectHostFromStoragePoolServersCommandCompleted(getParameters())) { auditLogDirector.log(new AuditLogableBase(getParameters().getVdsId()), AuditLogType.FAILED_TO_REGISTER_LIBVIRT_SECRET_ON_VDS); } } }

Target:
protected void executeCommand() { initConnectionList(true); Set<StorageType> storageTypes = new HashSet<StorageType>(); for (Map.Entry<StorageType, List<StorageServerConnections>> connectionToType : getConnectionsTypeMap().entrySet()) { disconnectStorageByType(connectionToType.getKey(), connectionToType.getValue()); if (!storageTypes.contains(connectionToType.getKey())) { storageTypes.add(connectionToType.getKey()); if (!StorageHelperDirector.getInstance().getItem(connectionToType.getKey()).disconnectHostFromStoragePoolServersCommandCompleted(getParameters())) { auditLogDirector.log(new AuditLogableBase(getParameters().getVdsId()), AuditLogType.FAILED_TO_REGISTER_LIBVIRT_SECRET_ON_VDS); } } } }
Source:
private Map<DisplayType, VmDeviceType> parseDisplayProtocols(int osId, Version version) { Map<DisplayType, VmDeviceType> parseDisplayProtocols = new HashMap<DisplayType, VmDeviceType>(); String displayProtocolValue = getValueByVersion(idToUnameLookup.get(osId), "displayProtocols", version); if (displayProtocolValue != null) { String[] displayProtocolList = displayProtocolValue.split(","); if (displayProtocolList != null && displayProtocolList.length > 0) { for (String displayProtocol : displayProtocolList) { String[] displayProtocolSplit = displayProtocol.split("/"); if (displayProtocolSplit != null && displayProtocolSplit.length == 2) { DisplayType displayType = DisplayType.valueOf(displayProtocolSplit[0].trim()); VmDeviceType vmDeviceType = VmDeviceType.getByName(displayProtocolSplit[1].trim()); if (displayType != null && vmDeviceType != null) { parseDisplayProtocols.put(displayType, vmDeviceType); } } } } } return parseDisplayProtocols; }

Target:
private Map<DisplayType, VmDeviceType> parseDisplayProtocols(int osId, Version version) { Map<DisplayType, VmDeviceType> parseDisplayProtocols = new HashMap<DisplayType, VmDeviceType>(); String displayProtocolValue = getValueByVersion(idToUnameLookup.get(osId), "displayProtocols", version); for (String displayProtocol : displayProtocolValue.split(",")) { Pair<String, String> pairs = parseDisplayProtocol(displayProtocol); if (pairs != null) { parseDisplayProtocols.put(DisplayType.valueOf(pairs.getFirst()), VmDeviceType.getByName(pairs.getSecond())); } } return parseDisplayProtocols; }
Source:
private void logFeedback(String feedbackText, String userResponse, String fileName) { Boolean wasGoodReminder; if (userResponse.equals("yes")) { wasGoodReminder = true; } else { wasGoodReminder = false; } ObaAnalytics.reportDestinationReminderFeedback(mFirebaseAnalytics, wasGoodReminder , ((!isEmpty(feedbackText))? feedbackText : null), fileName); Log.d (TAG, "User feedback logged to Firebase Analytics :: wasGoodReminder - " + wasGoodReminder + ", feedbackText - " + ((!isEmpty(feedbackText))? feedbackText : null) + ", filename - " + fileName); }

Target:
private void logFeedback(String feedbackText, String userResponse, String fileName) { Boolean wasGoodReminder; if (userResponse.equals(Application.get().getString(R.string.analytics_label_destination_reminder_yes))) { wasGoodReminder = true; } else { wasGoodReminder = false; } ObaAnalytics.reportDestinationReminderFeedback(mFirebaseAnalytics, wasGoodReminder , ((!isEmpty(feedbackText))? feedbackText : null), fileName); Log.d (TAG, "User feedback logged to Firebase Analytics :: wasGoodReminder - " + wasGoodReminder + ", feedbackText - " + ((!isEmpty(feedbackText))? feedbackText : null) + ", filename - " + fileName); }
Source:
private ConfigEntry.ConfigType configType(DescribeConfigsResponse.ConfigType type) { if (type == null) { return ConfigEntry.ConfigType.UNKNOWN; } ConfigEntry.ConfigType configType; switch (type) { case BOOLEAN: configType = ConfigEntry.ConfigType.BOOLEAN; break; case CLASS: configType = ConfigEntry.ConfigType.CLASS; break; case DOUBLE: configType = ConfigEntry.ConfigType.DOUBLE; break; case INT: configType = ConfigEntry.ConfigType.INT; break; case LIST: configType = ConfigEntry.ConfigType.LIST; break; case LONG: configType = ConfigEntry.ConfigType.LONG; break; case PASSWORD: configType = ConfigEntry.ConfigType.PASSWORD; break; case SHORT: configType = ConfigEntry.ConfigType.SHORT; break; case STRING: configType = ConfigEntry.ConfigType.STRING; break; case UNKNOWN: configType = ConfigEntry.ConfigType.UNKNOWN; break; default: throw new IllegalArgumentException("Unexpected config type " + type); } return configType; }

Target:
private ConfigEntry.ConfigType configType(DescribeConfigsResponse.ConfigType type) { if (type == null) { return ConfigEntry.ConfigType.UNKNOWN; } ConfigEntry.ConfigType configType; switch (type) { case BOOLEAN: configType = ConfigEntry.ConfigType.BOOLEAN; break; case CLASS: configType = ConfigEntry.ConfigType.CLASS; break; case DOUBLE: configType = ConfigEntry.ConfigType.DOUBLE; break; case INT: configType = ConfigEntry.ConfigType.INT; break; case LIST: configType = ConfigEntry.ConfigType.LIST; break; case LONG: configType = ConfigEntry.ConfigType.LONG; break; case PASSWORD: configType = ConfigEntry.ConfigType.PASSWORD; break; case SHORT: configType = ConfigEntry.ConfigType.SHORT; break; case STRING: configType = ConfigEntry.ConfigType.STRING; break; default: configType = ConfigEntry.ConfigType.UNKNOWN; } return configType; }
Source:
public void onNext(final AggregationMessage aggregationMessage) { final AvroClockMsg rcvMsg = codec.decode(aggregationMessage.getData().array()); final String workerId = aggregationMessage.getSourceId().toString(); switch (rcvMsg.getType()) { case RequestInitClockMsg: final int workerClock = initializeWorkerClock(workerId); final byte[] data = codec.encode(getReplyInitialClockMessage(globalMinimumClock, workerClock)); int retryCount = 0; while (true) { if (retryCount++ > MAXIMUM_RETRY_COUNTS) { throw new RuntimeException(String.format("Sending initialization message to %s has failed %d times", workerId, MAXIMUM_RETRY_COUNTS + 1)); } try { aggregationMaster.send(AGGREGATION_CLIENT_NAME, workerId, data); break; } catch (final NetworkException e) { LOG.log(Level.INFO, String.format("ClockManager failed to send initialization message to %s", workerId), e); } } break; case TickMsg: tickClock(workerId); break; case NetworkWaitingTimeMsg: LOG.entering(ClockManager.MessageHandler.class.getSimpleName(), "onNext"); LOG.log(Level.INFO, "Total network waiting time for clock of {0}: {1}", new Object[]{workerId, rcvMsg.getNetworkWaitingTimeMsg()}); LOG.exiting(ClockManager.MessageHandler.class.getSimpleName(), "onNext"); break; default: throw new RuntimeException("Unexpected message type: " + rcvMsg.getType().toString()); } }

Target:
public void onNext(final AggregationMessage aggregationMessage) { final AvroClockMsg rcvMsg = codec.decode(aggregationMessage.getData().array()); final String workerId = aggregationMessage.getSourceId().toString(); switch (rcvMsg.getType()) { case RequestInitClockMsg: final int workerClock = initializeWorkerClock(workerId); final byte[] data = codec.encode(getReplyInitialClockMessage(globalMinimumClock, workerClock)); int retryCount = 0; while (true) { if (retryCount++ > MAXIMUM_RETRY_COUNTS) { throw new RuntimeException(String.format("Sending initialization message to %s has failed %d times", workerId, MAXIMUM_RETRY_COUNTS + 1)); } try { aggregationMaster.send(AGGREGATION_CLIENT_NAME, workerId, data); break; } catch (final NetworkException e) { LOG.log(Level.INFO, String.format("ClockManager failed to send initialization message to %s", workerId), e); } } break; case TickMsg: tickClock(workerId); break; default: throw new RuntimeException("Unexpected message type: " + rcvMsg.getType().toString()); } }
Source:
public void exceptionCaught(ChannelHandlerContext ctx, Throwable thr) { if (thr.getCause() instanceof IllegalArgumentException) { if ("empty text".equals(thr.getCause().getMessage())) { } else { log.error(thr.getCause().getMessage(), thr.getCause()); } } else if (thr.getCause() instanceof TooLongFrameException) { log.warn(String.format("Long frame from %s", ctx.channel().remoteAddress())); HttpResponder.respond(ctx, null, HttpResponseStatus.BAD_REQUEST); } else { log.warn("Exception event received: ", thr); } }

Target:
public void exceptionCaught(ChannelHandlerContext ctx, Throwable thr) { if (thr.getCause() instanceof TooLongFrameException) { log.warn(String.format("Long frame from %s", ctx.channel().remoteAddress())); HttpResponder.respond(ctx, null, HttpResponseStatus.BAD_REQUEST); } else { log.warn(String.format("Exception event received from %s: ", ctx.channel().remoteAddress()), thr); } }
Source:
public static Context updateContext(Context context, String language) { final Locale newLocale = LocaleParser.findBestMatchingLocaleForLanguage(language); Locale.setDefault(newLocale); final Resources resources = context.getResources(); final Configuration config = resources.getConfiguration(); final Configuration newConfig = copyWithNewLocale(config, newLocale); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { return context.createConfigurationContext(newConfig); } else { resources.updateConfiguration(newConfig, resources.getDisplayMetrics()); return context; } }

Target:
public static Context updateContext(Context context, String language) { final Locale newLocale = LocaleParser.findBestMatchingLocaleForLanguage(language); Locale.setDefault(newLocale); final Resources resources = context.getResources(); final Configuration config = resources.getConfiguration(); final Configuration newConfig = copyWithNewLocale(config, newLocale); return context.createConfigurationContext(newConfig); }
Source:
protected PlotSeriesDto generatePlotSeriesDto(MetricDto metricDto) { double yMinimum = Double.MAX_VALUE; List<PointDto> list = new ArrayList<PointDto>(); List<MetricValueDto> metricList = new ArrayList<MetricValueDto>(); for(MetricValueDto value :metricDto.getValues()) { metricList.add(value); } Collections.sort(metricList, new Comparator<MetricValueDto>() { @Override public int compare(MetricValueDto o1, MetricValueDto o2) { if (o2.getSessionId() < o1.getSessionId()) { return 1; } else { return -1; } } }); for (MetricValueDto value: metricList) { double temp = Double.parseDouble(value.getValue()); list.add(new PointDto(value.getSessionId(), temp)); if (yMinimum == Double.MAX_VALUE || temp < yMinimum) yMinimum = temp; } String legend = metricDto.getMetricName().getMetricDisplayName(); PlotDatasetDto pdd = new PlotDatasetDto( list, legend, ColorCodeGenerator.getHexColorCode() ); StringBuilder headerBuilder = new StringBuilder(); headerBuilder.append(metricDto.getMetricName().getTest().getTaskName()). append(", "). append(metricDto.getMetricName().getMetricName()); PlotSeriesDto psd = new PlotSeriesDto( Arrays.asList(pdd), "Sessions" , metricDto.getMetricName().getMetricName(), headerBuilder.toString() ); psd.setYAxisMin(yMinimum); return psd; }

Target:
protected PlotSeriesDto generatePlotSeriesDto(MetricDto metricDto) { double yMinimum = Double.MAX_VALUE; List<PointDto> list = new ArrayList<PointDto>(); List<MetricValueDto> metricList = new ArrayList<MetricValueDto>(); for(MetricValueDto value :metricDto.getValues()) { metricList.add(value); } Collections.sort(metricList, new Comparator<MetricValueDto>() { @Override public int compare(MetricValueDto o1, MetricValueDto o2) { return o2.getSessionId() < o1.getSessionId() ? 1 : -1; } }); for (MetricValueDto value: metricList) { double temp = Double.parseDouble(value.getValue()); list.add(new PointDto(value.getSessionId(), temp)); if (yMinimum == Double.MAX_VALUE || temp < yMinimum) yMinimum = temp; } String legend = metricDto.getMetricName().getMetricDisplayName(); PlotDatasetDto pdd = new PlotDatasetDto( list, legend, ColorCodeGenerator.getHexColorCode() ); StringBuilder headerBuilder = new StringBuilder(); headerBuilder.append(metricDto.getMetricName().getTest().getTaskName()). append(", "). append(metricDto.getMetricName().getMetricName()); PlotSeriesDto psd = new PlotSeriesDto( Arrays.asList(pdd), "Sessions" , metricDto.getMetricName().getMetricName(), headerBuilder.toString() ); psd.setYAxisMin(yMinimum); return psd; }
Source:
public Element getElement(Object node) { if (node == null) { return null; } EObject notationElement = getNativeWidget(node); CSSDOMSemanticElementHelper helper = new CSSDOMSemanticElementHelper(); View canonicalNotationElement = helper.findPrimaryView(notationElement); if (canonicalNotationElement.getDiagram() == null) { return null; } return super.getElement(canonicalNotationElement); }

Target:
public Element getElement(Object node) { if (node == null) { return null; } EObject notationElement = getNativeWidget(node); View canonicalNotationElement = CSSDOMSemanticElementHelper.getInstance().findPrimaryView(notationElement); if (canonicalNotationElement.getDiagram() == null) { return null; } return super.getElement(canonicalNotationElement); }
Source:
public void setCurrentGroupExprData(Expression expr, Object obj) { Integer index = exprToIndexInGroupByData.get(expr); if (index != null) { if (currentGroupByExprData[index] != null) { throw DbException.throwInternalError(); } currentGroupByExprData[index] = obj; return; } index = exprToIndexInGroupByData.size(); exprToIndexInGroupByData.put(expr, index); if (index >= currentGroupByExprData.length) { currentGroupByExprData = Arrays.copyOf(currentGroupByExprData, currentGroupByExprData.length * 2); if (currentGroupsKey != null) { groupByData.put(currentGroupsKey, currentGroupByExprData); } } currentGroupByExprData[index] = obj; }

Target:
public void setCurrentGroupExprData(Expression expr, Object obj) { Integer index = exprToIndexInGroupByData.get(expr); if (index != null) { assert currentGroupByExprData[index] == null; currentGroupByExprData[index] = obj; return; } index = exprToIndexInGroupByData.size(); exprToIndexInGroupByData.put(expr, index); if (index >= currentGroupByExprData.length) { currentGroupByExprData = Arrays.copyOf(currentGroupByExprData, currentGroupByExprData.length * 2); if (currentGroupsKey != null) { groupByData.put(currentGroupsKey, currentGroupByExprData); } } currentGroupByExprData[index] = obj; }
Source:
public String getProviderUrl() { return redirectUrl; }

Target:
public String getProviderUrl() { return providerUrl; }
Source:
public List<Double> getAttributeAsDoubleList(String key, Double defaultValue) { return getAttributeAsList(key, x -> { if (x == null || x == VCFConstants.MISSING_VALUE_v4) { return defaultValue; } else if (x instanceof Double) { return (Double) x; } else { return Double.valueOf((String)x); } } ); }

Target:
public List<Double> getAttributeAsDoubleList(String key, Double defaultValue) { return getAttributeAsList(key, x -> { if (x == null || x == VCFConstants.MISSING_VALUE_v4) { return defaultValue; } else if (x instanceof Number) { return ((Number) x).doubleValue(); } else { return Double.valueOf((String)x); } }); }
Source:
public static ArrayList<VmNetworkInterface> buildVmNetworkInterfacesFromDevices(Map<String, Object> vmStruct) { ArrayList<VmNetworkInterface> nics = new ArrayList<>(); Object[] devices = (Object[]) vmStruct.get("devices"); if (devices != null) { for (Object device : devices) { Map<String, Object> deviceMap = (Map<String, Object>) device; if (VdsProperties.VM_INTERFACE_DEVICE_TYPE.equals(deviceMap.get(VdsProperties.Type))) { VmNetworkInterface nic = new VmNetworkInterface(); nic.setId(deviceMap.get(VdsProperties.DeviceId) != null ? new Guid((String)deviceMap.get(VdsProperties.DeviceId)) : null); nic.setMacAddress((String) deviceMap.get(VdsProperties.MAC_ADDR)); nic.setName((String) deviceMap.get(VdsProperties.Name)); nic.setNetworkName((String) deviceMap.get(VdsProperties.NETWORK)); nic.setType(VmInterfaceType.valueOf((String) deviceMap.get(VdsProperties.NIC_TYPE)).getValue()); if (deviceMap.containsKey(VdsProperties.Model)) { String model = (String) deviceMap.get(VdsProperties.Model); for (VmInterfaceType type : VmInterfaceType.values()) { if (model.equals(type.getInternalName())) { nic.setType(type.getValue()); break; } } } nics.add(nic); } } } return nics; }

Target:
public static ArrayList<VmNetworkInterface> buildVmNetworkInterfacesFromDevices(Map<String, Object> vmStruct) { ArrayList<VmNetworkInterface> nics = new ArrayList<>(); Object[] devices = (Object[]) vmStruct.get(VdsProperties.Devices); if (devices != null) { for (Object device : devices) { Map<String, Object> deviceMap = (Map<String, Object>) device; if (VdsProperties.VM_INTERFACE_DEVICE_TYPE.equals(deviceMap.get(VdsProperties.Type))) { VmNetworkInterface nic = new VmNetworkInterface(); nic.setId(Guid.createGuidFromString((String)deviceMap.get(VdsProperties.DeviceId))); nic.setMacAddress((String) deviceMap.get(VdsProperties.MAC_ADDR)); nic.setName((String) deviceMap.get(VdsProperties.Name)); nic.setNetworkName((String) deviceMap.get(VdsProperties.NETWORK)); nic.setType(VmInterfaceType.valueOf((String) deviceMap.get(VdsProperties.NIC_TYPE)).getValue()); if (deviceMap.containsKey(VdsProperties.Model)) { String model = (String) deviceMap.get(VdsProperties.Model); for (VmInterfaceType type : VmInterfaceType.values()) { if (model.equals(type.getInternalName())) { nic.setType(type.getValue()); break; } } } nics.add(nic); } } } return nics; }
Source:
public void reportTaskResult(TaskResult taskResult) throws JMSException { TextMessage message = session.createTextMessage("taskresult:" + propertiesBean.getProperty("engine.unique.id") + ":" + taskResult.serializeToString()); synchronized(producer) { producer.send(message, DeliveryMode.PERSISTENT, 2, 0); } log.debug("[{}] TaskResult for destination sent to dispatcher.", taskResult.getTaskId(), taskResult.getDestinationId()); }

Target:
public void reportTaskResult(TaskResult taskResult) throws JMSException { TextMessage message = session.createTextMessage("taskresult:" + propertiesBean.getProperty("engine.unique.id") + ":" + taskResult.serializeToString()); synchronized(producer) { producer.send(message, DeliveryMode.PERSISTENT, 2, 0); } log.info("[{}] TaskResult for destination sent to dispatcher.", taskResult.getTaskId(), taskResult.getDestinationId()); }
Source:
private static void processFile(File file, final CommandContext cmdCtx) throws IOException { try ( BufferedReader reader = new BufferedReader(new FileReader(file))) { String line = reader.readLine(); while (cmdCtx.getExitCode() == 0 && !cmdCtx.isTerminated() && line != null) { LOGGER.debug("Executing command " + line.trim()); cmdCtx.handle(line.trim()); line = reader.readLine(); } } catch (Throwable e) { LOGGER.error("Unexpected exception processing commands ", e); throw new IllegalStateException("Failed to process file '" + file.getAbsolutePath() + "'", e); } String warnFile = WildFlySecurityManager.getPropertyPrivileged("org.wildfly.internal.cli.boot.hook.script.warn.file", null); if (warnFile != null) { File warns = new File(warnFile); if (warns.exists()) { for (String line : Files.readAllLines(warns.toPath())) { LOGGER.warn(line); } } } String errorFile = WildFlySecurityManager.getPropertyPrivileged("org.wildfly.internal.cli.boot.hook.script.error.file", null); if (errorFile != null) { File errors = new File(errorFile); if (errors.exists()) { LOGGER.error("Error applying " + file + " CLI script. The Operations were executed but " + "there were unexpected values. See list of errors in " + errors); for (String line : Files.readAllLines(errors.toPath())) { LOGGER.error(line); } } } if (cmdCtx.getExitCode() != 0 || cmdCtx.isTerminated()) { throw new RuntimeException("Error applying " + file + " CLI script."); } }

Target:
private static void processFile(File file, final CommandContext cmdCtx) throws IOException { try ( BufferedReader reader = new BufferedReader(new FileReader(file))) { String line = reader.readLine(); while (cmdCtx.getExitCode() == 0 && !cmdCtx.isTerminated() && line != null) { ROOT_LOGGER.executeCommand(line.trim()); cmdCtx.handle(line.trim()); line = reader.readLine(); } } catch (Throwable e) { throw ROOT_LOGGER.unexpectedException(e, file); } String warnFile = WildFlySecurityManager.getPropertyPrivileged("org.wildfly.internal.cli.boot.hook.script.warn.file", null); if (warnFile != null) { File warns = new File(warnFile); if (warns.exists()) { StringBuilder warnBuilder = new StringBuilder(); for (String line : Files.readAllLines(warns.toPath())) { warnBuilder.append(line).append("\n"); } ROOT_LOGGER.warn(warnBuilder.toString()); } } String errorFile = WildFlySecurityManager.getPropertyPrivileged("org.wildfly.internal.cli.boot.hook.script.error.file", null); if (errorFile != null) { File errors = new File(errorFile); if (errors.exists()) { ROOT_LOGGER.unexpectedErrors(file, errors); StringBuilder errorBuilder = new StringBuilder(); for (String line : Files.readAllLines(errors.toPath())) { errorBuilder.append(line).append("\n"); } ROOT_LOGGER.error(errorBuilder.toString()); } } if (cmdCtx.getExitCode() != 0 || cmdCtx.isTerminated()) { throw new RuntimeException("Error applying " + file + " CLI script."); } }
Source:
public void setProducer(final Producer producer) { }

Target:
public void setProducer(final Producer producer) { producer.request(Long.MAX_VALUE); }
Source:
private LinkedHashSet<TypeaheadSearchResp> getMatch(Map<String, Set<Gene>> map, List<String> keywords, Boolean exactMatch) { LinkedHashSet<TypeaheadSearchResp> result = new LinkedHashSet<>(); if (map == null || keywords == null) { return result; } if (exactMatch == null) exactMatch = false; for (Map.Entry<String, Set<Gene>> entry : map.entrySet()) { if (entry.getValue().size() > 0) { for (Gene gene : entry.getValue()) { Set<Alteration> alterations = AlterationUtils.getAllAlterations(gene); for (String keyword : keywords) { if (!keyword.equals(entry.getKey())) result.addAll(convertVariant(AlterationUtils.lookupVariant(keyword, exactMatch, alterations), keyword)); } } } } return result; }

Target:
private LinkedHashSet<TypeaheadSearchResp> getMatch(Map<String, Set<Gene>> map, List<String> keywords, Boolean exactMatch) { LinkedHashSet<TypeaheadSearchResp> result = new LinkedHashSet<>(); if (map == null || keywords == null) { return result; } if (exactMatch == null) exactMatch = false; for (Map.Entry<String, Set<Gene>> entry : map.entrySet()) { if (entry.getValue().size() > 0) { for (Gene gene : entry.getValue()) { Set<Alteration> alterations = AlterationUtils.getAllAlterations(gene); if (keywords.size() > 2) { Set<Alteration> keywordsMatches = null; for (String keyword : keywords) { if (!keyword.equals(entry.getKey())) { List<Alteration> matches = AlterationUtils.lookupVariant(keyword, exactMatch, alterations); if (matches != null) { if (keywordsMatches == null) { keywordsMatches = new HashSet<>(); keywordsMatches.addAll(matches); } else { List<Alteration> intersection = (List<Alteration>) CollectionUtils.intersection(keywordsMatches, matches); keywordsMatches = new HashSet<>(); keywordsMatches.addAll(intersection); } } } } result.addAll(convertVariant(new ArrayList<>(keywordsMatches), "")); } else { for (String keyword : keywords) { if (!keyword.equals(entry.getKey())) result.addAll(convertVariant(AlterationUtils.lookupVariant(keyword, exactMatch, alterations), keyword)); } } } } } return result; }
Source:
void done(K key, T value) throws PromiseResolvedException; void fail(K key, Throwable error) throws PromiseResolvedException; void failAll(Throwable error) throws PromiseResolvedException; boolean failAllRemaining(Throwable error); Collection<BatchEntry<T>> values(); Set<Map.Entry<K, BatchEntry<T>>> entires(); static <K, T> BatchBuilder<K, T> builder() { return new BatchBuilder<>(); }

Target:
void done(K key, T value) throws PromiseResolvedException; void fail(K key, Throwable error) throws PromiseResolvedException; int failAll(Throwable error); Collection<BatchEntry<T>> values(); Set<Map.Entry<K, BatchEntry<T>>> entries(); static <K, T> BatchBuilder<K, T> builder() { return new BatchBuilder<>(); }
Source:
public void setExecutor(StripedExecutorService executor) { this.executor = executor; }

Target:
public final synchronized void setExecutor(StripedExecutorService executor) { if (running.get()) { throw new IllegalStateException("cannot set executor while connector is running"); } else { this.executor = executor; } }
Source:
protected <T> T list(Class<T> clazz) { return get(clazz,uri("/artifacts/"+ artifactType.value())).execute(); }

Target:
protected <T> T list(Class<T> clazz) { return get(clazz,uri(PATH_ARTIFACTS+URI_SEP+ artifactType.value())).execute(); }
Source:
public void afterUpdate(boolean isUpdateSucceeded) { if (!isUpdateSucceeded && newBlobID != null) { try { logger.info("Removing blob " + newBlobID + " since the update failed"); router.get().deleteBlob(newBlobID, SERVICE_ID).get(); } catch (Exception e) { logger.error("Failed to delete blob={} because of {}", newBlobID, e); accountServiceMetrics.accountDeletesToAmbryServerErrorCount.inc(); } } if (isUpdateSucceeded && oldBlobIDsToDelete != null) { for (String blobID : oldBlobIDsToDelete) { try { logger.info("Removing blob " + blobID); router.get().deleteBlob(blobID, SERVICE_ID).get(); } catch (Exception e) { logger.error("Failed to delete blob={} because of {}", blobID, e); accountServiceMetrics.accountDeletesToAmbryServerErrorCount.inc(); } } } }

Target:
public void afterUpdate(boolean isUpdateSucceeded) { if (!isUpdateSucceeded && newBlobID != null) { try { logger.info("Removing blob " + newBlobID + " since the update failed"); router.get().deleteBlob(newBlobID, SERVICE_ID).get(); } catch (Exception e) { logger.error("Failed to delete blob=" + newBlobID, e); accountServiceMetrics.accountDeletesToAmbryServerErrorCount.inc(); } } if (isUpdateSucceeded && oldBlobIDsToDelete != null) { for (String blobID : oldBlobIDsToDelete) { try { logger.info("Removing blob " + blobID); router.get().deleteBlob(blobID, SERVICE_ID).get(); } catch (Exception e) { logger.error("Failed to delete blob=" + blobID, e); accountServiceMetrics.accountDeletesToAmbryServerErrorCount.inc(); } } } }
Source:
private KItem(Term kLabel, Term kList, TermContext termContext, Tool tool) { super(Kind.KITEM); this.kLabel = kLabel; this.kList = kList; Definition definition = termContext.definition(); if (kLabel instanceof KLabelConstant && kList instanceof KList && !((KList) kList).hasFrame()) { KLabelConstant kLabelConstant = (KLabelConstant) kLabel; CacheTableColKey cacheTabColKey = null; CacheTableValue cacheTabVal = null; boolean enableCache = (tool != Tool.KOMPILE) && definition.sortPredicateRulesOn(kLabelConstant).isEmpty(); if (enableCache) { cacheTabColKey = new CacheTableColKey(kLabelConstant, (KList) kList); cacheTabVal = definition.SORT_CACHE_TABLE.get(cacheTabColKey); if (cacheTabVal != null) { sort = cacheTabVal.sort; isExactSort = cacheTabVal.isExactSort; possibleSorts = cacheTabVal.possibleSorts; return; } } cacheTabVal = computeSort(kLabelConstant, (KList) kList, termContext, tool); if (enableCache) { definition.SORT_CACHE_TABLE.put(cacheTabColKey, cacheTabVal); } sort = cacheTabVal.sort; isExactSort = cacheTabVal.isExactSort; possibleSorts = cacheTabVal.possibleSorts; } else { if (kLabel instanceof KLabelInjection) { assert kList.equals(KList.EMPTY); isExactSort = true; } else { isExactSort = false; } sort = kind.asSort(); possibleSorts = Collections.singleton(sort); } }

Target:
private KItem(Term kLabel, Term kList, TermContext termContext, Tool tool) { super(Kind.KITEM); this.kLabel = kLabel; this.kList = kList; Definition definition = termContext.definition(); if (kLabel instanceof KLabelConstant && kList instanceof KList && !((KList) kList).hasFrame()) { KLabelConstant kLabelConstant = (KLabelConstant) kLabel; CacheTableColKey cacheTabColKey = null; CacheTableValue cacheTabVal = null; boolean enableCache = (tool != Tool.KOMPILE) && definition.sortPredicateRulesOn(kLabelConstant).isEmpty(); if (enableCache) { cacheTabColKey = new CacheTableColKey(kLabelConstant, (KList) kList); cacheTabVal = definition.getSortCacheTable().get(cacheTabColKey); if (cacheTabVal != null) { sort = cacheTabVal.sort; isExactSort = cacheTabVal.isExactSort; possibleSorts = cacheTabVal.possibleSorts; return; } } cacheTabVal = computeSort(kLabelConstant, (KList) kList, termContext, tool); if (enableCache) { definition.getSortCacheTable().put(cacheTabColKey, cacheTabVal); } sort = cacheTabVal.sort; isExactSort = cacheTabVal.isExactSort; possibleSorts = cacheTabVal.possibleSorts; } else { if (kLabel instanceof KLabelInjection) { assert kList.equals(KList.EMPTY); isExactSort = true; } else { isExactSort = false; } sort = kind.asSort(); possibleSorts = Collections.singleton(sort); } }
Source:
public String etagFor(EnvironmentConfig entityFromServer) { if (entityFromServer instanceof MergeEnvironmentConfig || entityFromServer instanceof UnknownEnvironmentConfig) { return md5Hex(valueOf(hash(entityFromServer))); } return entityHashingService.md5ForEntity(entityFromServer); }

Target:
public String etagFor(EnvironmentConfig entityFromServer) { return entityHashingService.md5ForEntity(entityFromServer); }
Source:
private void mergeProperties(Properties properties, Map<String, String> configurationMap) { if (properties != null) { for (final String name : properties.stringPropertyNames()) if (!configurationMap.containsKey(name)) { configurationMap.put(name, properties.getProperty(name)); } } }

Target:
private static void mergeProperties(Properties properties, Map<String, String> configurationMap) { if (properties != null) { for (final String name : properties.stringPropertyNames()) { if (!configurationMap.containsKey(name)) { configurationMap.put(name, properties.getProperty(name)); } } } }
Source:
public static void main(String[] args) { System.out.println(" +----------------------------------------------+"); System.out.println(" | XBee Java Library Handle IO Samples Sample |"); System.out.println(" +----------------------------------------------+\n"); XBeeDevice localDevice = new XBeeDevice(PORT, BAUD_RATE); try { localDevice.open(); RemoteXBeeDevice remoteDevice = new RemoteXBeeDevice(localDevice, REMOTE_64_BIT_ADDRESS); remoteDevice.setDestinationAddress(localDevice.get64BitAddress()); remoteDevice.setIOConfiguration(IOLINE_IN, IOMode.DIGITAL_IN); remoteDevice.setDIOChangeDetection(CHANGE_DETECTION_MASK); remoteDevice.setIOSamplingRate(IO_SAMPLING_RATE); localDevice.startListeningForIOSamples(new IIOSampleReceiveListener() { @Override public void ioSampleReceived(IOSample ioSample, RemoteXBeeDevice remoteDevice) { System.out.println("New sample received from " + remoteDevice.get64BitAddress() + " >> " + IOLINE_IN + ": " + ioSample.getDigitalValue(IOLINE_IN)); } }); } catch (XBeeException e) { e.printStackTrace(); localDevice.close(); System.exit(1); } }

Target:
public static void main(String[] args) { System.out.println(" +----------------------------------------------+"); System.out.println(" | XBee Java Library Handle IO Samples Sample |"); System.out.println(" +----------------------------------------------+\n"); XBeeDevice localDevice = new XBeeDevice(PORT, BAUD_RATE); try { localDevice.open(); RemoteXBeeDevice remoteDevice = new RemoteXBeeDevice(localDevice, REMOTE_64_BIT_ADDRESS); remoteDevice.setDestinationAddress(localDevice.get64BitAddress()); remoteDevice.setIOConfiguration(DIGITAL_LINE, IOMode.DIGITAL_IN); remoteDevice.setIOConfiguration(ANALOG_LINE, IOMode.ADC); remoteDevice.setDIOChangeDetection(MONITORED_LINES); remoteDevice.setIOSamplingRate(IO_SAMPLING_RATE); localDevice.startListeningForIOSamples(new IIOSampleReceiveListener() { @Override public void ioSampleReceived(RemoteXBeeDevice remoteDevice, IOSample ioSample) { System.out.println("New sample received from " + remoteDevice.get64BitAddress() + " - " + ioSample); } }); } catch (XBeeException e) { e.printStackTrace(); localDevice.close(); System.exit(1); } }
Source:
public ShortBranchComponentsWithIssues(AnalysisMetadataHolder analysisMetadataHolder, DbClient dbClient) { this.analysisMetadataHolder = analysisMetadataHolder; this.dbClient = dbClient; }

Target:
public ShortBranchComponentsWithIssues(AnalysisMetadataHolder analysisMetadataHolder, DbClient dbClient) { this.uuid = analysisMetadataHolder.getUuid(); this.dbClient = dbClient; }
Source:
public String encodeUrlToUtf8(String urlStr) { urlStr = urlStr.replaceAll("http://", ""); try { urlStr = URLEncoder.encode(urlStr, "UTF-8"); } catch (UnsupportedEncodingException exp) { LOGGER.error("Failed to encode url [" + urlStr + "] to utf-8", exp); } urlStr = "http://" + urlStr; getContext().getResponse(); return urlStr; }

Target:
public String encodeUrlToUtf8(String urlStr) { return getCelementsWebService().encodeUrlToUtf8(urlStr); }
Source:
private void acquireLease() { try { if (lockStore.acquire(lock.getLockId())) { lock.input(LockEvent.LEASE_ACQUIRED); } } catch (WrongClusterException wce) { log.error("Lock: could not acquire lease due to trying to connect to a wrong cluster {}", lock.getLockId(), wce); throw wce; } catch (Exception e) { log.error("Lock: could not acquire lease {}", lock.getLockId(), e); } }

Target:
private void acquireLease() { try { if (lockStore.acquire(lock.getLockId())) { lock.input(LockEvent.LEASE_ACQUIRED); } } catch (Exception e) { log.error("Lock: could not acquire lease {}", lock.getLockId(), e); } }
Source:
public void showImpl (RepInfo info) { String status = null; String mime = info.getMimeType (); if (mime != null) { if (info.getWellFormed () == RepInfo.TRUE) { if (info.getValid () == RepInfo.TRUE) { status = "valid"; } else { status = "well-formed"; } } else { status = "not well-formed"; } } else { status = "not found"; } String md5 = null; List<?> list = info.getChecksum (); int len = list.size (); for (int i=0; i<len; i++) { Checksum checksum = (Checksum) list.get (i); if (checksum.getType ().equals (ChecksumType.MD5)) { md5 = checksum.getValue (); break; } } if (_nAudit == 0) { String margin = getIndent (++_level); String [][] attrs = { {"home", _home} }; _writer.println (margin + elementStart ("audit", attrs)); } String margn2 = getIndent (_level) + " "; String uri = info.getUri (); int n = uri.indexOf (_home); if (n == 0) { uri = uri.substring (_home.length () + 1); } String [][] attrs = { {"mime", mime }, {"status", status}, {"md5", md5} }; _writer.println (margn2 + element ("file", attrs, uri)); _nAudit++; }

Target:
public void showImpl (RepInfo info) { String status = null; String mime = info.getMimeType (); if (mime != null) { if (info.getWellFormed () == RepInfo.TRUE) { if (info.getValid () == RepInfo.TRUE) { status = "valid"; } else { status = "well-formed"; } } else { status = "not well-formed"; } } else { status = "not found"; } String md5 = null; for (Checksum checksum : info.getChecksum()) { if (checksum.getType ().equals (ChecksumType.MD5)) { md5 = checksum.getValue (); break; } } if (_nAudit == 0) { String margin = getIndent (++_level); String [][] attrs = { {"home", _home} }; _writer.println (margin + elementStart ("audit", attrs)); } String margn2 = getIndent (_level) + " "; String uri = info.getUri (); int n = uri.indexOf (_home); if (n == 0) { uri = uri.substring (_home.length () + 1); } String [][] attrs = { {"mime", mime }, {"status", status}, {"md5", md5} }; _writer.println (margn2 + element ("file", attrs, uri)); _nAudit++; }
Source:
private String getETag(File file) { try { return com.google.common.io.Files.asByteSource(file).hash(Hashing.md5()).toString(); } catch (IOException e) { Exceptions.ignore(e); } return null; }

Target:
private String getETag(File file) { return Hasher.md5().hashFile(file).toHexString(); }
Source:
private void performHardDeletes(List<MessageInfo> messageInfoList) throws StoreException { try { EnumSet<StoreGetOptions> getOptions = EnumSet.of(StoreGetOptions.Store_Include_Deleted, StoreGetOptions.Store_Include_Expired); List<BlobReadOptions> readOptions = new ArrayList<BlobReadOptions>(messageInfoList.size()); Map<StoreKey, MessageInfo> indexMessages = new HashMap<StoreKey, MessageInfo>(messageInfoList.size()); for (MessageInfo info : messageInfoList) { BlobReadOptions readInfo = getBlobReadInfo(info.getStoreKey(), getOptions); readOptions.add(readInfo); indexMessages.put(info.getStoreKey(), info); } StoreMessageReadSet readSet = log.getView(readOptions); Iterator<ReplaceInfo> hardDeleteIterator = hardDelete.replacementIterator(readSet, factory); Iterator<BlobReadOptions> readOptionsIterator = readOptions.iterator(); while (hardDeleteIterator.hasNext()) { ReplaceInfo replaceInfo = hardDeleteIterator.next(); long offsetToWriteAt = readOptionsIterator.next().getOffset(); if (replaceInfo != null) { log.writeFrom(replaceInfo.getChannel(), offsetToWriteAt, replaceInfo.getSize()); metrics.cleanupDoneCount.inc(1); } else { metrics.cleanupFailedCount.inc(1); } } } catch (IOException e) { throw new StoreException("IO exception while performing hard delete ", e, StoreErrorCodes.IOError); } }

Target:
private void performHardDeletes(List<MessageInfo> messageInfoList) throws StoreException { try { EnumSet<StoreGetOptions> getOptions = EnumSet.of(StoreGetOptions.Store_Include_Deleted); List<BlobReadOptions> readOptions = new ArrayList<BlobReadOptions>(messageInfoList.size()); for (MessageInfo info : messageInfoList) { try { BlobReadOptions readInfo = getBlobReadInfo(info.getStoreKey(), getOptions); readOptions.add(readInfo); } catch (StoreException e) { logger.error( "Failed to read blob info for blobid during hard deletes, ignoring the blob. Caught exception {}", info.getStoreKey(), e); } } StoreMessageReadSet readSet = log.getView(readOptions); Iterator<HardDeleteInfo> hardDeleteIterator = hardDelete.getHardDeleteMessages(readSet, factory); Iterator<BlobReadOptions> readOptionsIterator = readOptions.iterator(); while (hardDeleteIterator.hasNext()) { HardDeleteInfo hardDeleteInfo = hardDeleteIterator.next(); long offsetToWriteAt = readOptionsIterator.next().getOffset(); if (hardDeleteInfo != null) { log.writeFrom(hardDeleteInfo.getChannel(), offsetToWriteAt, hardDeleteInfo.getSize()); metrics.hardDeleteDoneCount.inc(1); try { throttler.maybeThrottle(hardDeleteInfo.getSize()); } catch (InterruptedException e) { logger.error("Caught interrupted exception, continuing "); } } else { metrics.hardDeleteFailedCount.inc(1); } } } catch (IOException e) { throw new StoreException("IO exception while performing hard delete ", e, StoreErrorCodes.IOError); } }
Source:
public static int getPercentCompleteFromTasksAndReviews(Artifact artifact) throws OseeCoreException { if (IAtsAction.isOfType(artifact)) { double percent = 0; for (IAtsTeamWorkflow team : AtsClientService.get().getWorkItemService().getTeams(artifact)) { if (!team.isCancelled()) { percent += getPercentCompleteFromTasksAndReviews((Artifact) team.getStoreObject()); } } if (percent == 0) { return 0; } Double rollPercent = percent / AtsClientService.get().getWorkItemService().getTeams(artifact).size(); return rollPercent.intValue(); } int spent = 0; int size = 0; if (artifact.isOfType(AtsArtifactTypes.TeamWorkflow)) { TeamWorkFlowArtifact TeamWorkFlowArtifact = (TeamWorkFlowArtifact) artifact; Collection<TaskArtifact> taskArts = TeamWorkFlowArtifact.getTaskArtifacts(); for (TaskArtifact taskArt : taskArts) { spent += PercentCompleteTotalUtil.getPercentCompleteTotal(taskArt, AtsClientService.get().getServices()); } size = taskArts.size(); } if (artifact.isOfType(AtsArtifactTypes.TeamWorkflow)) { TeamWorkFlowArtifact teamWf = (TeamWorkFlowArtifact) artifact; Collection<IAtsAbstractReview> reviewArts = AtsClientService.get().getReviewService().getReviews(teamWf); for (IAtsAbstractReview reviewArt : reviewArts) { spent += PercentCompleteTotalUtil.getPercentCompleteTotal(reviewArt, AtsClientService.get().getServices()); } size += reviewArts.size(); } if (size == 0) { return 0; } return spent / size; }

Target:
public static int getPercentCompleteFromTasksAndReviews(Artifact artifact) throws OseeCoreException { if (IAtsAction.isOfType(artifact)) { double percent = 0; for (IAtsTeamWorkflow team : AtsClientService.get().getWorkItemService().getTeams(artifact)) { if (!team.isCancelled()) { percent += getPercentCompleteFromTasksAndReviews((Artifact) team.getStoreObject()); } } if (percent == 0) { return 0; } Double rollPercent = percent / AtsClientService.get().getWorkItemService().getTeams(artifact).size(); return rollPercent.intValue(); } int spent = 0; int size = 0; if (IAtsTeamWorkflow.isOfType(artifact)) { TeamWorkFlowArtifact TeamWorkFlowArtifact = (TeamWorkFlowArtifact) artifact; Collection<TaskArtifact> taskArts = TeamWorkFlowArtifact.getTaskArtifacts(); for (TaskArtifact taskArt : taskArts) { spent += PercentCompleteTotalUtil.getPercentCompleteTotal(taskArt, AtsClientService.get().getServices()); } size = taskArts.size(); TeamWorkFlowArtifact teamWf = (TeamWorkFlowArtifact) artifact; Collection<IAtsAbstractReview> reviewArts = AtsClientService.get().getReviewService().getReviews(teamWf); for (IAtsAbstractReview reviewArt : reviewArts) { spent += PercentCompleteTotalUtil.getPercentCompleteTotal(reviewArt, AtsClientService.get().getServices()); } size += reviewArts.size(); } if (size == 0) { return 0; } return spent / size; }
Source:
public void awake_sleeping_awake_sleeping() { queueModeHelper.assertClientNotRegisterered(); queueModeHelper.client.start(); queueModeHelper.waitForRegistration(1); queueModeHelper.assertClientRegisterered(); assertArrayEquals(Link.parse("</>;rt=\"oma.lwm2m\",</1/0>,</2>,</3/0>,</2000/0>".getBytes()), queueModeHelper.getCurrentRegistration().getObjectLinks()); queueModeHelper.ensureClientAwake(); queueModeHelper.waitForAwakeTime(queueModeHelper.awaketime * 1010); queueModeHelper.ensureClientSleeping(); if (queueModeHelper.sleeptime != 0) { queueModeHelper.waitForUpdate(queueModeHelper.sleeptime * 1010); } else { queueModeHelper.waitForUpdate(1); } queueModeHelper.ensureClientAwake(); queueModeHelper.resetAwakeLatch(); queueModeHelper.waitForAwakeTime(queueModeHelper.awaketime * 1010); queueModeHelper.ensureClientSleeping(); queueModeHelper.client.stop(false); }

Target:
public void awake_sleeping_awake_sleeping() { queueModeHelper.assertClientNotRegisterered(); queueModeHelper.client.start(); queueModeHelper.waitForRegistration(1); queueModeHelper.assertClientRegisterered(); assertArrayEquals(Link.parse("</>;rt=\"oma.lwm2m\",</1/0>,</2>,</3/0>,</2000/0>".getBytes()), queueModeHelper.getCurrentRegistration().getObjectLinks()); queueModeHelper.ensureClientAwake(); queueModeHelper.waitForAwakeTime(awaketime * 1010); queueModeHelper.ensureClientSleeping(); queueModeHelper.client.triggerRegistrationUpdate(); queueModeHelper.waitForUpdate(1); queueModeHelper.ensureClientAwake(); queueModeHelper.resetAwakeLatch(); queueModeHelper.waitForAwakeTime(awaketime * 1010); queueModeHelper.ensureClientSleeping(); queueModeHelper.client.stop(false); }
Source:
public void endReporting() { if (!initialized()) { return; } if (startedReporting) { telescopeClient.endIngest(taskId); stoppedReporting = true; log.debug("Finished reporting to Telescope (taskId:)", taskId); } else { log.warn("Someone tried to stop a telescope report that has never started"); } }

Target:
public void endReporting() { if (!initialized()) { return; } if (startedReporting) { telescopeClient.endIngest(taskId); stoppedReporting = true; log.debug("Finished reporting to Telescope, taskId={}", taskId); } else { log.warn("Someone tried to stop a telescope report that has never started"); } }
Source:
public void testResetPassword_shouldUpdatePassword() { String username = "superuser"; PasswordResetBackingForm form = aPasswordResetBackingForm().withUsername(username).build(); controllerService.resetPassword(form); }

Target:
public void testResetPassword_shouldUpdatePassword() { String username = "superuser"; PasswordResetBackingForm form = aPasswordResetBackingForm().withUsername(username).build(); controllerService.resetPassword(form); verify(passwordResetService).resetUserPassword(username); }
Source:
private static int getRotationAngle(RotationOptions rotationOptions, EncodedImage encodedImage) { if (!rotationOptions.rotationEnabled()) { return RotationOptions.NO_ROTATION; } int rotationFromMetadata = extractOrientationFromMetadata(encodedImage); if (rotationOptions.useImageMetadata()) { return rotationFromMetadata; } int angle = rotationFromMetadata + rotationOptions.getForcedAngle(); while (angle >= FULL_ROUND) { angle -= FULL_ROUND; } return angle; }

Target:
private static int getRotationAngle(RotationOptions rotationOptions, EncodedImage encodedImage) { if (!rotationOptions.rotationEnabled()) { return RotationOptions.NO_ROTATION; } int rotationFromMetadata = extractOrientationFromMetadata(encodedImage); if (rotationOptions.useImageMetadata()) { return rotationFromMetadata; } return (rotationFromMetadata + rotationOptions.getForcedAngle()) % FULL_ROUND; }