auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void notify(Context context, Bundle bundle) { NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); String message = bundle.getString(UnifiedPushMessage.ALERT_KEY); String pushMessageId = bundle.getString(UnifiedPushMessage.PUSH_MESSAGE_ID); @SuppressLint("WrongConstant") Intent intent = new Intent(context, MessagesActivity.class) .addFlags(PendingIntent.FLAG_UPDATE_CURRENT) .putExtra(UnifiedPushMessage.ALERT_KEY, message) .putExtra(UnifiedPushMessage.PUSH_MESSAGE_ID, pushMessageId) .putExtra(HelloWorldApplication.PUSH_MESSAGE_FROM_BACKGROUND, true); PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intent, FLAG_UPDATE_CURRENT); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, CHANNEL_ID) .setAutoCancel(true) .setSmallIcon(R.mipmap.ic_launcher) .setContentTitle(context.getString(R.string.app_name)) .setStyle(new NotificationCompat.BigTextStyle().bigText(message)) .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)) .setContentText(message); mBuilder.setContentIntent(contentIntent); mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build()); }

Target:
private void notify(Context context, Bundle bundle) { NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); String message = bundle.getString(UnifiedPushMessage.ALERT_KEY); String pushMessageId = bundle.getString(UnifiedPushMessage.PUSH_MESSAGE_ID); Intent intent = new Intent(context, MessagesActivity.class) .putExtra(UnifiedPushMessage.ALERT_KEY, message) .putExtra(UnifiedPushMessage.PUSH_MESSAGE_ID, pushMessageId) .putExtra(HelloWorldApplication.PUSH_MESSAGE_FROM_BACKGROUND, true); PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intent, FLAG_UPDATE_CURRENT); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, CHANNEL_ID) .setAutoCancel(true) .setSmallIcon(R.mipmap.ic_launcher) .setContentTitle(context.getString(R.string.app_name)) .setStyle(new NotificationCompat.BigTextStyle().bigText(message)) .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)) .setContentText(message); mBuilder.setContentIntent(contentIntent); mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build()); }
Source:
public SqlStatements setTimingCollector(TimingCollector timingCollector) { this.timingCollector = timingCollector == null ? TimingCollector.NOP_TIMING_COLLECTOR : timingCollector; return this; }

Target:
public SqlStatements setTimingCollector(TimingCollector timingCollector) { this.sqlLogger = timingCollector == null ? SqlLogger.NOP_SQL_LOGGER : new SqlLogger() { @Override public void logAfterExecution(StatementContext context) { timingCollector.collect(context.getElapsedTime(ChronoUnit.NANOS), context); } }; return this; }
Source:
public void test_services_config_port_increment_false() { Microservices node = Microservices.builder() .serviceTransport(TransportConfig.builder() .port(3000) .portAutoIncrement(false) .build()) .clusterConfig(ClusterConfig.builder() .transportConfig(TransportConfig.builder() .port(4000) .portAutoIncrement(false) .build())) .build(); assertEquals(node.transport().address().port(), 3000); assertEquals(node.cluster().address().port(), 4000); node.cluster().shutdown(); }

Target:
public void test_services_config_port_increment_false() { Microservices node = Microservices.builder() .serviceTransport(TransportConfig.builder() .port(3000) .portAutoIncrement(false) .build()) .clusterConfig(ClusterConfig.builder() .port(4000) .portAutoIncrement(false)) .build(); assertEquals(node.sender().address().port(), 3000); assertEquals(node.cluster().address().port(), 4000); node.cluster().shutdown(); }
Source:
public void autoValue() { Auto a = Auto.create("foo"); assertEquals("foo", a.val()); assertEquals("Auto{val=foo}", a.toString()); }

Target:
public void autoValue() { Auto a = Auto.create("foo"); assertThat(a.val()).isEqualTo("foo"); assertThat(a.toString()).isEqualTo("Auto{val=foo}"); }
Source:
public Map<String, ?> getRawCapabilities() { DesiredCapabilities headlessChrome = DesiredCapabilities.chrome(); headlessChrome.setBrowserName("chromeHeadless"); return headlessChrome.asMap(); }

Target:
public Map<String, ?> getRawCapabilities() { return DesiredCapabilities.chrome().asMap(); }
Source:
private IMergeViewerItem.Container getParent(NotLoadedFragmentMatch nlfm) { IMergeViewerItem.Container parent = null; final Collection<? extends Match> children = nlfm.getChildren(); for (Match match : children) { URI uri = ResourceUIUtil.getDataURI(match, getSide()); if (uri != null) { ReadOnlyGraph<URI> graph = ResourceUIUtil.getResourcesURIGraph(); URI parentData = graph.getParentData(uri); ResourceSet rs = ResourceUIUtil.getDataResourceSet(match, getSide()); Resource resourceParent = ResourceUIUtil.getParent(rs, uri); boolean _continue = true; while (resourceParent == null && _continue == true) { if (parentData != null) { resourceParent = ResourceUIUtil.getParent(rs, parentData.trimFragment()); parentData = graph.getParentData(parentData.trimFragment()); } else { _continue = false; } } if (resourceParent != null && parentData != null) { EObject eObjectParent = resourceParent.getEObject(parentData.fragment()); if (eObjectParent != null) { parent = createBasicContainer(eObjectParent); break; } } else { URI rootURI = ResourceUIUtil.getRootResource(uri); if (rootURI != null) { Collection<Match> notLoadedFragmentMatches = Lists.newArrayList(); Collection<Match> rootMatches = getComparison().getMatches(); Collection<URI> uris = ResourceUIUtil.getDataURIs(rootMatches, getSide()); for (Match rootMatch : rootMatches) { URI rootMatchDataURI = ResourceUIUtil.getDataURI(rootMatch, getSide()); if (!rootURI.equals(rootMatchDataURI) && !ResourceUIUtil.isChildOf(rootMatchDataURI, uris)) { notLoadedFragmentMatches.add(new NotLoadedFragmentMatch(rootMatch)); } } if (notLoadedFragmentMatches.size() > 1) { final NotLoadedFragmentMatch notLoadedFragmentMatch = new NotLoadedFragmentMatch( notLoadedFragmentMatches); parent = new MergeViewerItem.Container(getComparison(), getDiff(), notLoadedFragmentMatch, notLoadedFragmentMatch, notLoadedFragmentMatch, getSide(), getAdapterFactory()); break; } } } } } return parent; }

