auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testEnableSampling() { SamplerConfiguration samplerConfig = new SamplerConfiguration("test"); NewTableConfiguration ntcSample1 = new NewTableConfiguration().enableSampling(samplerConfig); assertTrue(ntcSample1.getProperties().containsValue("test")); RowSampler rowSampler = new RowSampler(); SamplerConfiguration sha1SamplerConfig = new SamplerConfiguration(rowSampler.getClass()); sha1SamplerConfig.setOptions(options); rowSampler.init(sha1SamplerConfig); NewTableConfiguration ntcSample2 = new NewTableConfiguration().enableSampling(sha1SamplerConfig); assertTrue(ntcSample2.getProperties().containsValue("murmur3_32")); }

Target:
public void testEnableSampling() { SamplerConfiguration sha1SamplerConfig = new SamplerConfiguration("com.mysampler"); sha1SamplerConfig.setOptions(options); NewTableConfiguration ntcSample2 = new NewTableConfiguration().enableSampling(sha1SamplerConfig); assertEquals("com.mysampler", ntcSample2.getProperties().get("table.sampler")); assertEquals("5", ntcSample2.getProperties().get("table.sampler.opt.modulus")); assertEquals("murmur3_32", ntcSample2.getProperties().get("table.sampler.opt.hasher")); }
Source:
public static void viewBlogSharing(Context context, SiteModel site) { Intent intent = new Intent(context, PublicizeListActivity.class); intent.putExtra(WordPress.SITE, site); context.startActivity(intent); }

Target:
public static void viewBlogSharing(Context context, SiteModel site) { Intent intent = new Intent(context, PublicizeListActivity.class); intent.putExtra(WordPress.SITE, site); context.startActivity(intent); AnalyticsUtils.trackWithSiteDetails(Stat.OPENED_SHARING_MANAGEMENT, site); }
Source:
protected final void activateStripe(Collection<InetSocketAddress> newNodes, Cluster cluster, InetSocketAddress destination, Measure<TimeUnit> restartDelay, Measure<TimeUnit> restartWaitTime) { activateNomadSystem(newNodes, cluster, getLicenseContentFrom(destination).orElse(null)); runClusterActivation(newNodes, cluster); logger.debug("Configuration directories have been created for all nodes"); syncNomadChangesTo(newNodes, getAllNomadChangesFrom(destination)); restartNodes(newNodes, restartDelay, restartWaitTime); }

Target:
protected final void activateStripe(Collection<InetSocketAddress> newNodes, Cluster cluster, InetSocketAddress destination, Measure<TimeUnit> restartDelay, Measure<TimeUnit> restartWaitTime) { activateNomadSystem(newNodes, cluster, getLicenseContentFrom(destination).orElse(null)); runClusterActivation(newNodes, cluster); syncNomadChangesTo(newNodes, getAllNomadChangesFrom(destination)); restartNodes(newNodes, restartDelay, restartWaitTime); }
Source:
public static ByteBuffer serializeJsonToByteBuffer(ObjectMapper objectMapper, Object object) { try { ByteBufferOutputStream byteBufferOutputStream = new ByteBufferOutputStream(); objectMapper.writeValue(byteBufferOutputStream, object); return byteBufferOutputStream.asByteBuffer(); } catch (IOException e) { throw new IllegalArgumentException("Failed to serialize json", e); } }

Target:
public static ByteBuffer serializeJsonToByteBuffer(ObjectMapper objectMapper, Object object) { try { ByteBufferOutputStream byteBufferOutputStream = new ByteBufferOutputStream(ONE_KB); objectMapper.writeValue(byteBufferOutputStream, object); return byteBufferOutputStream.asByteBuffer(); } catch (IOException e) { throw new IllegalArgumentException("Failed to serialize the object into json", e); } }
Source:
public void initialize() { logger.debug("Initializing the LIRC Bridge handler"); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); configuration = getConfigAs(LIRCBridgeConfiguration.class); if (connectorTask == null || connectorTask.isCancelled()) { connectorTask = scheduler.scheduleAtFixedRate(new Runnable() { @Override public void run() { logger.debug("Checking LIRC connection, thing status = {}", thing.getStatus()); if (thing.getStatus() != ThingStatus.ONLINE) { connect(); } } }, 0, 60, TimeUnit.SECONDS); } }

Target:
public void initialize() { logger.debug("Initializing the LIRC Bridge handler"); configuration = getConfigAs(LIRCBridgeConfiguration.class); if (connectorTask == null || connectorTask.isCancelled()) { connectorTask = scheduler.scheduleAtFixedRate(new Runnable() { @Override public void run() { logger.debug("Checking LIRC connection, thing status = {}", thing.getStatus()); if (thing.getStatus() != ThingStatus.ONLINE) { connect(); } } }, 0, 60, TimeUnit.SECONDS); } }
Source:
public String getAttributeValue(@Nullable String name) { return name; }

Target:
public @Nullable String getAttributeValue(@Nullable String name) { return name; }
Source:
public ApplicationRecord[] appRecordArray() { SqlStorage<ApplicationRecord> appList = CommCareApplication._().getInstalledAppRecords(); ApplicationRecord[] appArray = new ApplicationRecord[appList.getNumRecords()]; int index = 0; for (ApplicationRecord r : appList) { appArray[index++] = r; } return appArray; }

Target:
public ApplicationRecord[] appRecordArray() { ArrayList<ApplicationRecord> appList = CommCareApplication._().getInstalledAppRecords(); ApplicationRecord[] appArray = new ApplicationRecord[appList.size()]; int index = 0; for (ApplicationRecord r : appList) { appArray[index++] = r; } return appArray; }
Source:
public void testContainsAnyIgnoreCase_StringStringArray() { assertFalse(StringUtils.containsAnyIgnoreCase(null, (String[]) null)); assertFalse(StringUtils.containsAnyIgnoreCase(null, new String[0])); assertFalse(StringUtils.containsAnyIgnoreCase(null, new String[] { "hello" })); assertFalse(StringUtils.containsAnyIgnoreCase("", (String[]) null)); assertFalse(StringUtils.containsAnyIgnoreCase("", new String[0])); assertFalse(StringUtils.containsAnyIgnoreCase("", new String[] { "hello" })); assertFalse(StringUtils.containsAnyIgnoreCase("hello, goodbye", (String[]) null)); assertFalse(StringUtils.containsAnyIgnoreCase("hello, goodbye", new String[0])); assertTrue(StringUtils.containsAnyIgnoreCase("hello, goodbye", new String[]{"hello", "goodbye"})); assertTrue(StringUtils.containsAnyIgnoreCase("hello, goodbye", new String[]{"hello", "Goodbye"})); assertTrue(StringUtils.containsAnyIgnoreCase("hello, goodbye", new String[]{"Hello", "Goodbye"})); assertTrue(StringUtils.containsAnyIgnoreCase("hello, goodbye", new String[]{"Hello", null})); assertTrue(StringUtils.containsAnyIgnoreCase("hello, null", new String[] { "Hello", null })); assertTrue(StringUtils.containsAnyIgnoreCase("abcd", "AB", null)); assertTrue(StringUtils.containsAnyIgnoreCase("abcd", "ab", "CD")); assertTrue(StringUtils.containsAnyIgnoreCase("abc", "D", "abc")); assertFalse(StringUtils.containsAnyIgnoreCase("abc", "d", "efg")); }

