auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public StartAtlasDbTransactionResponse startAtlasDbTransaction(IdentifiedTimeLockRequest request) { if (shouldUseStartAtlasDbTransactionEndpoint()) { try { StartAtlasDbTransactionResponse response = delegate.startAtlasDbTransaction(request); serverSupportsStartAtlasDbTransaction = true; return response; } catch (AtlasDbRemoteException remoteException) { if (remoteException.getStatus() == Response.Status.NOT_FOUND.getStatusCode()) { serverSupportsStartAtlasDbTransaction = false; return startTransactionViaConstituentCalls(request); } throw remoteException; } } return startTransactionViaConstituentCalls(request); }

Target:
public StartAtlasDbTransactionResponse startAtlasDbTransaction(IdentifiedTimeLockRequest request) { if (shouldUseStartAtlasDbTransactionEndpoint()) { try { StartAtlasDbTransactionResponse response = delegate.startAtlasDbTransaction(request); serverSupportsStartAtlasDbTransaction = true; return response; } catch (AtlasDbRemoteException remoteException) { if (remoteException.getStatus() == Response.Status.NOT_FOUND.getStatusCode()) { serverSupportsStartAtlasDbTransaction = false; return startTransactionViaConstituentCalls(request); } throw remoteException; } } else { return startTransactionViaConstituentCalls(request); } }
Source:
public static AssemblyRegion assemblyRegionWithWellMappedReads(final AssemblyRegion originalAssemblyRegion, final int minMappingQuality, final SAMFileHeader readsHeader) { final AssemblyRegion result = new AssemblyRegion(originalAssemblyRegion.getSpan(), originalAssemblyRegion.getSupportingStates(), originalAssemblyRegion.isActive(), originalAssemblyRegion.getExtension(), readsHeader); for (final GATKRead rec : originalAssemblyRegion.getReads()) { if (rec.getMappingQuality() >= minMappingQuality) { result.add(rec); } } return result; }

Target:
public static AssemblyRegion assemblyRegionWithWellMappedReads(final AssemblyRegion originalAssemblyRegion, final int minMappingQuality, final SAMFileHeader readsHeader) { final AssemblyRegion result = new AssemblyRegion(originalAssemblyRegion.getSpan(), originalAssemblyRegion.getSupportingStates(), originalAssemblyRegion.isActive(), originalAssemblyRegion.getExtension(), readsHeader); originalAssemblyRegion.getReads().stream() .filter(rec -> rec.getMappingQuality() >= minMappingQuality) .forEach(result::add); return result; }
Source:
public void testTrailingWildcardParameter_slashes() { ConjureRuntime runtime = DefaultConjureRuntime.builder().build(); Channel channel = mock(Channel.class); Response response = mock(Response.class); when(response.body()).thenReturn(new ByteArrayInputStream(new byte[0])); when(response.code()).thenReturn(204); when(response.headers()).thenReturn(ImmutableListMultimap.of()); when(channel.execute(any(Endpoint.class), any(Request.class))).thenReturn(Futures.immediateFuture(response)); StubService service = JaxRsClient.create(StubService.class, channel, runtime); service.complexPath("dynamic0", "dynamic1/dynamic2"); ArgumentCaptor<Endpoint> endpointCaptor = ArgumentCaptor.forClass(Endpoint.class); ArgumentCaptor<Request> requestCaptor = ArgumentCaptor.forClass(Request.class); verify(channel).execute(endpointCaptor.capture(), requestCaptor.capture()); UrlBuilder urlBuilder = mock(UrlBuilder.class); endpointCaptor.getValue().renderPath(ImmutableMap.of(), urlBuilder); verify(urlBuilder).pathSegment("foo"); verify(urlBuilder).pathSegment("static0"); verify(urlBuilder).pathSegment("dynamic0"); verify(urlBuilder).pathSegment("static1"); verify(urlBuilder).pathSegment("dynamic1/dynamic2"); }

Target:
public void testTrailingWildcardParameter_slashes() { Channel channel = stubNoContentResponseChannel(); StubService service = JaxRsClient.create(StubService.class, channel, runtime); service.complexPath("dynamic0", "dynamic1/dynamic2"); ArgumentCaptor<Endpoint> endpointCaptor = ArgumentCaptor.forClass(Endpoint.class); ArgumentCaptor<Request> requestCaptor = ArgumentCaptor.forClass(Request.class); verify(channel).execute(endpointCaptor.capture(), requestCaptor.capture()); UrlBuilder urlBuilder = mock(UrlBuilder.class); endpointCaptor.getValue().renderPath(ImmutableMap.of(), urlBuilder); verify(urlBuilder).pathSegment("foo"); verify(urlBuilder).pathSegment("static0"); verify(urlBuilder).pathSegment("dynamic0"); verify(urlBuilder).pathSegment("static1"); verify(urlBuilder).pathSegment("dynamic1/dynamic2"); }
Source:
void reset(int startLine, int lineCount, boolean resetByStyles) { int endLine = startLine + lineCount; if (startLine < 0 || endLine > lineWidth.length) return; for (int i = startLine; i < endLine; i++) { lineStylesDirty[i] = resetByStyles; if (!resetByStyles) { lineWidth[i] = -1; lineHeight[i] = -1; } } if (startLine <= maxWidthLineIndex && maxWidthLineIndex < endLine) { maxWidth = 0; maxWidthLineIndex = -1; if (lineCount != this.lineCount) { for (int i = 0; i < this.lineCount; i++) { if (lineWidth[i] > maxWidth) { maxWidth = lineWidth[i]; maxWidthLineIndex = i; } } } } }

Target:
void reset(int startLine, int lineCount, boolean resetByStyles) { int endLine = startLine + lineCount; if (startLine < 0 || endLine > lineSizes.length) return; for (int i = startLine; i < endLine; i++) { LineSizeInfo lineSize = getLineSize(i); if (resetByStyles) { int start = content.getOffsetAtLine(i); int length = content.getLine(i).length(); StyleRange[] ranges = getStyleRanges(start, length, false); lineSize.update(ranges); } else { lineSize.resetSize(); } } if (startLine <= maxWidthLineIndex && maxWidthLineIndex < endLine) { maxWidth = 0; maxWidthLineIndex = -1; if (lineCount != this.lineCount) { for (int i = 0; i < this.lineCount; i++) { LineSizeInfo lineSize = getLineSize(i); if (lineSize.width > maxWidth) { maxWidth = lineSize.width; maxWidthLineIndex = i; } } } } }
Source:
static boolean onKeyUp(final HTMLInputElement input) { final String oldValue = getOldAttribute(input); final int newValue = toInt(input.value); if (!isValidValue(input, newValue)) { input.value = oldValue; } return true; }