Target:
private IMergeViewerItem.Container getParent(NotLoadedFragmentMatch nlfm) { IMergeViewerItem.Container parent = null; final Collection<? extends Match> children = nlfm.getChildren(); for (Match match : children) { URI uri = ResourceUIUtil.getDataURI(match, getSide()); if (uri != null) { ReadOnlyGraph<URI> graph = ResourceUIUtil.getResourcesURIGraph(); URI parentData = graph.getParentData(uri); ResourceSet rs = ResourceUIUtil.getDataResourceSet(match, getSide()); Resource resourceParent = ResourceUIUtil.getParent(rs, uri); while (resourceParent == null && parentData != null) { resourceParent = ResourceUIUtil.getParent(rs, parentData.trimFragment()); parentData = graph.getParentData(parentData.trimFragment()); } if (resourceParent != null && parentData != null) { EObject eObjectParent = resourceParent.getEObject(parentData.fragment()); if (eObjectParent != null) { parent = createBasicContainer(eObjectParent); break; } } else { parent = createNotLoadedFragmentContainer(uri); if (parent != null) { break; } } } } return parent; }
Source:
protected void appendToURI(StringBuilder restOfURI, String queryParamName, String queryParamvalue) { if (!StringUtils.endsWith(restOfURI.toString(), PATH_SEPARATOR)) { if (!StringUtils.contains(restOfURI.toString(), QUERY_PARAM_NAME_VALUE_SEPERATOR)) { restOfURI.append(QUERY_BEGINNER); restOfURI.append(queryParamName); restOfURI.append(QUERY_PARAM_NAME_VALUE_SEPERATOR); restOfURI.append(queryParamvalue); } else { restOfURI.append(QUERY_SEPARATOR); restOfURI.append(queryParamName); restOfURI.append(QUERY_PARAM_NAME_VALUE_SEPERATOR); restOfURI.append(queryParamvalue); } } }

Target:
protected void appendToURI(StringBuilder restOfURI, String queryParamName, String queryParamvalue) { if (!StringUtils.endsWith(restOfURI.toString(), PATH_SEPARATOR)) { if (!StringUtils.contains(restOfURI.toString(), QUERY_PARAM_NAME_VALUE_SEPERATOR)) { restOfURI.append(QUERY_BEGINNER); } else { restOfURI.append(QUERY_SEPARATOR); } restOfURI.append(queryParamName); restOfURI.append(QUERY_PARAM_NAME_VALUE_SEPERATOR); restOfURI.append(queryParamvalue); } }
Source:
public void loadUserWhenUserInfoSuccessResponseThenReturnUser() throws Exception { String userInfoResponse = "{\n" + " \"id\": \"user1\",\n" + " \"first-name\": \"first\",\n" + " \"last-name\": \"last\",\n" + " \"middle-name\": \"middle\",\n" + " \"address\": \"address\",\n" + " \"email\": \"user1@example.com\"\n" + "}\n"; enqueueApplicationJsonBody(userInfoResponse); OAuth2User user = this.userService.loadUser(oauth2UserRequest()).block(); assertThat(user.getName()).isEqualTo("user1"); assertThat(user.getAttributes().size()).isEqualTo(6); assertThat((Object) user.getAttribute("id")).isEqualTo("user1"); assertThat((Object) user.getAttribute("first-name")).isEqualTo("first"); assertThat((Object) user.getAttribute("last-name")).isEqualTo("last"); assertThat((Object) user.getAttribute("middle-name")).isEqualTo("middle"); assertThat((Object) user.getAttribute("address")).isEqualTo("address"); assertThat((Object) user.getAttribute("email")).isEqualTo("user1@example.com"); assertThat(user.getAuthorities().size()).isEqualTo(1); assertThat(user.getAuthorities().iterator().next()).isInstanceOf(OAuth2UserAuthority.class); OAuth2UserAuthority userAuthority = (OAuth2UserAuthority) user.getAuthorities().iterator().next(); assertThat(userAuthority.getAuthority()).isEqualTo("ROLE_USER"); assertThat(userAuthority.getAttributes()).isEqualTo(user.getAttributes()); }

Target:
public void loadUserWhenUserInfoSuccessResponseThenReturnUser() throws Exception { String userInfoResponse = "{\n" + " \"id\": \"user1\",\n" + " \"first-name\": \"first\",\n" + " \"last-name\": \"last\",\n" + " \"middle-name\": \"middle\",\n" + " \"address\": \"address\",\n" + " \"email\": \"user1@example.com\"\n" + "}\n"; enqueueApplicationJsonBody(userInfoResponse); OAuth2User user = this.userService.loadUser(oauth2UserRequest()).block(); assertThat(user.getName()).isEqualTo("user1"); assertThat(user.getAttributes().size()).isEqualTo(6); assertThat((String) user.getAttribute("id")).isEqualTo("user1"); assertThat((String) user.getAttribute("first-name")).isEqualTo("first"); assertThat((String) user.getAttribute("last-name")).isEqualTo("last"); assertThat((String) user.getAttribute("middle-name")).isEqualTo("middle"); assertThat((String) user.getAttribute("address")).isEqualTo("address"); assertThat((String) user.getAttribute("email")).isEqualTo("user1@example.com"); assertThat(user.getAuthorities().size()).isEqualTo(1); assertThat(user.getAuthorities().iterator().next()).isInstanceOf(OAuth2UserAuthority.class); OAuth2UserAuthority userAuthority = (OAuth2UserAuthority) user.getAuthorities().iterator().next(); assertThat(userAuthority.getAuthority()).isEqualTo("ROLE_USER"); assertThat(userAuthority.getAttributes()).isEqualTo(user.getAttributes()); }
Source:
public static PcapFile getPcapFile(Path filePath) throws IOException, BadPcapFileException { if (filePath.getFileName().toString().endsWith(PCAPNG_EXTENSION)) { return new PcapNgFile(filePath); } return new PcapOldFile(filePath); }

