auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ImmutableList<DiffAnalytics> parseDifferentialResults(JsonObject obj) { try { ImmutableList.Builder<DiffAnalytics> diffAnalyticsListBuilder = ImmutableList.builder(); JsonArray results = obj.getAsJsonArray("results"); for(JsonElement e : results) { DiffAnalytics diffAnalytics = buildDiffAnalyticObject(e); if(diffAnalytics != null) { diffAnalyticsListBuilder.add(diffAnalytics); } } return diffAnalyticsListBuilder.build(); } catch (RuntimeException e) { throw new RuntimeException("Input Json is missing a results field OR results field is not an Array",e); } }

Target:
public ImmutableList<DiffAnalytics> parseDifferentialResults(JsonObject obj) { try { ImmutableList.Builder<DiffAnalytics> diffAnalyticsListBuilder = ImmutableList.builder(); JsonArray results = obj.getAsJsonArray("results"); for(JsonElement e : results) { DiffAnalytics diffAnalytics = buildDiffAnalyticsObject(e); if(Optional.ofNullable(diffAnalytics).isPresent()) { diffAnalyticsListBuilder.add(diffAnalytics); } } return diffAnalyticsListBuilder.build(); } catch (IllegalFormatException e) { throw new RuntimeException("Input Json is missing a results field OR results field is not an Array",e.getCause()); } }
Source:
public void waitForRollups() throws InterruptedException { Thread.currentThread().sleep(LOCATOR_WAIT_FOR_ALL_SECS * 1000); }

Target:
protected void waitForRollups() throws InterruptedException { Thread.currentThread().sleep(LOCATOR_WAIT_FOR_ALL_SECS * 1000); }
Source:
public void visit(final Parameter n, final Void arg) { printJavaComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), false, arg); printModifiers(n.getModifiers()); if (n.getType() != null) { n.getType().accept(this, arg); } if (n.isVarArgs()) { printAnnotations(n.getVarArgsAnnotations(), false, arg); printer.print("..."); } if (n.getType() != null && !(n.getType() instanceof UnknownType)) { printer.print(" "); } n.getName().accept(this, arg); }

Target:
public void visit(final Parameter n, final Void arg) { printJavaComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), false, arg); printModifiers(n.getModifiers()); n.getType().accept(this, arg); if (n.isVarArgs()) { printAnnotations(n.getVarArgsAnnotations(), false, arg); printer.print("..."); } if (!(n.getType() instanceof UnknownType)) { printer.print(" "); } n.getName().accept(this, arg); }
Source:
protected void acceptRead(final SAMRecord rec, final ReferenceSequence ref) { if (recordFilter.filterOut(rec)) return; final String library = (rec.getReadGroup() == null) ? UNKNOWN_LIBRARY : getOrElse(rec.getReadGroup().getLibrary(), UNKNOWN_LIBRARY); if (!libraries.contains(library)) { throw new PicardException("Record contains library that is missing from header: " + library); } final ArtifactCounter counter = artifactCounters.get(library); final byte[] readBases = rec.getReadBases(); final byte[] readQuals = rec.getBaseQualities(); final int contextFullLength = 2 * CONTEXT_SIZE + 1; for (final AlignmentBlock block : rec.getAlignmentBlocks()) { for (int offset = 0; offset < block.getLength(); offset++) { final int readPos = block.getReadStart() + offset; final int refPos = block.getReferenceStart() + offset; final byte qual = readQuals[readPos - 1]; if (qual < MINIMUM_QUALITY_SCORE) continue; final char readBase = (char)readBases[readPos - 1]; if (readBase == 'N') continue; if (intervalMask != null && !intervalMask.get(ref.getContigIndex(), refPos)) continue; if (dbSnpMask != null && dbSnpMask.isDbSnpSite(ref.getName(), refPos)) continue; final int contextStartIndex = refPos - CONTEXT_SIZE - 1; if (contextStartIndex < 0 || contextStartIndex + contextFullLength > ref.length()) continue; final String context = getRefContext(ref, contextStartIndex, contextFullLength); if (context.contains("N")) continue; counter.countRecord(context, readBase, rec); } } }

Target:
protected void acceptRead(final SAMRecord rec, final ReferenceSequence ref) { if (recordFilter.filterOut(rec)) return; final String library = (rec.getReadGroup() == null) ? UNKNOWN_LIBRARY : getOrElse(rec.getReadGroup().getLibrary(), UNKNOWN_LIBRARY); if (!libraries.contains(library)) { throw new PicardException("Record contains library that is missing from header: " + library); } final int contextFullLength = 2 * CONTEXT_SIZE + 1; final ArtifactCounter counter = artifactCounters.get(library); final byte[] readBases = rec.getReadBases(); final byte[] readQuals; if (USE_OQ) { final byte[] tmp = rec.getOriginalBaseQualities(); readQuals = tmp == null ? rec.getBaseQualities() : tmp; } else { readQuals = rec.getBaseQualities(); } for (final AlignmentBlock block : rec.getAlignmentBlocks()) { for (int offset = 0; offset < block.getLength(); offset++) { final int readPos = block.getReadStart() + offset; final int refPos = block.getReferenceStart() + offset; final byte qual = readQuals[readPos - 1]; if (qual < MINIMUM_QUALITY_SCORE) continue; final char readBase = Character.toUpperCase((char)readBases[readPos - 1]); if (readBase == 'N') continue; if (intervalMask != null && !intervalMask.get(ref.getContigIndex(), refPos)) continue; if (dbSnpMask != null && dbSnpMask.isDbSnpSite(ref.getName(), refPos)) continue; final int contextStartIndex = refPos - CONTEXT_SIZE - 1; if (contextStartIndex < 0 || contextStartIndex + contextFullLength > ref.length()) continue; final String context = getRefContext(ref, contextStartIndex, contextFullLength); if (context.contains("N")) continue; counter.countRecord(context, readBase, rec); } } }
Source:
static Map<String, Long> getExternalResources(Configuration config, String suffix) { final Set<String> resourceSet = getExternalResourceSet(config); LOG.info("Enabled external resources: {}", resourceSet); if (resourceSet.isEmpty()) { return Collections.emptyMap(); } final Map<String, Long> externalResourceConfigs = new HashMap<>(); for (String resourceName: resourceSet) { final ConfigOption<Long> amountOption = key(ExternalResourceOptions.keyWithResourceNameAndSuffix(resourceName, ExternalResourceOptions.EXTERNAL_RESOURCE_AMOUNT_SUFFIX)) .longType() .defaultValue(0L); final ConfigOption<String> configKeyOption = key(ExternalResourceOptions.keyWithResourceNameAndSuffix(resourceName, suffix)) .stringType() .noDefaultValue(); final String configKey = config.getString(configKeyOption); final Long amount = config.getLong(amountOption); if (StringUtils.isNullOrWhitespaceOnly(configKey)) { LOG.warn("Could not find valid for {}", configKeyOption.key(), resourceName); break; } if (amount <= 0) { LOG.warn("The amount of the should be configured with a positive value.", resourceName); break; } if (externalResourceConfigs.put(configKey, amount) != null) { LOG.warn("Duplicate config key occurred for external resources, the one with amount will overwrite the value.", configKey, amount); } else { LOG.info("Add external resources configs with key value {}.", configKey, amount); } } return externalResourceConfigs; }

