auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void createDescriptorsNoDescriptorDestinationFolder() throws IOException { String pomFileName = "pom.xml"; String descriptorFileName = "mule-application.json"; Path sourceFolderPath = projectBaseFolder.getRoot().toPath(); PackagerTestUtils.createFolder(sourceFolderPath, pomFileName, true); PackagerTestUtils.createFolder(sourceFolderPath, descriptorFileName, true); Path pomPropertiesDestinationPath = projectTargetFolder.getRoot().toPath().resolve(PackagerTestUtils.META_INF).resolve( PackagerTestUtils.MAVEN) .resolve(GROUP_ID).resolve(ARTIFACT_ID); PackagerTestUtils.createEmptyFolder(pomPropertiesDestinationPath); contentGenerator.createDescriptors(); }

Target:
public void createDescriptorsNoDescriptorDestinationFolder() throws IOException { String descriptorFileName = MULE_APPLICATION_DESCRIPTOR_FILE_NAME; Path sourceFolderPath = projectBaseFolder.getRoot().toPath(); PackagerTestUtils.createFolder(sourceFolderPath, POM_FILE_NAME, true); PackagerTestUtils.createFolder(sourceFolderPath, descriptorFileName, true); Path pomPropertiesDestinationPath = projectTargetFolder.getRoot().toPath().resolve(PackagerTestUtils.META_INF).resolve( PackagerTestUtils.MAVEN) .resolve(GROUP_ID).resolve(ARTIFACT_ID); PackagerTestUtils.createEmptyFolder(pomPropertiesDestinationPath); contentGenerator.createDescriptors(); }
Source:
@Override public SqlNode getCastSpec(final RelDataType type) { if (type instanceof BasicSqlType) { switch (type.getSqlTypeName()) { case INTEGER: final SqlBasicTypeNameSpec typeNameSpec = new SqlBasicTypeNameSpec( INT, type.getPrecision(), type.getScale(), null, SqlParserPos.ZERO); return new SqlDataTypeSpec(typeNameSpec, SqlParserPos.ZERO); } } return super.getCastSpec(type); }

Target:
@Override public SqlNode getCastSpec(final RelDataType type) { if (type instanceof BasicSqlType) { switch (type.getSqlTypeName()) { case INTEGER: SqlUserDefinedTypeNameSpec typeNameSpec = new SqlUserDefinedTypeNameSpec( new SqlIdentifier("INT", SqlParserPos.ZERO), SqlParserPos.ZERO); return new SqlDataTypeSpec(typeNameSpec, SqlParserPos.ZERO); } } return super.getCastSpec(type); }
Source:
public void start(ServiceConfiguration<?> cfg, final ServiceProvider serviceProvider) { this.serviceLocator = (ServiceLocator)serviceProvider; }

Target:
public void start(ServiceConfiguration<?> cfg, final ServiceProvider serviceProvider) { this.serviceProvider = serviceProvider; }
Source:
public void onDroneBatteryChanged(int value) { Log.d(TAG, "Battery Status = " + Integer.toString(value)); DroneControlService dcs = DroneServiceWrapper.getInstance().getDroneService(); if (dcs != null && (value < DroneInitializer.DRONE_BATTERY_THRESHOLD) && dcs.getDroneNavData().flying && !droneBatteryMessageShown) { ToastUtil.showError(this, getString(R.string.notification_low_battery) + " " + value); droneBatteryMessageShown = true; } }

Target:
public void onDroneBatteryChanged(int value) { Log.d(TAG, "Battery Status = " + Integer.toString(value)); DroneControlService dcs = DroneServiceWrapper.getInstance().getDroneService(); if (dcs != null && (value < DroneInitializer.DRONE_BATTERY_THRESHOLD) && dcs.getDroneNavData().flying && !droneBatteryMessageShown) { ToastUtil.showError(this, getString(R.string.notification_low_battery_with_value, value)); droneBatteryMessageShown = true; } }
Source:
public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putBoolean("isSearching", isSearching); }

Target:
public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putBoolean(SEARCHING_TAG, isSearching); }
Source:
private static void release(@Pointer long self, @Pointer long sel) { if (ObjCRuntime.int_objc_msgSend(self, retainCount) == 1) { synchronized (CUSTOM_OBJECTS) { CUSTOM_OBJECTS.remove(self); } } long cls = ObjCRuntime.object_getClass(self); long nativeSuper = customClassToNativeSuper.get(cls); Super sup = new Super(self, nativeSuper); ObjCRuntime.void_objc_msgSendSuper(sup.getHandle(), sel); }

Target:
private static void release(@Pointer long self, @Pointer long sel) { if (ObjCRuntime.int_objc_msgSend(self, retainCount) == 1) { synchronized (CUSTOM_OBJECTS) { CUSTOM_OBJECTS.remove(self); } } long cls = ObjCRuntime.object_getClass(self); long nativeSuper = 0; synchronized(customClassToNativeSuper) { nativeSuper = customClassToNativeSuper.get(cls); } Super sup = new Super(self, nativeSuper); ObjCRuntime.void_objc_msgSendSuper(sup.getHandle(), sel); }
Source:
public T get() { T variant = variants.get(0); return outputCopier.apply(variant); }

Target:
public T get() { T variant = variants.first(); return copier.apply(variant); }
Source:
public void startLoadingAndWatchingLocalReplays() { Path replaysDirectory = preferencesService.getReplaysDirectory(); if (Files.notExists(replaysDirectory)) { noCatch(() -> createDirectories(replaysDirectory)); } LoadLocalReplaysTask loadLocalReplaysTask = applicationContext.getBean(LoadLocalReplaysTask.class); taskService.submitTask(loadLocalReplaysTask).getFuture().thenAccept( replays -> { localReplays.clear(); localReplays.addAll(replays); eventBus.post(new LocalReplaysChangedEvent(replays, new ArrayList<Replay>())); }); try { Optional.ofNullable(directoryWatcherThread).ifPresent(Thread::interrupt); directoryWatcherThread = startDirectoryWatcher(replaysDirectory); } catch (IOException e) { logger.debug("Failed to start watching the local replays directory"); } }