Target:
public static PcapFile getPcapFile(Path filePath) throws IOException, BadPcapFileException { if (Files.notExists(filePath) || !Files.isRegularFile(filePath) || Files.size(filePath) < PcapFileValues.GLOBAL_HEADER_SIZE) { throw new BadPcapFileException("Bad Pcap File."); } if (!Files.isReadable(filePath)) { throw new BadPcapFileException("File is not readable."); } fFileChannel = checkNotNull(Files.newByteChannel(filePath)); FileChannel f = (FileChannel) fFileChannel; if (f.size() == 0) { throw new BadPcapFileException("It is not a FileChannel type."); } ByteBuffer header = ByteBuffer.allocate(PcapFileValues.PCAPNG_HEADER_SIZE); header.clear(); header.order(ByteOrder.LITTLE_ENDIAN); f.read(header); header.flip(); int blockType = header.getInt(); f.close(); if (blockType == PcapFileValues.PCAPNG_SHB) { return new PcapNgFile(filePath); } return new PcapOldFile(filePath); }
Source:
void addAllLogsToSysTable() { if (queueForSysTable == null) { LOG.warn("hbase.regionserver.slowlog.systable.enabled is turned off. Exiting."); return; } if (this.connection == null) { LOG.warn("LogEventHandler has null connection. Exiting."); return; } List<SlowLogPayload> slowLogPayloads = new ArrayList<>(); int i = 0; while (!queueForSysTable.isEmpty()) { slowLogPayloads.add(queueForSysTable.poll()); i++; if (i == 100) { SlowLogTableAccessor.addSlowLogRecords(slowLogPayloads, this.connection); slowLogPayloads = new ArrayList<>(); i = 0; } } if (slowLogPayloads.size() > 0) { SlowLogTableAccessor.addSlowLogRecords(slowLogPayloads, this.connection); } }

Target:
void addAllLogsToSysTable() { if (queueForSysTable == null) { return; } if (LOCK.isLocked()) { return; } LOCK.lock(); try { List<SlowLogPayload> slowLogPayloads = new ArrayList<>(); int i = 0; while (!queueForSysTable.isEmpty()) { slowLogPayloads.add(queueForSysTable.poll()); i++; if (i == SYSTABLE_PUT_BATCH_SIZE) { SlowLogTableAccessor.addSlowLogRecords(slowLogPayloads, this.configuration); slowLogPayloads.clear(); i = 0; } } if (slowLogPayloads.size() > 0) { SlowLogTableAccessor.addSlowLogRecords(slowLogPayloads, this.configuration); } } finally { LOCK.unlock(); } }
Source:
protected Control createPageControls(Composite parent) { setTitle(Messages.RemoveReviewerDialog_Remove_Reviewer); Label label = new Label(parent, SWT.NONE); label.setText( NLS.bind(Messages.RemoveReviewerDialog_Are_You_Sure_You_Want_To_Remove, userToRemove.getDisplayName())); return parent; }

Target:
protected Control createPageControls(Composite parent) { setTitle(Messages.RemoveReviewerDialog_Remove_Reviewer); Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(1, false)); Label label = new Label(composite, SWT.NONE); label.setText( NLS.bind(Messages.RemoveReviewerDialog_Are_You_Sure_You_Want_To_Remove, userToRemove.getDisplayName())); return parent; }
Source:
public String format(Thread thread, String formatString) { final StringBuilder builder = new StringBuilder(formatString.length() * 5); final ThreadGroup group = thread.getThreadGroup(); final Matcher matcher = searchPattern.matcher(formatString); while (matcher.find()) { if (matcher.group(1) != null) { builder.append(matcher.group()); } else { switch (matcher.group().charAt(1)) { case '%': builder.append('%'); break; case 't': builder.append(perFactoryThreadSequenceNum); break; case 'g': builder.append(globalThreadSequenceNum); break; case 'f': builder.append(factorySequenceNum); break; case 'p': if (group != null) appendGroupPath(group, builder); break; case 'i': builder.append(thread.getId()); case 'G': if (group != null) builder.append(group.getName()); break; case 'n': if (node != null) builder.append(node); break; case 'c': if (component != null) builder.append(component); break; } } } return builder.toString(); }