Target:
public void testContainsAnyIgnoreCase_StringStringArray() { assertFalse(StringUtils.containsAnyIgnoreCase("", (String[]) null)); assertFalse(StringUtils.containsAnyIgnoreCase("", new String[0])); assertFalse(StringUtils.containsAnyIgnoreCase("", new String[] { "hello" })); assertFalse(StringUtils.containsAnyIgnoreCase("hello, goodbye", (String[]) null)); assertFalse(StringUtils.containsAnyIgnoreCase("hello, goodbye", new String[0])); assertTrue(StringUtils.containsAnyIgnoreCase("hello, goodbye", new String[]{"hello", "goodbye"})); assertTrue(StringUtils.containsAnyIgnoreCase("hello, goodbye", new String[]{"hello", "Goodbye"})); assertTrue(StringUtils.containsAnyIgnoreCase("hello, goodbye", new String[]{"Hello", "Goodbye"})); assertTrue(StringUtils.containsAnyIgnoreCase("hello, goodbye", new String[]{"Hello", null})); assertTrue(StringUtils.containsAnyIgnoreCase("hello, null", new String[] { "Hello", null })); assertTrue(StringUtils.containsAnyIgnoreCase("abcd", "AB", null)); assertTrue(StringUtils.containsAnyIgnoreCase("abcd", "ab", "CD")); assertTrue(StringUtils.containsAnyIgnoreCase("abc", "D", "abc")); assertFalse(StringUtils.containsAnyIgnoreCase("abc", "d", "efg")); }
Source:
public StringBuffer format(double x, StringBuffer sb) { StringBuffer temp = new StringBuffer(); if ((Math.abs(x) >= DECIMAL_MIN && x < DECIMAL_MAX) || x == 0) { x = truncate(x); long lx = (long) x; if (lx == x) { temp.append(lx); } else { temp.append(x); } } else { if (forcedDecimal) { coordFormatter.format(x, temp, ZERO); } else { temp.append(truncate(x)); } } return sb.append(eventuallyPad(temp)); }

Target:
public StringBuffer format(double x, StringBuffer sb) { String formatted; if ((Math.abs(x) >= DECIMAL_MIN && x < DECIMAL_MAX) || x == 0) { x = truncate(x); long lx = (long) x; if (lx == x) { formatted = lx + ""; } else { formatted = x + ""; } } else { if (forcedDecimal) { StringBuffer temp = new StringBuffer(); coordFormatter.format(x, temp, ZERO); formatted = temp.toString(); } else { formatted = truncate(x) + ""; } } return sb.append(zeroPad(formatted)); }
Source:
public IClientRouter addClient(IClient client) { client.setRouter(this); try { client.getHandledTypes().stream() .forEach(x -> { handlerMap.put(x, client); log.info("Registered client to handle messages of type {}", x); }); } catch (Exception ex) { } clientList.add(client); return this; }

Target:
public IClientRouter addClient(IClient client) { client.setRouter(this); try { client.getHandledTypes().stream() .forEach(x -> { handlerMap.put(x, client); log.info("Registered client to handle messages of type {}", x); }); } catch (UnsupportedOperationException ex) { log.error("No registered CorfuMsg handler for client {}", client, ex); } clientList.add(client); return this; }
Source:
private static FormValidation checkForDuplicates(String value, ModelObject context, ModelObject object) { for (CredentialsStore store : CredentialsProvider.lookupStores(object)) { if (!store.hasPermission(CredentialsProvider.VIEW)) { continue; } ModelObject storeContext = store.getContext(); for (Domain domain : store.getDomains()) { Credentials match = CredentialsMatchers .firstOrNull(store.getCredentials(domain), CredentialsMatchers.withId(value)); if (match != null) { if (storeContext == context) { return FormValidation.error("This ID is already in use"); } else { if (match.getScope() == CredentialsScope.SYSTEM) { continue; } return FormValidation.warning("The ID ‘%s’ is already in use in %s", value, storeContext instanceof Item ? ((Item) storeContext).getFullDisplayName() : storeContext.getDisplayName()); } } } } return null; }

Target:
private static FormValidation checkForDuplicates(String value, ModelObject context, ModelObject object) { CredentialsMatcher withId = CredentialsMatchers.withId(value); for (CredentialsStore store : CredentialsProvider.lookupStores(object)) { if (!store.hasPermission(CredentialsProvider.VIEW)) { continue; } ModelObject storeContext = store.getContext(); for (Domain domain : store.getDomains()) { for (Credentials match : CredentialsMatchers.filter(store.getCredentials(domain), withId)) { if (storeContext == context) { return FormValidation.error("This ID is already in use"); } else { CredentialsScope scope = match.getScope(); if (scope != null && !scope.isVisible(context)) { continue; } return FormValidation.warning("The ID ‘%s’ is already in use in %s", value, storeContext instanceof Item ? ((Item) storeContext).getFullDisplayName() : storeContext.getDisplayName()); } } } } return null; }
Source:
public int hashCode() { return HashUtil.combineHashCodes(slaDueDate.hashCode()); }