Target:
public void startLoadingAndWatchingLocalReplays() { Path replaysDirectory = preferencesService.getReplaysDirectory(); if (Files.notExists(replaysDirectory)) { noCatch(() -> createDirectories(replaysDirectory)); } LoadLocalReplaysTask loadLocalReplaysTask = applicationContext.getBean(LoadLocalReplaysTask.class); taskService.submitTask(loadLocalReplaysTask).getFuture().thenAccept( replays -> { localReplays.clear(); localReplays.addAll(replays); publisher.publishEvent(new LocalReplaysChangedEvent(this, replays, new ArrayList<Replay>())); }); try { Optional.ofNullable(directoryWatcherThread).ifPresent(Thread::interrupt); directoryWatcherThread = startDirectoryWatcher(replaysDirectory); } catch (IOException e) { logger.warn("Failed to start watching the local replays directory"); } }
Source:
protected void readSecretFile(String secretFile) { BufferedReader in = null; passphrase = null; try { if (secretFile != null) { log.debug("reading secret file: " + secretFile); in = new BufferedReader(new FileReader(secretFile)); StringBuilder tmpPassphrase = new StringBuilder(); String line = null; while ((line = in.readLine()) != null) { tmpPassphrase.append(line); } passphrase = tmpPassphrase.toString(); } else { log.debug("No secret file provided."); } } catch (FileNotFoundException e) { log.debug("File not found: " + secretFile); } catch (IOException e) { log.debug("IOException while reading: " + secretFile); } finally { if (in != null) { try { in.close(); } catch (IOException ioe) { } } } }

Target:
protected void readSecretFile(String secretFile) { BufferedReader in = null; passphrase = null; try { if (secretFile != null) { log.debug("reading secret file: {}", secretFile); in = new BufferedReader(new FileReader(secretFile)); StringBuilder tmpPassphrase = new StringBuilder(); String line = null; while ((line = in.readLine()) != null) { tmpPassphrase.append(line); } passphrase = tmpPassphrase.toString(); } else { log.debug("No secret file provided."); } } catch (FileNotFoundException e) { log.debug("File not found: {}", secretFile); } catch (IOException e) { log.debug("IOException while reading: {}", secretFile); } finally { if (in != null) { try { in.close(); } catch (IOException ioe) { } } } }
Source:
public void testOnlyFlowScriptContainsAPIBinding() throws InvalidScriptException { Script s = scriptWithoutApiBinding(); FlowScript fs = flowScriptWithApiBindingUser(); Mockito.when(it.getPreScript()).thenReturn(s); Mockito.when(it.getPostScript()).thenReturn(s); Mockito.when(fe.getEnvScript()).thenReturn(s); Mockito.when(sec.getScript()).thenReturn(s); Mockito.when(it.getFlowScript()).thenReturn(fs); Boolean result = new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd); assertEquals(true, result); }

Target:
public void testOnlyFlowScriptContainsAPIBinding() throws InvalidScriptException { Script s = scriptWithoutApiBinding(); FlowScript fs = flowScriptWithApiBindingUser(); Mockito.when(it.getPreScript()).thenReturn(s); Mockito.when(it.getPostScript()).thenReturn(s); Mockito.when(fe.getEnvScript()).thenReturn(s); Mockito.when(sec.getScript()).thenReturn(s); Mockito.when(it.getFlowScript()).thenReturn(fs); assertTrue(new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd)); }
Source:
private String[][] formatBucketList(final DetailedTapeFailureList result) { final List<DetailedTapeFailure> failures = result.getDetailedTapeFailures(); final String [][] formatArray = new String[failures.size()][]; int i = 0; for(DetailedTapeFailure failure : failures) { final String bucketArray = new String[4]; bucketArray[0] = nullGuard(failure.getType().toString()); bucketArray[1] = nullGuard(failure.getErrorMessage().toString()); bucketArray[2] = nullGuard(failure.getId().toString()); final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); bucketArray[3] = DATE_FORMAT.format(failure.getDate()); formatArray[i++] = bucketArray; } return formatArray; }

Target:
private String[][] formatBucketList(final DetailedTapeFailureList result) { final List<DetailedTapeFailure> failures = result.getDetailedTapeFailures(); final String [][] formatArray = new String[failures.size()][]; int i = 0; for(final DetailedTapeFailure failure : failures) { final String bucketArray = new String[4]; bucketArray[0] = nullGuard(failure.getType().toString()); bucketArray[1] = nullGuard(failure.getErrorMessage().toString()); bucketArray[2] = nullGuard(failure.getId().toString()); final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); bucketArray[3] = DATE_FORMAT.format(failure.getDate()); formatArray[i++] = bucketArray; } return formatArray; }
Source:
Alphametics(String userInput) { String[] array = userInput.split("=="); wordsToSum = Arrays.stream(array[0].split("\\+")) .map(String::new) .map(String::trim) .collect(Collectors.collectingAndThen(Collectors.toList(), Collections::unmodifiableList)); wordResult = array[1].trim(); }

Target:
Alphametics(String userInput) { String[] questionAndAnswer = userInput.split("=="); wordsToSum = Arrays.stream(questionAndAnswer[0].split("\\+")) .map(String::new) .map(String::trim) .collect(Collectors.collectingAndThen(Collectors.toList(), Collections::unmodifiableList)); wordResult = questionAndAnswer[1].trim(); }
Source:
public void addContents(@NonNull Container container) { container.add( new Content("update-center.md") { @Override public void writeTo(OutputStream os) throws IOException { PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(os, "utf-8"))); Jenkins instance = Jenkins.getInstance(); if (instance == null) { out.println("Jenkins has not started yet. No update center information is available."); } else { hudson.model.UpdateCenter updateCenter = instance.getUpdateCenter(); out.println("=== Sites ==="); for (UpdateSite c : updateCenter.getSiteList()) { out.println(" - Url: " + c.getUrl()); out.println(" - Connection Url: " + c.getConnectionCheckUrl()); } out.println("======"); out.println("Last updated: " + updateCenter.getLastUpdatedString()); } } } ); }

