auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private <C extends org.atlasapi.content.Content> C setContentFields(C c, Content input) { c.setYear(input.getYear()); c.setLanguages(input.getLanguages()); c.setCountriesOfOrigin(input.getCountriesOfOrigin()); c.setTags( translateTopicRefs( legacyTagTopicMerger.mergeTags( input.getTopicRefs(), legacyGenreToTagTransformer.mapGenresToTopicRefs(input.getGenres()) ))); c.setGenericDescription(input.getGenericDescription()); c.setEventRefs(translateEventRefs(input.events())); c.setCertificates(input.getCertificates().stream() .map(input1 -> new Certificate(input1.classification(), input1.country())) .collect(Collectors.toList())); c.setClips(transformClipsOfContent(input)); c.setPeople( input.people().stream() .map(legacyCrewMemberTransformer::apply) .filter(java.util.Objects::nonNull) .collect(Collectors.toList()) ); transformEncodings(c, input.getVersions()); return c; }

Target:
private <C extends org.atlasapi.content.Content> C setContentFields(C c, Content input) { c.setYear(input.getYear()); c.setLanguages(input.getLanguages()); c.setCountriesOfOrigin(input.getCountriesOfOrigin()); c.setTags( translateTopicRefs( legacyTagTopicMerger.mergeTags( input.getTopicRefs(), legacyGenreToTagTransformer.mapGenresToTopicRefs(input.getGenres()) ))); c.setGenericDescription(input.getGenericDescription()); c.setEventRefs(translateEventRefs(input.events())); c.setCertificates(input.getCertificates().stream() .map(certificate -> new Certificate( certificate.classification(), certificate.country() )) .collect(Collectors.toList())); c.setClips(transformClipsOfContent(input)); c.setPeople( input.people().stream() .map(legacyCrewMemberTransformer::apply) .filter(java.util.Objects::nonNull) .collect(Collectors.toList()) ); transformEncodings(c, input.getVersions()); return c; }
Source:
public PipelineStats summarize() { return new PipelineStats( pipelineId, firstStartTime, lastStartTime, lastEndTime, inputPipeline, outputPipeline, totalDrivers, queuedDrivers, queuedPartitionedDrivers, runningDrivers, runningPartitionedDrivers, completedDrivers, memoryReservation, systemMemoryReservation, queuedTime, elapsedTime, totalScheduledTime, totalCpuTime, totalUserTime, totalBlockedTime, fullyBlocked, blockedReasons, rawInputDataSize, rawInputPositions, processedInputDataSize, processedInputPositions, outputDataSize, outputPositions, spilledDataSize, operatorSummaries.stream() .map(OperatorStats::summarize) .collect(Collectors.toList()), ImmutableList.of() ); }

Target:
public PipelineStats summarize() { return new PipelineStats( pipelineId, firstStartTime, lastStartTime, lastEndTime, inputPipeline, outputPipeline, totalDrivers, queuedDrivers, queuedPartitionedDrivers, runningDrivers, runningPartitionedDrivers, blockedDrivers, completedDrivers, memoryReservation, systemMemoryReservation, queuedTime, elapsedTime, totalScheduledTime, totalCpuTime, totalUserTime, totalBlockedTime, fullyBlocked, blockedReasons, rawInputDataSize, rawInputPositions, processedInputDataSize, processedInputPositions, outputDataSize, outputPositions, spilledDataSize, operatorSummaries.stream() .map(OperatorStats::summarize) .collect(Collectors.toList()), ImmutableList.of()); }
Source:
public void onCacheEventModified( CacheEntryEvent event ) { if ( event.getKey() == this.key ) { FileBlock updatedBlock = (FileBlock) event.getValue(); if( updatedBlock.isEOF() ) { this.lock.signal(); } } }

Target:
public void onCacheEventModified( CacheEntryEvent event ) { if ( event.getKey().equals( this.key ) ) { FileBlock updatedBlock = (FileBlock) event.getValue(); if ( updatedBlock.isEOF() ) { this.lock.signal(); } } }
Source:
private boolean labelRenamed() { return NetworkUtils.isLabeled(getOldNetwork()) && NetworkUtils.isLabeled(getNetwork()) && !getOldNetwork().getLabel().equals(getNetwork().getLabel()); }

Target:
private boolean labelRenamed() { return NetworkUtils.isLabeled(getOldNetwork()) && NetworkUtils.isLabeled(getNetwork()) && labelChanged(); }
Source:
public void testDeleteDontMarkPreviouslyMarkedSearchesAsDeleted() { DatabaseSearchCacheSvcImpl.setMaximumResultsToDeleteInOnePassForUnitTest(5); DatabaseSearchCacheSvcImpl.setMaximumSearchesToCheckForDeletionCandidacyForUnitTest(10); runInTransaction(()->{ for (int i = 0; i < 20; i++) { Search search = new Search(); search.setCreated(DateUtils.addDays(new Date(), -1)); search.setLastUpdated(DateUtils.addDays(new Date(), -1), DateUtils.addDays(new Date(), -1)); search.setUuid(UUID.randomUUID().toString()); search.setSearchType(SearchTypeEnum.SEARCH); search.setStatus(SearchStatusEnum.FINISHED); mySearchDao.save(search); if (i < 3) { for (int j = 0; j < 10; j++) { SearchResult sr = new SearchResult(search); sr.setOrder(j); sr.setResourcePid((long) j); mySearchResultDao.save(sr); } } } }); runInTransaction(()->{ assertEquals(20, mySearchDao.count()); assertEquals(30, mySearchResultDao.count()); }); myCaptureQueriesListener.clear(); myDataaseCacheSvc.pollForStaleSearchesAndDeleteThem(); runInTransaction(()->{ assertEquals(13, mySearchDao.count()); assertEquals(3, mySearchDao.countDeleted()); assertEquals(15, mySearchResultDao.count()); }); myCaptureQueriesListener.clear(); myDataaseCacheSvc.pollForStaleSearchesAndDeleteThem(); runInTransaction(()->{ assertEquals(6, mySearchDao.count()); assertEquals(6, mySearchDao.countDeleted()); assertEquals(0, mySearchResultDao.count()); }); myCaptureQueriesListener.clear(); myDataaseCacheSvc.pollForStaleSearchesAndDeleteThem(); runInTransaction(()->{ assertEquals(0, mySearchDao.count()); assertEquals(0, mySearchDao.countDeleted()); assertEquals(0, mySearchResultDao.count()); }); }