Target:
public int hashCode() { return HashUtil.combineHashCodes(Objects.hashCode(slaDueDate)); }
Source:
public JSONObject toJSON() throws JSONException { final JSONObject rv = new JSONObject(); rv.put("format", format.ordinal()); rv.put("plainLat", plainLat); rv.put("plainLon", plainLon); rv.put("latHemisphere", latHemisphere); rv.put("lonHemisphere", lonHemisphere); { final JSONArray array = new JSONArray(); for (final CalculateButton.ButtonData but : buttons) { array.put(but.toJASON()); } rv.put("buttons", array); } { final JSONArray array = new JSONArray(); for (final CalculatorVariable.VariableData equ : equations) { array.put(equ.toJSON()); } rv.put("equations", array); } { final JSONArray array = new JSONArray(); for (final CalculatorVariable.VariableData equ : freeVariables) { array.put(equ.toJSON()); } rv.put("freeVariables", array); } rv.put("notes", notes); return rv; }

Target:
public JSONObject toJSON() throws JSONException { final JSONObject returnValue = new JSONObject(); returnValue.put("format", format.ordinal()); returnValue.put("plainLat", plainLat); returnValue.put("plainLon", plainLon); returnValue.put("latHemisphere", latHemisphere); returnValue.put("lonHemisphere", lonHemisphere); returnValue.put("buttons", toJSON(buttons)); returnValue.put("equations", toJSON(equations)); returnValue.put("freeVariables", toJSON(freeVariables)); returnValue.put("notes", notes); return returnValue; }
Source:
public void run(InputStream inputStream) { try (Scanner scanner = new Scanner(inputStream)) { while (scanner.hasNextLine()) { String line = scanner.nextLine(); if (line.equals("stop")) { commandSender.printInfo(TextComponent.of("Stopping!")); break; } CommandEvent event = new CommandEvent(commandSender, line); WorldEdit.getInstance().getEventBus().post(event); if (!event.isCancelled()) { commandSender.printError(TextComponent.of("Unknown command!")); } else { saveAllWorlds(false); } } } finally { saveAllWorlds(false); } }

Target:
public void run(InputStream inputStream) { try (Scanner scanner = new Scanner(inputStream)) { while (scanner.hasNextLine()) { String line = scanner.nextLine(); if (line.equals("stop")) { commandSender.printInfo(TranslatableComponent.of("worldedit.cli.stopping")); break; } CommandEvent event = new CommandEvent(commandSender, line); WorldEdit.getInstance().getEventBus().post(event); if (!event.isCancelled()) { commandSender.printError(TranslatableComponent.of("worldedit.cli.unknown-command")); } else { saveAllWorlds(false); } } } finally { saveAllWorlds(false); } }
Source:
private boolean provideJavaClasses(IPluginModelBase[] models, IProgressMonitor monitor) { try { IProject project = fModel.getUnderlyingResource().getProject(); if (!project.hasNature(JavaCore.NATURE_ID)) return false; IJavaProject jProject = JavaCore.create(project); IPackageFragment[] packageFragments = PluginJavaSearchUtil.collectPackageFragments(models, jProject, true); SearchEngine engine = new SearchEngine(); IJavaSearchScope searchScope = PluginJavaSearchUtil.createSeachScope(jProject); SubMonitor subMonitor = SubMonitor.convert(monitor, "", packageFragments.length * 2); for (int i = 0; i < packageFragments.length; i++) { IPackageFragment pkgFragment = packageFragments[i]; if (pkgFragment.hasChildren()) { Requestor requestor = new Requestor(); engine.search(SearchPattern.createPattern(pkgFragment, IJavaSearchConstants.REFERENCES), new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }, searchScope, requestor, subMonitor.newChild(1)); if (requestor.foundMatches()) { if (provideJavaClasses(packageFragments[i], engine, searchScope, subMonitor.newChild(1))) { return true; } } else subMonitor.worked(1); } else { subMonitor.worked(2); } } } catch (CoreException e) { } return false; }

Target:
private boolean provideJavaClasses(IPluginModelBase[] models, IProgressMonitor monitor) { try { IProject project = fModel.getUnderlyingResource().getProject(); if (!project.hasNature(JavaCore.NATURE_ID)) return false; IJavaProject jProject = JavaCore.create(project); IPackageFragment[] packageFragments = PluginJavaSearchUtil.collectPackageFragments(models, jProject, true); SearchEngine engine = new SearchEngine(); IJavaSearchScope searchScope = PluginJavaSearchUtil.createSeachScope(jProject); SubMonitor subMonitor = SubMonitor.convert(monitor, packageFragments.length * 2); for (int i = 0; i < packageFragments.length; i++) { SubMonitor iterationMonitor = subMonitor.newChild(2); IPackageFragment pkgFragment = packageFragments[i]; if (pkgFragment.hasChildren()) { Requestor requestor = new Requestor(); engine.search(SearchPattern.createPattern(pkgFragment, IJavaSearchConstants.REFERENCES), new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }, searchScope, requestor, iterationMonitor.newChild(1)); if (requestor.foundMatches()) { if (provideJavaClasses(packageFragments[i], engine, searchScope, iterationMonitor.newChild(1))) { return true; } } } } } catch (CoreException e) { PDEPlugin.logException(e); } return false; }
Source:
private void prepareBuffer() { if (bufferToSend == null) { bufferToSend = ByteBuffer.allocate(sizeExcludingBlobAndCrcSize()); writeHeader(); int crcStart = bufferToSend.position(); bufferToSend.put(blobId.toBytes()); BlobPropertiesSerDe.serializeBlobProperties(bufferToSend, properties); bufferToSend.putInt(usermetadata.capacity()); bufferToSend.put(usermetadata); bufferToSend.putShort((short) blobType.ordinal()); short keyLength = blobEncryptionKey == null ? 0 : (short) blobEncryptionKey.remaining(); bufferToSend.putShort(keyLength); if (keyLength > 0) { bufferToSend.put(blobEncryptionKey); } bufferToSend.putLong(blobSize); crc.update(bufferToSend.array(), bufferToSend.arrayOffset() + crcStart, bufferToSend.position() - crcStart); nioBuffersFromBlob = blob.nioBuffers(); for (ByteBuffer bb : nioBuffersFromBlob) { crc.update(bb); bb.position(0); } crcBuf.putLong(crc.getValue()); crcBuf.flip(); bufferToSend.flip(); } }