Target:
public void addContents(@NonNull Container container) { container.add( new Content("update-center.md") { @Override public void writeTo(OutputStream os) throws IOException { PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(os, "utf-8"))); Jenkins instance = Jenkins.getInstance(); if (instance == null) { out.println("Jenkins has not started yet. No update center information is available."); } else { hudson.model.UpdateCenter updateCenter = instance.getUpdateCenter(); out.println("=== Sites ==="); for (UpdateSite c : updateCenter.getSiteList()) { out.println(" - Url: " + c.getUrl()); out.println(" - Connection Url: " + c.getConnectionCheckUrl()); out.println(" - Implementation Type: " + c.getClass().getName()); } out.println("======"); out.println("Last updated: " + updateCenter.getLastUpdatedString()); } } } ); }
Source:
private long emitResultAndCleanUpState(long currentWatermark) throws Exception { List<RowData> rightRowsSorted = getRightRowSorted(rightRowtimeComparator); long lastUnprocessedTime = Long.MAX_VALUE; Iterator<Map.Entry<Long, RowData>> leftIterator = leftState.entries().iterator(); Map<Long, RowData> orderedOutputs = new TreeMap<>(); while (leftIterator.hasNext()) { Map.Entry<Long, RowData> entry = leftIterator.next(); Long leftSeq = entry.getKey(); RowData leftRow = entry.getValue(); long leftTime = getLeftTime(leftRow); if (leftTime <= currentWatermark) { Optional<RowData> rightRow = latestRightRowToJoin(rightRowsSorted, leftTime); if (rightRow.isPresent() && RowDataUtil.isAccumulateMsg(rightRow.get())) { if (joinCondition.apply(leftRow, rightRow.get())) { orderedOutputs.put(leftSeq, getJoinedRow(leftRow, rightRow.get())); } else { if (isLeftOuterJoin) { orderedOutputs.put(leftSeq, getJoinedRow(leftRow, rightNullRow)); } } } else { if (isLeftOuterJoin) { orderedOutputs.put(leftSeq, getJoinedRow(leftRow, rightNullRow)); } } leftIterator.remove(); } else { lastUnprocessedTime = Math.min(lastUnprocessedTime, leftTime); } } orderedOutputs.forEach((k, v) -> collector.collect(v)); orderedOutputs.clear(); cleanupExpiredVersionInState(currentWatermark, rightRowsSorted); return lastUnprocessedTime; }

Target:
private long emitResultAndCleanUpState(long currentWatermark) throws Exception { List<RowData> rightRowsSorted = getRightRowSorted(rightRowtimeComparator); long lastUnprocessedTime = Long.MAX_VALUE; Iterator<Map.Entry<Long, RowData>> leftIterator = leftState.entries().iterator(); final Map<Long, RowData> orderedLeftRecords = new TreeMap<>(); while (leftIterator.hasNext()) { Map.Entry<Long, RowData> entry = leftIterator.next(); Long leftSeq = entry.getKey(); RowData leftRow = entry.getValue(); long leftTime = getLeftTime(leftRow); if (leftTime <= currentWatermark) { orderedLeftRecords.put(leftSeq, leftRow); leftIterator.remove(); } else { lastUnprocessedTime = Math.min(lastUnprocessedTime, leftTime); } } orderedLeftRecords.forEach((leftSeq, leftRow) -> { long leftTime = getLeftTime(leftRow); Optional<RowData> rightRow = latestRightRowToJoin(rightRowsSorted, leftTime); if (rightRow.isPresent() && RowDataUtil.isAccumulateMsg(rightRow.get())) { if (joinCondition.apply(leftRow, rightRow.get())) { collectJoinedRow(leftRow, rightRow.get()); } else { if (isLeftOuterJoin) { collectJoinedRow(leftRow, rightNullRow); } } } else { if (isLeftOuterJoin) { collectJoinedRow(leftRow, rightNullRow); } } }); orderedLeftRecords.clear(); cleanupExpiredVersionInState(currentWatermark, rightRowsSorted); return lastUnprocessedTime; }
Source:
public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain ) throws IOException, ServletException { HttpServletResponse httpResponse = (HttpServletResponse) response; QueryInterruptedException unauthorizedError = new QueryInterruptedException( QueryInterruptedException.UNAUTHORIZED, null, null, DruidNode.getDefaultHost() ); unauthorizedError.setStackTrace(new StackTraceElement[0]); OutputStream out = httpResponse.getOutputStream(); Boolean authInfoChecked = (Boolean) request.getAttribute(AuthConfig.DRUID_AUTH_TOKEN_CHECKED); String authToken = (String) request.getAttribute(AuthConfig.DRUID_AUTH_TOKEN); if (authInfoChecked != null || authToken != null) { sendJsonError(httpResponse, Response.SC_FORBIDDEN, jsonMapper.writeValueAsString(unauthorizedError), out); return; } chain.doFilter(request, response); }

Target:
public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain ) throws IOException, ServletException { HttpServletResponse httpResponse = (HttpServletResponse) response; OutputStream out = httpResponse.getOutputStream(); Boolean authInfoChecked = (Boolean) request.getAttribute(AuthConfig.DRUID_AUTHORIZATION_CHECKED); AuthenticationResult result = (AuthenticationResult) request.getAttribute(AuthConfig.DRUID_AUTHENTICATION_RESULT); if (authInfoChecked != null || result != null) { sendJsonError(httpResponse, Response.SC_FORBIDDEN, unauthorizedMessage, out); out.close(); return; } chain.doFilter(request, response); }
Source:
private void validateEnabledAlternativeClasses(BeanManagerImpl beanManager, BeanDeployment deployment) { BeansXml beansXml = deployment.getBeanDeploymentArchive().getBeansXml(); if (beansXml != null && !beansXml.getEnabledAlternativeClasses().isEmpty()) { Map<String, Class<?>> loadedClasses = buildClassNameMap(beanManager.getEnabled().getAlternativeClasses()); Multimap<Class<?>, Bean<?>> beansByClass = SetMultimap.newSetMultimap(); for (Bean<?> bean : beanManager.getDynamicAccessibleBeans()) { if (!(bean instanceof NewBean)) { beansByClass.put(bean.getBeanClass(), bean); } } for (Metadata<String> definition : beansXml.getEnabledAlternativeClasses()) { Class<?> enabledClass = loadedClasses.get(definition.getValue()); if (enabledClass.isAnnotation() || enabledClass.isInterface()) { throw ValidatorLogger.LOG.alternativeBeanClassNotClass(definition); } else { final WeldConfiguration configuration = beanManager.getServices().get(WeldConfiguration.class); boolean allowExcludedAlternatives = configuration.getBooleanProperty(ConfigurationKey.ALLOW_EXCLUDED_ALTERNATIVES); if (! allowExcludedAlternatives) { boolean alternativeBeanFound = false; for (Bean<?> bean : beansByClass.get(enabledClass)) { if (bean.isAlternative()) { alternativeBeanFound = true; } } if (!alternativeBeanFound) { throw ValidatorLogger.LOG.alternativeBeanClassNotAnnotatedOrVetoed(definition.getValue(), definition.getLocation()); } } else if (allowExcludedAlternatives && !isAlternativeBean(enabledClass, beansByClass) && !isAlternativeCandidate(enabledClass, beanManager)) { throw ValidatorLogger.LOG.alternativeBeanClassNotAnnotated(definition.getValue(), definition.getLocation()); } } } } }