Target:
public static Map<String, Long> getExternalResources(Configuration config, String suffix) { final Set<String> resourceSet = getExternalResourceSet(config); LOG.info("Enabled external resources: {}", resourceSet); if (resourceSet.isEmpty()) { return Collections.emptyMap(); } final Map<String, Long> externalResourceConfigs = new HashMap<>(); for (String resourceName: resourceSet) { final ConfigOption<Long> amountOption = key(ExternalResourceOptions.getAmountConfigOptionForResource(resourceName)) .longType() .noDefaultValue(); final ConfigOption<String> configKeyOption = key(ExternalResourceOptions.getSystemConfigKeyConfigOptionForResource(resourceName, suffix)) .stringType() .noDefaultValue(); final String configKey = config.getString(configKeyOption); final Optional<Long> amountOpt = config.getOptional(amountOption); if (StringUtils.isNullOrWhitespaceOnly(configKey)) { LOG.warn("Could not find valid for {}. Will ignore that resource.", configKeyOption.key(), resourceName); continue; } if (!amountOpt.isPresent()) { LOG.warn("The amount of the should be configured. Will ignore that resource.", resourceName); continue; } else if (amountOpt.get() <= 0) { LOG.warn("The amount of the should be positive while finding {}. Will ignore that resource.", amountOpt.get(), resourceName); continue; } if (externalResourceConfigs.put(configKey, amountOpt.get()) != null) { LOG.warn("Duplicate config key occurred for external resources, the one named with amount will overwrite the value.", configKey, resourceName, amountOpt); } else { LOG.info("Add external resource config for with key value {}.", resourceName, configKey, amountOpt); } } return externalResourceConfigs; }
Source:
public int hashCode() { int result = name != null ? name.hashCode() : 0; result = 31 * result + (type != null ? type.hashCode() : 0); result = 31 * result + (description != null ? description.hashCode() : 0); result = 31 * result + (defaultValue != null ? defaultValue.hashCode() : 0); return result; }

Target:
public int hashCode() { return Objects.hashCode(name, type, description, defaultValue); }
Source:
void left() { session.end(); }

Target:
void left() { if (session != null) { session.end(); } }
Source:
private void proceedBalloonCheck() { if (getVdsManager().getCopyVds().isBalloonEnabled()) { VmBalloonInfo balloonInfo = vdsmVm.getVmStatistics().getVmBalloonInfo(); if (balloonInfo.getBalloonLastMemory() == null || balloonInfo.getBalloonLastMemory() == 0) { balloonInfo.setBalloonLastMemory(balloonInfo.getCurrentMemory()); return; } Guid vmId = vdsmVm.getVmDynamic().getId(); if (dbVm == null) { return; } if (isBalloonDeviceActiveOnVm(vdsmVm) && (Objects.equals(balloonInfo.getCurrentMemory(), balloonInfo.getBalloonMaxMemory()) || !isBalloonWorking(balloonInfo))) { vmBalloonDriverIsRequestedAndUnavailable(vmId); } else { vmBalloonDriverIsNotRequestedOrAvailable(vmId); } balloonInfo.setBalloonLastMemory(balloonInfo.getCurrentMemory()); if (vdsmVm.getVmStatistics().getusage_mem_percent() != null && vdsmVm.getVmStatistics().getusage_mem_percent() == 0 && balloonInfo.isBalloonDeviceEnabled() && !Objects.equals(balloonInfo.getCurrentMemory(), balloonInfo.getBalloonMaxMemory())) { guestAgentIsDownAndBalloonInfalted(vmId); } else { guestAgentIsUpOrBalloonDeflated(vmId); } } }

Target:
private void proceedBalloonCheck() { if (getVdsManager().getCopyVds().isBalloonEnabled()) { VmBalloonInfo balloonInfo = vdsmVm.getVmStatistics().getVmBalloonInfo(); Guid vmId = vdsmVm.getVmDynamic().getId(); if (dbVm == null) { return; } if (balloonInfo.getBalloonLastMemory() == null || balloonInfo.getBalloonLastMemory() == 0) { balloonInfo.setBalloonLastMemory(balloonInfo.getCurrentMemory()); return; } if (isBalloonDeviceActiveOnVm(vdsmVm) && (Objects.equals(balloonInfo.getCurrentMemory(), balloonInfo.getBalloonMaxMemory()) || !isBalloonWorking(balloonInfo))) { vmBalloonDriverIsRequestedAndUnavailable(vmId); } else { vmBalloonDriverIsNotRequestedOrAvailable(vmId); } balloonInfo.setBalloonLastMemory(balloonInfo.getCurrentMemory()); if (vdsmVm.getVmStatistics().getusage_mem_percent() != null && vdsmVm.getVmStatistics().getusage_mem_percent() == 0 && balloonInfo.isBalloonDeviceEnabled() && !Objects.equals(balloonInfo.getCurrentMemory(), balloonInfo.getBalloonMaxMemory())) { guestAgentIsDownAndBalloonInfalted(vmId); } else { guestAgentIsUpOrBalloonDeflated(vmId); } } }
Source:
@Override protected Void doInBackground(Void... voids) { if(!albumsMode && !all_photos && !fav_photos){ for(Media m: getAlbum().getSelectedMedia()){ bitmaps.add(getBitmap(m.getPath())); } }else if(!albumsMode && all_photos && !fav_photos){ for(Media m: selectedMedias){ bitmaps.add(getBitmap(m.getPath())); } } byte[] bytes = createGIFFromImages(bitmaps); File file = new File(Environment.getExternalStorageDirectory() + "/" + "Phimpme_gifs"); DateFormat dateFormat = new SimpleDateFormat("dMMMyyyy_HHmmss"); String date = dateFormat.format(Calendar.getInstance().getTime()); if(file.exists() && file.isDirectory()){ FileOutputStream outStream = null; try{ outStream = new FileOutputStream(file.getPath() + "/" + "GIF_"+date+".gif"); outStream.write(bytes); outStream.close(); }catch(Exception e){ e.printStackTrace(); } }else { if (file.mkdir()) { FileOutputStream outStream = null; try { outStream = new FileOutputStream(file.getPath() + "/" + "GIF_"+date+".gif"); outStream.write(bytes); outStream.close(); } catch (Exception e) { e.printStackTrace(); } } } return null; }