Target:
public void testDeleteDontMarkPreviouslyMarkedSearchesAsDeleted() { DatabaseSearchCacheSvcImpl.setMaximumResultsToDeleteInOnePassForUnitTest(5); DatabaseSearchCacheSvcImpl.setMaximumSearchesToCheckForDeletionCandidacyForUnitTest(10); runInTransaction(()->{ for (int i = 0; i < 20; i++) { Search search = new Search(); search.setCreated(DateUtils.addDays(new Date(), -1)); search.setLastUpdated(DateUtils.addDays(new Date(), -1), DateUtils.addDays(new Date(), -1)); search.setUuid(UUID.randomUUID().toString()); search.setSearchType(SearchTypeEnum.SEARCH); search.setStatus(SearchStatusEnum.FINISHED); mySearchDao.save(search); if (i < 3) { for (int j = 0; j < 10; j++) { SearchResult sr = new SearchResult(search); sr.setOrder(j); sr.setResourcePid((long) j); mySearchResultDao.save(sr); } } } }); runInTransaction(()->{ assertEquals(20, mySearchDao.count()); assertEquals(30, mySearchResultDao.count()); }); myDataaseCacheSvc.pollForStaleSearchesAndDeleteThem(); runInTransaction(()->{ assertEquals(13, mySearchDao.count()); assertEquals(3, mySearchDao.countDeleted()); assertEquals(15, mySearchResultDao.count()); }); myDataaseCacheSvc.pollForStaleSearchesAndDeleteThem(); runInTransaction(()->{ assertEquals(6, mySearchDao.count()); assertEquals(6, mySearchDao.countDeleted()); assertEquals(0, mySearchResultDao.count()); }); myDataaseCacheSvc.pollForStaleSearchesAndDeleteThem(); runInTransaction(()->{ assertEquals(0, mySearchDao.count()); assertEquals(0, mySearchDao.countDeleted()); assertEquals(0, mySearchResultDao.count()); }); }
Source:
public Object generateValue(Object key, int size, Random random) { return new RandomStream(key.hashCode(), size); }

Target:
public Object generateValue(Object key, int size, Random random) { return new RandomStream(size); }
Source:
public static Event getEvent(Context context, long id) { ContentResolver cr = context.getContentResolver(); Cursor evtCur = cr.query( CalendarContract.Events.CONTENT_URI, EVENT_PROJECTION, CalendarContract.Events._ID + "=" + id, null, null); evtCur.moveToFirst(); Event event = eventFromCusrsor(context, evtCur); evtCur.close(); return event; }

Target:
public static Event getEvent(Context context, long id) { ContentResolver cr = context.getContentResolver(); Cursor evtCur = cr.query( CalendarContract.Events.CONTENT_URI, EVENT_PROJECTION, CalendarContract.Events._ID + "=" + id, null, null); evtCur.moveToFirst(); if(evtCur.getCount() < 1) { return null; } Event event = fromCursor(context, evtCur); evtCur.close(); return event; }
Source:
protected Node loadXMLNode() { try { File XMLFile = fFilePath.toFile(); if (XMLFile == null || !XMLFile.exists() || !XMLFile.isFile()) { return null; } DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder; dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(XMLFile); doc.getDocumentElement().normalize(); NodeList stateproviderNodes = doc.getElementsByTagName(TmfXmlStrings.STATE_PROVIDER); Element stateproviderNode = null; for (int i = 0; i < stateproviderNodes.getLength(); i++) { Element node = (Element) stateproviderNodes.item(i); String analysisid = node.getAttribute(TmfXmlStrings.ANALYSIS_ID); if (analysisid.equals(fStateId)) { stateproviderNode = node; } } return stateproviderNode; } catch (ParserConfigurationException e) { Activator.logError("Error loading XML file", e); } catch (SAXException e) { Activator.logError(NLS.bind(Messages.XmlUtils_XmlValidationError, e.getLocalizedMessage()), e); } catch (IOException e) { Activator.logError("Error loading XML file", e); } return null; }

Target:
protected Node loadXMLNode() { try { File XMLFile = fFilePath.toFile(); if (XMLFile == null || !XMLFile.exists() || !XMLFile.isFile()) { return null; } DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder; dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(XMLFile); doc.getDocumentElement().normalize(); NodeList stateproviderNodes = doc.getElementsByTagName(TmfXmlStrings.STATE_PROVIDER); Element stateproviderNode = null; for (int i = 0; i < stateproviderNodes.getLength(); i++) { Element node = (Element) stateproviderNodes.item(i); String analysisid = node.getAttribute(TmfXmlStrings.ANALYSIS_ID); if (analysisid.equals(fStateId)) { stateproviderNode = node; } } return stateproviderNode; } catch (ParserConfigurationException | IOException e) { Activator.logError("Error loading XML file", e); } catch (SAXException e) { Activator.logError(NLS.bind(Messages.XmlUtils_XmlValidationError, e.getLocalizedMessage()), e); } return null; }
Source:
public static void escapeJson(final StringBuilder toAppendTo, final int start) { int escapeCount = 0; for (int i = start; i < toAppendTo.length(); i++) { final char c = toAppendTo.charAt(i); switch (c) { case '\b': case '\t': case '\f': case '\n': case '\r': case '"': case '\\': escapeCount++; break; default: if (Character.isISOControl(c)) { escapeCount += 5; } } } int lastChar = toAppendTo.length() - 1; toAppendTo.setLength(toAppendTo.length() + escapeCount); int lastPos = toAppendTo.length() - 1; for (int i = lastChar; i >= start; i--) { final char c = toAppendTo.charAt(i); switch (c) { case '\b': lastPos = escapeAndDecrement(toAppendTo, lastPos, 'b'); break; case '\t': lastPos = escapeAndDecrement(toAppendTo, lastPos, 't'); break; case '\f': lastPos = escapeAndDecrement(toAppendTo, lastPos, 'f'); break; case '\n': lastPos = escapeAndDecrement(toAppendTo, lastPos, 'n'); break; case '\r': lastPos = escapeAndDecrement(toAppendTo, lastPos, 'r'); break; case '"': lastPos = escapeAndDecrement(toAppendTo, lastPos, '"'); break; case '\\': lastPos = escapeAndDecrement(toAppendTo, lastPos, '\\'); break; default: if (Character.isISOControl(c)) { toAppendTo.setCharAt(lastPos - 5, '\\'); toAppendTo.setCharAt(lastPos - 4, 'u'); toAppendTo.setCharAt(lastPos - 3, '0'); toAppendTo.setCharAt(lastPos - 2, '0'); toAppendTo.setCharAt(lastPos - 1, Chars.getUpperCaseHex((c & 0xF0) >> 4)); toAppendTo.setCharAt(lastPos, Chars.getUpperCaseHex(c & 0xF)); lastPos -= 6; } else { toAppendTo.setCharAt(lastPos, c); lastPos--; } } } }