Target:
private void prepareBuffer() { bufferToSend = ByteBuffer.allocate(sizeExcludingBlobAndCrcSize()); writeHeader(); int crcStart = bufferToSend.position(); bufferToSend.put(blobId.toBytes()); BlobPropertiesSerDe.serializeBlobProperties(bufferToSend, properties); bufferToSend.putInt(usermetadata.capacity()); bufferToSend.put(usermetadata); bufferToSend.putShort((short) blobType.ordinal()); short keyLength = blobEncryptionKey == null ? 0 : (short) blobEncryptionKey.remaining(); bufferToSend.putShort(keyLength); if (keyLength > 0) { bufferToSend.put(blobEncryptionKey); } bufferToSend.putLong(blobSize); crc.update(bufferToSend.array(), bufferToSend.arrayOffset() + crcStart, bufferToSend.position() - crcStart); nioBuffersFromBlob = blob.nioBuffers(); for (ByteBuffer bb : nioBuffersFromBlob) { crc.update(bb); bb.position(0); } crcBuf.putLong(crc.getValue()); crcBuf.flip(); bufferToSend.flip(); }
Source:
public Map<String, Object> getSpecificEventStyle(ITimeEvent event) { Map<String, Object> map = new HashMap<>(super.getSpecificEventStyle(event)); if (isType(event.getEntry(), Type.CURRENT_THREAD) && event instanceof TimeEvent) { int threadEventValue = ((TimeEvent) event).getValue(); RGBAColor color = PALETTE.get(Math.floorMod(threadEventValue + COLOR_DIFFERENCIATION_FACTOR, NUM_COLORS)); map.put(StyleProperties.BACKGROUND_COLOR, X11ColorUtils.toHexColor(color.getRed(), color.getGreen(), color.getBlue())); map.put(StyleProperties.STYLE_NAME, String.valueOf(threadEventValue)); } else if (event.getEntry() instanceof TimeGraphEntry && ((TimeGraphEntry) event.getEntry()).getEntryModel() instanceof ITimeGraphEntryModelWeighted) { ITimeGraphEntryModelWeighted model = (ITimeGraphEntryModelWeighted) ((TimeGraphEntry) event.getEntry()).getEntryModel(); int eventValue = ((TimeEvent) event).getValue(); map.put(StyleProperties.HEIGHT, (float) model.getWeight(eventValue)); } return map; }

Target:
public Map<String, Object> getSpecificEventStyle(ITimeEvent event) { Map<String, Object> map = new HashMap<>(super.getSpecificEventStyle(event)); if (isType(event.getEntry(), Type.CURRENT_THREAD) && event instanceof TimeEvent) { int threadEventValue = ((TimeEvent) event).getValue(); RGBAColor color = PALETTE.get(Math.floorMod(threadEventValue + COLOR_DIFFERENCIATION_FACTOR, NUM_COLORS)); map.put(StyleProperties.BACKGROUND_COLOR, ColorUtils.toHexColor(color.getRed(), color.getGreen(), color.getBlue())); map.put(StyleProperties.STYLE_NAME, String.valueOf(threadEventValue)); } else if (event.getEntry() instanceof TimeGraphEntry && ((TimeGraphEntry) event.getEntry()).getEntryModel() instanceof ITimeGraphEntryModelWeighted) { ITimeGraphEntryModelWeighted model = (ITimeGraphEntryModelWeighted) ((TimeGraphEntry) event.getEntry()).getEntryModel(); int eventValue = ((TimeEvent) event).getValue(); map.put(StyleProperties.HEIGHT, (float) model.getWeight(eventValue)); } return map; }
Source:
public String toString() { return "KafkaSupervisorSpec{" + "dataSchema=" + getDataSchema() + ", tuningConfig=" + getTuningConfig() + ", ioConfig=" + getIoConfig() + '}'; }

Target:
public String toString() { return "KafkaSupervisorSpec{" + "dataSchema=" + getDataSchema() + ", tuningConfig=" + getTuningConfig() + ", ioConfig=" + getIoConfig() + ", context=" + getContext() + ", suspend=" + isSuspended() + '}'; }
Source:
protected Map<String, Pair<String, String>> getExclusiveLocks() { return Collections.singletonMap(getVmTemplateId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.TEMPLATE, EngineMessage.VM_TEMPLATE_IS_LOCKED)); }

Target:
protected Map<String, Pair<String, String>> getExclusiveLocks() { Map<String, Pair<String, String>> locks = new HashMap<>(); locks.put(getVmTemplateId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.TEMPLATE, EngineMessage.VM_TEMPLATE_SYSPREP_IS_RUNNING)); getDiskImages().forEach(diskImage -> locks.put(diskImage.getId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.DISK, EngineMessage.VM_TEMPLATE_SYSPREP_IS_RUNNING))); return locks; }
Source:
public void waitForView(int viewId) { if (channel == null) return; log.tracef("Waiting on view %d being accepted", viewId); viewUpdateLock.lock(); try { while (channel != null && this.getViewId() < viewId) { try { viewUpdateCondition.await(); } catch (InterruptedException e) { log.interruptedWaitingForCoordinator(e); } } } finally { viewUpdateLock.unlock(); } }

Target:
public void waitForView(int viewId) throws InterruptedException { if (channel == null) return; log.tracef("Waiting on view %d being accepted", viewId); viewUpdateLock.lock(); try { while (channel != null && this.getViewId() < viewId) { viewUpdateCondition.await(); } } finally { viewUpdateLock.unlock(); } }
Source:
public void testExactMatchBeforeCoercion() { TypeRegistry typeManager = new TypeRegistry(); FunctionRegistry registry = createFunctionRegistry(typeManager); boolean foundOperator = false; for (SqlFunction function : registry.listOperators()) { OperatorType operatorType = unmangleOperator(function.getSignature().getName()); if (operatorType == CAST || operatorType == OperatorType.SATURATED_FLOOR_CAST) { continue; } if (!function.getSignature().getTypeVariableConstraints().isEmpty()) { continue; } if (function.getSignature().getArgumentTypes().stream().anyMatch(TypeSignature::isCalculated)) { continue; } FunctionHandle exactOperator = registry.resolveOperator(operatorType, resolveTypes(function.getSignature().getArgumentTypes(), typeManager)); assertEquals(exactOperator.getSignature(), function.getSignature()); foundOperator = true; } assertTrue(foundOperator); }