Target:
@Override protected Void doInBackground(Void... voids) { if(!albumsMode && !all_photos && !fav_photos){ for(Media m: getAlbum().getSelectedMedia()){ bitmaps.add(getBitmap(m.getPath())); } }else if(!albumsMode && all_photos && !fav_photos){ for(Media m: selectedMedias){ bitmaps.add(getBitmap(m.getPath())); } } byte[] bytes = createGIFFromImages(bitmaps); File file = new File(Environment.getExternalStorageDirectory() + "/" + "Phimpme_gifs"); DateFormat dateFormat = new SimpleDateFormat("ddMMyy_HHmm"); String date = dateFormat.format(Calendar.getInstance().getTime()); if(file.exists() && file.isDirectory()){ FileOutputStream outStream = null; try{ outStream = new FileOutputStream(file.getPath() + "/" + "GIF_"+date+".gif"); outStream.write(bytes); outStream.close(); }catch(Exception e){ e.printStackTrace(); } }else { if (file.mkdir()) { FileOutputStream outStream = null; try { outStream = new FileOutputStream(file.getPath() + "/" + "GIF_"+date+".gif"); outStream.write(bytes); outStream.close(); } catch (Exception e) { e.printStackTrace(); } } } return null; }
Source:
public ColumnValueSelector<?> makeColumnValueSelector(String columnName) { if (columnName.equals(Column.TIME_COLUMN_NAME)) { class TimeLongColumnSelector implements LongColumnSelector { @Override public long getLong() { return row.get().getTimestampFromEpoch(); } @Override public boolean isNull() { return false; } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("row", row); } } return new TimeLongColumnSelector(); } else { return new ColumnValueSelector() { @Override public double getDouble() { return DimensionHandlerUtils.nullToZeroDouble(row.get().getMetric(columnName)).doubleValue(); } @Override public boolean isNull() { return row.get().getRaw(columnName) == null; } @Override public float getFloat() { return DimensionHandlerUtils.nullToZeroDouble(row.get().getMetric(columnName)).floatValue(); } @Override public long getLong() { return DimensionHandlerUtils.nullToZeroDouble(row.get().getMetric(columnName)).longValue(); } @Nullable @Override public Object getObject() { return row.get().getRaw(columnName); } @Override public Class classOfObject() { return Object.class; } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("row", row); } }; } }

Target:
public ColumnValueSelector<?> makeColumnValueSelector(String columnName) { if (columnName.equals(Column.TIME_COLUMN_NAME)) { class TimeLongColumnSelector implements LongColumnSelector { @Override public long getLong() { return row.get().getTimestampFromEpoch(); } @Override public boolean isNull() { return false; } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("row", row); } } return new TimeLongColumnSelector(); } else { return new ColumnValueSelector() { @Override public boolean isNull() { return row.get().getRaw(columnName) == null; } @Override public double getDouble() { Number metric = row.get().getMetric(columnName); assert NullHandling.replaceWithDefault() || metric != null; return DimensionHandlerUtils.nullToZero(metric).doubleValue(); } @Override public float getFloat() { Number metric = row.get().getMetric(columnName); assert NullHandling.replaceWithDefault() || metric != null; return DimensionHandlerUtils.nullToZero(metric).floatValue(); } @Override public long getLong() { Number metric = row.get().getMetric(columnName); assert NullHandling.replaceWithDefault() || metric != null; return DimensionHandlerUtils.nullToZero(metric).longValue(); } @Nullable @Override public Object getObject() { return row.get().getRaw(columnName); } @Override public Class classOfObject() { return Object.class; } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("row", row); } }; } }
Source:
public void findEncounter_shouldThrowIllegalArgumentExceptionIfGivenEncounterParametersIsNull() throws Exception { EncounterParameters encounterParameters = null; Visit visit = visitService.getVisit(VISIT_ID_WITH_VOIDED_ENCOUNTER); expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("encounterParameters are required"); radiologyEncounterMatcher.findEncounter(visit, encounterParameters); }

Target:
public void findEncounter_shouldThrowIllegalArgumentExceptionIfGivenEncounterParametersIsNull() throws Exception { Visit visit = visitService.getVisit(VISIT_ID_WITH_VOIDED_ENCOUNTER); expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("encounterParameters are required"); radiologyEncounterMatcher.findEncounter(visit, null); }
Source:
public Map<TopicPartition, OffsetAndMetadata> committableOffsetsAndMetadata() { final Map<TopicPartition, Long> partitionTimes = extractPartitionTimes(); final Map<TopicPartition, OffsetAndMetadata> consumedOffsetsAndMetadata = new HashMap<>(consumedOffsets.size()); for (final Map.Entry<TopicPartition, Long> entry : consumedOffsets.entrySet()) { final TopicPartition partition = entry.getKey(); Long offset = partitionGroup.headRecordOffset(partition); if (offset == null) { try { offset = mainConsumer.position(partition); } catch (final TimeoutException error) { throw new IllegalStateException(error); } catch (final KafkaException fatal) { throw new StreamsException(fatal); } } final long partitionTime = partitionTimes.get(partition); consumedOffsetsAndMetadata.put(partition, new OffsetAndMetadata(offset, encodeTimestamp(partitionTime))); } return consumedOffsetsAndMetadata; }