Target:
private static boolean onKeyUp(final HTMLInputElement input) { final String oldValue = getOldAttribute(input); final int newValue = toNonNullInt(input.value); if (!isValidValue(input, newValue)) { input.value = oldValue; } return true; }
Source:
public String getProjectTemplateTitles(int id) { try { return serviceManager.getProjectService().getProjectTemplatesTitlesAsString(id); } catch (DAOException e) { logger.error(e.getMessage()); FacesContext facesContext = FacesContext.getCurrentInstance(); FacesMessage facesMessage = new FacesMessage("ERROR: Unable to retrieve templates for project!"); facesContext.addMessage(null, facesMessage); return null; } }

Target:
public String getProjectTemplateTitles(int id) { try { return serviceManager.getProjectService().getProjectTemplatesTitlesAsString(id); } catch (DAOException e) { logger.error(e.getMessage()); FacesContext facesContext = FacesContext.getCurrentInstance(); FacesMessage facesMessage = new FacesMessage(Helper.getTranslation("unableToRetrieveTemplates")); facesContext.addMessage(null, facesMessage); return null; } }
Source:
static int getStaged(@Nullable IndexDiffData indexDiff) { if (indexDiff == null) { return 0; } int size = indexDiff.getAdded().size(); size += indexDiff.getChanged().size(); size += indexDiff.getRemoved().size(); return size; }

Target:
private static int getStaged(@Nullable IndexDiffData indexDiff) { if (indexDiff == null) { return 0; } int size = indexDiff.getAdded().size(); size += indexDiff.getChanged().size(); size += indexDiff.getRemoved().size(); return size; }
Source:
public Object evaluate(ProcessContext context) throws Exception { Map<String, Object> variables = new HashMap<>(); variables.put("kcontext", context); Globals globals = context.getKieRuntime().getGlobals(); if (globals != null && globals.getGlobalKeys() != null) { for (String gKey : globals.getGlobalKeys()) { variables.put(gKey, globals.get(gKey)); } } if (context.getProcessInstance() != null && context.getProcessInstance().getProcess() != null) { VariableScopeInstance variableScope = (VariableScopeInstance) ((WorkflowProcessInstance)context.getProcessInstance()) .getContextInstance(VariableScope.VARIABLE_SCOPE); if (variables != null ) { variables.putAll(variableScope.getVariables()); } } FEEL feel = FEEL.newInstance(); Object value = feel.evaluate(expr, variables); if ( !(value instanceof Boolean) ) { throw new RuntimeException( "Constraints must return boolean values: " + expr + " returns " + value + (value == null? "" : " (type=" + value.getClass())); } return ((Boolean) value).booleanValue(); }

Target:
public Object evaluate(ProcessContext context) throws Exception { Map<String, Object> variables = new HashMap<>(); variables.put("kcontext", context); Globals globals = context.getKieRuntime().getGlobals(); if (globals != null && globals.getGlobalKeys() != null) { for (String gKey : globals.getGlobalKeys()) { variables.put(gKey, globals.get(gKey)); } } if (context.getProcessInstance() != null && context.getProcessInstance().getProcess() != null) { VariableScopeInstance variableScope = (VariableScopeInstance) ((WorkflowProcessInstance)context.getProcessInstance()) .getContextInstance(VariableScope.VARIABLE_SCOPE); if (variables != null ) { variables.putAll(variableScope.getVariables()); } } DMNRuntime runtime = ((KieSession) context.getKieRuntime()).getKieRuntime(DMNRuntime.class); List<FEELProfile> profiles = (List)((DMNRuntimeImpl) runtime).getProfiles(); FEEL feel = FEEL.newInstance(runtime.getRootClassLoader(), profiles); Object value = feel.evaluate(expr, variables); if ( !(value instanceof Boolean) ) { throw new RuntimeException( "Constraints must return boolean values: " + expr + " returns " + value + (value == null? "" : " (type=" + value.getClass())); } return ((Boolean) value).booleanValue(); }
Source:
public void testOutExpire() { sp.out ("PUSH", "ONE", 1000L); sp.out ("PUSH", "TWO", 2000L); sp.out ("PUSH", "THREE", 3000L); sp.out ("PUSH", "FOUR", 4000L); assertEquals ("ONE", sp.rdp ("PUSH")); ISOUtil.sleep (1500L); assertEquals ("TWO", sp.rdp ("PUSH")); ISOUtil.sleep (1000L); assertEquals ("THREE", sp.rdp ("PUSH")); assertEquals ("THREE", sp.inp ("PUSH")); assertEquals ("FOUR", sp.inp ("PUSH")); assertNull (sp.rdp ("PUSH")); }

Target:
public void testOutExpire() { sp.out ("OUT", "ONE", 1000L); sp.out ("OUT", "TWO", 2000L); sp.out ("OUT", "THREE", 3000L); sp.out ("OUT", "FOUR", 4000L); assertEquals ("ONE", sp.rdp ("OUT")); ISOUtil.sleep (1500L); assertEquals ("TWO", sp.rdp ("OUT")); ISOUtil.sleep (1000L); assertEquals ("THREE", sp.rdp ("OUT")); assertEquals ("THREE", sp.inp ("OUT")); assertEquals ("FOUR", sp.inp ("OUT")); assertNull (sp.rdp ("OUT")); }
Source:
FunctionsMap getFunctions() { return this.functions; }

Target:
Functions getFunctions() { return this.functions; }
Source:
protected void appendAllLocalVariableDefinitions(Map<String, Collection<String>> definitions, EObject context) { super.appendAllLocalVariableDefinitions(definitions, context); EditMaskVariables emv = null; if (context instanceof LabelEditTool) { emv = ((LabelEditTool) context).getMask(); for (AbstractVariable subVar : ((LabelEditTool) context).getVariables()) { availableVariables.put(subVar.getName(), AbstractInterpretedExpressionQuery.DEFAULT_VARIABLE_TYPE); } } else if (context instanceof CreateCellTool) { emv = ((CreateCellTool) context).getMask(); } if (emv != null) { appendEditMaskVariables(emv, definitions); } }