Target:
public void testExactMatchBeforeCoercion() { TypeRegistry typeManager = new TypeRegistry(); FunctionRegistry registry = createFunctionRegistry(typeManager); boolean foundOperator = false; for (SqlFunction function : registry.listOperators()) { OperatorType operatorType = unmangleOperator(function.getSignature().getName()); if (operatorType == CAST || operatorType == SATURATED_FLOOR_CAST) { continue; } if (!function.getSignature().getTypeVariableConstraints().isEmpty()) { continue; } if (function.getSignature().getArgumentTypes().stream().anyMatch(TypeSignature::isCalculated)) { continue; } FunctionHandle exactOperator = registry.resolveOperator(operatorType, resolveTypes(function.getSignature().getArgumentTypes(), typeManager)); assertEquals(exactOperator.getSignature(), function.getSignature()); foundOperator = true; } assertTrue(foundOperator); }
Source:
protected void okPressed() { boolean copyAsLink = false; if(fCopyLinkButton != null) { copyAsLink = fCopyLinkButton.getSelection(); } IResource trace = copyTrace(fNewTraceName.getText(), copyAsLink); if (trace == null) { return; } setSelectionResult(new IResource[] { trace }); super.okPressed(); }

Target:
protected void okPressed() { boolean copyAsLink = fCopyLinkButton != null ? fCopyLinkButton.getSelection() : false; IResource trace = copyTrace(fNewTraceName.getText(), copyAsLink); if (trace == null) { return; } setSelectionResult(new IResource[] { trace }); super.okPressed(); }
Source:
private TryBackToAllSnapshotsOfVmParameters(Guid vmId, Guid dstSnapshotId, boolean restoreMemory) { this(vmId, dstSnapshotId); this.restoreMemory = restoreMemory; }

Target:
public TryBackToAllSnapshotsOfVmParameters(Guid vmId, Guid dstSnapshotId, boolean restoreMemory) { this(vmId, dstSnapshotId); this.restoreMemory = restoreMemory; }
Source:
private static String msg(byte[] bytes, int offset, int length) { try { return MessageFormat.format( JGitText.get().invalidId, new String(bytes, offset, length, "US-ASCII")); } catch (UnsupportedEncodingException | StringIndexOutOfBoundsException e) { return JGitText.get().invalidId0; } }

Target:
private static String msg(byte[] bytes, int offset, int length) { try { return MessageFormat.format( JGitText.get().invalidId, new String(bytes, offset, length, US_ASCII)); } catch (StringIndexOutOfBoundsException e) { return JGitText.get().invalidId0; } }
Source:
protected static void validateNameIdFormatValue(final String format, final String value) throws WSSecurityException { if (NhincConstants.AUTH_FRWK_NAME_ID_FORMAT_EMAIL_ADDRESS.equals(format)) { emailValidator(value); } else if (NhincConstants.AUTH_FRWK_NAME_ID_FORMAT_X509.equals(format)) { nameValidator(value); } else if (NhincConstants.AUTH_FRWK_NAME_ID_FORMAT_WINDOWS_NAME.equals(format)) { partsValidator(value); } }

Target:
protected static void validateNameIdFormatValue(final String format, final String value) throws WSSecurityException { if (NhincConstants.AUTH_FRWK_NAME_ID_FORMAT_EMAIL_ADDRESS.equals(format)) { validateEmail(value); } else if (NhincConstants.AUTH_FRWK_NAME_ID_FORMAT_X509.equals(format)) { validateName(value); } else if (NhincConstants.AUTH_FRWK_NAME_ID_FORMAT_WINDOWS_NAME.equals(format)) { validateParts(value); } }
Source:
private boolean checkElementSeparator(Collection<AbstractConfigNode> nodes) { if (flavor == ConfigSyntax.JSON) { Token t = nextTokenIgnoringWhitespace(nodes); if (t == Tokens.COMMA) { nodes.add(new ConfigNodeSingleToken(t)); return true; } else { putBack(t); return false; } } else { boolean sawSeparatorOrNewline = false; Token t = nextToken(); while (true) { if (Tokens.isIgnoredWhitespace(t) || isUnquotedWhitespace(t)) { } else if (Tokens.isComment(t)) { nodes.add(new ConfigNodeComment(t)); t = nextToken(); continue; } else if (Tokens.isNewline(t)) { sawSeparatorOrNewline = true; lineNumber++; } else if (t == Tokens.COMMA) { nodes.add(new ConfigNodeSingleToken(t)); return true; } else { putBack(t); return sawSeparatorOrNewline; } nodes.add(new ConfigNodeSingleToken(t)); t = nextToken(); } } }

Target:
private boolean checkElementSeparator(Collection<AbstractConfigNode> nodes) { if (flavor == ConfigSyntax.JSON) { Token t = nextTokenCollectingWhitespace(nodes); if (t == Tokens.COMMA) { nodes.add(new ConfigNodeSingleToken(t)); return true; } else { putBack(t); return false; } } else { boolean sawSeparatorOrNewline = false; Token t = nextToken(); while (true) { if (Tokens.isIgnoredWhitespace(t) || isUnquotedWhitespace(t)) { nodes.add(new ConfigNodeSingleToken(t)); } else if (Tokens.isComment(t)) { nodes.add(new ConfigNodeComment(t)); } else if (Tokens.isNewline(t)) { sawSeparatorOrNewline = true; lineNumber++; nodes.add(new ConfigNodeSingleToken(t)); } else if (t == Tokens.COMMA) { nodes.add(new ConfigNodeSingleToken(t)); return true; } else { putBack(t); return sawSeparatorOrNewline; } t = nextToken(); } } }
Source:
private static HttpURLConnection getHttpConnection(String uri, SSLContext sslContext, String sniName) throws KeyManagementException, IOException { URL url = new URL(uri); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); if (FhirConstants.HTTP.equals(url.getProtocol())) { return urlConnection; } SSLParameters sslParamters = sslContext.getDefaultSSLParameters(); CertificateManager cm = CertificateManagerImpl.getInstance(); sslContext.init(getKeyManager(cm), getTrustManager(cm), null); SSLSocketFactory factory; if (StringUtils.isNotBlank(sniName)) { List<SNIServerName> sniHostList = new ArrayList<>(); sniHostList.add(new SNIHostName(sniName)); sslParamters.setServerNames(sniHostList); factory = new SSLSocketFactoryWrapper(sslContext.getSocketFactory(), sslParamters); } else { factory = sslContext.getSocketFactory(); } HttpsURLConnection httpsConnection = ((HttpsURLConnection) urlConnection); httpsConnection.setSSLSocketFactory(factory); if (isCNCheckDisabled()) { httpsConnection.setHostnameVerifier(getAllHostnameVerifier()); } return urlConnection; }