Target:
public Map<TopicPartition, OffsetAndMetadata> committableOffsetsAndMetadata() { if (state() == State.CLOSED) { throw new IllegalStateException("Task " + id + " is closed."); } if (state() != State.RUNNING) { return Collections.emptyMap(); } final Map<TopicPartition, Long> partitionTimes = extractPartitionTimes(); final Map<TopicPartition, OffsetAndMetadata> consumedOffsetsAndMetadata = new HashMap<>(consumedOffsets.size()); for (final Map.Entry<TopicPartition, Long> entry : consumedOffsets.entrySet()) { final TopicPartition partition = entry.getKey(); Long offset = partitionGroup.headRecordOffset(partition); if (offset == null) { try { offset = mainConsumer.position(partition); } catch (final TimeoutException error) { throw new IllegalStateException(error); } catch (final KafkaException fatal) { throw new StreamsException(fatal); } } final long partitionTime = partitionTimes.get(partition); consumedOffsetsAndMetadata.put(partition, new OffsetAndMetadata(offset, encodeTimestamp(partitionTime))); } return consumedOffsetsAndMetadata; }
Source:
public org.apache.hadoop.hbase.client.CompactionState getCompactionState( final TableName tableName) { org.apache.hadoop.hbase.client.CompactionState compactionState = org.apache.hadoop.hbase.client.CompactionState.NONE; try { List<RegionInfo> regions = assignmentManager.getRegionStates().getRegionsOfTable(tableName, false); for (RegionInfo regionInfo : regions) { ServerName serverName = assignmentManager.getRegionStates().getRegionServerOfRegion(regionInfo); if (serverName == null) { continue; } ServerMetrics sl = serverManager.getLoad(serverName); if (sl == null) { continue; } RegionMetrics regionMetrics = sl.getRegionMetrics().get(regionInfo.getRegionName()); if (regionMetrics.getCompactionState() == org.apache.hadoop.hbase.client.CompactionState.MAJOR) { if (compactionState == org.apache.hadoop.hbase.client.CompactionState.MINOR) { compactionState = org.apache.hadoop.hbase.client.CompactionState.MAJOR_AND_MINOR; } else { compactionState = org.apache.hadoop.hbase.client.CompactionState.MAJOR; } } else if (regionMetrics.getCompactionState() == org.apache.hadoop.hbase.client.CompactionState.MINOR) { if (compactionState == org.apache.hadoop.hbase.client.CompactionState.MAJOR) { compactionState = org.apache.hadoop.hbase.client.CompactionState.MAJOR_AND_MINOR; } else { compactionState = org.apache.hadoop.hbase.client.CompactionState.MINOR; } } } } catch (Exception e) { compactionState = null; LOG.error("Exception when get compaction state for " + tableName.getNameAsString(), e); } return compactionState; }

Target:
public CompactionState getCompactionState(final TableName tableName) { CompactionState compactionState = CompactionState.NONE; try { List<RegionInfo> regions = assignmentManager.getRegionStates().getRegionsOfTable(tableName, false); for (RegionInfo regionInfo : regions) { ServerName serverName = assignmentManager.getRegionStates().getRegionServerOfRegion(regionInfo); if (serverName == null) { continue; } ServerMetrics sl = serverManager.getLoad(serverName); if (sl == null) { continue; } RegionMetrics regionMetrics = sl.getRegionMetrics().get(regionInfo.getRegionName()); if (regionMetrics.getCompactionState() == CompactionState.MAJOR) { if (compactionState == CompactionState.MINOR) { compactionState = CompactionState.MAJOR_AND_MINOR; } else { compactionState = CompactionState.MAJOR; } } else if (regionMetrics.getCompactionState() == CompactionState.MINOR) { if (compactionState == CompactionState.MAJOR) { compactionState = CompactionState.MAJOR_AND_MINOR; } else { compactionState = CompactionState.MINOR; } } } } catch (Exception e) { compactionState = null; LOG.error("Exception when get compaction state for " + tableName.getNameAsString(), e); } return compactionState; }
Source:
public PopulatedAssetsView() { domUtil = new Elemental2DomUtil(); }

Target:
public PopulatedAssetsView() { }
Source:
public StreamsAddressResponse getStreamsAddressSpace() { Map<UUID, StreamAddressSpace> streamsAddressSpace = new HashMap<>(logMetadata.getStreamsAddressSpaceMap()); return new StreamsAddressResponse(streamsAddressSpace); }

Target:
public StreamsAddressResponse getStreamsAddressSpace() { return new StreamsAddressResponse(logMetadata.getGlobalTail(), logMetadata.getStreamsAddressSpaceMap()); }
Source:
protected boolean validateQuota() { getParameters().setQuotaId(QuotaHelper.getInstance().getQuotaIdToConsume(getVmTemplate().getQuotaId(), getStoragePool())); for (DiskImage diskImage : mImages) { diskImage.setQuotaId(QuotaHelper.getInstance().getQuotaIdToConsume(getVmTemplate().getQuotaId(), getStoragePool())); } if (!isInternalExecution()) { return QuotaManager.validateMultiStorageQuota(getStoragePool().getQuotaEnforcementType(), getQuotaConsumeMap(), getCommandId(), getReturnValue().getCanDoActionMessages()); } return true; }

Target:
protected boolean validateQuota() { getParameters().setQuotaId(QuotaHelper.getInstance().getQuotaIdToConsume(getQuotaId(), getStoragePool())); for (DiskImage diskImage : mImages) { diskImage.setQuotaId(QuotaHelper.getInstance().getQuotaIdToConsume(getQuotaId(), getStoragePool())); } if (!isInternalExecution()) { return QuotaManager.validateMultiStorageQuota(getStoragePool().getQuotaEnforcementType(), getQuotaConsumeMap(), getCommandId(), getReturnValue().getCanDoActionMessages()); } return true; }
Source:
private List<String> resolvePartialGroupNames(String userName, String errMessage, String groupNames) throws PartialGroupNameException { if (Shell.WINDOWS) { throw new PartialGroupNameException("Does not support partial group" + " name resolution on Windows. " + errMessage); } if (groupNames.isEmpty()) { throw new PartialGroupNameException("The user name '" + userName + "' is not found. " + errMessage); } else { LOG.warn("Some group names for '{}' are not resolvable. {}", userName, errMessage); ShellCommandExecutor exec2 = createGroupIDExecutor(userName); try { exec2.execute(); return parsePartialGroupNames(groupNames, exec2.getOutput()); } catch (ExitCodeException ece) { throw new PartialGroupNameException("failed to get group id list for " + "user '" + userName + "'", ece); } catch (IOException ioe) { String message = "Can't execute the shell command to " + "get the list of group id for user '" + userName + "'"; if (exec2.isTimedOut()) { message += " because of the command taking longer than " + "the configured timeout: " + timeout + " seconds"; throw new PartialGroupNameException(message); } throw new PartialGroupNameException(message, ioe); } } }