Target:
protected void appendAllLocalVariableDefinitions(Map<String, Collection<String>> definitions, EObject context) { super.appendAllLocalVariableDefinitions(definitions, context); EditMaskVariables emv = null; if (context instanceof LabelEditTool) { emv = ((LabelEditTool) context).getMask(); for (AbstractVariable subVar : ((LabelEditTool) context).getVariables()) { availableVariables.put(subVar.getName(), getVariableTypeName(subVar)); } } else if (context instanceof CreateCellTool) { emv = ((CreateCellTool) context).getMask(); } if (emv != null) { appendEditMaskVariables(emv, definitions); } }
Source:
public Map<String, String> getJobMessageProperties() { jobProperties = new HashMap<>(); List<PermissionSubject> subjects = getPermissionCheckSubjects(); if (jobProperties == null && subjects != null && !subjects.isEmpty()) { VdcObjectType entityType; Guid entityId; String value; for (PermissionSubject permSubject : subjects) { entityType = permSubject.getObjectType(); entityId = permSubject.getObjectId(); if (entityType != null && entityId != null) { value = DbFacade.getInstance().getEntityNameByIdAndType(entityId, entityType); if (value == null) { value = entityId.toString(); } jobProperties.put(entityType.name().toLowerCase(), value); } } } return jobProperties; }

Target:
public Map<String, String> getJobMessageProperties() { jobProperties = new HashMap<>(); List<PermissionSubject> subjects = getPermissionCheckSubjects(); if (!subjects.isEmpty()) { VdcObjectType entityType; Guid entityId; String value; for (PermissionSubject permSubject : subjects) { entityType = permSubject.getObjectType(); entityId = permSubject.getObjectId(); if (entityType != null && entityId != null) { value = DbFacade.getInstance().getEntityNameByIdAndType(entityId, entityType); if (value == null) { value = entityId.toString(); } jobProperties.put(entityType.name().toLowerCase(), value); } } } return jobProperties; }
Source:
public void testTriggerMerge() throws Exception { boolean onlyTriggerPhrase = true; boolean onlyAdminsMerge = false; boolean disallowOwnCode = false; GhprbPullRequestMerge merger = setupMerger(onlyTriggerPhrase, onlyAdminsMerge, disallowOwnCode); setupConditions(adminLogin, committerName, committerEmail, triggerPhrase); assertThat(merger.perform(build, null, listener)).isEqualTo(true); setupConditions(adminLogin, committerName, committerEmail, nonTriggerPhrase); assertThat(merger.perform(build, null, listener)).isEqualTo(true); }

Target:
public void testTriggerMerge() throws Exception { boolean onlyTriggerPhrase = true; boolean onlyAdminsMerge = false; boolean disallowOwnCode = false; GhprbPullRequestMerge merger = setupMerger(onlyTriggerPhrase, onlyAdminsMerge, disallowOwnCode); setupConditions(adminLogin, committerName, committerEmail, triggerPhrase); assertThat(merger.perform(build, null, listener)).isEqualTo(true); verify(pr, times(1)).merge(mergeComment); setupConditions(adminLogin, committerName, committerEmail, nonTriggerPhrase); assertThat(merger.perform(build, null, listener)).isEqualTo(true); verify(pr, times(1)).merge(mergeComment); }
Source:
public String toString() { List<String> allConstraints = Lists2.map(typeVariableConstraints, TypeVariableConstraint::toString); return name + (allConstraints.isEmpty() ? "" : "<" + String.join(",", allConstraints) + ">") + "(" + String.join(",", Lists2.map(argumentTypes, TypeSignature::toString)) + "):" + returnType; }

Target:
public String toString() { List<String> allConstraints = Lists2.map(typeVariableConstraints, TypeVariableConstraint::toString); return name + (allConstraints.isEmpty() ? "" : "<" + String.join(",", allConstraints) + ">") + "(" + Lists2.joinOn(",", argumentTypes, TypeSignature::toString) + "):" + returnType; }
Source:
private AlertDialog showInstallPsmartAppDownloadDialog() { AlertDialog.Builder downloadDialog = new AlertDialog.Builder(activity); downloadDialog.setTitle("Install P-Smart app"); downloadDialog.setMessage("Would you like to install P-Smart app?"); downloadDialog.setPositiveButton("Yes", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { String packageName = "org.kenyahmis.psmart"; Uri uri = Uri.parse("market://details?id=" + packageName); Intent intent = new Intent(Intent.ACTION_VIEW, uri); try { activity.startActivity(intent); } catch (ActivityNotFoundException e) { Log.w(TAG, "Google Play is not installed; cannot install " + packageName, e); } } }); downloadDialog.setNegativeButton("No", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { } }); return downloadDialog.show(); }

Target:
private AlertDialog showInstallPsmartAppDownloadDialog() { AlertDialog.Builder downloadDialog = new AlertDialog.Builder(activity); downloadDialog.setTitle(activity.getString(R.string.title_install_psmart)); downloadDialog.setMessage(activity.getString(R.string.hint_install_psmart)); downloadDialog.setPositiveButton("Yes", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { String packageName = "org.kenyahmis.psmart"; Uri uri = Uri.parse("market://details?id=" + packageName); Intent intent = new Intent(Intent.ACTION_VIEW, uri); try { activity.startActivity(intent); } catch (ActivityNotFoundException e) { Log.w(TAG, "Google Play is not installed; cannot install " + packageName, e); } } }); downloadDialog.setNegativeButton(R.string.general_no, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { } }); return downloadDialog.show(); }
Source:
public void run() { boolean terminate = !readState(); setChecked(terminate); IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(GdbPlugin.PLUGIN_ID); if (preferences != null) { preferences.putBoolean(IGdbDebugPreferenceConstants.PREF_AUTO_TERMINATE_GDB, terminate); try { preferences.flush(); } catch (BackingStoreException e) { } } }

Target:
public void run() { IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(GdbPlugin.PLUGIN_ID); if (preferences != null) { preferences.putBoolean(IGdbDebugPreferenceConstants.PREF_AUTO_TERMINATE_GDB, !readState()); try { preferences.flush(); } catch (BackingStoreException e) { } } }
Source:
public void stop() throws Exception { this.zooKeeperClient.getConnectionStateListenable().removeListener(connectionStateListener); }