Target:
private void validateEnabledAlternativeClasses(BeanManagerImpl beanManager, BeanDeployment deployment) { BeansXml beansXml = deployment.getBeanDeploymentArchive().getBeansXml(); if (beansXml != null && !beansXml.getEnabledAlternativeClasses().isEmpty()) { Map<String, Class<?>> loadedClasses = buildClassNameMap(beanManager.getEnabled().getAlternativeClasses()); Multimap<Class<?>, Bean<?>> beansByClass = SetMultimap.newSetMultimap(); for (Bean<?> bean : beanManager.getDynamicAccessibleBeans()) { if (!(bean instanceof NewBean)) { beansByClass.put(bean.getBeanClass(), bean); } } for (Metadata<String> definition : beansXml.getEnabledAlternativeClasses()) { Class<?> enabledClass = loadedClasses.get(definition.getValue()); if (enabledClass.isAnnotation() || enabledClass.isInterface()) { throw ValidatorLogger.LOG.alternativeBeanClassNotClass(definition); } else { final WeldConfiguration configuration = beanManager.getServices().get(WeldConfiguration.class); boolean allowExcludedAlternatives = configuration.getBooleanProperty(ConfigurationKey.ALLOW_VETOED_ALTERNATIVES); if (!isAlternativeBean(enabledClass, beansByClass)) { if (! allowExcludedAlternatives) { throw ValidatorLogger.LOG.alternativeBeanClassNotAnnotatedOrVetoed(definition.getValue(), definition.getLocation()); } else if (! isAlternativeCandidate(enabledClass, beanManager)) { throw ValidatorLogger.LOG.alternativeBeanClassNotAnnotated(definition.getValue(), definition.getLocation()); } } } } } }
Source:
public void showLinkPreview(PageTitle title, int entrySource) { if (getSupportFragmentManager().findFragmentByTag(LinkPreviewDialog.TAG) == null) { LinkPreviewDialog linkPreview = LinkPreviewDialog.newInstance(title, entrySource); linkPreview.show(getSupportFragmentManager(), LinkPreviewDialog.TAG); } }

Target:
public void showLinkPreview(PageTitle title, int entrySource) { if (getSupportFragmentManager().findFragmentByTag(LINK_PREVIEW_FRAGMENT_TAG) == null) { LinkPreviewDialog linkPreview = LinkPreviewDialog.newInstance(title, entrySource); linkPreview.show(getSupportFragmentManager(), LINK_PREVIEW_FRAGMENT_TAG); } }
Source:
public void enableUI() { connectButton.setEnabled(true); cancelButton.setEnabled(true); Cursor.getPredefinedCursor(DEFAULT_CURSOR); }

Target:
public void enableUI() { connectButton.setEnabled(true); cancelButton.setEnabled(true); setCursor(Cursor.getPredefinedCursor(DEFAULT_CURSOR)); }
Source:
private static String getName(@NotNull GoFunctionOrMethodDeclaration element) { PsiElement resolved = element.getIdentifier(); if (resolved == null) { return null; } return resolved.getText().toLowerCase(); }

Target:
private static String getName(@NotNull GoFunctionOrMethodDeclaration element) { String name = element.getName(); if (name == null) return null; return name.toLowerCase(Locale.getDefault()); }
Source:
public F.Promise<Result> index() { return F.Promise.pure(redirect(productcatalog.controllers.routes.ProductOverviewPageController.pop(1))); }

Target:
public F.Promise<Result> index() { return F.Promise.pure(redirect(productcatalog.controllers.routes.ProductOverviewPageController.show(1))); }
Source:
protected final CmdLineParser newCmdLineParserInstance(final Object bean) { Field f = null; ApproveCmdLineParser parser = new ApproveCmdLineParser(bean); try { f = CmdOption.class.getField("value"); for (CmdOption c : optionList) { parser.addOption(new FieldSetter(c, f), c); } } catch (Exception e) { e.printStackTrace(); } return parser; }

Target:
protected final CmdLineParser newCmdLineParserInstance(final Object bean) { CmdLineParser parser = new CmdLineParser(bean); for (CmdOption c : optionList) { parser.addOption(c, c); } return parser; }
Source:
protected void hideStereotypeProperty(final Stereotype stereotype, final Property propertyToHide) { if (diagramElement == null) { return; } try { if (stereotype != null && propertyToHide != null) { View nodeToDisplay = StereotypeDisplayHelper.getInstance().getStereotypeProperty((View) diagramElement, stereotype, propertyToHide); View compartment = helper.getStereotypeCompartment((View) diagramElement, stereotype); helper.setPersistency(getDomain(), nodeToDisplay); helper.setVisibility(getDomain(), nodeToDisplay, false); updateCompartmentVisibility(compartment); } } catch (Exception e) { Activator.logException(e); } }

Target:
protected void hideStereotypeProperty(final Stereotype stereotype, final Property propertyToHide) { if (diagramElement != null) { try { if (stereotype != null && propertyToHide != null) { View nodeToDisplay = StereotypeDisplayHelper.getInstance().getStereotypeProperty((View) diagramElement, stereotype, propertyToHide); View compartment = helper.getStereotypeCompartment((View) diagramElement, stereotype); helper.setPersistency(getDomain(), nodeToDisplay); helper.setVisibility(getDomain(), nodeToDisplay, false); updateCompartmentVisibility(compartment); } } catch (Exception e) { Activator.logException(e); } } }
Source:
public int execute() { try { AtlasReplInfo atlasReplInfo = createAtlasReplInfo(); Map<String, Long> metricMap = new HashMap<>(); metricMap.put(ReplUtils.MetricName.TAGS.name(), 0L); work.getMetricCollector().reportStageStart(getName(), metricMap); LOG.info("Loading atlas metadata from srcDb: to tgtDb: from staging: {}", atlasReplInfo.getSrcDB(), atlasReplInfo.getTgtDB(), atlasReplInfo.getStagingDir()); AtlasLoadLogger replLogger = new AtlasLoadLogger(atlasReplInfo.getSrcDB(), atlasReplInfo.getTgtDB(), atlasReplInfo.getStagingDir().toString()); replLogger.startLog(); int importCount = importAtlasMetadata(atlasReplInfo); replLogger.endLog(importCount); work.getMetricCollector().reportStageProgress(getName(), ReplUtils.MetricName.TAGS.name(), importCount); LOG.info("Atlas entities import count {}", importCount); work.getMetricCollector().reportStageEnd(getName(), Status.SUCCESS); return 0; } catch (Exception e) { LOG.error("Exception while loading atlas metadata", e); setException(e); try { work.getMetricCollector().reportStageEnd(getName(), Status.FAILED); } catch (SemanticException ex) { LOG.error("Failed to collect Metrics ", ex); } return ErrorMsg.getErrorMsg(e.getMessage()).getErrorCode(); } }