Target:
private List<String> resolvePartialGroupNames(String userName, String errMessage, String groupNames) throws PartialGroupNameException { if (Shell.WINDOWS) { throw new PartialGroupNameException("Does not support partial group" + " name resolution on Windows. " + errMessage); } if (groupNames.isEmpty()) { throw new PartialGroupNameException("The user name '" + userName + "' is not found. " + errMessage); } else { LOG.warn("Some group names for '{}' are not resolvable. {}", userName, errMessage); ShellCommandExecutor partialResolver = createGroupIDExecutor(userName); try { partialResolver.execute(); return parsePartialGroupNames( groupNames, partialResolver.getOutput()); } catch (ExitCodeException ece) { throw new PartialGroupNameException( "failed to get group id list for user '" + userName + "'", ece); } catch (IOException ioe) { String message = "Can't execute the shell command to " + "get the list of group id for user '" + userName + "'"; if (partialResolver.isTimedOut()) { message += " because of the command taking longer than " + "the configured timeout: " + timeout + " seconds"; } throw new PartialGroupNameException(message, ioe); } } }
Source:
public CohortDefinition getPersonWithAttribute() { PersonAttributeCohortDefinition cd = new PersonAttributeCohortDefinition(); cd.addParameter(new Parameter("attributeType", "reporting.parameter.attributeType", PersonAttributeType.class)); cd.addParameter(new Parameter("values", "reporting.parameter.values", String.class, List.class, null)); return new MappedParametersCohortDefinition(cd, "attributeType", "attributeType", "values", "values"); }

Target:
public CohortDefinition getPersonWithAttribute() { PersonAttributeCohortDefinition cd = new PersonAttributeCohortDefinition(); cd.addParameter(new Parameter("attributeType", "reporting.parameter.attributeType", PersonAttributeType.class)); cd.addParameter(new Parameter("values", "reporting.parameter.values", String.class, List.class, null)); return cd; }
Source:
private void renderFinalStereoImage(RenderingStage renderingStage) { switch (renderingStage) { case LEFT_EYE: vrProvider.updateState(); leftEye.bind(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); renderFullscreenQuad(); break; case RIGHT_EYE: rightEye.bind(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); renderFullscreenQuad(); vrProvider.submitFrame(); GL11.glFinish(); break; } new BindFBOTask(0,DEFAULT_FRAME_BUFFER_URN).execute(); }

Target:
private void renderFinalStereoImage(RenderingStage renderingStage) { switch (renderingStage) { case LEFT_EYE: vrProvider.updateState(); leftEyeFbo.bind(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); renderFullscreenQuad(); break; case RIGHT_EYE: rightEyeFbo.bind(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); renderFullscreenQuad(); vrProvider.submitFrame(); GL11.glFinish(); break; } glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); }
Source:
public void handle(Request request, Response response) throws Exception { Boolean isMember = request.mandatoryParamAsBoolean(PARAM_MEMBER); if (isMember){ userSession.checkLoggedIn(); } try (DbSession dbSession = dbClient.openSession(false)) { OrganizationQuery dbQuery = buildDbQuery(request); int total = dbClient.organizationDao().countByQuery(dbSession, dbQuery); Paging paging = buildWsPaging(request, total); List<OrganizationDto> organizations = dbClient.organizationDao().selectByQuery(dbSession, dbQuery, forPage(paging.getPageIndex()).andSize(paging.getPageSize())); Set<String> adminOrganizationUuids = searchOrganizationWithAdminPermission(dbSession); writeResponse(request, response, organizations, adminOrganizationUuids, paging); } }

Target:
public void handle(Request request, Response response) throws Exception { boolean isMember = request.mandatoryParamAsBoolean(PARAM_MEMBER); if (isMember){ userSession.checkLoggedIn(); } try (DbSession dbSession = dbClient.openSession(false)) { OrganizationQuery dbQuery = buildDbQuery(request); int total = dbClient.organizationDao().countByQuery(dbSession, dbQuery); Paging paging = buildWsPaging(request, total); List<OrganizationDto> organizations = dbClient.organizationDao().selectByQuery(dbSession, dbQuery, forPage(paging.getPageIndex()).andSize(paging.getPageSize())); Set<String> adminOrganizationUuids = searchOrganizationWithAdminPermission(dbSession); writeResponse(request, response, organizations, adminOrganizationUuids, paging); } }
Source:
public void launch(ISelection selection, String mode) { try { Object objSelected = ((IStructuredSelection) selection).getFirstElement(); if (objSelected instanceof IFile) { launchHelper((IFile) objSelected, mode); } else if (objSelected instanceof IContainer) { launchHelper((IContainer) objSelected, mode); } } catch (CoreException e) { NodePlugin.logError(e.getLocalizedMessage()); } }

Target:
public void launch(ISelection selection, String mode) { try { Object objSelected = ((IStructuredSelection) selection).getFirstElement(); if (objSelected instanceof IResource) { launchHelper((IResource) objSelected, mode); } } catch (CoreException e) { NodePlugin.logError(e.getLocalizedMessage()); } }
Source:
protected final boolean activateBasicLayer(final DDiagram dDiagram, final String layerName) { BasicLayer layer = getBasicLayer(dDiagram, layerName); if (layer != null && !dDiagram.getActivatedLayers().contains(layer)) { Command changeLayersActivationCmd = new ChangeLayerActivationCommand(session.getTransactionalEditingDomain(), dDiagram, layer, new NullProgressMonitor()); session.getTransactionalEditingDomain().getCommandStack().execute(changeLayersActivationCmd); return true; } return false; }

Target:
protected final boolean activateBasicLayer(final DDiagram dDiagram, final String layerName) { BasicLayer layer = getBasicLayer(dDiagram, layerName); if (layer != null && !dDiagram.getActivatedLayers().contains(layer) && !dDiagram.getActivatedTransientLayers().contains(layer)) { Command changeLayersActivationCmd = new ChangeLayerActivationCommand(session.getTransactionalEditingDomain(), dDiagram, layer, new NullProgressMonitor()); session.getTransactionalEditingDomain().getCommandStack().execute(changeLayersActivationCmd); return true; } return false; }
Source:
private Config( ConfigBuilder builder ) { this.logging = builder.logging; this.connectionPoolSize = builder.connectionPoolSize; this.idleTimeBeforeConnectionTest = builder.idleTimeBeforeConnectionTest; this.encryptionLevel = builder.encruptionLevel; this.trustStrategy = builder.trustStrategy; this.authToken = builder.authToken; }

Target:
private Config( ConfigBuilder builder ) { this.logging = builder.logging; this.connectionPoolSize = builder.connectionPoolSize; this.idleTimeBeforeConnectionTest = builder.idleTimeBeforeConnectionTest; this.encryptionLevel = builder.encruptionLevel; this.trustStrategy = builder.trustStrategy; }
Source:
public ArtifactProviderCache() { this.parentCache = new MapMaker() .initialCapacity(500) .expirationT(30, TimeUnit.MINUTES) .makeMap(); clearSearchCache(); }