Target:
public void stop() throws Exception { zooKeeperClient.getConnectionStateListenable().removeListener(connectionStateListener); scheduler.shutdown(); }
Source:
private void processPayloadState(ChannelHandlerContext ctx, ByteBuf in, Http2FrameListener listener) throws Http2Exception { if (in.readableBytes() < payloadLength) { return; } int remaining = in.readableBytes() - payloadLength; readingHeaders = true; switch (frameType) { case DATA: readDataFrame(ctx, in, remaining, listener); break; case HEADERS: readHeadersFrame(ctx, in, remaining, listener); break; case PRIORITY: readPriorityFrame(ctx, in, listener); break; case RST_STREAM: readRstStreamFrame(ctx, in, listener); break; case SETTINGS: readSettingsFrame(ctx, in, listener); break; case PUSH_PROMISE: readPushPromiseFrame(ctx, in, remaining, listener); break; case PING: readPingFrame(ctx, in.readLong(), listener); break; case GO_AWAY: readGoAwayFrame(ctx, in, remaining, listener); break; case WINDOW_UPDATE: readWindowUpdateFrame(ctx, in, listener); break; case CONTINUATION: readContinuationFrame(in, remaining, listener); break; default: readUnknownFrame(ctx, in, remaining, listener); break; } in.readerIndex(in.writerIndex() - remaining); }

Target:
private void processPayloadState(ChannelHandlerContext ctx, ByteBuf in, Http2FrameListener listener) throws Http2Exception { if (in.readableBytes() < payloadLength) { return; } int payloadEndIndex = in.readerIndex() + payloadLength; readingHeaders = true; switch (frameType) { case DATA: readDataFrame(ctx, in, payloadEndIndex, listener); break; case HEADERS: readHeadersFrame(ctx, in, payloadEndIndex, listener); break; case PRIORITY: readPriorityFrame(ctx, in, listener); break; case RST_STREAM: readRstStreamFrame(ctx, in, listener); break; case SETTINGS: readSettingsFrame(ctx, in, listener); break; case PUSH_PROMISE: readPushPromiseFrame(ctx, in, payloadEndIndex, listener); break; case PING: readPingFrame(ctx, in.readLong(), listener); break; case GO_AWAY: readGoAwayFrame(ctx, in, payloadEndIndex, listener); break; case WINDOW_UPDATE: readWindowUpdateFrame(ctx, in, listener); break; case CONTINUATION: readContinuationFrame(in, payloadEndIndex, listener); break; default: readUnknownFrame(ctx, in, payloadEndIndex, listener); break; } in.readerIndex(payloadEndIndex); }
Source:
private static void checkPlaceHolders(Method method, List<String> errors) { int count = 0; if (PropertiesFileInfo.properties.getProperty(method.getName()) != null) { Set<Integer> foundIndex = new HashSet<Integer>(); Set<Integer> requiredIndexes = determineRequiredIndexes(method.getParameterAnnotations()); int minRequired = requiredIndexes.size(); Matcher matcher = placeHolderPattern.matcher(PropertiesFileInfo.properties.getProperty(method.getName())); while (matcher.find()) { int placeHolderIndex = -1; try { placeHolderIndex = Integer.parseInt(matcher.group(1)); if (!foundIndex.contains(placeHolderIndex)) { count++; foundIndex.add(placeHolderIndex); requiredIndexes.remove(placeHolderIndex); } if (placeHolderIndex < 0 || placeHolderIndex >= getMaxMethodParameter(method.getParameterAnnotations())) { errors.add(method.getName() + " contains out of bound index " + placeHolderIndex + " in " + PropertiesFileInfo.fileName); } } catch (NumberFormatException nfe) { errors.add(method.getName() + " contains invalid key " + matcher.group(0) + " in " + PropertiesFileInfo.fileName); } } if (count < minRequired || count > getMaxMethodParameter(method.getParameterAnnotations())) { errors.add(method.getName() + " does not match the number of parameters in " + PropertiesFileInfo.fileName); } if (!requiredIndexes.isEmpty()) { errors.add(method.getName() + " is missing required indexes in " + PropertiesFileInfo.fileName); } } }

Target:
private static void checkPlaceHolders(Method method, List<String> errors) { int count = 0; String methodName = method.getName(); if (PropertiesFileInfo.properties.getProperty(methodName) != null) { Set<Integer> foundIndex = new HashSet<Integer>(); Set<Integer> requiredIndexes = determineRequiredIndexes(method.getParameterAnnotations()); int minRequired = requiredIndexes.size(); Matcher matcher = placeHolderPattern.matcher(PropertiesFileInfo.properties.getProperty(methodName)); while (matcher.find()) { int placeHolderIndex = -1; try { placeHolderIndex = Integer.parseInt(matcher.group(1)); if (!foundIndex.contains(placeHolderIndex)) { count++; foundIndex.add(placeHolderIndex); requiredIndexes.remove(placeHolderIndex); } if (placeHolderIndex < 0 || placeHolderIndex >= getMethodParameterCount(method)) { errors.add(methodName + " contains out of bound index " + placeHolderIndex + " in " + PropertiesFileInfo.fileName); } } catch (NumberFormatException nfe) { errors.add(methodName + " contains invalid key " + matcher.group(0) + " in " + PropertiesFileInfo.fileName); } } if (count < minRequired || count > getMethodParameterCount(method)) { errors.add(methodName + " does not match the number of parameters in " + PropertiesFileInfo.fileName); } if (!requiredIndexes.isEmpty()) { errors.add(methodName + " is missing required indexes in " + PropertiesFileInfo.fileName); } } }
Source:
Mono<Response<KeyVaultRestoreOperation>> restoreWithResponse(String backupFolderUrl, String sasToken, Context context) { String[] segments = backupFolderUrl.split("/"); String folderName = segments[segments.length - 1]; String containerUrl = backupFolderUrl.substring(0, backupFolderUrl.length() - folderName.length()); SASTokenParameter sasTokenParameter = new SASTokenParameter() .setStorageResourceUri(containerUrl) .setToken(sasToken); RestoreOperationParameters restoreOperationParameters = new RestoreOperationParameters() .setSasTokenParameters(sasTokenParameter) .setFolderToRestore(folderName); return clientImpl.fullRestoreOperationWithResponseAsync(vaultUrl, restoreOperationParameters, context.addData(AZ_TRACING_NAMESPACE_KEY, KEYVAULT_TRACING_NAMESPACE_VALUE)) .doOnRequest(ignored -> logger.info("Restoring from location - {}{}", containerUrl, folderName)) .doOnSuccess(response -> logger.info("Restored from location - {}{}", containerUrl, folderName)) .doOnError(error -> logger.warning("Failed to restore from location - {}{}", containerUrl, folderName, error)) .map(restoreOperationResponse -> new SimpleResponse<>(restoreOperationResponse.getRequest(), restoreOperationResponse.getStatusCode(), restoreOperationResponse.getHeaders(), (KeyVaultRestoreOperation) transformToLongRunningOperation(restoreOperationResponse.getValue()))); }