Target:
public static void escapeJson(final StringBuilder toAppendTo, final int start) { int escapeCount = 0; for (int i = start; i < toAppendTo.length(); i++) { final char c = toAppendTo.charAt(i); switch (c) { case '\b': case '\t': case '\f': case '\n': case '\r': case '"': case '\\': escapeCount++; break; default: if (Character.isISOControl(c)) { escapeCount += 5; } } } int lastChar = toAppendTo.length() - 1; toAppendTo.setLength(toAppendTo.length() + escapeCount); int lastPos = toAppendTo.length() - 1; for (int i = lastChar; lastPos > i; i--) { final char c = toAppendTo.charAt(i); switch (c) { case '\b': lastPos = escapeAndDecrement(toAppendTo, lastPos, 'b'); break; case '\t': lastPos = escapeAndDecrement(toAppendTo, lastPos, 't'); break; case '\f': lastPos = escapeAndDecrement(toAppendTo, lastPos, 'f'); break; case '\n': lastPos = escapeAndDecrement(toAppendTo, lastPos, 'n'); break; case '\r': lastPos = escapeAndDecrement(toAppendTo, lastPos, 'r'); break; case '"': case '\\': lastPos = escapeAndDecrement(toAppendTo, lastPos, c); break; default: if (Character.isISOControl(c)) { toAppendTo.setCharAt(lastPos--, Chars.getUpperCaseHex(c & 0xF)); toAppendTo.setCharAt(lastPos--, Chars.getUpperCaseHex((c & 0xF0) >> 4)); toAppendTo.setCharAt(lastPos--, '0'); toAppendTo.setCharAt(lastPos--, '0'); toAppendTo.setCharAt(lastPos--, 'u'); toAppendTo.setCharAt(lastPos--, '\\'); } else { toAppendTo.setCharAt(lastPos, c); lastPos--; } } } }
Source:
private void assertMutatesEquivalent(List<Mutation> mutations, InMemoryMap imm1, InMemoryMap imm2) { int mutationKVPairs = countKVPairs(mutations); List<MemKey> memKeys1 = getArrayOfMemKeys(imm1); List<MemKey> memKeys2 = getArrayOfMemKeys(imm2); assertEquals("Not all key value pairs included: " + dumpInMemoryMap(imm1, memKeys1), mutationKVPairs, memKeys1.size()); assertEquals("Not all key value pairs included: " + dumpInMemoryMap(imm2, memKeys2), mutationKVPairs, memKeys2.size()); assertEquals("InMemoryMaps differ in size: " + dumpInMemoryMap(imm1, memKeys1) + "\n" + dumpInMemoryMap(imm2, memKeys2), memKeys1.size(), memKeys2.size()); assertEquals("InMemoryMap did not have distinct kvCounts " + dumpInMemoryMap(imm1, memKeys1), mutationKVPairs, getUniqKVCount(memKeys1).size()); assertEquals("InMemoryMap did not have distinct kvCounts " + dumpInMemoryMap(imm2, memKeys2), mutationKVPairs, getUniqKVCount(memKeys2).size()); }

Target:
private void assertMutatesEquivalent(List<Mutation> mutations, InMemoryMap imm1, InMemoryMap imm2) { int mutationKVPairs = countKVPairs(mutations); List<MemKey> memKeys1 = getArrayOfMemKeys(imm1); List<MemKey> memKeys2 = getArrayOfMemKeys(imm2); assertEquals("Not all key value pairs included: " + dumpInMemoryMap(imm1, memKeys1), mutationKVPairs, memKeys1.size()); assertEquals("InMemoryMaps differ in size: " + dumpInMemoryMap(imm1, memKeys1) + "\n" + dumpInMemoryMap(imm2, memKeys2), memKeys1.size(), memKeys2.size()); assertEquals("InMemoryMap did not have distinct kvCounts " + dumpInMemoryMap(imm1, memKeys1), mutationKVPairs, getUniqKVCount(memKeys1)); assertEquals("InMemoryMap did not have distinct kvCounts " + dumpInMemoryMap(imm2, memKeys2), mutationKVPairs, getUniqKVCount(memKeys2)); }
Source:
public Map<String, String> getOrcSchemaMapping() { String prefix = "secor.orc.schema.mapfile.topic"; return getKeyValueFromPrefix(prefix); }

Target:
public Map<String, String> getOrcSchemaMapping() { return getKeyValueFromPrefix("secor.orc.schema.mapfile.topic"); }
Source:
public void cleanup() { logger.debug("EventHubBolt cleanup"); try { ehClient.close().whenCompleteAsync((voidargs, error) -> { try { if (error != null) { logger.error("Exception during EventHubBolt cleanup phase" + error.toString()); } if (sender != null) { sender.closeSync(); } } catch (Exception e) { logger.error("Exception during EventHubBolt cleanup phase" + e.toString()); } }).get(); executorService.shutdown(); } catch (InterruptedException | ExecutionException e) { logger.error("Exception occured during cleanup phase" + e.toString()); } finally { sender = null; ehClient = null; } }

Target:
public void cleanup() { logger.debug("EventHubBolt cleanup"); if (sender != null) { try { sender.closeSync(); } catch (EventHubException e) { logger.error("Exception occurred while cleaning up sender" + e.toString()); } finally { sender = null; } } if (ehClient != null) { try { ehClient.closeSync(); } catch (EventHubException e) { logger.error("Exception occurred during EventHubClient cleanup phase" + e.toString()); } finally { ehClient = null; } } if (executorService != null) { executorService.shutdown(); try { executorService.awaitTermination(2, TimeUnit.SECONDS); } catch (InterruptedException e) { logger.warn("Exception occurred while terminating ExecutorService: " + e.toString()); } finally { executorService = null; } } }
Source:
public String toString(List<? extends DocTree> tags, Element element) { if (tags.size() == 0) { return null; } StringBuilder buf = new StringBuilder(String.format("%n<dl><dt><span class=\"strong\">%s</span></dt>%n", getHeader())); for (DocTree t : tags) { String text = ((UnknownBlockTagTree) t).getContent().get(0).toString(); buf.append(" <dd>").append(genLink(text)).append("</dd><br/>"); } return buf.toString(); }