Target:
private static HttpURLConnection getHttpConnection(String uri, SSLContext sslContext, String sniName) throws KeyManagementException, IOException, FhirClientException { if (StringUtils.isBlank(uri)) { throw new FhirClientException("URL not specified"); } URL url = new URL(uri); if (FhirConstants.HTTPS.equals(url.getProtocol())) { return getHttpsConnection(url, sslContext, sniName); } return (HttpURLConnection) url.openConnection(); }
Source:
public FEELFnResult<BigDecimal> invoke(@ParameterName( "number" ) BigDecimal number) { if ( number == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( FEELEvent.Severity.ERROR, "number", "cannot be null" ) ); } return FEELFnResult.ofResult( new BigDecimal( Math.exp( number.doubleValue() ) ) ); }

Target:
public FEELFnResult<BigDecimal> invoke(@ParameterName( "number" ) BigDecimal number) { if ( number == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( FEELEvent.Severity.ERROR, "number", "cannot be null" ) ); } return FEELFnResult.ofResult( new BigDecimal( Math.exp( number.doubleValue() ), MathContext.DECIMAL128 ) ); }
Source:
private void readAdvertisedRefsImpl() throws IOException { final LinkedHashMap<String, Ref> avail = new LinkedHashMap<>(); for (;;) { String line; try { line = pckIn.readString(); } catch (EOFException eof) { if (avail.isEmpty()) throw noRepository(); throw eof; } if (line == PacketLineIn.END) break; if (line.startsWith("ERR ")) { throw new RemoteRepositoryException(uri, line.substring(4)); } if (avail.isEmpty()) { final int nul = line.indexOf('\0'); if (nul >= 0) { for (String c : line.substring(nul + 1).split(" ")) remoteCapablities.add(c); line = line.substring(0, nul); } } Matcher matcher = ADVERTISED_REF_PATTERN.matcher(line); if (!matcher.matches()) { continue; } String name = matcher.group(2); if (avail.isEmpty() && name.equals("capabilities^{}")) { continue; } final ObjectId id = ObjectId.fromString(matcher.group(1)); if (name.equals(".have")) { additionalHaves.add(id); } else if (name.endsWith("^{}")) { name = name.substring(0, name.length() - 3); final Ref prior = avail.get(name); if (prior == null) throw new PackProtocolException(uri, MessageFormat.format( JGitText.get().advertisementCameBefore, name, name)); if (prior.getPeeledObjectId() != null) throw duplicateAdvertisement(name + "^{}"); avail.put(name, new ObjectIdRef.PeeledTag( Ref.Storage.NETWORK, name, prior.getObjectId(), id)); } else { final Ref prior = avail.put(name, new ObjectIdRef.PeeledNonTag( Ref.Storage.NETWORK, name, id)); if (prior != null) throw duplicateAdvertisement(name); } } available(avail); }

Target:
private void readAdvertisedRefsImpl() throws IOException { final LinkedHashMap<String, Ref> avail = new LinkedHashMap<>(); for (;;) { String line; try { line = pckIn.readString(); } catch (EOFException eof) { if (avail.isEmpty()) throw noRepository(); throw eof; } if (line == PacketLineIn.END) break; if (line.startsWith("ERR ")) { throw new RemoteRepositoryException(uri, line.substring(4)); } if (avail.isEmpty()) { final int nul = line.indexOf('\0'); if (nul >= 0) { for (String c : line.substring(nul + 1).split(" ")) remoteCapablities.add(c); line = line.substring(0, nul); } } if (line.length() < 41 || line.charAt(40) != ' ') { throw invalidRefAdvertisementLine(line); } String name = line.substring(41, line.length()); if (avail.isEmpty() && name.equals("capabilities^{}")) { continue; } final ObjectId id; try { id = ObjectId.fromString(line.substring(0, 40)); } catch (InvalidObjectIdException e) { throw invalidRefAdvertisementLine(line); } if (name.equals(".have")) { additionalHaves.add(id); } else if (name.endsWith("^{}")) { name = name.substring(0, name.length() - 3); final Ref prior = avail.get(name); if (prior == null) throw new PackProtocolException(uri, MessageFormat.format( JGitText.get().advertisementCameBefore, name, name)); if (prior.getPeeledObjectId() != null) throw duplicateAdvertisement(name + "^{}"); avail.put(name, new ObjectIdRef.PeeledTag( Ref.Storage.NETWORK, name, prior.getObjectId(), id)); } else { final Ref prior = avail.put(name, new ObjectIdRef.PeeledNonTag( Ref.Storage.NETWORK, name, id)); if (prior != null) throw duplicateAdvertisement(name); } } available(avail); }
Source:
private String findDefaultR() throws ConfigurationException { File r = Paths.get(osChecker.isWindows() ? DEFAULT_WINDOWS_R_PATH : DEFAULT_LINUX_R_PATH).toFile(); if (r.exists() && r.canExecute()) { return r.getAbsolutePath(); } else { throw new ConfigurationException("Could not find R."); } }

Target:
private String findDefaultR() throws ConfigurationException { String rPath = osChecker.isWindows() ? DEFAULT_WINDOWS_R_PATH : DEFAULT_LINUX_R_PATH; File r = Paths.get(rPath).toFile(); if (r.exists() && r.canExecute()) { return r.getAbsolutePath(); } else { throw new ConfigurationException("Could not find R."); } }
Source:
public IStatus getProfileDefinitionStatus() { String profilePath = getProfileURI(); IStatus okStatus = new Status(IStatus.OK, Activator.PLUGIN_ID, ""); if (profilePath == null || profilePath.equalsIgnoreCase("")) { return okStatus; } URI profileURI = URI.createURI(profilePath); ResourceSet resourceSet = new ResourceSetImpl(); Resource resource = null; try { resource = resourceSet.getResource(profileURI, true); } catch (WrappedException ex) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ProfileChooserComposite_ProfileStatus_UnavailableResource); } if (resource == null) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ProfileChooserComposite_ProfileStatus_NullResource); } if (resource.getContents().isEmpty()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ProfileChooserComposite_ProfileStatus_EmptyResource); } EObject eObject = resource.getContents().get(0); if (!(eObject instanceof Profile)) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ProfileChooserComposite_ProfileStatus_NotAProfile); } Profile profile = (Profile) eObject; if (!profile.isDefined()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ProfileChooserComposite_ProfileStatus_ProfileNotDefined); } return okStatus; }