Target:
public int execute() { try { AtlasReplInfo atlasReplInfo = createAtlasReplInfo(); Map<String, Long> metricMap = new HashMap<>(); metricMap.put(ReplUtils.MetricName.ENTITIES.name(), 0L); work.getMetricCollector().reportStageStart(getName(), metricMap); LOG.info("Loading atlas metadata from srcDb: to tgtDb: from staging: {}", atlasReplInfo.getSrcDB(), atlasReplInfo.getTgtDB(), atlasReplInfo.getStagingDir()); AtlasLoadLogger replLogger = new AtlasLoadLogger(atlasReplInfo.getSrcDB(), atlasReplInfo.getTgtDB(), atlasReplInfo.getStagingDir().toString()); replLogger.startLog(); int importCount = importAtlasMetadata(atlasReplInfo); replLogger.endLog(importCount); work.getMetricCollector().reportStageProgress(getName(), ReplUtils.MetricName.ENTITIES.name(), importCount); LOG.info("Atlas entities import count {}", importCount); work.getMetricCollector().reportStageEnd(getName(), Status.SUCCESS); return 0; } catch (Exception e) { LOG.error("Exception while loading atlas metadata", e); setException(e); try { work.getMetricCollector().reportStageEnd(getName(), Status.FAILED); } catch (SemanticException ex) { LOG.error("Failed to collect Metrics ", ex); } return ErrorMsg.getErrorMsg(e.getMessage()).getErrorCode(); } }
Source:
private void resetOffsetIfNeeded(TopicPartition partition, OffsetResetStrategy requestedResetStrategy, ListOffsetData offsetData) { SubscriptionState.FetchPosition position = new SubscriptionState.FetchPosition( offsetData.offset, offsetData.leaderEpoch, metadata.leaderAndEpoch(partition)); offsetData.leaderEpoch.ifPresent(epoch -> metadata.updateLastSeenEpochIfNewer(partition, epoch)); subscriptions.maybeSeekUnvalidated(partition, position, requestedResetStrategy); }

Target:
private void resetOffsetIfNeeded(TopicPartition partition, OffsetResetStrategy requestedResetStrategy, ListOffsetData offsetData) { SubscriptionState.FetchPosition position = new SubscriptionState.FetchPosition( offsetData.offset, Optional.empty(), metadata.leaderAndEpoch(partition)); offsetData.leaderEpoch.ifPresent(epoch -> metadata.updateLastSeenEpochIfNewer(partition, epoch)); subscriptions.maybeSeekUnvalidated(partition, position, requestedResetStrategy); }
Source:
private static void validateSchema(OMElement claimElement) throws UserStoreException { String message = null; if (claimElement.getFirstChildWithName(new QName(LOCAL_NAME_CLAIM_URI)) == null) { message = "In valid schema <ClaimUri> element not present"; if (log.isDebugEnabled()) { log.debug(message); } throw new UserStoreException(message); } if (claimElement.getFirstChildWithName(new QName(LOCAL_NAME_DESCRIPTION)) == null) { message = "In valid schema <Description> element not present"; if (log.isDebugEnabled()) { log.debug(message); } throw new UserStoreException(message); } if (claimElement.getFirstChildWithName(new QName(LOCAL_NAME_ATTR_ID)) == null) { message = "In valid schema <AttributeId> element not present"; if (log.isDebugEnabled()) { log.debug(message); } throw new UserStoreException(message); } }

Target:
private static void validateSchema(OMElement claimElement) throws UserStoreException { String message; if (claimElement.getFirstChildWithName(new QName(LOCAL_NAME_CLAIM_URI)) == null) { message = "In valid schema <ClaimUri> element not present"; if (log.isDebugEnabled()) { log.debug(message); } throw new UserStoreException(message); } if (claimElement.getFirstChildWithName(new QName(LOCAL_NAME_DESCRIPTION)) == null) { message = "In valid schema <Description> element not present"; if (log.isDebugEnabled()) { log.debug(message); } throw new UserStoreException(message); } if (claimElement.getFirstChildWithName(new QName(LOCAL_NAME_ATTR_ID)) == null) { message = "In valid schema <AttributeId> element not present"; if (log.isDebugEnabled()) { log.debug(message); } throw new UserStoreException(message); } }
Source:
public void shouldReturn400_whenCorporatePrepaidCreditCardSurchargeOperationIsMissing() { JsonNode jsonNode = new ObjectMapper() .valueToTree(ImmutableMap.of( "path", "corporate_prepaid_credit_card_surcharge_amount", "value", 250)); Response response = resources.client() .target("/v1/api/accounts/12") .request() .method("PATCH", Entity.json(jsonNode)); assertThat(response.getStatus(), is(400)); String errorMessage = response.readEntity(JsonNode.class).get("message").get(0).textValue(); assertThat(errorMessage, is("Field [op] is required")); }

Target:
public void shouldReturn400_whenCorporatePrepaidCreditCardSurchargeOperationIsMissing() { JsonNode jsonNode = new ObjectMapper() .valueToTree(ImmutableMap.of( "path", "corporate_prepaid_credit_card_surcharge_amount", "value", 250)); Response response = resources.client() .target("/v1/api/accounts/12") .request() .method("PATCH", Entity.json(jsonNode)); assertThat(response.getStatus(), is(400)); JsonNode body = response.readEntity(JsonNode.class); assertErrorBodyMatches(body, "Field [op] is required", ErrorIdentifier.GENERIC); }
Source:
private SSLEngine createSSLEngine(boolean clientMode) { final SSLContext ctx = this.sslContext; if (ctx == null) { return null; } final SSLEngine engine = ctx.createSSLEngine(); engine.setUseClientMode(clientMode); return engine; }

Target:
private SSLEngine createSSLEngine(boolean clientMode) { final SSLEngine engine = this.sslContext.createSSLEngine(); engine.setUseClientMode(clientMode); return engine; }
Source:
public List<VariableReferenceExpression> getOutputs() { return unmodifiableList(new ArrayList<>(assignments.keySet())); }