Target:
public String toString(List<? extends DocTree> tags, Element element) { if (tags.size() == 0) { return null; } StringBuilder buf = new StringBuilder(String.format("<dl><dt><span class=\"strong\">%s</span></dt>", getHeader())); for (DocTree tag : tags) { String text = ((UnknownBlockTagTree) tag).getContent().get(0).toString(); buf.append("<dd>").append(genLink(text)).append("</dd>"); } return buf.toString(); }
Source:
public java.util.List<List<Alert>> filterAlertsByRiskLevel( ExtensionExportReport extension, List<List<Alert>> alerts) { ArrayList<String> selectedRisks = extension.getIncludedAlertSeverity(); ArrayList<String> alertRisks = extension.getAlertSeverity(); boolean isSelected; for (int i = alerts.size() - 1; i >= 0; i--) { List<Alert> alertList = alerts.get(i); isSelected = false; for (int j = alertList.size() - 1; j >= 0; j--) { Alert alert = alertList.get(j); for (int k = 0; k < selectedRisks.size(); k++) { if (alertRisks.get(alert.getRisk()).equals(selectedRisks.get(k))) { isSelected = true; } } if (!isSelected) { alertList.remove(j); } } if (alerts.get(i).size() == 0) { alerts.remove(i); } } return alerts; }

Target:
public java.util.List<List<Alert>> filterAlertsByRiskLevel( ExtensionExportReport extension, List<List<Alert>> alerts) { ArrayList<String> selectedRisks = extension.getIncludedAlertSeverity(); ArrayList<String> alertRisks = extension.getAlertSeverity(); for (int i = alerts.size() - 1; i >= 0; i--) { List<Alert> alertList = alerts.get(i); for (int j = alertList.size() - 1; j >= 0; j--) { Alert alert = alertList.get(j); if (!selectedRisks.contains(alertRisks.get(alert.getRisk()))) { alertList.remove(j); } } if (alerts.get(i).size() == 0) { alerts.remove(i); } } return alerts; }
Source:
protected <T> Stream<Object> resolveEventTargets(EventMessage message, T parentEntity, Member member, ForwardingMode eventForwardingMode) { Map<?, Object> fieldValue = ReflectionUtils.getMemberValue(member, parentEntity); return fieldValue == null ? Stream.empty() : eventForwardingMode.filterCandidates(message, fieldValue.values().stream()); }

Target:
protected <T> Stream<Object> resolveEventTargets(EventMessage message, T parentEntity, Member member, ForwardingMode eventForwardingMode) { Map<?, Object> memberValue = ReflectionUtils.getMemberValue(member, parentEntity); return memberValue == null ? Stream.empty() : eventForwardingMode.filterCandidates(message, memberValue.values().stream()); }
Source:
public void setDisableHyperLink() { if (!selectHyperLinkLabel.isDisposed()) { selectHyperLinkLabel.setEnabled(false); } if (!clearHyperLinkLabel.isDisposed()) { clearHyperLinkLabel.setEnabled(false); } }

Target:
public void setDisableHyperLink() { if (selectHyperLinkLabel != null && !selectHyperLinkLabel.isDisposed()) { selectHyperLinkLabel.setEnabled(false); } if (clearHyperLinkLabel != null && !clearHyperLinkLabel.isDisposed()) { clearHyperLinkLabel.setEnabled(false); } }
Source:
private void updatePatchedValues(Context context, EPersonRest ePersonRest, EPerson ePerson) throws SQLException, AuthorizeException { if (ePersonRest.getPassword() != null) { es.setPassword(ePerson, ePersonRest.getPassword()); } if (ePersonRest.isRequireCertificate() != ePerson.getRequireCertificate()) { ePerson.setRequireCertificate(ePersonRest.isRequireCertificate()); } if (ePersonRest.isCanLogIn() != ePerson.canLogIn()) { ePerson.setCanLogIn(ePersonRest.isCanLogIn()); } if (ePersonRest.getNetid() != null) { if (!ePersonRest.getNetid().equals(ePerson.getName())) { ePerson.setNetid(ePersonRest.getNetid()); } } es.update(context, ePerson); }

Target:
private void updatePatchedValues(Context context, EPersonRest ePersonRest, EPerson ePerson) throws SQLException, AuthorizeException { if (ePersonRest.getPassword() != null) { es.setPassword(ePerson, ePersonRest.getPassword()); } if (ePersonRest.isRequireCertificate() != ePerson.getRequireCertificate()) { ePerson.setRequireCertificate(ePersonRest.isRequireCertificate()); } if (ePersonRest.isCanLogIn() != ePerson.canLogIn()) { ePerson.setCanLogIn(ePersonRest.isCanLogIn()); } if (!Objects.equals(ePersonRest.getNetid(), ePerson.getNetid())) { ePerson.setNetid(ePersonRest.getNetid()); } es.update(context, ePerson); }
Source:
public Optional<StorageFile> getFile() { if (layout == StorageFileLayout.BUNDLE) { if (parts.length < 2) { return Optional.empty(); } val gnosId = getGnosId(); val fileName = getFilename(); return context.getFilesByGnosId(gnosId).stream() .filter(file -> file.getFileName().equals(fileName)) .findFirst(); } else if (layout == StorageFileLayout.OBJECT_ID) { if (parts.length == 0) { return Optional.empty(); } val fileName = getFilename(); if (fileName.endsWith(".bai")) { val bamObjectId = fileName.replace(".bai", ""); return context.getBaiFile(bamObjectId); } else if (fileName.endsWith(".tbi")) { val vcfObjectId = fileName.replace(".tbi", ""); return context.getTbiFile(vcfObjectId); } return Optional.ofNullable(context.getFile(fileName)); } return null; }

Target:
public Optional<StorageFile> getFile() { if (layout == StorageFileLayout.BUNDLE) { if (parts.length < 2) { return Optional.empty(); } val gnosId = getGnosId(); val fileName = getFilename(); return context.getFilesByGnosId(gnosId).stream() .filter(file -> file.getFileName().equals(fileName)) .findFirst(); } else if (layout == StorageFileLayout.OBJECT_ID) { if (parts.length == 0) { return Optional.empty(); } val fileName = getFilename(); val indexFileType = IndexFileType.fromPath(fileName); if (indexFileType.isPresent()) { val objectId = IndexFileType.getFileName(fileName); return context.getIndexFile(objectId, indexFileType.get()); } return Optional.ofNullable(context.getFile(fileName)); } return null; }
Source:
public void testInvalidInput() { assertNotNull(new XmlPatternStateProvider(new TmfTraceStub(), "Bla", Path.fromOSString(""), (@NonNull ISegment segment) -> { })); }