Target:
public IStatus getProfileDefinitionStatus() { String profilePath = getProfileURI(); if (profilePath == null || profilePath.equalsIgnoreCase("")) { return Status.OK_STATUS; } URI profileURI = URI.createURI(profilePath); ResourceSet resourceSet = Util.createTemporaryResourceSet(); Resource resource = null; try { resource = resourceSet.getResource(profileURI, true); } catch (WrappedException ex) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ProfileChooserComposite_ProfileStatus_UnavailableResource, ex); } finally { EMFHelper.unload(resourceSet); } if (resource == null) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ProfileChooserComposite_ProfileStatus_NullResource); } if (resource.getContents().isEmpty()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ProfileChooserComposite_ProfileStatus_EmptyResource); } EObject eObject = resource.getContents().get(0); if (!(eObject instanceof Profile)) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ProfileChooserComposite_ProfileStatus_NotAProfile); } Profile profile = (Profile) eObject; if (!profile.isDefined()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ProfileChooserComposite_ProfileStatus_ProfileNotDefined); } return Status.OK_STATUS; }
Source:
private String getIPAddress(JoinPoint jp) { Object[] args = jp.getArgs(); if (args.length <= 0) { throw new IllegalArgumentException(RATE_LIMIT_PRECONDITION_FAIL); } Object lastParam = args[args.length - 1]; if (lastParam instanceof HttpServletRequest) { HttpServletRequest request = (HttpServletRequest) lastParam; String ipAddress = request.getHeader("X-FORWARDED-FOR"); if (ipAddress == null) { ipAddress = request.getRemoteAddr(); } return ipAddress; } else { throw new IllegalArgumentException(RATE_LIMIT_PRECONDITION_FAIL); } }

Target:
private String getIPAddress(JoinPoint jp) { Object[] args = jp.getArgs(); if (args.length <= 0) { throw new IllegalArgumentException(RATE_LIMIT_PRECONDITION_FAIL); } Object lastParam = args[args.length - 1]; if (lastParam instanceof HttpServletRequest) { HttpServletRequest request = (HttpServletRequest) lastParam; String ipAddress = request.getHeader("X-FORWARDED-FOR"); return ipAddress == null ? request.getRemoteAddr() : ipAddress; } else { throw new IllegalArgumentException(RATE_LIMIT_PRECONDITION_FAIL); } }
Source:
public Profile get(String id) { Profile profile = null; try { File file = new File(storageFile); if (file.exists()) { JsonParser jsonParser = new JsonParser(); jsonParser.parse(new InputStreamReader(new FileInputStream(file))); JsonValue jsonFromFile = jsonParser.getJsonObject(); profile = profileFromJson(jsonFromFile); } else { profile = DtoFactory.getInstance().createDto(Profile.class).withId(id).withUserId("codenvy").withAttributes( Arrays.asList( DtoFactory.getInstance().createDto(Attribute.class).withName("First Name").withValue("Felix") .withDescription("User's first name"))); update(profile); } } catch (JsonException | IOException e) { LOG.error("It is not possible to parse file " + storageFile + " or this file not found", e); } return profile; }

Target:
public Profile get(String id) throws IOException { Profile profile = null; File file = new File(storageFile); InputStreamReader inputStreamReader = null; try { if (file.exists()) { inputStreamReader = new InputStreamReader(new FileInputStream(file)); profile = DtoFactory.getInstance().createDtoFromJson(inputStreamReader, Profile.class); } else { profile = DtoFactory.getInstance().createDto(Profile.class).withId(id).withUserId("codenvy").withAttributes( Arrays.asList( DtoFactory.getInstance().createDto(Attribute.class).withName("First Name").withValue("Felix") .withDescription("User's first name"))); update(profile); } } catch (IOException e) { LOG.error("It is not possible to parse file " + storageFile + " or this file not found", e); } finally { if (inputStreamReader != null) { inputStreamReader.close(); } } return profile; }
Source:
protected ToPagedIterable(PacketApi api, Function<Href, ListOptions> hrefToOptions) { this.api = checkNotNull(api, "api"); this.hrefToOptions = hrefToOptions; }

Target:
ToPagedIterable(PacketApi api, Function<Href, ListOptions> hrefToOptions) { this.api = api; this.hrefToOptions = hrefToOptions; }
Source:
public void checkSpecificAccessControl() { String feedbackQuestionId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); FeedbackQuestionAttributes feedbackQuestion = logic.getFeedbackQuestion(feedbackQuestionId); if (feedbackQuestion == null) { throw new EntityNotFoundException(new EntityDoesNotExistException("The feedback question does not exist.")); } verifyInstructorCanSeeQuestionIfInModeration(feedbackQuestion); Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackQuestion.getFeedbackSessionName(), feedbackQuestion.getCourseId()); switch (intent) { case STUDENT_SUBMISSION: if (userInfo == null && StringHelper.isEmpty(getRequestParamValue(Const.ParamsNames.REGKEY))) { throw new UnauthorizedAccessException("Instructor or Student account is required to access this resource."); } gateKeeper.verifyAnswerableForStudent(feedbackQuestion); StudentAttributes studentAttributes = getStudentOfCourseFromRequest(feedbackSession.getCourseId()); checkAccessControlForStudentFeedbackSubmission(studentAttributes, feedbackSession); break; case INSTRUCTOR_SUBMISSION: if (userInfo == null) { throw new UnauthorizedAccessException("Instructor account is required to access this resource."); } gateKeeper.verifyAnswerableForInstructor(feedbackQuestion); InstructorAttributes instructorAttributes = getInstructorOfCourseFromRequest(feedbackSession.getCourseId()); checkAccessControlForInstructorFeedbackSubmission(instructorAttributes, feedbackSession); break; default: throw new InvalidHttpParameterException("Unknown intent " + intent); } }