Target:
public ArtifactProviderCache() { this.parentCache = new MapMaker() .initialCapacity(500) .expiration(30, TimeUnit.MINUTES) .makeMap(); clearSearchCache(); }
Source:
public Server get() { requireNonNull(this.props); final int maxThreads = this.props .getInt("jetty.maxThreads", Constants.DEFAULT_JETTY_MAX_THREAD_COUNT); final boolean useSsl = this.props.getBoolean("jetty.use.ssl", true); final int port; final Server server = new Server(); if (useSsl) { final int sslPortNumber = this.props .getInt("jetty.ssl.port", Constants.DEFAULT_SSL_PORT_NUMBER); port = sslPortNumber; logger.info("Setting up Jetty Https Server with port:" + sslPortNumber + " and numThreads:" + maxThreads); server.addConnector(getSslSocketConnector(sslPortNumber)); } else { port = this.props.getInt("jetty.port", Constants.DEFAULT_PORT_NUMBER); server.addConnector(getSocketConnector(port)); } setStatsOnConnectors(server); logger.info(String.format("Starting %sserver on port: %d", useSsl ? "SSL " : "", port)); return server; }

Target:
public Server get() { requireNonNull(this.props); final int maxThreads = this.props .getInt("jetty.maxThreads", Constants.DEFAULT_JETTY_MAX_THREAD_COUNT); final boolean useSsl = this.props.getBoolean("jetty.use.ssl", true); final int port; final Server server = new Server(); if (useSsl) { final int sslPortNumber = this.props .getInt("jetty.ssl.port", Constants.DEFAULT_SSL_PORT_NUMBER); port = sslPortNumber; server.addConnector(getSslSocketConnector(sslPortNumber)); } else { port = this.props.getInt("jetty.port", Constants.DEFAULT_PORT_NUMBER); server.addConnector(getSocketConnector(port)); } setStatsOnConnectors(server); logger.info(String.format( "Starting %sserver on port: %d # Max threads: %d", useSsl ? "SSL " : "", port, maxThreads)); return server; }
Source:
public PngModule() { super (NAME, RELEASE, DATE, FORMAT, COVERAGE, MIMETYPE, WELLFORMED, VALIDITY, REPINFO, NOTE, RIGHTS, RANDOM); keywordList = new HashMap(); keywordList.put(KEYWORD[0], new Booolean(false,KEYWORD[0])); keywordList.put(KEYWORD[1], new Booolean(false,KEYWORD[1])); keywordList.put(KEYWORD[2], new Booolean(false,KEYWORD[2])); keywordList.put(KEYWORD[3], new Booolean(false,KEYWORD[3])); keywordList.put(CREATION_TIME_KEYWORD, new Booolean(false,CREATION_TIME_KEYWORD)); keywordList.put(KEYWORD[4], new Booolean(false,KEYWORD[4])); keywordList.put(KEYWORD[5], new Booolean(false,KEYWORD[5])); keywordList.put(KEYWORD[6], new Booolean(false,KEYWORD[6])); keywordList.put(KEYWORD[7], new Booolean(false,KEYWORD[7])); keywordList.put(KEYWORD[8], new Booolean(false,KEYWORD[8])); }

Target:
public PngModule() { super (NAME, RELEASE, DATE, FORMAT, COVERAGE, MIMETYPE, WELLFORMED, VALIDITY, REPINFO, NOTE, RIGHTS, RANDOM); keywordList = new HashMap(); keywordList.put(TITLE_KEYWORD, new Booolean(false,TITLE_KEYWORD)); keywordList.put(AUTHOR_KEYWORD, new Booolean(false,AUTHOR_KEYWORD)); keywordList.put(DESCRIPTION_KEYWORD, new Booolean(false,DESCRIPTION_KEYWORD)); keywordList.put(COPYRIGHT_KEYWORD, new Booolean(false,COPYRIGHT_KEYWORD)); keywordList.put(CREATION_TIME_KEYWORD, new Booolean(false,CREATION_TIME_KEYWORD)); keywordList.put(SOFTWARE_KEYWORD, new Booolean(false,SOFTWARE_KEYWORD)); keywordList.put(DISCLAIMER_KEYWORD, new Booolean(false,DISCLAIMER_KEYWORD)); keywordList.put(WARNING_KEYWORD, new Booolean(false,WARNING_KEYWORD)); keywordList.put(SOURCE_KEYWORD, new Booolean(false,SOURCE_KEYWORD)); keywordList.put(COMMENT_KEYWORD, new Booolean(false,COMMENT_KEYWORD)); }
Source:
public StringBuffer format(@Nullable Object obj, @Nullable StringBuffer toAppendTo, @Nullable FieldPosition pos) { if (obj != null && obj instanceof Number && toAppendTo != null) { @Nullable LamiGraphRange internalRange = fInternalRange; @Nullable LamiGraphRange externalRange = fExternalRange; if (internalRange == null || externalRange == null) { StringBuffer buffer = super.format(obj, toAppendTo, pos); return buffer == null ? new StringBuffer() : buffer; } if (internalRange.getDelta().compareTo(BigDecimal.ZERO) == 0) { StringBuffer buffer = super.format(externalRange.getMinimum().doubleValue(), toAppendTo, pos); return buffer == null ? new StringBuffer() : buffer; } BigDecimal range = externalRange.getDelta(); if (range.compareTo(BigDecimal.ZERO) == 0) { range = BigDecimal.ONE; } BigDecimal externalValue = (new BigDecimal(obj.toString())) .subtract(internalRange.getMinimum()) .multiply(range) .divide(internalRange.getDelta(), 22, BigDecimal.ROUND_DOWN) .add(externalRange.getMinimum()); Double value = externalValue.doubleValue(); StringBuffer buffer = super.format(value, toAppendTo, pos); return buffer == null ? new StringBuffer() : buffer; } throw new IllegalArgumentException("Cannot format given Object as a Number: " + obj); }