Target:
public List<VariableReferenceExpression> getOutputs() { return outputs; }
Source:
private BufferedReader getBufferedReader() throws IOException { String extension; Charset charset; if (FileUtil.isUrl(uri)) { extension = FileUtil.getUrlExtension(uri).toLowerCase(PMS.getLocale()); } else { extension = FileUtil.getExtension(uri).toLowerCase(PMS.getLocale()); } if (extension != null && (extension.equals("m3u8") || extension.equals(".cue"))) { charset = StandardCharsets.UTF_8; } else { charset = StandardCharsets.ISO_8859_1; } if (FileUtil.isUrl(uri)) { return new BufferedReader(new InputStreamReader(new BOMInputStream(new URL(uri).openStream()), charset)); } else { File playlistfile = new File(uri); if (playlistfile.length() < 10000000) { try (FileInputStream fis = new FileInputStream(playlistfile)) { return new BufferedReader(new InputStreamReader(new BOMInputStream(fis), charset)); } } } return null; }

Target:
private BufferedReader getBufferedReader() throws IOException { String extension; Charset charset; if (FileUtil.isUrl(uri)) { extension = FileUtil.getUrlExtension(uri).toLowerCase(PMS.getLocale()); } else { extension = FileUtil.getExtension(uri).toLowerCase(PMS.getLocale()); } if (extension != null && (extension.equals("m3u8") || extension.equals(".cue"))) { charset = StandardCharsets.UTF_8; } else { charset = StandardCharsets.ISO_8859_1; } if (FileUtil.isUrl(uri)) { return new BufferedReader(new InputStreamReader(new BOMInputStream(new URL(uri).openStream()), charset)); } else { File playlistfile = new File(uri); if (playlistfile.length() < 10000000) { FileInputStream fis = new FileInputStream(playlistfile); return new BufferedReader(new InputStreamReader(new BOMInputStream(fis), charset)); } } return null; }
Source:
public void testAddLocation() { Mockito.when(this.locationDataManager.getUserDefinedFieldIdOfCode(UDTableType.LOCATION_LTYPE, LocationType.BLOCK.getCode())).thenReturn(1001); Mockito.when(this.locationDataManager.getUserDefinedFieldIdOfCode(UDTableType.LOCDES_DTYPE, LocdesType.BLOCK_PARENT.getCode())).thenReturn(1002); this.fieldbookServiceImpl.addLocation("LOCNAME", 1, 101, LocationType.BLOCK.getCode(), LocdesType.BLOCK_PARENT.getCode()); Mockito.verify(this.locationDataManager).getUserDefinedFieldIdOfCode(UDTableType.LOCATION_LTYPE, LocationType.BLOCK.getCode()); Mockito.verify(this.locationDataManager).getUserDefinedFieldIdOfCode(UDTableType.LOCDES_DTYPE, LocdesType.BLOCK_PARENT.getCode()); Mockito.verify(this.locationDataManager).addLocationAndLocdes(ArgumentMatchers.any(Location.class), ArgumentMatchers.any(Locdes.class)); }

Target:
public void testAddLocation() { Mockito.when(this.locationDataManager.getUserDefinedFieldIdOfCode(UDTableType.LOCATION_LTYPE, LocationType.BLOCK.getCode())).thenReturn(1001); Mockito.when(this.locationDataManager.getUserDefinedFieldIdOfCode(UDTableType.LOCDES_DTYPE, LocdesType.BLOCK_PARENT.getCode())).thenReturn(1002); this.fieldbookServiceImpl.addLocation("LOCNAME", 1, 101, LocationType.BLOCK.getCode(), LocdesType.BLOCK_PARENT.getCode()); Mockito.verify(this.locationDataManager).getUserDefinedFieldIdOfCode(UDTableType.LOCATION_LTYPE, LocationType.BLOCK.getCode()); Mockito.verify(this.locationDataManager).getUserDefinedFieldIdOfCode(UDTableType.LOCDES_DTYPE, LocdesType.BLOCK_PARENT.getCode()); final ArgumentCaptor<Location> locationCaptor = ArgumentCaptor.forClass(Location.class); final ArgumentCaptor<Locdes> locdesCaptor = ArgumentCaptor.forClass(Locdes.class); Mockito.verify(this.locationDataManager).addLocationAndLocdes(locationCaptor.capture(), locdesCaptor.capture()); final Location location = locationCaptor.getValue(); final Locdes locdes = locdesCaptor.getValue(); Assert.assertEquals("1001", location.getLtype().toString()); Assert.assertEquals("LOCNAME", location.getLname()); Assert.assertNull(location.getLabbr()); Assert.assertEquals("1002", locdes.getTypeId().toString()); Assert.assertEquals("101", locdes.getUserId().toString()); Assert.assertEquals("1", locdes.getDval()); }
Source:
public ConnectorPageSource createPageSource(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorSplit split, List<ColumnHandle> columns) { RaptorSplit raptorSplit = (RaptorSplit) split; OptionalInt bucketNumber = raptorSplit.getBucketNumber(); TupleDomain<RaptorColumnHandle> predicate = raptorSplit.getEffectivePredicate(); ReaderAttributes attributes = ReaderAttributes.from(session); OptionalLong transactionId = raptorSplit.getTransactionId(); Optional<Map<String, Type>> columnTypes = raptorSplit.getColumnTypes(); boolean deltaDeleteEnabled = raptorSplit.getDeltaDeleteEnabled(); Optional<Map<UUID, UUID>> shardDeltaMap = raptorSplit.getShardDeltaMap(); if (raptorSplit.getShardUuids().size() == 1) { UUID shardUuid = raptorSplit.getShardUuids().iterator().next(); return createPageSource(shardUuid, shardDeltaMap.isPresent() && shardDeltaMap.get().get(shardUuid) != null ? Optional.of(shardDeltaMap.get().get(shardUuid)) : Optional.empty(), deltaDeleteEnabled, bucketNumber, columns, predicate, attributes, transactionId, columnTypes); } Iterator<ConnectorPageSource> iterator = raptorSplit.getShardUuids().stream() .map(shardUuid -> createPageSource(shardUuid, shardDeltaMap.isPresent() && shardDeltaMap.get().get(shardUuid) != null ? Optional.of(shardDeltaMap.get().get(shardUuid)) : Optional.empty(), deltaDeleteEnabled, bucketNumber, columns, predicate, attributes, transactionId, columnTypes)) .iterator(); return new ConcatPageSource(iterator); }