Target:
Mono<Response<KeyVaultRestoreOperation>> restoreWithResponse(String backupFolderUrl, String sasToken, Context context) { String[] segments = backupFolderUrl.split("/"); String folderName = segments[segments.length - 1]; String containerUrl = backupFolderUrl.substring(0, backupFolderUrl.length() - folderName.length()); SASTokenParameter sasTokenParameter = new SASTokenParameter() .setStorageResourceUri(containerUrl) .setToken(sasToken); RestoreOperationParameters restoreOperationParameters = new RestoreOperationParameters() .setSasTokenParameters(sasTokenParameter) .setFolderToRestore(folderName); return clientImpl.fullRestoreOperationWithResponseAsync(vaultUrl, restoreOperationParameters, context.addData(AZ_TRACING_NAMESPACE_KEY, KEYVAULT_TRACING_NAMESPACE_VALUE)) .doOnRequest(ignored -> logger.info("Restoring from location - {}", backupFolderUrl)) .doOnSuccess(response -> logger.info("Restored from location - {}", backupFolderUrl)) .doOnError(error -> logger.warning("Failed to restore from location - {}", backupFolderUrl, error)) .map(restoreOperationResponse -> new SimpleResponse<>(restoreOperationResponse.getRequest(), restoreOperationResponse.getStatusCode(), restoreOperationResponse.getHeaders(), (KeyVaultRestoreOperation) transformToLongRunningOperation(restoreOperationResponse.getValue()))); }
Source:
public void truncateJobCancelWithOutForce() throws IOException, SignatureException, XmlProcessingException, URISyntaxException, InterruptedException { final int testTimeOutSeconds = 5; final String bucketName = "test_truncate_cancel_job"; final String book1 = "beowulf.txt"; final Path objPath1 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book1); final Ds3Object obj1 = new Ds3Object(book1, Files.size(objPath1)); final Ds3Object obj2 = new Ds3Object("place_holder", 5000000); final Path dirPath = FileSystems.getDefault().getPath("output"); try { client.putBucket(new PutBucketRequest(bucketName)); Ds3ClientHelpers.wrap(client).ensureBucketExists(bucketName); final Ds3ClientHelpers.Job putJob = Ds3ClientHelpers.wrap(client).startWriteJob(bucketName, Lists.newArrayList(obj1, obj2)); final UUID jobId = putJob.getJobId(); final SeekableByteChannel book1Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book1); client.putObject(new PutObjectRequest(bucketName, book1, book1Channel, jobId, 0, Files.size(objPath1))); final long startTime = System.nanoTime(); long cachedSize =0; while (cachedSize == 0) { Thread.sleep(500); final MasterObjectList mol = client.getJobSpectraS3(new GetJobSpectraS3Request(jobId)).getMasterObjectListResult(); cachedSize = mol.getCachedSizeInBytes(); assertTrue((System.nanoTime() - startTime)/1000000000 < testTimeOutSeconds ); } final CancelJobSpectraS3Response failedResponse = client.cancelJobSpectraS3(new CancelJobSpectraS3Request(jobId)); failedResponse.checkStatusCode(400); final GetJobSpectraS3Response truncatedJob = client.getJobSpectraS3(new GetJobSpectraS3Request(jobId)); assertEquals(truncatedJob.getMasterObjectListResult().getOriginalSizeInBytes(), Files.size(objPath1)); } finally { deleteAllContents(client, bucketName); } }

Target:
public void truncateJobCancelWithOutForce() throws IOException, SignatureException, XmlProcessingException, URISyntaxException, InterruptedException { final int testTimeOutSeconds = 5; final String book1 = "beowulf.txt"; final Path objPath1 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book1); final Ds3Object obj1 = new Ds3Object(book1, Files.size(objPath1)); final Ds3Object obj2 = new Ds3Object("place_holder", 5000000); try { final Ds3ClientHelpers.Job putJob = HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(obj1, obj2)); final UUID jobId = putJob.getJobId(); final SeekableByteChannel book1Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book1); client.putObject(new PutObjectRequest(BUCKET_NAME, book1, book1Channel, jobId, 0, Files.size(objPath1))); waitForObjectToBeInCache(testTimeOutSeconds, jobId); final CancelJobSpectraS3Response failedResponse = client.cancelJobSpectraS3(new CancelJobSpectraS3Request(jobId)); assertThat(failedResponse.getStatusCode(),is(400)); final GetJobSpectraS3Response truncatedJob = client.getJobSpectraS3(new GetJobSpectraS3Request(jobId)); assertEquals(truncatedJob.getMasterObjectListResult().getOriginalSizeInBytes(), Files.size(objPath1)); } finally { deleteAllContents(client, BUCKET_NAME); } }
Source:
public static BindingListenerAnnotationBeanPostProcessor bindToAnnotationBeanPostProcessor(@Lazy BinderAwareChannelResolver binderAwareChannelResolver, @Lazy CompositeMessageConverterFactory compositeMessageConverterFactory) { DefaultMessageHandlerMethodFactory messageHandlerMethodFactory = new DefaultMessageHandlerMethodFactory(); messageHandlerMethodFactory.setMessageConverter(compositeMessageConverterFactory.getMessageConverterForAllRegistered()); messageHandlerMethodFactory.afterPropertiesSet(); BindingListenerAnnotationBeanPostProcessor bindingListenerAnnotationBeanPostProcessor = new BindingListenerAnnotationBeanPostProcessor(binderAwareChannelResolver, messageHandlerMethodFactory); return bindingListenerAnnotationBeanPostProcessor; }

Target:
public static StreamListenerAnnotationBeanPostProcessor bindToAnnotationBeanPostProcessor(@Lazy BinderAwareChannelResolver binderAwareChannelResolver, @Lazy CompositeMessageConverterFactory compositeMessageConverterFactory) { DefaultMessageHandlerMethodFactory messageHandlerMethodFactory = new DefaultMessageHandlerMethodFactory(); messageHandlerMethodFactory.setMessageConverter(compositeMessageConverterFactory.getMessageConverterForAllRegistered()); messageHandlerMethodFactory.afterPropertiesSet(); return new StreamListenerAnnotationBeanPostProcessor(binderAwareChannelResolver, messageHandlerMethodFactory); }
Source:
protected TestQueryPlanDeterminism() { super(TestQueryPlanDeterminism::createLocalQueryRunner, FeatureSelection.all().without(ENGINE_ONLY).build()); }