Target:
public StringBuffer format(@Nullable Object obj, @Nullable StringBuffer toAppendTo, @Nullable FieldPosition pos) { if (!(obj instanceof Number) || toAppendTo == null) { throw new IllegalArgumentException("Cannot format given Object as a Number: " + obj); } @Nullable LamiGraphRange internalRange = fInternalRange; @Nullable LamiGraphRange externalRange = fExternalRange; if (internalRange == null || externalRange == null) { StringBuffer buffer = super.format(obj, toAppendTo, pos); return buffer == null ? new StringBuffer() : buffer; } if (internalRange.getDelta().compareTo(BigDecimal.ZERO) == 0) { StringBuffer buffer = super.format(externalRange.getMinimum().doubleValue(), toAppendTo, pos); return buffer == null ? new StringBuffer() : buffer; } BigDecimal range = externalRange.getDelta(); if (range.compareTo(BigDecimal.ZERO) == 0) { range = BigDecimal.ONE; } BigDecimal externalValue = (new BigDecimal(obj.toString())) .subtract(internalRange.getMinimum()) .multiply(range) .divide(internalRange.getDelta(), BIG_DECIMAL_DIVISION_SCALE, BigDecimal.ROUND_DOWN) .add(externalRange.getMinimum()); Double value = externalValue.doubleValue(); StringBuffer buffer = super.format(value, toAppendTo, pos); return buffer == null ? new StringBuffer() : buffer; }
Source:
public DataExplorerModel deselectAll() { WebDriverWait wait = new WebDriverWait(driver, 60); wait.until(ExpectedConditions.elementToBeClickable(deselectAllButton)); Actions action = new Actions(driver); action.moveToElement(deselectAllButton).click().perform(); spinner().waitTillDone(60, TimeUnit.SECONDS); return this; }

Target:
public DataExplorerModel deselectAll() { deselectAllButton.click(); return this; }
Source:
public void addSelectionListener(SelectionListener listener) { if (this.dropdownTableViewer != null && !this.dropdownTable.isDisposed()) this.dropdownTable.addSelectionListener(listener); }

Target:
public void addSelectionListener(SelectionListener listener) { if (this.dropdownTable != null && !this.dropdownTable.isDisposed()) this.dropdownTable.addSelectionListener(listener); }
Source:
public void getRadiologyOrders_shouldReturnAllRadiologyOrdersForGivenAccessionNumberIfAccessionNumberIsSpecified() throws Exception { RadiologyOrderSearchCriteria radiologyOrderSearchCriteria = new RadiologyOrderSearchCriteria.Builder().withAccessionNumber(EXISTING_RADIOLOGY_ORDER_ACCESSION_NUMBER) .build(); List<RadiologyOrder> radiologyOrders = radiologyOrderService.getRadiologyOrders(radiologyOrderSearchCriteria); assertThat(radiologyOrders.size(), is(1)); for (RadiologyOrder radiologyOrder : radiologyOrders) { assertThat(radiologyOrder.getAccessionNumber(), is(EXISTING_RADIOLOGY_ORDER_ACCESSION_NUMBER)); } }

Target:
public void getRadiologyOrders_shouldReturnAllRadiologyOrdersForGivenAccessionNumberIfAccessionNumberIsSpecified() throws Exception { RadiologyOrderSearchCriteria radiologyOrderSearchCriteria = new RadiologyOrderSearchCriteria.Builder().withAccessionNumber(EXISTING_RADIOLOGY_ORDER_ACCESSION_NUMBER) .build(); List<RadiologyOrder> radiologyOrders = radiologyOrderService.getRadiologyOrders(radiologyOrderSearchCriteria); assertThat(radiologyOrders.size(), is(1)); assertThat(radiologyOrders.get(0) .getAccessionNumber(), is(EXISTING_RADIOLOGY_ORDER_ACCESSION_NUMBER)); }
Source:
Outer(int fileNum, File outFile, int maxLength) throws FileNotFoundException { this.fileNum = fileNum; this.outFile = outFile; this.maxLength = maxLength; FileOutputStream outStream = new FileOutputStream(outFile); this.channel = outStream.getChannel(); closer.register(outStream); closer.register(channel); }

Target:
Outer(int fileNum, File outFile, int maxLength) throws FileNotFoundException { this.fileNum = fileNum; this.outFile = outFile; this.maxLength = maxLength; FileOutputStream outStream = closer.register(new FileOutputStream(outFile)); this.channel = closer.register(outStream.getChannel()); }
Source:
private List<XmlPackage> getAllPackages() { final List<XmlPackage> allPackages = Lists.newArrayList(); final List<XmlPackage> suitePackages = this.m_xmlTest.getSuite().getPackages(); if (suitePackages != null) allPackages.addAll(suitePackages); final List<XmlPackage> testPackages = this.m_xmlTest.getPackages(); if (testPackages != null) allPackages.addAll(testPackages); return allPackages; }

Target:
private List<XmlPackage> getAllPackages() { final List<XmlPackage> allPackages = Lists.newArrayList(); final List<XmlPackage> suitePackages = this.m_xmlTest.getSuite().getPackages(); if (suitePackages != null) { allPackages.addAll(suitePackages); } final List<XmlPackage> testPackages = this.m_xmlTest.getPackages(); if (testPackages != null) { allPackages.addAll(testPackages); } return allPackages; }
Source:
protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode resolvedValue, ModelNode currentValue, HandbackHolder<Void> handbackHolder) throws OperationFailedException { Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS); ModelNode model = resource.getModel(); attributeDefinition.validateAndSet(operation, model); JaxrsContextParamHandler.setContextParam(attributeName, resolvedValue); if (ModelType.LIST.equals(resolvedValue.getType())) { StringBuffer sb = new StringBuffer("\""); boolean first = true; for (ModelNode element : resolvedValue.asList()) { if (first) { first = false; } else { sb.append(","); } sb.append(element.asString()); } } return false; }

Target:
protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode resolvedValue, ModelNode currentValue, HandbackHolder<Void> handbackHolder) throws OperationFailedException { JaxrsContextParamHandler.setContextParam(attributeName, resolvedValue); return false; }
Source:
public PaymentWorksNewVendorDetailDTO getVendorDetailFromPaymentWorks(String newVendorRequestId) { Client client = buildClient(); String URL = (new StringBuilder(getPaymentworksApiUrl()).append(NEW_VENDOR_REQUEST_DETAILS_PREFIX).append(PaymentWorksConstants.FORWARD_SLASH) .append(newVendorRequestId).append(PaymentWorksConstants.FORWARD_SLASH).append(NEW_VENDOR_REQUEST_DETAILS_SUFFIX)).toString(); ClientResponse response = client.handle(buildClientRequest(URL)); PaymentWorksNewVendorDetailDTO newVendorDetail = response.getEntity(PaymentWorksNewVendorDetailDTO.class); LOG.debug("getVendorDetailFromPaymentWorks, Status: " + response.getStatus()); if (response.getStatus() == 200) { LOG.debug("getVendorDetailFromPaymentWorks, New Vendor Request Detail retrieved."); } else { LOG.error("Failed to retrieve New Vendor Request Detail for Vendor Request Id(" + newVendorRequestId + "): " + response.getEntity(String.class)); } return newVendorDetail; }