Target:
public String format(Thread thread, String formatString) { final StringBuilder builder = new StringBuilder(formatString.length() * 5); final ThreadGroup group = thread.getThreadGroup(); final Matcher matcher = searchPattern.matcher(formatString); while (matcher.find()) { if (matcher.group(1) != null) { builder.append(matcher.group()); } else { switch (matcher.group().charAt(1)) { case '%': builder.append('%'); break; case 't': builder.append(perFactoryThreadSequenceNum); break; case 'g': builder.append(globalThreadSequenceNum); break; case 'f': builder.append(factorySequenceNum); break; case 'p': if (group != null) appendGroupPath(group, builder); break; case 'i': builder.append(thread.getId()); break; case 'G': if (group != null) builder.append(group.getName()); break; case 'n': if (node != null) builder.append(node); break; case 'c': if (component != null) builder.append(component); break; } } } return builder.toString(); }
Source:
public void testDecisionExpressionContextSimple() throws Exception { final String expected = loadResource("decision-expression-context-simple.xml"); setContent(expected); final String actual = getContent(); assertThat(actual).isNotBlank(); final Predicate<Node> nodeFilter = node -> { final String localName = node.getLocalName(); final String namespaceURI = node.getNamespaceURI(); if (Objects.equals(namespaceURI, KIE.getUri())) { if (Objects.equals(localName, "ComponentWidths")) { return false; } } return true; }; final Predicate<Attr> attributeFilter = attr -> { final String localName = attr.getLocalName(); final String namespaceURI = Objects.nonNull(attr.getNamespaceURI()) ? attr.getNamespaceURI() : attr.getOwnerElement().getNamespaceURI(); if (Objects.equals(namespaceURI, DMN.getUri())) { if (Objects.equals(attr.getOwnerElement().getLocalName(), "literalExpression")) { if (Objects.equals(localName, "id")) { return false; } } } return true; }; XmlAssert.assertThat(actual) .and(expected) .ignoreComments() .ignoreWhitespace() .withNodeFilter(nodeFilter) .withAttributeFilter(attributeFilter) .areIdentical(); final Map<String, String> prefix2Uri = new Maps.Builder<String, String>() .put(DMN.getPrefix(), DMN.getUri()) .build(); XmlAssert.assertThat(actual) .withNamespaceContext(prefix2Uri) .hasXPath("/dmn:definitions" + "/dmn:decision[@id='_4FEA7589-823B-4880-BCFA-AF2F9B145785']" + "/dmn:context[@id='_23253C3F-352C-4A00-8548-174EDC272929']" + "/dmn:contextEntry" + "/dmn:literalExpression" + "/dmn:text[text()='null }

Target:
public void testDecisionExpressionContextSimple() throws Exception { final String expected = loadResource("decision-expression-context-simple.xml"); setContent(expected); final String actual = getContent(); assertThat(actual).isNotBlank(); final Predicate<Node> nodeFilter = node -> { final String localName = node.getLocalName(); final String namespaceURI = node.getNamespaceURI(); if (Objects.equals(namespaceURI, KIE.getUri())) { if (Objects.equals(localName, "ComponentWidths")) { return false; } } return true; }; final Predicate<Attr> attributeFilter = attr -> { final String localName = attr.getLocalName(); final String namespaceURI = Objects.nonNull(attr.getNamespaceURI()) ? attr.getNamespaceURI() : attr.getOwnerElement().getNamespaceURI(); if (Objects.equals(namespaceURI, DMN.getUri())) { if (Objects.equals(attr.getOwnerElement().getLocalName(), "literalExpression")) { if (Objects.equals(localName, "id")) { return false; } } } return true; }; XmlAssert.assertThat(actual) .and(expected) .ignoreComments() .ignoreWhitespace() .withNodeFilter(nodeFilter) .withAttributeFilter(attributeFilter) .areIdentical(); XmlAssert.assertThat(actual) .withNamespaceContext(NAMESPACES) .hasXPath("/dmn:definitions" + "/dmn:decision[@id='_4FEA7589-823B-4880-BCFA-AF2F9B145785']" + "/dmn:context[@id='_23253C3F-352C-4A00-8548-174EDC272929']" + "/dmn:contextEntry" + "/dmn:literalExpression" + "/dmn:text[text()='null }
Source:
default MBeanServer getMBeanServer() { return getPlatformMBeanServer(); }

Target:
default MBeanServer getMBeanServer() { throw new UnsupportedOperationException(); }
Source:
public void vmsMonitoring() { if (isMonitoringNeeded()) { VmsListFetcher fetcher = getRefreshStatistics() ? new VmsStatisticsFetcher(this) : new VmsListFetcher(this); fetcher.fetch(); new VmsMonitoring(this, fetcher.getChangedVms(), fetcher.getVmsWithChangedDevices(), auditLogDirector, fetcher.getFetchTime() ).perform(); } }

Target:
public void vmsMonitoring() { if (isMonitoringNeeded()) { VmsListFetcher fetcher = getRefreshStatistics() ? new VmsStatisticsFetcher(this) : new VmsListFetcher(this); long fetchTime = System.nanoTime(); fetcher.fetch(); new VmsMonitoring(this, fetcher.getChangedVms(), fetcher.getVmsWithChangedDevices(), auditLogDirector, fetchTime ).perform(); } }
Source:
public InitCommand setBare(boolean bare) { this.bare = bare; validateDirs(); return this; }

Target:
public InitCommand setBare(boolean bare) { validateDirs(directory, gitDir, bare); this.bare = bare; return this; }
Source:
public String toString() { Map<String, Object> display = new ConcurrentHashMap<String, Object>(this.values); display.remove(VALUES_KEY); return display.toString(); }

Target:
public String toString() { Map<String, Object> display = new HashMap<String, Object>(this.values); display.remove(VALUES_KEY); return display.toString(); }
Source:
public void detectLanguageForListInputTextsWithResponse() { final List<String> textInputs = Arrays.asList( "This is written in English", "Este es un document escrito en Español."); final DocumentResultCollection<DetectLanguageResult> detectLanguageResults = textAnalyticsClient.detectLanguagesWithResponse(textInputs, "US", Context.NONE).getValue(); final TextDocumentBatchStatistics batchStatistics = detectLanguageResults.getStatistics(); System.out.printf( "A batch of document statistics, document count: %s, transaction count: %s, valid document count: %s.%n", batchStatistics.getDocumentCount(), batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount()); for (DetectLanguageResult detectLanguageResult : detectLanguageResults) { System.out.printf("Document ID: %s%n", detectLanguageResult.getId()); for (DetectedLanguage detectedLanguage : detectLanguageResult.getDetectedLanguages()) { System.out.printf("Detected language: %s, ISO 6391 name: %s, score: %s.%n", detectedLanguage.getName(), detectedLanguage.getIso6391Name(), detectedLanguage.getScore()); } } END: com.azure.ai.textanalytics.TextAnalyticsClient.detectLanguagesWithResponse#List-String-Context }

Target:
public void detectLanguageForListInputTextsWithResponse() { final List<String> textInputs = Arrays.asList( "This is written in English", "Este es un document escrito en Español."); final DocumentResultCollection<DetectLanguageResult> detectLanguageResults = textAnalyticsClient.detectLanguagesWithResponse(textInputs, "US", Context.NONE).getValue(); final TextDocumentBatchStatistics batchStatistics = detectLanguageResults.getStatistics(); System.out.printf( "A batch of document statistics, transaction count: %s, valid document count: %s.%n", batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount()); for (DetectLanguageResult detectLanguageResult : detectLanguageResults) { System.out.printf("Document ID: %s%n", detectLanguageResult.getId()); for (DetectedLanguage detectedLanguage : detectLanguageResult.getDetectedLanguages()) { System.out.printf("Detected language: %s, ISO 6391 name: %s, score: %s.%n", detectedLanguage.getName(), detectedLanguage.getIso6391Name(), detectedLanguage.getScore()); } } END: com.azure.ai.textanalytics.TextAnalyticsClient.detectLanguagesWithResponse#List-String-Context }
Source:
public InputStream getObject(String bucketName, String objectName) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException, InvalidArgumentException { if ((bucketName == null) || (bucketName.isEmpty())) { throw new InvalidArgumentException("bucket name cannot be empty"); } if ((objectName == null) || (objectName.isEmpty())) { throw new InvalidArgumentException("object name cannot be empty"); } return getObject(bucketName, objectName, 0, null); }

Target:
public InputStream getObject(String bucketName, String objectName) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException, InvalidArgumentException { return getObject(bucketName, objectName, 0, null); }
Source:
public int compare(ITimeGraphEntry o1, ITimeGraphEntry o2) { if (o1.getParent() != null || o2.getParent() != null) { return o1.getStartTime() < o2.getStartTime() ? -1 : o1.getStartTime() > o2.getStartTime() ? 1 : 0; } int result = 0; if ((o1 instanceof ControlFlowEntry) && (o2 instanceof ControlFlowEntry)) { ControlFlowEntry entry1 = (ControlFlowEntry) o1; ControlFlowEntry entry2 = (ControlFlowEntry) o2; result = entry1.getTrace().getStartTime().compareTo(entry2.getTrace().getStartTime()); if (result == 0) { result = entry1.getTrace().getName().compareTo(entry2.getTrace().getName()); } if (result == 0) { result = entry1.getThreadId() < entry2.getThreadId() ? -1 : entry1.getThreadId() > entry2.getThreadId() ? 1 : 0; } } if (result == 0) { result = o1.getStartTime() < o2.getStartTime() ? -1 : o1.getStartTime() > o2.getStartTime() ? 1 : 0; } return result; }

Target:
public int compare(ITimeGraphEntry o1, ITimeGraphEntry o2) { if (o1.getParent() != null || o2.getParent() != null) { return Long.compare(o1.getStartTime(), o2.getStartTime()); } int result = 0; if ((o1 instanceof ControlFlowEntry) && (o2 instanceof ControlFlowEntry)) { ControlFlowEntry entry1 = (ControlFlowEntry) o1; ControlFlowEntry entry2 = (ControlFlowEntry) o2; result = entry1.getTrace().getStartTime().compareTo(entry2.getTrace().getStartTime()); if (result == 0) { result = entry1.getTrace().getName().compareTo(entry2.getTrace().getName()); } if (result == 0) { result = Integer.compare(entry1.getThreadId(), entry2.getThreadId()); } } if (result == 0) { result = Long.compare(o1.getStartTime(), o2.getStartTime()); } return result; }
Source:
public Map<String, Object> getAllocatedIPs() { return allocatedIPs; }

Target:
public List<Map<String, Object>> getAllocatedIPs() { return allocatedIPs; }
Source:
private void removeFiles(String location, ValidWriteIdList writeIdList, CompactionInfo ci) throws IOException, HiveException { Path locPath = new Path(location); AcidUtils.Directory dir = AcidUtils.getAcidState(locPath, conf, writeIdList); List<FileStatus> obsoleteDirs = dir.getObsolete(); List<Path> filesToDelete = new ArrayList<Path>(obsoleteDirs.size()); StringBuilder extraDebugInfo = new StringBuilder("["); for (FileStatus stat : obsoleteDirs) { filesToDelete.add(stat.getPath()); extraDebugInfo.append(stat.getPath().getName()).append(","); if(!FileUtils.isPathWithinSubtree(stat.getPath(), locPath)) { LOG.info(idWatermark(ci) + " found unexpected file: " + stat.getPath()); } } extraDebugInfo.setCharAt(extraDebugInfo.length() - 1, ']'); List<Long> compactIds = new ArrayList<>(compactId2CompactInfoMap.keySet()); Collections.sort(compactIds); extraDebugInfo.append("compactId2CompactInfoMap.keySet(").append(compactIds).append(")"); LOG.info(idWatermark(ci) + " About to remove " + filesToDelete.size() + " obsolete directories from " + location + ". " + extraDebugInfo.toString()); if (filesToDelete.size() < 1) { LOG.warn("Hmm, nothing to delete in the cleaner for directory " + location + ", that hardly seems right."); return; } FileSystem fs = filesToDelete.get(0).getFileSystem(conf); for (Path dead : filesToDelete) { LOG.debug("Going to delete path " + dead.toString()); if (ReplChangeManager.isReplPolicySet(Hive.get().getDatabase(ci.dbname))) { replChangeManager.recycle(dead, ReplChangeManager.RecycleType.MOVE, true); } fs.delete(dead, true); } }

Target:
private void removeFiles(String location, ValidWriteIdList writeIdList, CompactionInfo ci) throws IOException, HiveException { Path locPath = new Path(location); AcidUtils.Directory dir = AcidUtils.getAcidState(locPath, conf, writeIdList); List<FileStatus> obsoleteDirs = dir.getObsolete(); List<Path> filesToDelete = new ArrayList<Path>(obsoleteDirs.size()); StringBuilder extraDebugInfo = new StringBuilder("["); for (FileStatus stat : obsoleteDirs) { filesToDelete.add(stat.getPath()); extraDebugInfo.append(stat.getPath().getName()).append(","); if(!FileUtils.isPathWithinSubtree(stat.getPath(), locPath)) { LOG.info(idWatermark(ci) + " found unexpected file: " + stat.getPath()); } } extraDebugInfo.setCharAt(extraDebugInfo.length() - 1, ']'); List<Long> compactIds = new ArrayList<>(compactId2CompactInfoMap.keySet()); Collections.sort(compactIds); extraDebugInfo.append("compactId2CompactInfoMap.keySet(").append(compactIds).append(")"); LOG.info(idWatermark(ci) + " About to remove " + filesToDelete.size() + " obsolete directories from " + location + ". " + extraDebugInfo.toString()); if (filesToDelete.size() < 1) { LOG.warn("Hmm, nothing to delete in the cleaner for directory " + location + ", that hardly seems right."); return; } FileSystem fs = filesToDelete.get(0).getFileSystem(conf); Database db = Hive.get().getDatabase(ci.dbname); for (Path dead : filesToDelete) { LOG.debug("Going to delete path " + dead.toString()); if (ReplChangeManager.isSourceOfReplication(db)) { replChangeManager.recycle(dead, ReplChangeManager.RecycleType.MOVE, true); } fs.delete(dead, true); } }
Source:
protected void onLoginFinished() { AnalyticsUtils.trackAnalyticsSignIn(mAccountStore, mSiteStore, true); if (isSocialLogin) { AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_SUCCESS); mLoginListener.loggedInViaSocialAccount(mOldSitesIDs); } else { mLoginListener.loggedInViaPassword(mOldSitesIDs); } }

Target:
protected void onLoginFinished() { AnalyticsUtils.trackAnalyticsSignIn(mAccountStore, mSiteStore, true); if (isSocialLogin) { mLoginListener.loggedInViaSocialAccount(mOldSitesIDs); } else { mLoginListener.loggedInViaPassword(mOldSitesIDs); } }
Source:
private static boolean pmExists(PrivateMessage pm) { info("Looking for PM with subject: [" + pm.getMessageSubject() + "]"); List<WebElement> pmList = pmPage.getPmList(); for(WebElement singlePmRow : pmList) { String messageSubject = singlePmRow.findElements(By.cssSelector("a")).get(1).getText(); info("Found subject in the list: [" + StringUtils.left(messageSubject, 7) + "...]"); if(messageSubject.equals(pm.getMessageSubject())) { info("Search result = Required PM. The message exists."); return true; } } info("Expected PM wasn't found"); return false; }

Target:
private static boolean pmExists(PrivateMessage pm) { try { pmPage.findPmBySubject(pm.getMessageSubject()); info("The message exists."); return true; } catch (NoSuchElementException e) { info("Expected PM wasn't found"); return false; } }
Source:
@After public void teardown() throws SQLException { if (conn != null) { conn.close(); } }

Target:
public void teardown() throws SQLException { if (conn != null) { conn.close(); } }
Source:
private ClientConfig updateProxy(ClientConfig config) { final String proxyHost = System.getProperty("http.proxyHost"); if (proxyHost != null) { config.property(ClientProperties.PROXY_URI, proxyHost + ":" + System.getProperty("http.proxyPort", "8080")); config.property(ClientProperties.REQUEST_ENTITY_PROCESSING, RequestEntityProcessing.BUFFERED); } return config; }

Target:
private ClientConfig updateProxy(ClientConfig config) { final String proxyHost = System.getProperty("http.proxyHost"); if (proxyHost != null) { config.property(ClientProperties.PROXY_URI, proxyHost + ":" + checkNotNull(System.getProperty("http.proxyPort"), "http.proxyPort")); config.property(ClientProperties.REQUEST_ENTITY_PROCESSING, RequestEntityProcessing.BUFFERED); } return config; }
Source:
public TurboLabel(String repoId, SerializableLabel label) { this.actualName = label.getActualName(); this.grouping = initGroupMembership(); this.simpleName = initSimpleName(); this.groupName = initGroupName(); this.colour = label.getColour(); this.repoId = repoId; }

Target:
public TurboLabel(String repoId, SerializableLabel label) { this(repoId, label.getColour(), label.getFullName()); }
Source:
private Integer getBarWidth() { WebDriverWait wait = new WebDriverWait(driver, 7); wait.until(ExpectedConditions.alertIsPresent()); Alert alert = driver.switchTo().alert(); Integer barWidth = Integer.valueOf(alert.getText().substring(alert.getText().length()-3)); System.out.println(barWidth); alert.accept(); return barWidth; }

Target:
private Integer getBarWidth() { WebDriverWait wait = new WebDriverWait(driver, 7); wait.until(ExpectedConditions.alertIsPresent()); Alert alert = driver.switchTo().alert(); Integer barWidth = Integer.valueOf(alert.getText().split(": ")[1]); System.out.println(barWidth); alert.accept(); return barWidth; }
Source:
public void getObjsByUris() throws Exception { final MetadataService md = gd.getMetadataService(); final Map<String, String> uris = md.identifiersToUris(project, asList( "attr.person.department", "attr.person.role", "fact.person.shoesize" )); final Collection<Obj> objects = md.getObjsByUris(project, uris.values()); assertThat(objects.stream().map(Obj::getUri).collect(Collectors.toSet()), equalTo(new HashSet<>(uris.values()))); }

Target:
public void getObjsByUris() throws Exception { final MetadataService md = gd.getMetadataService(); final Map<String, String> uris = md.identifiersToUris(project, asList( "attr.person.department", "attr.person.role", "fact.person.shoesize" )); final Collection<Obj> objects = md.getObjsByUris(project, uris.values()); assertThat(objects.stream().map(Obj::getUri).collect(Collectors.toSet()), is(new HashSet<>(uris.values()))); }
Source:
public void display() { setShowLoginProgress(false); LoginPrefs loginPrefs = preferencesService.getPreferences().getLogin(); String username = loginPrefs.getUsername(); String password = loginPrefs.getPassword(); boolean isAutoLogin = loginPrefs.getAutoLogin(); usernameInput.setText(Strings.nullToEmpty(username)); autoLoginCheckBox.setSelected(isAutoLogin); initializeFuture.thenAccept(aVoid -> { if (loginAllowed == null) { log.error("loginAllowed not set for unknown reason. Possible race condition detected. Enabling login now to preserve user experience."); loginAllowed = true; } if (loginAllowed && loginPrefs.getAutoLogin() && !isNullOrEmpty(username) && !isNullOrEmpty(password)) { login(username, password, true); } else if (isNullOrEmpty(username)) { usernameInput.requestFocus(); } else { passwordInput.requestFocus(); } }); }

Target:
public void display() { setShowLoginProgress(false); LoginPrefs loginPrefs = preferencesService.getPreferences().getLogin(); String username = loginPrefs.getUsername(); String password = loginPrefs.getPassword(); boolean isAutoLogin = loginPrefs.getAutoLogin(); usernameInput.setText(Strings.nullToEmpty(username)); autoLoginCheckBox.setSelected(isAutoLogin); initializeFuture.thenRun(() -> { if (loginAllowed == null) { log.error("loginAllowed not set for unknown reason. Possible race condition detected. Enabling login now to preserve user experience."); loginAllowed = true; } if (loginAllowed && loginPrefs.getAutoLogin() && !isNullOrEmpty(username) && !isNullOrEmpty(password)) { login(username, password, true); } else if (isNullOrEmpty(username)) { usernameInput.requestFocus(); } else { passwordInput.requestFocus(); } }); }
Source:
private void showCompareForCurrentFile() { view.setEnableNextDiffButton(currentItemIndex != (changedItems.getFilesQuantity() - 1)); view.setEnablePreviousDiffButton(currentItemIndex != 0); changedItems.getProject() .getFile(changedItems.getItemByIndex(currentItemIndex)) .then(file -> { if (file.isPresent()) { if (compareWithLatest) { showCompareWithLatestForFile(file.get(), changedItems.getStatusByIndex(currentItemIndex)); } else { showCompareBetweenRevisionsForFile(file.get(), changedItems.getStatusByIndex(currentItemIndex)); } } }).catchError(error -> { notificationManager.notify(error.getMessage(), FAIL, NOT_EMERGE_MODE); }); }

Target:
private void showCompareForCurrentFile() { view.setEnableNextDiffButton(currentFileIndex != (alteredFiles.getFilesQuantity() - 1)); view.setEnablePreviousDiffButton(currentFileIndex != 0); alteredFiles .getProject() .getFile(alteredFiles.getFileByIndex(currentFileIndex)) .then( file -> { if (file.isPresent()) { this.comparedFile = file.get(); view.setEnableSaveChangesButton(true); } else { this.comparedFile = null; view.setEnableSaveChangesButton(false); } final Path gitDirLocation = alteredFiles.getProject().getLocation(); final Path relPath = Path.valueOf(alteredFiles.getFileByIndex(currentFileIndex)); if (compareWithLatest) { showCompareWithLatestForFile( gitDirLocation, relPath, alteredFiles.getStatusByIndex(currentFileIndex)); } else { showCompareBetweenRevisionsForFile( gitDirLocation, relPath, alteredFiles.getStatusByIndex(currentFileIndex)); } }) .catchError( error -> { notificationManager.notify(error.getMessage(), FAIL, NOT_EMERGE_MODE); }); }
Source:
public org.atlasapi.media.channel.Channel transform(String str) { String[] split = str.split(","); Channel channel = new Channel(); channel.setTitle(sanitize(split[1])); channel.setUri(uriFor(sanitize(split[0]))); channel.setPublisherDetails(PUB_DETAILS); channel.setChannelType("CHANNEL"); channel.setMediaType("video"); org.atlasapi.media.channel.Channel complex = modelTransformer.transform(channel); complex.addAlias(new Alias(ALIAS_NAMESPACE, sanitize(split[0]))); return complex; }

Target:
public org.atlasapi.media.channel.Channel transform(String str) { String[] split = str.split(","); checkArgument(split.length == 2); String stationCode = sanitize(split[0]); String channelTitle = sanitize(split[1]); checkArgument(isValid(stationCode)); Channel channel = new Channel(); channel.setTitle(channelTitle); channel.setUri(uriFor(stationCode)); channel.setPublisherDetails(PUB_DETAILS); channel.setChannelType("CHANNEL"); channel.setMediaType("video"); org.atlasapi.media.channel.Channel complex = modelTransformer.transform(channel); complex.addAlias(new Alias(ALIAS_NAMESPACE, stationCode)); return complex; }
Source:
void fillPolygonInPixels (int[] pointArray) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); checkGC(FILL); if (data.gdipGraphics != 0) { int mode = OS.GetPolyFillMode(handle) == OS.WINDING ? Gdip.FillModeWinding : Gdip.FillModeAlternate; Gdip.Graphics_TranslateTransform(data.gdipGraphics, 1, data.gdipYOffset, Gdip.MatrixOrderPrepend); Gdip.Graphics_FillPolygon(data.gdipGraphics, data.gdipBrush, pointArray, pointArray.length / 2, mode); Gdip.Graphics_TranslateTransform(data.gdipGraphics, -1, -data.gdipYOffset, Gdip.MatrixOrderPrepend); return; } if ((data.style & SWT.MIRRORED) != 0) { for (int i = 0; i < pointArray.length; i+=2) { pointArray[i]--; } } OS.Polygon(handle, pointArray, pointArray.length / 2); if ((data.style & SWT.MIRRORED) != 0) { for (int i = 0; i < pointArray.length; i+=2) { pointArray[i]++; } } }

Target:
void fillPolygonInPixels (int[] pointArray) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); checkGC(FILL); if (data.gdipGraphics != 0) { int mode = OS.GetPolyFillMode(handle) == OS.WINDING ? Gdip.FillModeWinding : Gdip.FillModeAlternate; Gdip.Graphics_TranslateTransform(data.gdipGraphics, data.gdipXOffset + 1, data.gdipYOffset, Gdip.MatrixOrderPrepend); Gdip.Graphics_FillPolygon(data.gdipGraphics, data.gdipBrush, pointArray, pointArray.length / 2, mode); Gdip.Graphics_TranslateTransform(data.gdipGraphics, data.gdipXOffset -1, -data.gdipYOffset, Gdip.MatrixOrderPrepend); return; } if ((data.style & SWT.MIRRORED) != 0) { for (int i = 0; i < pointArray.length; i+=2) { pointArray[i]--; } } OS.Polygon(handle, pointArray, pointArray.length / 2); if ((data.style & SWT.MIRRORED) != 0) { for (int i = 0; i < pointArray.length; i+=2) { pointArray[i]++; } } }
Source:
public ISerializableEvaluation unmarshalEvaluation() throws CoreException { int oldPos = fPos; short firstBytes = getShort(); if (firstBytes == NULL_TYPE) { return null; } fPos = oldPos; return fLinkage.unmarshalEvaluation(this); }

Target:
public ISerializableEvaluation unmarshalEvaluation() throws CoreException { return fLinkage.unmarshalEvaluation(this); }
Source:
public void stoppedFollowing(Reason reason) { String shownReason; switch (reason) { case FOLLOWEE_LEFT_SESSION: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWEE_LEFT_SESSION; break; case FOLLOWER_CLOSED_OR_SWITCHED_EDITOR: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWER_CLOSED_OR_SWITCHED_EDITOR; break; case FOLLOWER_CLOSED_EDITOR: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWER_CLOSED_EDITOR; break; case FOLLOWER_STOPPED: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWER_STOPPED; break; case FOLLOWER_SWITCHES_FOLLOWEE: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWER_SWITCHES_FOLLOWEE; break; default: shownReason = reason.name(); log.error("Encountered unknown reason for follow mode end. reason: " + reason); } NotificationPanel.showInformation( String.format( Messages.FollowModeNotificationDispatcher_stopped_following_message, followedUser, shownReason), Messages.FollowModeNotificationDispatcher_stopped_following_title); followedUser = null; }

Target:
public void stoppedFollowing(Reason reason) { String shownReason; switch (reason) { case FOLLOWEE_LEFT_SESSION: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWEE_LEFT_SESSION; break; case FOLLOWER_CLOSED_OR_SWITCHED_EDITOR: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWER_CLOSED_OR_SWITCHED_EDITOR; break; case FOLLOWER_CLOSED_EDITOR: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWER_CLOSED_EDITOR; break; case FOLLOWER_STOPPED: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWER_STOPPED; break; case FOLLOWER_SWITCHES_FOLLOWEE: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWER_SWITCHES_FOLLOWEE; break; default: shownReason = reason.name(); log.warn("Encountered unknown reason for follow mode end. reason: " + reason); } NotificationPanel.showInformation( MessageFormat.format( Messages.FollowModeNotificationDispatcher_stopped_following_message, followedUser, shownReason), Messages.FollowModeNotificationDispatcher_stopped_following_title); followedUser = null; }
Source:
public void onToggleSneak(PlayerToggleSneakEvent e) { if (!e.isSneaking()) return; Player p = e.getPlayer(); if (p.getInventory().getChestplate() != null) { SlimefunItem chestplate = SlimefunItem.getByItem(p.getInventory().getChestplate()); if (chestplate == null || !Slimefun.hasUnlocked(p, chestplate, true)) return; if (chestplate instanceof Jetpack) { double thrust = ((Jetpack) chestplate).getThrust(); if (thrust > 0.2) new JetpackTask(p, thrust).scheduleRepeating(0, 3); } else if (chestplate.getID().equals("PARACHUTE")) new ParachuteTask(p).scheduleRepeating(0, 3); } if (p.getInventory().getBoots() != null) { SlimefunItem boots = SlimefunItem.getByItem(p.getInventory().getBoots()); if (boots instanceof JetBoots && Slimefun.hasUnlocked(p, boots, true)) { double speed = ((JetBoots) boots).getSpeed(); if (speed > 0.2) new JetBootsTask(p, speed).scheduleRepeating(0, 2); } } if (SlimefunManager.containsSimilarItem(p.getInventory(), SlimefunItems.INFUSED_MAGNET, true)) new MagnetTask(p).scheduleRepeating(0, 8); }

Target:
public void onToggleSneak(PlayerToggleSneakEvent e) { if (!e.isSneaking()) return; Player p = e.getPlayer(); if (p.getInventory().getChestplate() != null) { SlimefunItem chestplate = SlimefunItem.getByItem(p.getInventory().getChestplate()); handleChestplate(p, chestplate); } if (p.getInventory().getBoots() != null) { SlimefunItem boots = SlimefunItem.getByItem(p.getInventory().getBoots()); handleBoots(p, boots); } if (SlimefunManager.containsSimilarItem(p.getInventory(), SlimefunItems.INFUSED_MAGNET, true)) new MagnetTask(p).scheduleRepeating(0, 8); }
Source:
private CompositeCommand buildCommand(Diagram diagram) { CompositeCommand reconcileCommand = new CompositeCommand("Reconciling"); if (!DiagramVersioningUtils.isOfCurrentPapyrusVersion(diagram)) { String sourceVersion = DiagramVersioningUtils.getCompatibilityVersion(diagram); Map<String, Collection<DiagramReconciler>> diagramReconcilers = DiagramReconcilersReader .getInstance().load(); String diagramType = diagram.getType(); Collection<DiagramReconciler> reconcilers = new LinkedList<DiagramReconciler>(); if (diagramReconcilers.containsKey(diagramType)) { reconcilers.addAll(diagramReconcilers.get(diagramType)); } boolean someFailed = false; Iterator<DiagramReconciler> reconciler = reconcilers.iterator(); while (reconciler.hasNext() && !someFailed) { DiagramReconciler next = reconciler.next(); if (!next.canReconcileFrom(diagram, sourceVersion)) { continue; } ICommand nextCommand = next.getReconcileCommand(diagram); if (nextCommand == null) { continue; } if (nextCommand.canExecute()) { reconcileCommand.add(nextCommand); } } if (someFailed) { reconcileCommand = null; } } return reconcileCommand; }

Target:
private CompositeCommand buildCommand(Diagram diagram) { CompositeCommand reconcileCommand = new CompositeCommand("Reconciling"); if (!DiagramVersioningUtils.isOfCurrentPapyrusVersion(diagram)) { String sourceVersion = DiagramVersioningUtils.getCompatibilityVersion(diagram); Map<String, Collection<DiagramReconciler>> diagramReconcilers = DiagramReconcilersReader .getInstance().load(); String diagramType = diagram.getType(); Collection<DiagramReconciler> reconcilers = new LinkedList<DiagramReconciler>(); if (diagramReconcilers.containsKey(diagramType)) { reconcilers.addAll(diagramReconcilers.get(diagramType)); } boolean someFailed = false; Iterator<DiagramReconciler> reconciler = reconcilers.iterator(); while (reconciler.hasNext() && !someFailed) { DiagramReconciler next = reconciler.next(); if (!next.canReconcileFrom(diagram, sourceVersion)) { continue; } ICommand nextCommand = next.getReconcileCommand(diagram); if (nextCommand == null) { continue; } if (nextCommand.canExecute()) { reconcileCommand.add(nextCommand); } else { CompareDiagramIDEUIPapyrusPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, CompareDiagramIDEUIPapyrusPlugin.PLUGIN_ID, "Diagram reconciler " + next + " failed to reconcile diagram: " + diagram)); someFailed = true; } } if (someFailed) { reconcileCommand = null; } } return reconcileCommand; }
Source:
public String read(int numBytes) throws IOException { char[] strBuffer = new char[numBytes]; int strBufferIndex = 0; int numBytesRemaining = numBytes; if (end - offset > 0) { int length = Math.min(end - offset,numBytesRemaining); System.arraycopy(buffer, offset, strBuffer, strBufferIndex, length); strBufferIndex += length; offset += length; numBytesRemaining -= length; } if (numBytesRemaining > 0) { IOUtils.readFully(is, strBuffer, strBufferIndex); } return new String(strBuffer); }