Target:
protected TestQueryPlanDeterminism() { super(TestQueryPlanDeterminism::createLocalQueryRunner); }
Source:
private void assertAllDisksAreActive(Collection<Disk> disks) { for (Disk disk : disks){ if (disk instanceof LunDisk){ continue; } DiskImage diskImage = DiskImage.class.cast(disk); assertTrue("disk should be active", diskImage.getActive()); } }

Target:
private void assertAllDisksAreActive(Collection<Disk> disks) { for (Disk disk : disks){ if (disk instanceof LunDisk){ continue; } DiskImage diskImage = (DiskImage) disk; assertTrue("disk should be active", diskImage.getActive()); } }
Source:
public MarkerItem getMarkerItem(IMarker marker) { if (markerToEntryMap == null) { Map<IMarker, MarkerEntry> newMarkerToEntryMap = new HashMap<>(); for (MarkerEntry markerEntry : markerEntryArray) { IMarker nextMarker = markerEntry.getMarker(); if (nextMarker != null) { newMarkerToEntryMap.put(nextMarker, markerEntry); } } markerToEntryMap = newMarkerToEntryMap; } synchronized (markerToEntryMap) { if (markerToEntryMap.containsKey(marker)) { return markerToEntryMap.get(marker); } } return null; }

Target:
public MarkerItem getMarkerItem(IMarker marker) { Map<IMarker, MarkerEntry> entryMap = markerToEntryMap; if (entryMap == null) { entryMap = new HashMap<>(); for (MarkerEntry markerEntry : markerEntryArray) { IMarker nextMarker = markerEntry.getMarker(); if (nextMarker != null) { entryMap.put(nextMarker, markerEntry); } } markerToEntryMap = entryMap; } if (entryMap.containsKey(marker)) { return entryMap.get(marker); } return null; }
Source:
public int setVersion() { buffer[offset] |= 0x80; return 1; }

Target:
public boolean setVersion() { if (isInvalid()) { return false; } buffer[offset] |= 0x80; return true; }
Source:
public Dimension getFloatingItemOffset() { if (editPart instanceof FloatingLabelEditPart) { return ((FloatingLabelEditPart) editPart).getFloatingItemOffset(); } return new Dimension(); }

Target:
public Dimension getFloatingItemOffset() { Dimension offset = null; if (editPart instanceof FloatingLabelEditPart) { offset = ((FloatingLabelEditPart) editPart).getFloatingItemOffset(); } return offset != null ? offset : new Dimension(); }
Source:
public void run() { AbstractAbstractFileNode<?> fileNode = weakNodeRef.get(); if (fileNode == null) { return; } List<ContentTag> tags = fileNode.getContentTagsFromDatabase(); CorrelationAttributeInstance attribute = fileNode.getCorrelationAttributeInstance(); SCOData scoData = new SCOData(); scoData.setScoreAndDescription(fileNode.getScorePropertyAndDescription(tags)); scoData.setComment(fileNode.getCommentProperty(tags, attribute)); if (!UserPreferences.hideCentralRepoCommentsAndOccurrences()) { scoData.setCountAndDescription(fileNode.getCountPropertyAndDescription(attribute)); } if (listener != null) { listener.propertyChange(new PropertyChangeEvent( AutopsyEvent.SourceType.LOCAL.toString(), AbstractAbstractFileNode.NodeSpecificEvents.SCO_AVAILABLE.toString(), null, scoData)); } }

Target:
public void run() { AbstractContentNode<?> contentNode = weakNodeRef.get(); if (contentNode == null) { return; } List<Tag> tags = contentNode.getAllTagsFromDatabase(); CorrelationAttributeInstance attribute = contentNode.getCorrelationAttributeInstance(); SCOData scoData = new SCOData(); scoData.setScoreAndDescription(contentNode.getScorePropertyAndDescription(tags)); scoData.setComment(contentNode.getCommentProperty(tags, attribute)); if (!UserPreferences.hideCentralRepoCommentsAndOccurrences()) { scoData.setCountAndDescription(contentNode.getCountPropertyAndDescription(attribute)); } if (listener != null) { listener.propertyChange(new PropertyChangeEvent( AutopsyEvent.SourceType.LOCAL.toString(), AbstractAbstractFileNode.NodeSpecificEvents.SCO_AVAILABLE.toString(), null, scoData)); } }
Source:
private static int getJUnitVersion(ClassTree classTree, List<MethodTree> methods) { if (isJunit3Class(classTree)) { return 3; } boolean containsJUnit4Tests = false; for (MethodTree methodTree : methods) { SymbolMetadata metadata = methodTree.symbol().metadata(); containsJUnit4Tests |= metadata.isAnnotatedWith("org.junit.Test"); if (metadata.isAnnotatedWith("org.junit.jupiter.api.Test")) { return 5; } } return containsJUnit4Tests ? 4 : -1; }

Target:
private static int getJUnitVersion(ClassTree classTree, List<MethodTree> methods) { if (isJunit3Class(classTree)) { return 3; } boolean containsJUnit4Tests = false; for (MethodTree methodTree : methods) { SymbolMetadata metadata = methodTree.symbol().metadata(); containsJUnit4Tests |= metadata.isAnnotatedWith("org.junit.Test"); if (UnitTestUtils.hasJUnit5TestAnnotation(methodTree)) { return 5; } } return containsJUnit4Tests ? 4 : -1; }
Source:
public void actionPerformed(ActionEvent e) { if (e.getSource() == chkProxy) { if (chkProxy.isSelected()) { txtHost.setEnabled(true); txtPort.setEnabled(true); if (!StringUtils.isNotEmptyNotNull(txtPort.getText())) { txtPort.setText("80"); } updateProxySettings(); } else { txtHost.setEnabled(false); txtPort.setEnabled(false); BriefcasePreferences.setBriefcaseProxyProperty(null); } } }

Target:
public void actionPerformed(ActionEvent e) { if (e.getSource() == chkProxy) { if (chkProxy.isSelected()) { txtHost.setEnabled(true); spinPort.setEnabled(true); if (!StringUtils.isNotEmptyNotNull(txtHost.getText())) { txtHost.setText("127.0.0.1"); } updateProxySettings(); } else { txtHost.setEnabled(false); spinPort.setEnabled(false); BriefcasePreferences.setBriefcaseProxyProperty(null); } } }
Source:
private void releaseSharedLock(String key) { InternalLockView lock = locks.get(key); if (lock != null) { if (lock.getCount() > 0) { lock.decreaseCount(); log.debugFormat("The shared lock for key {0} is released.", key); if (lock.getCount() == 0) { locks.remove(key); log.debugFormat("The shared lock for key {0} is removed from map", key); } } else { log.warnFormat("Trying decrease shared lock index which is 0 is for key {0}", key); } } else { log.warnFormat("Trying release shared lock which is not exist for key {0}", key); } }