Target:
public PaymentWorksNewVendorDetailDTO getVendorDetailFromPaymentWorks(String newVendorRequestId) { Client client = buildClient(); String URL = (new StringBuilder(getPaymentworksApiUrl()).append(NEW_VENDOR_REQUEST_DETAILS_PREFIX) .append(PaymentWorksConstants.FORWARD_SLASH).append(newVendorRequestId) .append(PaymentWorksConstants.FORWARD_SLASH).append(NEW_VENDOR_REQUEST_DETAILS_SUFFIX)).toString(); ClientResponse response = client.handle(buildClientRequest(URL)); PaymentWorksNewVendorDetailDTO newVendorDetail = null; if (response.getStatus() == HttpURLConnection.HTTP_OK) { LOG.debug("getVendorDetailFromPaymentWorks, New Vendor Request Detail retrieved."); newVendorDetail = response.getEntity(PaymentWorksNewVendorDetailDTO.class); } else { LOG.error("Failed to retrieve New Vendor Request Detail for Vendor Request Id(" + newVendorRequestId + "): " + response.getEntity(String.class)); throw new RuntimeException("Unable to get vendor detail information from PaymentWorks"); } return newVendorDetail; }
Source:
public T deleteHostedVersion(@ApiParam(hidden = true) @Parameter(hidden = true, name = "user") @Auth User user, @ApiParam(value = "Entry to modify.", required = true) @PathParam("entryId") Long entryId, @ApiParam(value = "version", required = true) @QueryParam("version") String version) { T entry = getEntryDAO().findById(entryId); checkEntry(entry); checkUserCanUpdate(user, entry); checkHosted(entry); Optional<U> deleteVersion = entry.getWorkflowVersions().stream().filter(v -> Objects.equals(v.getName(), version)).findFirst(); if (deleteVersion.isPresent() && deleteVersion.get().isFrozen()) { throw new CustomWebApplicationException("Cannot delete a snapshotted version.", HttpStatus.SC_BAD_REQUEST); } if (entry.getActualDefaultVersion().getName().equals(version)) { Optional<U> max = entry.getWorkflowVersions().stream().filter(v -> !Objects.equals(v.getName(), version)) .max(Comparator.comparingLong(ver -> ver.getDate().getTime())); entry.setActualDefaultVersion(max.orElse(null)); } entry.getWorkflowVersions().removeIf(v -> Objects.equals(v.getName(), version)); PublicStateManager.getInstance().handleIndexUpdate(entry, StateManagerMode.UPDATE); return entry; }

Target:
public T deleteHostedVersion(@ApiParam(hidden = true) @Parameter(hidden = true, name = "user") @Auth User user, @ApiParam(value = "Entry to modify.", required = true) @PathParam("entryId") Long entryId, @ApiParam(value = "version", required = true) @QueryParam("version") String version) { T entry = getEntryDAO().findById(entryId); checkEntry(entry); checkUserCanUpdate(user, entry); checkHosted(entry); Optional<U> deleteVersion = entry.getWorkflowVersions().stream().filter(v -> Objects.equals(v.getName(), version)).findFirst(); if (deleteVersion.isEmpty()) { throw new CustomWebApplicationException("Cannot find version: " + version + " to delete", HttpStatus.SC_NOT_FOUND); } if (deleteVersion.get().isFrozen()) { throw new CustomWebApplicationException("Cannot delete a snapshotted version.", HttpStatus.SC_BAD_REQUEST); } if (entry.getActualDefaultVersion().getName().equals(version)) { Optional<U> max = entry.getWorkflowVersions().stream().filter(v -> !Objects.equals(v.getName(), version)) .max(Comparator.comparingLong(ver -> ver.getDate().getTime())); entry.setActualDefaultVersion(max.orElse(null)); } entry.getWorkflowVersions().removeIf(v -> Objects.equals(v.getName(), version)); PublicStateManager.getInstance().handleIndexUpdate(entry, StateManagerMode.UPDATE); return entry; }
Source:
public static int getComponentIdentifier(String componentId) { return Character.getNumericValue(componentId.charAt(componentId.length() - 2)); }

Target:
public static int getComponentIdentifier(String componentId) { final char ciChar = componentId.charAt(componentId.length() - 2); final int ci = Character.digit(ciChar, 10); if (ci == -1) { throw new IllegalArgumentException("Invalid component identifier " + ciChar); } return ci; }
Source:
private Map<String, Boolean> getHealthStatusFromRest(String instance, List<String> partitions, RESTConfig restConfig, Map<String, String> customPayLoads) { MetricRegistry metrics = SharedMetricRegistries.getOrCreate(_namespace); Counter requestsTotal = metrics.counter(CUSTOM_PARTITION_CHECK_HTTP_REQUESTS_TOTAL); Counter errorRequestsTotal = metrics.counter(CUSTOM_PARTITION_CHECK_HTTP_REQUESTS_ERROR_TOTAL); try (final Timer.Context timer = metrics.timer(CUSTOM_PARTITION_CHECK_HTTP_REQUEST_DURATION) .time()) { requestsTotal.inc(); return _restClient.getPartitionStoppableCheck(restConfig.getBaseUrl(instance), partitions, customPayLoads); } catch (IOException e) { LOG.error("Failed to get partition status on instance {}, partitions: {}", instance, partitions, e); errorRequestsTotal.inc(); return Collections.emptyMap(); } }

Target:
private Map<String, Boolean> getHealthStatusFromRest(String instance, List<String> partitions, RESTConfig restConfig, Map<String, String> customPayLoads) { MetricRegistry metrics = SharedMetricRegistries.getOrCreate(_namespace); try (final Timer.Context timer = metrics.timer(CUSTOM_PARTITION_CHECK_HTTP_REQUESTS_DURATION) .time()) { return _restClient.getPartitionStoppableCheck(restConfig.getBaseUrl(instance), partitions, customPayLoads); } catch (IOException e) { LOG.error("Failed to get partition status on instance {}, partitions: {}", instance, partitions, e); metrics.counter(CUSTOM_PARTITION_CHECK_HTTP_REQUESTS_ERROR_TOTAL).inc(); return Collections.emptyMap(); } }
Source:
public void testMult() { DoubleAD v1 = new DoubleAD(2.0, 4.0); DoubleAD v2 = new DoubleAD(3.0, 2.0); DoubleAD result = ADMath.mult(v1, v2); DoubleAD correctResult = new DoubleAD(6.0, 16.0); testCompareValues(correctResult, result, 0.0); }

Target:
public void testMult() { DoubleAD v1 = new DoubleAD(2.0, 4.0); DoubleAD v2 = new DoubleAD(3.0, 2.0); DoubleAD result = ADMath.mult(v1, v2); DoubleAD correctResult = new DoubleAD(6.0, 16.0); assertEquals(correctResult, result); }