Target:
public void testInvalidInput() { assertNotNull(new XmlPatternStateProvider(CtfTmfTestTraceUtils.getTrace(getTrace()), "Bla", Path.fromOSString(""), (@NonNull ISegment segment) -> { })); }
Source:
public String resolveExpression() { String expr = getType().getMetricExpression(); if (expr == null || expr.isEmpty()) { expr = "$metric"; } if (expr.contains("$metric")) { StringBuilder metricString = new StringBuilder(); if (getMetricFamily() != null) { metricString.append(getMetricFamily()); } if (getMetricLabels() != null && !getMetricLabels().isEmpty()) { String comma = ""; metricString.append("{"); for (Map.Entry<String, String> label : getMetricLabels().entrySet()) { metricString.append(comma) .append(label.getKey()) .append("=\"") .append(label.getValue()) .append("\""); comma = ","; } metricString.append("}"); } expr = expr.replaceAll("\\$metric", metricString.toString()); } return expr; }

Target:
public String resolveExpression() { String expr = getType().getMetricExpression(); if (expr == null || expr.isEmpty()) { expr = "$metric"; } if (expr.contains("$metric")) { StringBuilder metricString = new StringBuilder(); if (getMetricFamily() != null) { metricString.append(getMetricFamily()); } if (getMetricLabels() != null && !getMetricLabels().isEmpty()) { String comma = ""; metricString.append("{"); for (Map.Entry<String, String> label : getMetricLabels().entrySet()) { metricString.append(comma) .append(label.getKey()) .append("=\"") .append(label.getValue()) .append("\""); comma = ","; } metricString.append("}"); } expr = expr.replace("$metric", metricString.toString()); } return expr; }
Source:
public SchemaRegistryAvroSerializer buildSyncClient() { return new SchemaRegistryAvroSerializer( this.registryUrl, this.credential, this.schemaGroup, this.autoRegisterSchemas, this.maxSchemaMapSize); }

Target:
public SchemaRegistryAvroSerializer buildSyncClient() { CachedSchemaRegistryClient client = new CachedSchemaRegistryClientBuilder() .endpoint(registryUrl) .credential(credential) .maxSchemaMapSize(maxSchemaMapSize) .buildClient(); return new SchemaRegistryAvroSerializer(client, this.schemaGroup, this.autoRegisterSchemas); }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ContentValuesEntry other = (ContentValuesEntry) obj; return areEqual(key, other.key) && areEqual(value, other.value); }

Target:
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ContentValuesEntry other = (ContentValuesEntry) obj; return areEqual(key, other.key) && areEqual(value, other.value); }
Source:
public static int randomIntInRange(final int from, final int to) { if (from > to) { throw new ValidationException(String.format("From (%d) must be less than to (%d)", from, to), "from", "to"); } else if (from == to) { throw new ValidationException(String.format("From (%d) must be different to (%d)", from, to), "from", "to"); } return from + Randoms.randomInt(to - from); }

Target:
public static int randomIntInRange(final int from, final int to) { int returnValue; if (from > to) { throw new IllegalArgumentException(String.format("From (%d) must be less than to (%d)", from, to)); } else { returnValue = from + Randoms.randomInt(to - from); } return returnValue; }
Source:
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.fragment_description_edit, container, false); unbinder = ButterKnife.bind(this, view); source = getArguments().getInt(ARG_INVOKE_SOURCE, InvokeSource.PAGE_ACTIVITY.ordinal()); editView.setTranslationEdit(source == InvokeSource.EDIT_FEED_TRANSLATE_TITLE_DESC.ordinal()); editView.setTranslationSourceLanguageDescription(getArguments().getCharSequence(ARG_TRANSLATION_SOURCE_LANG_DESC)); editView.setPageTitle(pageTitle); editView.setHighlightText(highlightText); editView.setCallback(new EditViewCallback()); if (reviewEnabled) { loadPageSummary(savedInstanceState); } if (funnel != null) { funnel.logReady(); } return view; }

Target:
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.fragment_description_edit, container, false); unbinder = ButterKnife.bind(this, view); editView.setTranslationEdit(invokeSource == EDIT_FEED_TRANSLATE_TITLE_DESC); editView.setTranslationSources(getArguments().getCharSequence(ARG_TRANSLATION_SOURCE_DESCRIPTION), getArguments().getString(ARG_TRANSLATION_SOURCE_LANGUAGE_CODE)); editView.setPageTitle(pageTitle); editView.setHighlightText(highlightText); editView.setCallback(new EditViewCallback()); editView.editTaskEnabled(reviewEnabled); if (reviewEnabled) { editView.setVisibility(View.GONE); editView.showProgressBar(true); loadPageSummary(savedInstanceState); } if (funnel != null) { funnel.logReady(); } return view; }
Source:
void processAnnotatedType(@Observes ProcessAnnotatedType<NoAnnotationBean> bean) { if(classToProcess.contains(bean.getAnnotatedType().getJavaClass())) { AnnotatedTypeWrapper<NoAnnotationBean> wrapper = new AnnotatedTypeWrapper<NoAnnotationBean>(bean); wrapper.addAnnotation(new TransactionalLiteral()); bean.setAnnotatedType(wrapper); } }

Target:
void processAnnotatedType(@Observes ProcessAnnotatedType<NoAnnotationBean> bean) { AnnotatedTypeWrapper<NoAnnotationBean> wrapper = new AnnotatedTypeWrapper<NoAnnotationBean>(bean); wrapper.addAnnotation(new TransactionalLiteral()); bean.setAnnotatedType(wrapper); }
Source:
private void addSubmodule(String url, String name, String revision, List<CopyFile> copyfiles) throws SAXException { if (repo.isBare()) { Project proj = new Project(url, name, revision, null); proj.copyfiles.addAll(copyfiles); bareProjects.add(proj); } else { SubmoduleAddCommand add = git .submoduleAdd() .setPath(name) .setURI(url); if (monitor != null) add.setProgressMonitor(monitor); try { Repository subRepo = add.call(); if (revision != null) { Git git = new Git(subRepo); git.checkout().setName(findRef(revision, subRepo)).call(); git.add().addFilepattern(name).call(); } for (CopyFile copyfile : copyfiles) { copyfile.copy(); this.git.add().addFilepattern(copyfile.dest).call(); } } catch (GitAPIException e) { throw new SAXException(e); } catch (IOException e) { throw new SAXException(e); } } }