Target:
private void releaseSharedLock(String key) { InternalLockView lock = locks.get(key); if (lock != null) { if (lock.getCount() > 0) { lock.decreaseCount(); log.debugFormat("The shared lock for key {0} is released.", key); if (lock.getCount() == 0) { locks.remove(key); log.debugFormat("The shared lock for key {0} is removed from map", key); } } else { log.warnFormat("Trying to decrease a shared lock for key: {0} , but shared index is 0", key); } } else { log.warnFormat("Trying to release a shared lock for key: {0} , but lock does not exist", key); } }
Source:
public void init(List<TransformFunction> arguments, Map<String, DataSource> dataSourceMap) { Preconditions .checkArgument(arguments.size() == 1, "Exactly 1 argument is required for transform function: %s", getName()); TransformFunction transformFunction = arguments.get(0); Preconditions.checkArgument(transformFunction.getResultMetadata().isSingleValue(), "The argument must be single-valued for transform function: %s", getName()); _transformFunction = transformFunction; _reader = new WKTReader(getGeometryFactory()); }

Target:
public void init(List<TransformFunction> arguments, Map<String, DataSource> dataSourceMap) { Preconditions .checkArgument(arguments.size() == 1, "Exactly 1 argument is required for transform function: %s", getName()); TransformFunction transformFunction = arguments.get(0); Preconditions.checkArgument(transformFunction.getResultMetadata().isSingleValue(), "The argument must be single-valued for transform function: %s", getName()); Preconditions.checkArgument(transformFunction.getResultMetadata().getDataType() == FieldSpec.DataType.STRING, "The argument must be of string type"); _transformFunction = transformFunction; _reader = new WKTReader(getGeometryFactory()); }
Source:
public String getAlgorithm() { return ClearPassword.ALGORITHM_CLEAR; }

Target:
public String getAlgorithm() { return algorithm; }
Source:
public List<IssueDetail> eval(BranchContext context, ValidationRule rule) throws Exception { checkArgument(type().equals(rule.getType()), "'%s' is not recognizable by this evaluator (accepts: %s)", rule, type()); return context.service(ObjectMapper.class) .<SnomedComponentValidationQuery<?, PageableCollectionResource<SnomedComponent>, SnomedComponent>>readValue(rule.getImplementation(), TYPE_REF) .prepareSearch() .all() .setFields(SnomedComponentDocument.Fields.ID, SnomedComponentDocument.Fields.MODULE_ID, SnomedComponentDocument.Fields.ACTIVE) .build() .execute(context) .stream() .map(component -> { final ComponentIdentifier affectedComponent = component.getComponentIdentifier(); final String moduleId = component.getModuleId(); final Map<String, Object> details = newHashMap(); details.put(SnomedRf2Headers.FIELD_MODULE_ID, moduleId); details.put(SnomedRf2Headers.FIELD_ACTIVE, Boolean.valueOf(component.isActive())); return new IssueDetail(affectedComponent, details); }) .collect(Collectors.toList()); }

Target:
public List<IssueDetail> eval(BranchContext context, ValidationRule rule) throws Exception { checkArgument(type().equals(rule.getType()), "'%s' is not recognizable by this evaluator (accepts: %s)", rule, type()); return context.service(ObjectMapper.class) .<SnomedComponentValidationQuery<?, PageableCollectionResource<SnomedComponent>, SnomedComponent>>readValue(rule.getImplementation(), TYPE_REF) .prepareSearch() .all() .setFields(SnomedComponentDocument.Fields.ID, SnomedComponentDocument.Fields.MODULE_ID, SnomedComponentDocument.Fields.ACTIVE) .build() .execute(context) .stream() .map(component -> { final ComponentIdentifier affectedComponent = component.getComponentIdentifier(); final String moduleId = component.getModuleId(); final Map<String, Object> details = newHashMap(); details.put(SnomedRf2Headers.FIELD_MODULE_ID, moduleId); details.put(SnomedRf2Headers.FIELD_ACTIVE, component.isActive()); return new IssueDetail(affectedComponent, details); }) .collect(Collectors.toList()); }
Source:
public void setResponses(Map<String, Response> responses) { this.responses = responses; if (this.responsesObject == null && responses != null) { this.responsesObject = new Responses(); for (String key : responses.keySet()) { this.responsesObject.put(key, responses.get(key)); } } }

Target:
public void setResponses(Map<String, Response> responses) { this.responses = responses; }
Source:
private void marshall(final Diagram diagram, final Promise.PromiseExecutorCallbackFn.ResolveCallbackFn<String> resolveCallbackFn, final Promise.PromiseExecutorCallbackFn.RejectCallbackFn rejectCallbackFn) { if (Objects.isNull(diagram)) { return; } final Graph graph = diagram.getGraph(); if (Objects.isNull(graph)) { return; } final DMN12MarshallCallback jsCallback = r -> { String xml = r; if (!xml.startsWith("<?xml version=\"1.0\" ?>")) { xml = "<?xml version=\"1.0\" ?>" + xml; } resolveCallbackFn.onInvoke(xml); }; try { final JSITDefinitions jsitDefinitions = dmnMarshallerKogitoMarshaller.marshall(graph); final DMN12 dmn12 = Js.uncheckedCast(JsUtils.newWrappedInstance()); JsUtils.setNameOnWrapped(dmn12, makeJSINameForDMN12()); JsUtils.setValueOnWrapped(dmn12, jsitDefinitions); MainJs.marshall(dmn12, jsitDefinitions.getNamespace(), jsCallback); } catch (Exception e) { GWT.log(e.getMessage(), e); rejectCallbackFn.onInvoke(e); } }