Target:
public void checkSpecificAccessControl() { String feedbackQuestionId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); FeedbackQuestionAttributes feedbackQuestion = logic.getFeedbackQuestion(feedbackQuestionId); if (feedbackQuestion == null) { throw new EntityNotFoundException(new EntityDoesNotExistException("The feedback question does not exist.")); } verifyInstructorCanSeeQuestionIfInModeration(feedbackQuestion); Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackQuestion.getFeedbackSessionName(), feedbackQuestion.getCourseId()); switch (intent) { case STUDENT_SUBMISSION: gateKeeper.verifyAnswerableForStudent(feedbackQuestion); StudentAttributes studentAttributes = getStudentOfCourseFromRequest(feedbackSession.getCourseId()); checkAccessControlForStudentFeedbackSubmission(studentAttributes, feedbackSession); break; case INSTRUCTOR_SUBMISSION: gateKeeper.verifyAnswerableForInstructor(feedbackQuestion); InstructorAttributes instructorAttributes = getInstructorOfCourseFromRequest(feedbackSession.getCourseId()); checkAccessControlForInstructorFeedbackSubmission(instructorAttributes, feedbackSession); break; default: throw new InvalidHttpParameterException("Unknown intent " + intent); } }
Source:
public void shouldOnlyCallIdentifiedTimeIfLeaseIsValid() { LeasedLockToken validToken = LeasedLockToken.of(LOCK_TOKEN, getLease()); when(timelockService.getLeaderTime()).thenReturn(getIdentifiedTime()); timelockClient.refreshLockLeases(ImmutableSet.of(validToken)); verify(timelockService).getLeaderTime(); verifyNoMoreInteractions(timelockService); }

Target:
public void shouldOnlyCallIdentifiedTimeIfLeaseIsValid() { LeasedLockToken validToken = LeasedLockToken.of(LOCK_TOKEN, getLease()); when(timelockRpcClient.getLeaderTime()).thenReturn(getIdentifiedTime()); timelockService.refreshLockLeases(ImmutableSet.of(validToken)); verify(timelockRpcClient).getLeaderTime(); verifyNoMoreInteractions(timelockRpcClient); }
Source:
public void shouldRemoveClaimWhenPassingNull() throws Exception { Algorithm algorithm = mock(Algorithm.class); JWTVerifier verifier = JWTVerifier.init(algorithm) .withSubject("1234567890") .withSubject(null) .build(); assertThat(verifier.claims, is(notNullValue())); assertThat(verifier.claims, not(hasKey("sub"))); }

Target:
public void shouldRemoveClaimWhenPassingNull() throws Exception { Algorithm algorithm = mock(Algorithm.class); JWTVerifier verifier = JWTVerifier.init(algorithm) .withIssuer("iss") .withIssuer(null) .build(); assertThat(verifier.claims, is(notNullValue())); assertThat(verifier.claims, not(hasKey("iss"))); }
Source:
public boolean cancelOrder(CancelOrderParams orderParams) throws IOException { if (orderParams instanceof CancelOrderByIdParams) { return cancelOrder(((CancelOrderByIdParams) orderParams).getOrderId()); } else { return false; } }

Target:
public boolean cancelOrder(CancelOrderParams orderParams) throws IOException { try { if (orderParams instanceof CancelOrderByIdParams) { return cancelOrder(((CancelOrderByIdParams) orderParams).getOrderId()); } else { return false; } } catch (CoingiException e) { throw CoingiErrorAdapter.adapt(e); } }
Source:
public void setData(@Nullable LatencyAnalysis analysis) { if (analysis == null) { return; } ISegmentStore<ISegment> results = analysis.getResults(); if (results != null) { updateModel(LatencyViewerUtils.storeAndGet(results)); return; } LatencyViewerUtils.runAnalysis(fListener); }

Target:
public void setData(@Nullable LatencyAnalysis analysis) { if (analysis == null) { updateModel(null); return; } ISegmentStore<ISegment> results = analysis.getResults(); if (results != null) { updateModel(LatencyViewerUtils.storeAndGet(results)); return; } updateModel(null); LatencyViewerUtils.runAnalysis(fListener); }
Source:
public Object[][] testSexDataProviderInt() { return new Object[][] { new Object[]{Sex.Male, 1, true}, new Object[]{Sex.Female, 2, true}, new Object[]{Sex.Unknown, 0, true}, new Object[]{Sex.NotReported, 0, false}, new Object[]{Sex.Female, 1, false}, new Object[]{Sex.Unknown, 2, false}, }; }

Target:
public Object[][] testSexDataProviderInt() { return new Object[][]{ {Sex.Male, 1}, {Sex.Female, 2}, {Sex.Unknown, 0}, }; }
Source:
public void periodicWorkFirstPass() { try { RecoveryStore recoveryStore = StoreManager.getRecoveryStore(); InputObjectState states = new InputObjectState(); if (recoveryStore.allObjUids(SubordinateAtomicAction.getType(), states) && (states.notempty())) { boolean finished = false; do { Uid uid = UidHelper.unpackFrom(states); if (uid.notEquals(Uid.nullUid())) { SubordinationManager .getTransactionImporter().recoverTransaction( uid); } else { finished = true; } } while (!finished); } } catch (ObjectStoreException | XAException | IOException e) { e.printStackTrace(); } }

Target:
public void periodicWorkFirstPass() { RecoveryStore recoveryStore = StoreManager.getRecoveryStore(); InputObjectState states = new InputObjectState(); Uid uid = null; try { if (recoveryStore.allObjUids(SubordinateAtomicAction.getType(), states) && (states.notempty())) { while (true) { uid = UidHelper.unpackFrom(states); if (uid.notEquals(Uid.nullUid())) { SubordinationManager .getTransactionImporter().recoverTransaction( uid); } else { break; } } } recoveryScanCompletedWithoutError = true; } catch (ObjectStoreException | XAException | IOException e) { jtaLogger.i18NLogger.warn_could_not_recover_subordinate(uid, e); recoveryScanCompletedWithoutError = false; } if (!validatePosition()) { recoveryScanCompletedWithoutError = false; } }
Source:
public String getName() { ServletContext servletContext = ResteasyContext.getContextData(ServletContext.class); FilterConfig filterConfig = ResteasyContext.getContextData(FilterConfig.class); ServletConfig servletConfig = ResteasyContext.getContextData(ServletConfig.class); return (servletContext != null ? servletContext.getServletContextName() : null) + ":" + (filterConfig != null ? filterConfig.getFilterName() : null) + ":" + (servletConfig != null ? servletConfig.getServletName() : null) + ":FilterConfigSource"; }

Target:
public String getName() { if (name == null) { synchronized(this) { if (name == null) { ServletContext servletContext = ResteasyContext.getContextData(ServletContext.class); FilterConfig filterConfig = ResteasyContext.getContextData(FilterConfig.class); StringBuilder sb = new StringBuilder(); name = sb.append(servletContext != null ? servletContext.getServletContextName() : null).append(":") .append(filterConfig != null ? filterConfig.getFilterName() : null) .append(":FilterConfigSource").toString(); } } } return name; }