Target:
public String read(int numBytes) throws IOException { char[] strBuffer = new char[numBytes]; int strBufferIndex = 0; int numBytesRemaining = numBytes; if (end - offset > 0) { int length = Math.min(end - offset,numBytesRemaining); System.arraycopy(buffer, offset, strBuffer, strBufferIndex, length); strBufferIndex += length; offset += length; numBytesRemaining -= length; } if (numBytesRemaining > 0) { IOUtils.readFully(reader, strBuffer, strBufferIndex); } return new String(strBuffer); }
Source:
protected static <T> List<T> merge(List<T> list, List<T> items) { List<T> returnValue = list; if (list != null) { if (items != null) { for (T item : items) { if (!returnValue.contains(item)) { returnValue.add(item); } } } } else { returnValue = items; } return returnValue; }

Target:
protected static <T> List<T> merge(List<T> list, List<T> items) { if (list != null) { if (items != null) { for (T item : items) { if (!list.contains(item)) { list.add(item); } } } } else { return items; } return list; }
Source:
protected MessageBeans resolveMessage(String msg, Integer idOfMessage) throws InternalErrorException { List<PerunBean> listOfBeans; listOfBeans = AuditParser.parseLog(msg); MessageBeans beans = new MessageBeansImpl(); boolean shouldntAddVo = false; if (msg.matches("Group:[\\d\\D]*created in Vo:[\\d\\D]*")) shouldntAddVo = true; if(!listOfBeans.isEmpty()){ int i=0; for(PerunBean p: listOfBeans) { if (shouldntAddVo && p.getBeanName().equals("Vo")) continue; i++; beans.addBean(p); } } return beans; }

Target:
protected MessageBeans resolveMessage(String msg, Integer idOfMessage) throws InternalErrorException { List<PerunBean> listOfBeans; listOfBeans = AuditParser.parseLog(msg); MessageBeans beans = new MessageBeansImpl(); boolean shouldntAddVo = msg.matches("Group:(.*)created in Vo:(.*)"); if(!listOfBeans.isEmpty()){ int i=0; for(PerunBean p: listOfBeans) { if (shouldntAddVo && p.getBeanName().equals("Vo")) { continue; } i++; beans.addBean(p); } } return beans; }