Target:
private void addSubmodule(String url, String name, String revision, List<CopyFile> copyfiles) throws SAXException { if (repo.isBare()) { Project proj = new Project(url, name, revision, null); proj.copyfiles.addAll(copyfiles); bareProjects.add(proj); } else { SubmoduleAddCommand add = git .submoduleAdd() .setPath(name) .setURI(url); if (monitor != null) add.setProgressMonitor(monitor); try { Repository subRepo = add.call(); if (revision != null) { Git sub = new Git(subRepo); sub.checkout().setName(findRef(revision, subRepo)).call(); git.add().addFilepattern(name).call(); } for (CopyFile copyfile : copyfiles) { copyfile.copy(); git.add().addFilepattern(copyfile.dest).call(); } } catch (GitAPIException e) { throw new SAXException(e); } catch (IOException e) { throw new SAXException(e); } } }
Source:
public void finish(TimePeriod timeout) { new PushButton("Finish").click(); new WaitWhile(new ShellWithTextIsActive(TITLE), TimePeriod.NORMAL, false); try { activate(); new PushButton("Resolve All Later").click(); new PushButton("Finish").click(); } catch (Exception e) { } try { new DefaultShell("Incomplete Maven Goal Execution"); new PushButton("OK").click(); } catch (CoreLayerException | SWTLayerException e) { } new WaitWhile(new ShellWithTextIsAvailable(TITLE), TimePeriod.LONG); new WaitWhile(new JobIsRunning(), timeout); AbstractWait.sleep(TimePeriod.NORMAL); new WaitWhile(new JobIsRunning(), TimePeriod.LONG); AbstractWait.sleep(TimePeriod.NORMAL); }

Target:
public void finish(TimePeriod timeout) { Shell shell = new DefaultShell(TITLE); new PushButton("Finish").click(); new WaitWhile(new ShellIsAvailable(shell), TimePeriod.NORMAL); try { ResolveDialog dialog = new ResolveDialog(); dialog.resolveAllLater(); dialog.finish(); } catch (Exception e) { } try { IncompleteDialog dialog = new IncompleteDialog(); dialog.ok(); } catch (CoreLayerException | SWTLayerException e) { } new WaitUntil(new JobIsRunning(), TimePeriod.NORMAL, false); new WaitWhile(new JobIsRunning(), timeout); }
Source:
public ThingUID getThingUID(ServiceInfo info) { if (info != null) { logger.trace("ServiceInfo: " + info); ThingTypeUID typeUID = getThingTypeUID(info); if (typeUID != null) { if (info.getType() != null) { if (info.getType().equals(getServiceType())) { logger.trace("Discovered a Bose SoundTouch thing with name '{}'", info.getName()); byte[] mac = getMacAddress(info); if (mac != null) { return new ThingUID(typeUID, new String(mac)); } else { return null; } } } } } return null; }

Target:
public ThingUID getThingUID(ServiceInfo info) { logger.trace("ServiceInfo: {}", info); ThingTypeUID typeUID = getThingTypeUID(info); if (typeUID != null) { if (info.getType() != null) { if (info.getType().equals(getServiceType())) { logger.trace("Discovered a Bose SoundTouch thing with name '{}'", info.getName()); byte[] mac = getMacAddress(info); if (mac != null) { return new ThingUID(typeUID, new String(mac)); } else { return null; } } } } return null; }
Source:
private UserProfile translateUser(String translateFrom) { int separator = -1; UserProfile result = new UserProfile(); if (userNameFormat == UserNameFormat.UPN && translateFrom.indexOf("\\") == -1) { separator = translateFrom.lastIndexOf("@"); result.userName = translateFrom.substring(0, separator); result.profile = translateFrom.substring(separator+1); } else if (userNameFormat == UserNameFormat.RESTAPI_SPECIFIC && translateFrom.indexOf("@") == -1) { separator = translateFrom.indexOf("\\"); result.profile = translateFrom.substring(0, separator); result.userName = translateFrom.substring(separator+1); } return result; }

Target:
private UserProfile translateUser(String translateFrom) { int separator = -1; UserProfile result = new UserProfile(); if (userNameFormat == UserNameFormat.UPN) { separator = translateFrom.lastIndexOf("@"); result.userName = translateFrom.substring(0, separator); result.profile = translateFrom.substring(separator+1); } else if (userNameFormat == UserNameFormat.RESTAPI_SPECIFIC) { separator = translateFrom.indexOf("\\"); result.profile = translateFrom.substring(0, separator); result.userName = translateFrom.substring(separator+1); } return result; }
Source:
public static String getResponseBodyContent(final HttpEntity entity) throws IOException, ParseException { if (entity == null) { throw new IllegalArgumentException("HTTP entity may not be null."); } InputStream instream = entity.getContent(); if (entity.getContentLength() > Integer.MAX_VALUE) { throw new IllegalArgumentException("HTTP entity too large to be buffered in memory."); } String charset = getContentCharSet(entity); if (charset == null) { charset = HTTP.DEFAULT_CONTENT_CHARSET; } Reader reader = new InputStreamReader(instream, charset); StringBuilder buffer = new StringBuilder(); try { char[] bufferSize = new char[1024]; int length; while ((length = reader.read(bufferSize)) != -1) { buffer.append(bufferSize, 0, length); } } finally { reader.close(); } return buffer.toString(); }

Target:
public static String getResponseBodyContent(final HttpEntity entity) throws IOException, ParseException { InputStream instream = entity.getContent(); if (entity.getContentLength() > Integer.MAX_VALUE) { throw new IllegalArgumentException("HTTP entity too large to be buffered in memory."); } String charset = getContentCharSet(entity); if (charset == null) { charset = HTTP.DEFAULT_CONTENT_CHARSET; } Reader reader = new InputStreamReader(instream, charset); StringBuilder buffer = new StringBuilder(); try { char[] bufferSize = new char[1024]; int length; while ((length = reader.read(bufferSize)) != -1) { buffer.append(bufferSize, 0, length); } } finally { reader.close(); } return buffer.toString(); }
Source:
public void writeTuples(final ReadableTable tuples) throws IOException { final String[] row = new String[tuples.numColumns()]; Schema tbsc = tuples.getSchema(); for (int i = 0; i < tuples.numTuples(); ++i) { for (int j = 0; j < tuples.numColumns(); ++j) { Type type = tbsc.getColumnType(j); if (type.equals(Type.BLOB_TYPE)) { String filename = UUID.randomUUID().toString(); ByteBuffer bb = tuples.getBlob(j, i); writeBBtoFile(bb, filename); row[j] = filename; } else { row[j] = tuples.getObject(j, i).toString(); } } csvPrinter.printRecord((Object[]) row); } }