Target:
private void marshall(final Diagram diagram, final Promise.PromiseExecutorCallbackFn.ResolveCallbackFn<String> resolveCallbackFn, final Promise.PromiseExecutorCallbackFn.RejectCallbackFn rejectCallbackFn) { if (Objects.isNull(diagram)) { return; } final Graph graph = diagram.getGraph(); if (Objects.isNull(graph)) { return; } final DMN12MarshallCallback jsCallback = result -> { String xml = result; if (!xml.startsWith("<?xml version=\"1.0\" ?>")) { xml = "<?xml version=\"1.0\" ?>" + xml; } resolveCallbackFn.onInvoke(xml); }; try { final JSITDefinitions jsitDefinitions = dmnMarshallerKogitoMarshaller.marshall(graph); final DMN12 dmn12 = Js.uncheckedCast(JsUtils.newWrappedInstance()); JsUtils.setNameOnWrapped(dmn12, makeJSINameForDMN12()); JsUtils.setValueOnWrapped(dmn12, jsitDefinitions); MainJs.marshall(dmn12, jsitDefinitions.getNamespace(), jsCallback); } catch (Exception e) { GWT.log(e.getMessage(), e); rejectCallbackFn.onInvoke(e); } }
Source:
@Test public void putOverrides() throws Exception { LinkedHashTreeMap<String, String> map = new LinkedHashTreeMap<>(); assertThat(map.put("d", "donut")).isNull(); assertThat(map.put("e", "eclair")).isNull(); assertThat(map.put("f", "froyo")).isNull(); assertThat(map.size()).isEqualTo(3); assertThat(map.get("d")).isEqualTo("donut"); assertThat(map.put("d", "done")).isEqualTo("donut"); assertThat(map.size()).isEqualTo(3); }

Target:
@Test public void putOverrides() throws Exception { LinkedHashTreeMap<String, String> map = new LinkedHashTreeMap<>(); assertThat(map.put("d", "donut")).isNull(); assertThat(map.put("e", "eclair")).isNull(); assertThat(map.put("f", "froyo")).isNull(); assertThat(map.size()).isEqualTo(3); assertThat(map.get("d")).isEqualTo("donut"); assertThat(map.put("d", "done")).isEqualTo("donut"); assertThat(map).hasSize(3); }
Source:
public MessageProducer createMessageProducer(Session session, Destination destination) throws JMSConnectorException { try { if ((JMSConstants.JMS_SPEC_VERSION_1_1.equals(jmsSpec)) || (JMSConstants.JMS_SPEC_VERSION_2_0 .equals(jmsSpec))) { return session.createProducer(destination); } else { if (this.destinationType.equals(JMSConstants.JMSDestinationType.QUEUE)) { return ((QueueSession) session).createSender((Queue) destination); } else { return ((TopicSession) session).createPublisher((Topic) destination); } } } catch (JMSException e) { throw new JMSConnectorException( "JMS Exception while creating the producer for the destination " + destinationName, e); } }

Target:
public MessageProducer createMessageProducer(Session session, Destination destination) throws JMSConnectorException { try { if ((JMSConstants.JMS_SPEC_VERSION_1_1.equals(jmsSpec)) || (JMSConstants.JMS_SPEC_VERSION_2_0 .equals(jmsSpec))) { return session.createProducer(destination); } else { if (JMSConstants.JMSDestinationType.QUEUE.equals(this.destinationType)) { return ((QueueSession) session).createSender((Queue) destination); } else { return ((TopicSession) session).createPublisher((Topic) destination); } } } catch (JMSException e) { throw new JMSConnectorException( "JMS Exception while creating the producer for the destination " + destinationName, e); } }
Source:
public void selectItem(String path, int timeoutForWaitingItem) { String locator = " waitItem(path, timeoutForWaitingItem); try { new WebDriverWait(seleniumWebDriver, EXPECTED_MESS_IN_CONSOLE_SEC) .until(ExpectedConditions.visibilityOfElementLocated(By.xpath(locator))) .click(); } catch (StaleElementReferenceException ex) { LOG.error(ex.getLocalizedMessage(), ex); waitProjectExplorer(); clickOnRefreshTreeButton(); waitItem(path); new WebDriverWait(seleniumWebDriver, EXPECTED_MESS_IN_CONSOLE_SEC) .until(ExpectedConditions.visibilityOfElementLocated(By.xpath(locator))) .click(); } }

Target:
public void selectItem(String path, int timeoutForWaitingItem) { String locator = " waitItem(path, timeoutForWaitingItem); try { new WebDriverWait(seleniumWebDriver, EXPECTED_MESS_IN_CONSOLE_SEC) .until(ExpectedConditions.visibilityOfElementLocated(By.xpath(locator))) .click(); } catch (StaleElementReferenceException ex) { LOG.warn(ex.getLocalizedMessage(), ex); waitProjectExplorer(); clickOnRefreshTreeButton(); waitItem(path); new WebDriverWait(seleniumWebDriver, EXPECTED_MESS_IN_CONSOLE_SEC) .until(ExpectedConditions.visibilityOfElementLocated(By.xpath(locator))) .click(); } }
Source:
public GA4GHBeaconResponse() { }

Target:
GA4GHBeaconResponse() { }
Source:
private static Collection<SAXParseException> validate(final XML xml) { final Collection<SAXParseException> errors = new CopyOnWriteArrayList<SAXParseException>(); final int amountOfRetries = 3; try { final Validator validator = newValidator(); validator.setErrorHandler( new XSDDocument.ValidationHandler(errors) ); final DOMSource domsrc = new DOMSource(xml.node()); for (int retry = 0; retry < amountOfRetries; ++retry) { try { validator.validate(domsrc); retry = amountOfRetries; } catch (final SocketException ex) { Logger.error( StrictXML.class, "Try #%d of %d failed: %s: %s", retry, amountOfRetries, ex.getClass().getName(), ex.getMessage() ); if (amountOfRetries == retry + 1) { throw new IllegalStateException(ex); } } } } catch (final SAXException ex) { throw new IllegalStateException(ex); } catch (final IOException ex) { throw new IllegalStateException(ex); } return errors; }

Target:
private static Collection<SAXParseException> validate(final XML xml) { final Collection<SAXParseException> errors = new CopyOnWriteArrayList<SAXParseException>(); final int max = 3; try { final Validator validator = newValidator(); validator.setErrorHandler( new XSDDocument.ValidationHandler(errors) ); final DOMSource dom = new DOMSource(xml.node()); for (int retry = 1; retry <= max; ++retry) { try { validator.validate(dom); break; } catch (final SocketException ex) { Logger.error( StrictXML.class, "Try #%d of %d failed: %s: %s", retry, max, ex.getClass().getName(), ex.getMessage() ); if (retry == max) { throw new IllegalStateException(ex); } } } } catch (final SAXException ex) { throw new IllegalStateException(ex); } catch (final IOException ex) { throw new IllegalStateException(ex); } return errors; }