Target:
public ConnectorPageSource createPageSource(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorSplit split, List<ColumnHandle> columns) { RaptorSplit raptorSplit = (RaptorSplit) split; OptionalInt bucketNumber = raptorSplit.getBucketNumber(); TupleDomain<RaptorColumnHandle> predicate = raptorSplit.getEffectivePredicate(); ReaderAttributes attributes = ReaderAttributes.from(session); OptionalLong transactionId = raptorSplit.getTransactionId(); Optional<Map<String, Type>> columnTypes = raptorSplit.getColumnTypes(); boolean tableSupportsDeltaDelete = raptorSplit.isTableSupportsDeltaDelete(); FileSystemContext context = new FileSystemContext(session); Map<UUID, UUID> shardDeltaMap = raptorSplit.getShardDeltaMap(); if (raptorSplit.getShardUuids().size() == 1) { UUID shardUuid = raptorSplit.getShardUuids().iterator().next(); return createPageSource(context, shardUuid, Optional.ofNullable(shardDeltaMap.get(shardUuid)), tableSupportsDeltaDelete, bucketNumber, columns, predicate, attributes, transactionId, columnTypes); } Iterator<ConnectorPageSource> iterator = raptorSplit.getShardUuids().stream() .map(shardUuid -> createPageSource(context, shardUuid, Optional.ofNullable(shardDeltaMap.get(shardUuid)), tableSupportsDeltaDelete, bucketNumber, columns, predicate, attributes, transactionId, columnTypes)) .iterator(); return new ConcatPageSource(iterator); }
Source:
public void storeCertificate(String pemEncodedCert, boolean force) throws CertificateException { CertificateCodec certificateCodec = new CertificateCodec(securityConfig); try { Path basePath = securityConfig.getCertificateLocation(); String certName; X509Certificate cert = CertificateCodec.getX509Certificate(pemEncodedCert); certName = String.format(CERT_FILE_NAME_FORMAT, cert.getSerialNumber().toString()); certificateCodec.writeCertificate(basePath, certName, pemEncodedCert, force); certificateMap.putIfAbsent(cert.getSerialNumber().toString(), cert); } catch (IOException | java.security.cert.CertificateException e) { throw new CertificateException("Error while storing certificate.", e, CERTIFICATE_ERROR); } }

Target:
public void storeCertificate(String pemEncodedCert, boolean force) throws CertificateException { CertificateCodec certificateCodec = new CertificateCodec(securityConfig); try { Path basePath = securityConfig.getCertificateLocation(); X509Certificate cert = CertificateCodec.getX509Certificate(pemEncodedCert); String certName = String.format(CERT_FILE_NAME_FORMAT, cert.getSerialNumber().toString()); certificateCodec.writeCertificate(basePath, certName, pemEncodedCert, force); certificateMap.putIfAbsent(cert.getSerialNumber().toString(), cert); } catch (IOException | java.security.cert.CertificateException e) { throw new CertificateException("Error while storing certificate.", e, CERTIFICATE_ERROR); } }
Source:
public String findAllCommentsIdsStartingFrom(Date date) { final String commentsIds = ""; final Objectify objectify = OfyService.ofy(); final List<TechnologyComment> comments = objectify.load().type(TechnologyComment.class) .filter(TechnologyComment.TIMESTAMP + " >" , date).list(); for (TechnologyComment technologyComment : comments) { commentsIds.concat("," + technologyComment.getId()); } return commentsIds; }

Target:
public String findAllCommentsIdsStartingFrom(Date date) { String commentsIds = ""; final Objectify objectify = OfyService.ofy(); final List<TechnologyComment> comments = objectify.load().type(TechnologyComment.class) .filter(TechnologyComment.TIMESTAMP + " >" , date).list(); for (TechnologyComment technologyComment : comments) { commentsIds = commentsIds.concat("," + technologyComment.getId()); } return commentsIds; }
Source:
public void request(long n) { if (n < 1) { throw new IllegalArgumentException("Only postive values are valid - passed-in " + n); } requested.addAndGet(n); synchronized (buffer) { InboundSseEvent bufferedEvent = null; while (delivered.get() < requested.get() && (bufferedEvent = ((LinkedList<InboundSseEvent>) buffer).pollFirst()) != null) { InboundSseEvent finalEvent = bufferedEvent; delivered.updateAndGet(l -> { subscriber.onNext(finalEvent); return l + 1; }); } } }

Target:
public void request(long n) { if (canceled.get()) { return; } if (n < 1) { fireError(new IllegalArgumentException("Only positive values may be requested - passed-in " + n)); return; } requested.addAndGet(n); synchronized (buffer) { InboundSseEvent bufferedEvent = null; synchronized (delivered) { while (delivered.get() < requested.get() && (bufferedEvent = buffer.pollFirst()) != null) { subscriber.onNext(bufferedEvent); delivered.incrementAndGet(); } } } }
Source:
public void setPermissive(String statusDirectory, String importFileName, long badRecordThreshold){ this.permissive=true; this.badRecordThreshold = badRecordThreshold; if(importFileName == null)importFileName="unspecified_" + System.currentTimeMillis(); BadRecordsRecorder badRecordsRecorder = new BadRecordsRecorder(statusDirectory, importFileName, badRecordThreshold); this.badRecordsAccumulator=SpliceSpark.getContext().accumulable(badRecordsRecorder, badRecordsRecorder.getUniqueName(), new BadRecordsAccumulator()); }

Target:
public void setPermissive(String statusDirectory, String importFileName, long badRecordThreshold){ this.permissive=true; this.badRecordThreshold = badRecordThreshold; if(importFileName == null)importFileName=BAD_FILENAME + System.currentTimeMillis(); BadRecordsRecorder badRecordsRecorder = new BadRecordsRecorder(statusDirectory, importFileName, badRecordThreshold); this.badRecordsAccumulator=SpliceSpark.getContext().accumulable(badRecordsRecorder, badRecordsRecorder.getUniqueName(), new BadRecordsAccumulator()); }
Source:
private String enableCapabilities(final ProgressMonitor monitor, OutputStream outputStream) { final StringBuilder line = new StringBuilder(); if (atomic) capableAtomic = wantCapability(line, CAPABILITY_ATOMIC); capableReport = wantCapability(line, CAPABILITY_REPORT_STATUS); capableDeleteRefs = wantCapability(line, CAPABILITY_DELETE_REFS); capableOfsDelta = wantCapability(line, CAPABILITY_OFS_DELTA); capablePushOptions = wantCapability(line, PUSH_OPTIONS); capableSideBand = wantCapability(line, CAPABILITY_SIDE_BAND_64K); if (capableSideBand) { in = new SideBandInputStream(in, monitor, getMessageWriter(), outputStream); pckIn = new PacketLineIn(in); } addUserAgentCapability(line); if (line.length() > 0) line.setCharAt(0, '\0'); return line.toString(); }