Target:
public void writeTuples(final ReadableTable tuples) throws IOException { final String[] row = new String[tuples.numColumns()]; Schema tbsc = tuples.getSchema(); for (int i = 0; i < tuples.numTuples(); ++i) { for (int j = 0; j < tuples.numColumns(); ++j) { Type type = tbsc.getColumnType(j); if (type.equals(Type.BLOB_TYPE)) { ByteBuffer bb = tuples.getBlob(j, i); String filename = writeToTempFile(bb); row[j] = filename; } else { row[j] = tuples.getObject(j, i).toString(); } } csvPrinter.printRecord((Object[]) row); } }
Source:
String elementToString(String qName, Attributes attributes, boolean isEndElement) { StringBuilder returnValue = new StringBuilder("<"); if (isEndElement) { returnValue.append('/'); } returnValue.append(qName); if (attributes != null) { for (int i = 0; i < attributes.getLength(); i++) { returnValue.append(" "); returnValue.append(attributes.getQName(i)); String value = attributes.getValue(i); if (value != null) { returnValue.append("=\""); returnValue.append(value); returnValue.append('"'); } } } returnValue.append(">"); return returnValue.toString(); }

Target:
private String elementToString(String qName, Attributes attributes, boolean isEndElement) { StringBuilder returnValue = new StringBuilder("<"); if (isEndElement) { returnValue.append('/'); } returnValue.append(qName); if (attributes != null) { for (int i = 0; i < attributes.getLength(); i++) { returnValue.append(" "); returnValue.append(attributes.getQName(i)); String value = attributes.getValue(i); if (Strings.isValid(value)) { returnValue.append("=\""); returnValue.append(value); returnValue.append('"'); } } } returnValue.append(">"); return returnValue.toString(); }
Source:
public OneOriginContainer finish () { return new OneOriginContainer(travelTimes, accessibilityAccumulator); }

Target:
public OneOriginResult finish () { return new OneOriginResult(travelTimeResult, accessibilityResult); }
Source:
public static void delete(final File f, int options) throws IOException { if ((options & SKIP_MISSING) != 0 && !f.exists()) return; if ((options & RECURSIVE) != 0 && f.isDirectory()) { final File[] items = f.listFiles(); if (items != null) { for (File c : items) delete(c, options); } } boolean delete = false; if ((options & EMPTY_DIRECTORY) != 0) if (f.isDirectory()) delete = true; else { if ((options & IGNORE_ERRORS) == 0) throw new IOException(MessageFormat.format( JGitText.get().deleteFileFailed, f.getAbsolutePath())); } else delete = true; if (delete && !f.delete()) { if ((options & RETRY) != 0 && f.exists()) { for (int i = 1; i < 10; i++) { try { Thread.sleep(100); } catch (InterruptedException e) { } if (f.delete()) return; } } if ((options & IGNORE_ERRORS) == 0) throw new IOException(MessageFormat.format( JGitText.get().deleteFileFailed, f.getAbsolutePath())); } }

Target:
public static void delete(final File f, int options) throws IOException { if ((options & SKIP_MISSING) != 0 && !f.exists()) return; if ((options & RECURSIVE) != 0 && f.isDirectory()) { final File[] items = f.listFiles(); if (items != null) { for (File c : items) delete(c, options); } } boolean delete = false; if ((options & EMPTY_DIRECTORIES_ONLY) != 0) { if (f.isDirectory()) { delete = true; } else { if ((options & IGNORE_ERRORS) == 0) throw new IOException(MessageFormat.format( JGitText.get().deleteFileFailed, f.getAbsolutePath())); } } else { delete = true; } if (delete && !f.delete()) { if ((options & RETRY) != 0 && f.exists()) { for (int i = 1; i < 10; i++) { try { Thread.sleep(100); } catch (InterruptedException e) { } if (f.delete()) return; } } if ((options & IGNORE_ERRORS) == 0) throw new IOException(MessageFormat.format( JGitText.get().deleteFileFailed, f.getAbsolutePath())); } }
Source:
private static String getCacheKey(String url, Integer userid) { String key = "api_responses_" + url; if (userid != null) { key += userid; } return key; }

Target:
private static String getCacheKey(String url, Integer userid) { String key = "api_responses_" + url; if (userid != null) { key += "_" + userid; } return key; }
Source:
public static void setupClass() { TestBase.setupClass(); if (TEST_MODE == TestMode.PLAYBACK) { return; } Reader indexData = new InputStreamReader(Objects.requireNonNull(AutocompleteSyncTests.class .getClassLoader() .getResourceAsStream(HOTELS_TESTS_INDEX_DATA_JSON))); try { SearchIndex index = new ObjectMapper().readValue(indexData, SearchIndex.class); Field searchIndexName = index.getClass().getDeclaredField("name"); AccessController.doPrivileged((PrivilegedAction<Object>) () -> { searchIndexName.setAccessible(true); return null; }); searchIndexName.set(index, INDEX_NAME); searchIndexClient = new SearchIndexClientBuilder() .endpoint(ENDPOINT) .credential(new AzureKeyCredential(API_KEY)) .retryPolicy(new RetryPolicy(new ExponentialBackoff(3, Duration.ofSeconds(10), Duration.ofSeconds(30)))) .buildClient(); searchIndexClient.createOrUpdateIndex(index); uploadDocumentsJson(searchIndexClient.getSearchClient(INDEX_NAME), HOTELS_DATA_JSON); } catch (Throwable ex) { throw new RuntimeException(ex); } }

Target:
public static void setupClass() { TestBase.setupClass(); if (TEST_MODE == TestMode.PLAYBACK) { return; } searchIndexClient = setupSharedIndex(INDEX_NAME); }
Source:
public void testSearchFieldsMetadata() throws Exception { client().prepareIndex("my-index").setId("1") .setRouting("1") .setSource(jsonBuilder().startObject().field("field1", "value").endObject()) .setRefreshPolicy(IMMEDIATE) .get(); SearchResponse searchResponse = client().prepareSearch("my-index") .addStoredField("field1").addStoredField("_routing") .get(); assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L)); assertThat(searchResponse.getHits().getAt(0).field("field1"), nullValue()); assertThat(searchResponse.getHits().getAt(0).isMetadataField("_routing"), equalTo(true)); assertThat(searchResponse.getHits().getAt(0).field("_routing").getValue().toString(), equalTo("1")); }

Target:
public void testSearchFieldsMetadata() throws Exception { client().prepareIndex("my-index").setId("1") .setRouting("1") .setSource(jsonBuilder().startObject().field("field1", "value").endObject()) .setRefreshPolicy(IMMEDIATE) .get(); SearchResponse searchResponse = client().prepareSearch("my-index") .addStoredField("field1").addStoredField("_routing") .get(); assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L)); assertThat(searchResponse.getHits().getAt(0).field("field1"), nullValue()); assertThat(searchResponse.getHits().getAt(0).field("_routing").getValue().toString(), equalTo("1")); }
Source:
public void write(final ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { if (closeFrameSent(ctx)) { return; } if (msg instanceof CloseWebSocketFrame) { ctx.channel().attr(CLOSE_FRAME_SENT_ATTR_KEY).set(true); } super.write(ctx, msg, promise); }

Target:
public void write(final ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { if (closeSent != null) { ReferenceCountUtil.release(msg); promise.setFailure(new ClosedChannelException()); return; } if (msg instanceof CloseWebSocketFrame) { promise = promise.unvoid(); closeSent = promise; } super.write(ctx, msg, promise); }
Source:
private static boolean getSigned(CommonTree rightNode) throws ParseException { boolean ret = false; CommonTree firstChild = (CommonTree) rightNode.getChild(0); if (firstChild.getType() == CTFParser.UNARY_EXPRESSION_STRING) { String strval = concatenateUnaryStrings(rightNode.getChildren()); if (strval.equals(CTFStrings.TRUE) || strval.equals(CTFStrings.TRUE2)) { ret = true; } else if (strval.equals(CTFStrings.FALSE) || strval.equals(CTFStrings.FALSE2)) { ret = false; } else { throw new ParseException("Invalid boolean value " + firstChild.getChild(0).getText()); } } else if (isUnaryInteger(firstChild)) { if (rightNode.getChildCount() > 1) { throw new ParseException("Invalid boolean value"); } long intval = parseUnaryInteger(firstChild); if (intval == 1) { ret = true; } else if (intval == 0) { ret = false; } else { throw new ParseException("Invalid boolean value " + firstChild.getChild(0).getText()); } } else { throw new ParseException(); } return ret; }

Target:
private static boolean getSigned(CommonTree rightNode) throws ParseException { boolean ret = false; CommonTree firstChild = (CommonTree) rightNode.getChild(0); if (isUnaryString(firstChild)) { String strval = concatenateUnaryStrings(rightNode.getChildren()); if (strval.equals(CTFStrings.TRUE) || strval.equals(CTFStrings.TRUE2)) { ret = true; } else if (strval.equals(CTFStrings.FALSE) || strval.equals(CTFStrings.FALSE2)) { ret = false; } else { throw new ParseException("Invalid boolean value " + firstChild.getChild(0).getText()); } } else if (isUnaryInteger(firstChild)) { if (rightNode.getChildCount() > 1) { throw new ParseException("Invalid boolean value"); } long intval = parseUnaryInteger(firstChild); if (intval == 1) { ret = true; } else if (intval == 0) { ret = false; } else { throw new ParseException("Invalid boolean value " + firstChild.getChild(0).getText()); } } else { throw new ParseException(); } return ret; }
Source:
protected boolean isOperationHidden(Method method) { io.swagger.v3.oas.annotations.Operation apiOperation = ReflectionUtils.getAnnotation(method, io.swagger.v3.oas.annotations.Operation.class); if (apiOperation != null && apiOperation.hidden()) { return true; } Hidden hidden = method.getAnnotation(Hidden.class); if (hidden != null) { return true; } return config != null && !Boolean.TRUE.equals(config.isReadAllResources()) && apiOperation == null; }

Target:
protected boolean isOperationHidden(Method method) { io.swagger.v3.oas.annotations.Operation apiOperation = ReflectionUtils.getAnnotation(method, io.swagger.v3.oas.annotations.Operation.class); if (apiOperation != null && apiOperation.hidden()) { return true; } Hidden hidden = method.getAnnotation(Hidden.class); if (hidden != null) { return true; } if (config != null && !Boolean.TRUE.equals(config.isReadAllResources()) && apiOperation == null) { return true; } return false; }
Source:
private void readHealthUpdate(ByteBuffer buffer) { List<GameObjectDAO> healths = new ArrayList<>(); do { int ID = buffer.getInt(); int maxHealth = buffer.getInt(); int healthValue = buffer.getInt(); GameObjectDAO objectHealth = new GameObjectDAO(); objectHealth.objectId = ID; objectHealth.maxHealth = maxHealth; objectHealth.healthValue = healthValue; healths.add(objectHealth); } while (buffer.get() == 31); map.updateHealths(healths); }

Target:
private void readHealthUpdate(ByteBuffer buffer) { List<GameObjectDAO> healths = new ArrayList<>(); do { GameObjectDAO objectHealth = new GameObjectDAO(); objectHealth.objectId = buffer.getInt(); objectHealth.maxHealth = buffer.getInt(); objectHealth.healthValue = buffer.getInt(); healths.add(objectHealth); } while (buffer.get() == 31); map.updateHealths(healths); }
Source:
<K, V> Ehcache<K, V> retrieve(Class<K> refKeyType, Class<V> refValueType) { if (keyType == refKeyType && valueType == refValueType) { if(cache == null) { synchronized (this) { boolean interrupted = false; try { while(cache == null) { try { wait(); } catch (InterruptedException e) { interrupted = true; } } } finally { if(interrupted) { Thread.currentThread().interrupt(); } } } } return (Ehcache<K, V>)cache; } else { throw new IllegalArgumentException(); } }

Target:
<K, V> Ehcache<K, V> retrieve(Class<K> refKeyType, Class<V> refValueType) { if (!isValueSet) { synchronized (this) { boolean interrupted = false; try { while(!isValueSet) { try { wait(); } catch (InterruptedException e) { interrupted = true; } } } finally { if(interrupted) { Thread.currentThread().interrupt(); } } } } if (keyType == refKeyType && valueType == refValueType) { return (Ehcache<K, V>)cache; } else { throw new IllegalArgumentException(); } }
Source:
public void testPutAsync() throws Exception { Future<String> f = c.putAsync("k", "v"); testFuture(f, null); testK("v"); f = c.putAsync("k", "v2"); testFuture(f, "v"); assertEquals("v2", c.get("k")); }

Target:
public void testPutAsync() throws Exception { Future<String> f = c.putAsync("k", "v"); testFuture(f, null); testK("v"); f = c.putAsync("k", "v2"); testFuture(f, "v"); testK("v2"); }
Source:
public void resetRuleConfigValue(String key) { if (ruleConfigs.containsKey(key)) { ruleConfigs.get(key).setValue(ruleConfigs.get(key).getDefaultValue()); } else { throw new InvalidParameterException("No such key"); } }

Target:
public void resetRuleConfigValue(String key) { if (ruleConfigs.containsKey(key)) { String value = ruleConfigs.get(key).getDefaultValue(); ruleConfigs.get(key).setValue(value); this.getConfig().setProperty(key, value); } else { throw new IllegalArgumentException("No such key"); } }