Target:
private String enableCapabilities(final ProgressMonitor monitor, OutputStream outputStream) { final StringBuilder line = new StringBuilder(); if (atomic) capableAtomic = wantCapability(line, CAPABILITY_ATOMIC); capableReport = wantCapability(line, CAPABILITY_REPORT_STATUS); capableDeleteRefs = wantCapability(line, CAPABILITY_DELETE_REFS); capableOfsDelta = wantCapability(line, CAPABILITY_OFS_DELTA); capablePushOptions = wantCapability(line, CAPABILITY_PUSH_OPTIONS); capableSideBand = wantCapability(line, CAPABILITY_SIDE_BAND_64K); if (capableSideBand) { in = new SideBandInputStream(in, monitor, getMessageWriter(), outputStream); pckIn = new PacketLineIn(in); } addUserAgentCapability(line); if (line.length() > 0) line.setCharAt(0, '\0'); return line.toString(); }
Source:
protected void onResume() { super.onResume(); Log.i("DD", "onResume()"); SharedPreferences sharedPrefs = this.getSharedPreferences( "skip_intro", this.MODE_PRIVATE); Log.i("DD", "" + (sharedPrefs.getInt("clickedSkip", 0))); if(sharedPrefs.getInt("clickedSkip", 0) == 1) { startActivity(new Intent(this, AccountActivity.class)); finish(); } }

Target:
protected void onResume() { super.onResume(); if(Preferences.getSkipButton() == true) { startActivity(new Intent(this, AccountActivity.class)); finish(); } }
Source:
protected T validateValueInternal(T rawValue) throws ProcessingException { T validValue; if (rawValue == null) { validValue = null; } else { T t = TypeCastUtility.castValue(rawValue, getHolderType()); IRadioButton b = getButtonFor(t); if (b != null) { validValue = t; } else { throw new ProcessingException("Illegal radio value: " + rawValue); } } return validValue; }

Target:
protected T validateValueInternal(T rawValue) throws ProcessingException { T validValue; if (rawValue == null) { validValue = null; } else { IRadioButton b = getButtonFor(rawValue); if (b != null) { validValue = rawValue; } else { throw new ProcessingException("Illegal radio value: " + rawValue); } } return validValue; }
Source:
private void tryToConnect(InetSocketAddress socketAddress, int timeout) throws Exception { SocketChannel socketChannel = SocketChannel.open(); Channel channel = connectionManager.createChannel(socketChannel, true); boolean success = false; try { if (ioService.isSocketBind()) { bindSocket(socketChannel); } Level level = silent ? Level.FINEST : Level.INFO; if (logger.isLoggable(level)) { logger.log(level, "Connecting to " + socketAddress + ", timeout: " + timeout + ", bind-any: " + ioService.isSocketBindAny()); } try { channel.connect(socketAddress, timeout); ioService.interceptSocket(socketChannel.socket(), false); TcpIpConnection connection = connectionManager.newConnection(channel, address); connectionManager.sendBindRequest(connection, address, true); success = true; } catch (NullPointerException e) { closeSocket(socketChannel); logger.log(level, "Could not connect to: " + socketAddress + ". Reason: " + e.getClass().getSimpleName() + "[" + e.getMessage() + "]"); logger.log(Level.INFO, "Add this stacktrace to <LINK_0> please!", e); throw e; } catch (Exception e) { closeSocket(socketChannel); logger.log(level, "Could not connect to: " + socketAddress + ". Reason: " + e.getClass().getSimpleName() + "[" + e.getMessage() + "]"); throw e; } } finally { if (!success) { connectionManager.acceptedChannels.remove(channel); } } }

Target:
private void tryToConnect(InetSocketAddress socketAddress, int timeout) throws Exception { SocketChannel socketChannel = SocketChannel.open(); Channel channel = connectionManager.createChannel(socketChannel, true); try { if (ioService.isSocketBind()) { bindSocket(socketChannel); } Level level = silent ? Level.FINEST : Level.INFO; if (logger.isLoggable(level)) { logger.log(level, "Connecting to " + socketAddress + ", timeout: " + timeout + ", bind-any: " + ioService.isSocketBindAny()); } try { channel.connect(socketAddress, timeout); ioService.interceptSocket(socketChannel.socket(), false); TcpIpConnection connection = connectionManager.newConnection(channel, address); connectionManager.sendBindRequest(connection, address, true); } catch (NullPointerException e) { closeSocket(socketChannel); logger.log(level, "Could not connect to: " + socketAddress + ". Reason: " + e.getClass().getSimpleName() + "[" + e.getMessage() + "]"); logger.log(Level.INFO, "Add this stacktrace to <LINK_0> please!", e); throw e; } catch (Exception e) { closeSocket(socketChannel); logger.log(level, "Could not connect to: " + socketAddress + ". Reason: " + e.getClass().getSimpleName() + "[" + e.getMessage() + "]"); throw e; } } finally { connectionManager.removeAcceptedChannel(channel); } }
Source:
public @Nullable String resolve(ISegment segment) { if (segment instanceof TmfXmlPatternSegment) { StringBuilder value = new StringBuilder(); int nbEntry = 0; for (Map.Entry<String, ITmfStateValue> content : ((TmfXmlPatternSegment) segment).getContent().entrySet()) { if (nbEntry > 0) { value.append(", "); } value.append(content.getKey()).append("=").append(content.getValue()); nbEntry++; } return value.toString(); } return EMPTY_STRING; }

Target:
public @Nullable String resolve(ISegment segment) { if (segment instanceof TmfXmlPatternSegment) { List<String> values = ((TmfXmlPatternSegment) segment).getContent().entrySet().stream().map(c -> c.getKey() + '=' + c.getValue()).collect(Collectors.toList()); return String.join(", ", values); } return EMPTY_STRING; }
Source:
public QueriesCommandBase(P parameters, EngineContext engineContext) { this.parameters = parameters; returnValue = new VdcQueryReturnValue(); queryType = initQueryType(); user = initUser(); }

Target:
public QueriesCommandBase(P parameters, EngineContext engineContext) { this.parameters = parameters; returnValue = new VdcQueryReturnValue(); queryType = initQueryType(); user = initUser(); this.engineContext = engineContext; }