auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<? extends Module> getJacksonModules() { return ImmutableList.<Module>of( new SimpleModule("DruidNamespacedExtractionModule") { @Override public void setupModule(SetupContext context) { context.registerSubtypes(NamespacedExtractor.class); context.registerSubtypes(ExtractionNamespace.class); <START> context.registerSubtypes(NamespaceLookupExtractorFactory.class); <END> } } ); }</code><technical_language>this is a long list well, new SimpleModule("DruidNamespacedExtractionModule").registerSubtypes(...)</technical_language>

Target:
public List<? extends Module> getJacksonModules() { return ImmutableList.<Module>of( new SimpleModule("DruidNamespacedExtractionModule") .registerSubtypes( ExtractionNamespace.class, NamespaceLookupExtractorFactory.class ) ); }
Source:
<code>public void sourceEntryShouldBeAdded() throws Exception { Variant variant = buildVariantWithSourceEntry("1", 1, 2, "A", "T", "fileId", "previousStudy"); Variant newVariant = buildVariantWithSourceEntry("1", 1, 2, "A", "T", "fileId", "dbsnpStudy"); VariantMongoWriter variantMongoWriter = new VariantMongoWriter(collectionName, mongoOperations, false, false); variantMongoWriter.write(Collections.singletonList(variant)); variantMongoWriter.write(Collections.singletonList(newVariant)); DBCollection dbCollection = mongoOperations.getCollection(collectionName); assertEquals(1, dbCollection.count()); final DBObject storedVariant = dbCollection.findOne(); assertEquals(2, ((BasicDBList) storedVariant.get(FILES_FIELD)).size()); <START> } <END></code><technical_language>In opinion, this line in previous block style of tests consistent (input data, operations test, assertions)</technical_language>

Target:
public void sourceEntryShouldBeAdded() throws Exception { Variant variant = buildVariantWithSampleData("1", 1, 2, "A", "T", "fileId", "previousStudy"); Variant newVariant = buildVariantWithSampleData("1", 1, 2, "A", "T", "fileId", "dbsnpStudy"); VariantMongoWriter variantMongoWriter = new VariantMongoWriter(collectionName, mongoOperations, false, false); variantMongoWriter.write(Collections.singletonList(variant)); variantMongoWriter.write(Collections.singletonList(newVariant)); DBCollection dbCollection = mongoOperations.getCollection(collectionName); assertEquals(1, dbCollection.count()); final DBObject storedVariant = dbCollection.findOne(); assertEquals(2, ((BasicDBList) storedVariant.get(FILES_FIELD)).size()); }
Source:
<code>public IFileStore mkdir(int options, IProgressMonitor monitor) throws CoreException { boolean shallow = (options & EFS.SHALLOW) != 0; boolean success = false; if (shallow) { success = file.mkdir(); } else { success = file.mkdirs(); } <START> if (!file.isDirectory()) { if (success && !file.exists()) { <END> try { Thread.sleep(100); } catch (InterruptedException e) { } if (file.isDirectory()) { return this; } } checkReadOnlyParent(file, null); checkTargetIsNotWritable(file, null); String message = NLS.bind(Messages.failedCreateWrongType, filePath); Policy.error(EFS.ERROR_WRONG_TYPE, message); } return this; }</code><technical_language>Is a strong evidence checking "success" is enough? replacing file.isDirectory() call fetchInfo</technical_language>

Target:
public IFileStore mkdir(int options, IProgressMonitor monitor) throws CoreException { boolean shallow = (options & EFS.SHALLOW) != 0; try { if (shallow) { Files.createDirectory(file.toPath()); } else { Files.createDirectories(file.toPath()); } } catch (IOException e) { String message = NLS.bind(Messages.failedCreateWrongType, filePath); Policy.error(EFS.ERROR_WRITE, message, e); } if (!file.isDirectory()) { checkReadOnlyParent(file, null); checkTargetDoesNotExist(file, null); checkTargetIsNotWritable(file, null); String message = NLS.bind(Messages.failedCreateWrongType, filePath); Policy.error(EFS.ERROR_WRONG_TYPE, message); } return this; }
Source:
<code>public MessageChannelEvent.Chat simulateChat(Text message) { String messageRaw = SpongeTexts.toLegacy(message); ITextComponent itextcomponent = new TextComponentTranslation("chat.type.text", SpongeTexts.toComponent(getDisplayNameText()), net.minecraftforge.common.ForgeHooks.newChatWithLinks(messageRaw)); EntityPlayerMP thisPlayer = (EntityPlayerMP)(Object) this; final ServerChatEvent event = new ServerChatEvent(thisPlayer, messageRaw, itextcomponent); ((IMixinInitCause) event).initCause(Cause.of(NamedCause.source(this))); if (!MinecraftForge.EVENT_BUS.post(event)) { MessageChannelEvent.Chat spongeEvent = (MessageChannelEvent.Chat) event; Text theMessage = spongeEvent.getMessage(); if (!spongeEvent.isMessageCancelled()) { <START> spongeEvent.getChannel().ifPresent(channel -> channel.send(this, theMessage, ChatTypes.CHAT)); <END> } } return (MessageChannelEvent.Chat) event; }</code><technical_language>spongeEvent.getMessage() instead of creating a local variable for</technical_language>

Target:
public MessageChannelEvent.Chat simulateChat(Text message) { String messageRaw = SpongeTexts.toLegacy(message); TextComponentTranslation itextcomponent = new TextComponentTranslation("chat.type.text", SpongeTexts.toComponent(getDisplayNameText()), net.minecraftforge.common.ForgeHooks.newChatWithLinks(messageRaw)); EntityPlayerMP thisPlayer = (EntityPlayerMP)(Object) this; final ServerChatEvent event = new ServerChatEvent(thisPlayer, messageRaw, itextcomponent); ((IMixinInitCause) event).initCause(Cause.of(NamedCause.source(this))); if (!MinecraftForge.EVENT_BUS.post(event)) { MessageChannelEvent.Chat spongeEvent = (MessageChannelEvent.Chat) event; if (!spongeEvent.isMessageCancelled()) { spongeEvent.getChannel().ifPresent(channel -> channel.send(this, spongeEvent.getMessage(), ChatTypes.CHAT)); } } return (MessageChannelEvent.Chat) event; }
Source:
<code>protected void generatePassword() { if (Strings.isBlank(getAttribute(AmbariServer.PASSWORD))) { String password; <START> if (Strings.isBlank(getConfig(AmbariServer.PASSWORD))) { <END> password = Identifiers.makeRandomId(10); } else { password = getConfig(AmbariServer.PASSWORD); } usernamePasswordCredentials = new UsernamePasswordCredentials(USERNAME, password); restAdapter = new RestAdapter.Builder() .setEndpoint(ambariUri) .setRequestInterceptor(new AmbariRequestInterceptor(new UsernamePasswordCredentials(USERNAME, DEFAULT_PASSWORD))) .setLogLevel(RestAdapter.LogLevel.FULL) .build(); ImmutableMap<String, ImmutableMap<String, String>> userRequest = ImmutableMap.of("Users", ImmutableMap.of( "user_name", USERNAME, "old_password", DEFAULT_PASSWORD, "password", usernamePasswordCredentials.getPassword() )); restAdapter.create(UsersEndpoint.class).updateUser(userRequest); sensors().set(AmbariServer.PASSWORD, password); } }</code><technical_language>change String password = getConfig(AmbariServer.PASSWORD) is a single call getConfig</technical_language>

Target:
protected void generatePassword() { String password = getAttribute(AmbariServer.PASSWORD); if (password == null) { password = getConfig(AmbariServer.PASSWORD); if (password == null) { password = Identifiers.makeRandomId(10); } usernamePasswordCredentials = new UsernamePasswordCredentials(USERNAME, password); restAdapter = new RestAdapter.Builder() .setEndpoint(ambariUri) .setRequestInterceptor(new AmbariRequestInterceptor(new UsernamePasswordCredentials(USERNAME, INITIAL_PASSWORD))) .setLogLevel(RestAdapter.LogLevel.FULL) .build(); ImmutableMap<String, ImmutableMap<String, String>> userRequest = ImmutableMap.of("Users", ImmutableMap.of( "user_name", USERNAME, "old_password", INITIAL_PASSWORD, "password", usernamePasswordCredentials.getPassword() )); restAdapter.create(UsersEndpoint.class).updateUser(userRequest); sensors().set(AmbariServer.PASSWORD, password); } }
Source:
<code>private List<OnmsAlarm> getAlarms() { final CriteriaBuilder alarmCb = new CriteriaBuilder(OnmsAlarm.class); alarmCb.alias("node", "node"); alarmCb.alias("node.categories", "category"); alarmCb.alias("lastEvent", "event"); String criteria = getDashletSpec().getParameters().get("criteria"); m_criteriaBuilderHelper.parseConfiguration(alarmCb, criteria); alarmCb.fetch("firstEvent", Fetch.FetchType.EAGER); alarmCb.fetch("lastEvent", Fetch.FetchType.EAGER); List<OnmsAlarm> onmsAlarmList = m_alarmDao.findMatching(alarmCb.toCriteria()); List<OnmsAlarm> distinctOnmsAlarmList = new LinkedList<>(); Set<Integer> onmsAlarmIdSet = new TreeSet<>(); <START> <END> for (OnmsAlarm onmsAlarm : onmsAlarmList) { if (!onmsAlarmIdSet.contains(onmsAlarm.getId())) { distinctOnmsAlarmList.add(onmsAlarm); onmsAlarmIdSet.add(onmsAlarm.getId()); } } return distinctOnmsAlarmList; }</code><technical_language>prefer a HashMap here. Map<Integer, OnmsAlarm> onmsAlarmMap</technical_language>

Target:
private List<OnmsAlarm> getAlarms() { final CriteriaBuilder alarmCb = new CriteriaBuilder(OnmsAlarm.class); alarmCb.alias("node", "node"); alarmCb.alias("node.categories", "category"); alarmCb.alias("lastEvent", "event"); String criteria = getDashletSpec().getParameters().get("criteria"); m_criteriaBuilderHelper.parseConfiguration(alarmCb, criteria); alarmCb.fetch("firstEvent", Fetch.FetchType.EAGER); alarmCb.fetch("lastEvent", Fetch.FetchType.EAGER); List<OnmsAlarm> onmsAlarmList = m_alarmDao.findMatching(alarmCb.toCriteria()); Map<Integer, OnmsAlarm> onmsAlarmMap = new LinkedHashMap<>(); for (OnmsAlarm onmsAlarm : onmsAlarmList) { if (!onmsAlarmMap.containsKey(onmsAlarm.getId())) { onmsAlarmMap.put(onmsAlarm.getId(), onmsAlarm); } } return Lists.newArrayList(onmsAlarmMap.values()); }
Source:
<code>public void parseStatFile(String fileName) throws FileNotFoundException { cpuCoreCountersOld = cpuCoreCounters; <START> cpuCoreCounters = new ProcStatCounters(); <END> File statFile = new File(fileName); if (!statFile.exists()) { throw new FileNotFoundException(); } BufferedReader reader = null; try { String coreId; Reader r = new InputStreamReader(new FileInputStream(statFile)); reader = new BufferedReader(r); String line; Pattern patternCpu = Pattern.compile("^(cpu[0-9]{1,})(.*)$"); while ((line = reader.readLine()) != null) { line = line.trim(); Matcher matcherCpu = patternCpu.matcher(line); if (matcherCpu.find()) { Vector<Integer> ticks = new Vector<Integer>(); coreId = matcherCpu.group(1); for (String tick : matcherCpu.group(2).trim().split("\\s+")) { ticks.add(Integer.parseInt(tick)); } try { cpuCoreCounters.addTickCounters(coreId, ticks.toArray(new Integer[ticks.size()])); } catch (ArithmeticException e) { break; } continue; } } } catch (IOException e) { } finally { try { if (reader != null) { reader.close(); } } catch (IOException e) { } reader = null; } }</code><technical_language>move this checking if file exists</technical_language>

Target:
public void parseStatFile(String fileName) throws FileNotFoundException, NumberFormatException { cpuCoreCountersOld = cpuCoreCounters; File statFile = new File(fileName); if (!statFile.exists()) { throw new FileNotFoundException(); } cpuCoreCounters = new ProcStatCounters(); BufferedReader reader = null; try { String coreId; Reader r = new InputStreamReader(new FileInputStream(statFile)); reader = new BufferedReader(r); String line; Pattern patternCpu = Pattern.compile("^(cpu[0-9]+)(.*)$"); while ((line = reader.readLine()) != null) { line = line.trim(); Matcher matcherCpu = patternCpu.matcher(line); if (matcherCpu.find()) { Vector<Integer> ticks = new Vector<Integer>(); coreId = matcherCpu.group(1); for (String tick : matcherCpu.group(2).trim().split("\\s+")) { ticks.add(Integer.parseInt(tick)); } cpuCoreCounters.addTickCounters(coreId, ticks.toArray(new Integer[ticks.size()])); } } } catch (IOException e) { } finally { try { if (reader != null) { reader.close(); } } catch (IOException e) { } reader = null; } }
Source:
<code>public static String sanitizeFileName(String fileName) { <START> return fileName.replaceAll("[^a-zA-Z0-9.-]", "_"); <END> }</code><technical_language>this desired effect UTF-8? I a lot of images end starting a pile of underscores, "_____________.jpg"</technical_language>

Target:
public static String sanitizeFileName(String fileName) { return fileName.replaceAll("[:\\\\/*\"?|<>']", "_"); }
Source:
<code>public void testParallelThreadsWithDifferentLocales() throws InterruptedException, ExecutionException { final CyclicBarrier barrier = new CyclicBarrier(2); class GetBundle implements Callable<TranslationBundle> { private Locale locale; GetBundle(Locale locale) { this.locale = locale; } public TranslationBundle call() throws Exception { NLS.setLocale(locale); barrier.await(); return GermanTranslatedBundle.get(); } } <START> ExecutorService pool = Executors.newFixedThreadPool(2); <END> Future<TranslationBundle> root = pool.submit(new GetBundle( NLS.ROOT_LOCALE)); Future<TranslationBundle> german = pool.submit(new GetBundle( Locale.GERMAN)); assertEquals(NLS.ROOT_LOCALE, root.get().effectiveLocale()); assertEquals(Locale.GERMAN, german.get().effectiveLocale()); }</code><technical_language>threads running test ends. shutdown pool wait for terminate leaving test method</technical_language>

Target:
public void testParallelThreadsWithDifferentLocales() throws InterruptedException, ExecutionException { final CyclicBarrier barrier = new CyclicBarrier(2); class GetBundle implements Callable<TranslationBundle> { private Locale locale; GetBundle(Locale locale) { this.locale = locale; } public TranslationBundle call() throws Exception { NLS.setLocale(locale); barrier.await(); return GermanTranslatedBundle.get(); } } ExecutorService pool = Executors.newFixedThreadPool(2); try { Future<TranslationBundle> root = pool.submit(new GetBundle( NLS.ROOT_LOCALE)); Future<TranslationBundle> german = pool.submit(new GetBundle( Locale.GERMAN)); assertEquals(NLS.ROOT_LOCALE, root.get().effectiveLocale()); assertEquals(Locale.GERMAN, german.get().effectiveLocale()); } finally { pool.shutdown(); pool.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS); } }
Source:
<code>public void initialize() { <START> fboManagerSubscribers = Lists.newArrayList(); <END> createStaticFBOs(); setDynamicFBOsDimensions(); createDynamicFBOs(); graphicState.refreshDynamicFBOs(); postProcessor.refreshDynamicFBOs(); createShadowMapFBO(); graphicState.setSceneShadowMap(sceneShadowMap); }</code><technical_language>a set I imagine, is need for ordering subscribers. other hand subscribers allowed subscribe more receive notification more once</technical_language>

Target:
public void initialize() { fboManagerSubscribers = Sets.newHashSet(); createStaticFBOs(); setDynamicFBOsDimensions(); createDynamicFBOs(); createShadowMapFBO(); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { setTheme(UserPreferences.getTheme()); super.onCreate(savedInstanceState); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } if (actionBar != null && getIntent() != null && getIntent().hasExtra(ARG_TITLE)) { actionBar.setTitle(getIntent().getStringExtra(ARG_TITLE)); } StorageUtils.checkStorageAvailability(this); final String feedUrl; if (getIntent().hasExtra(ARG_FEEDURL)) { feedUrl = getIntent().getStringExtra(ARG_FEEDURL); } else if (TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND) || TextUtils.equals(getIntent().getAction(), Intent.ACTION_VIEW)) { feedUrl = TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND) ? getIntent().getStringExtra(Intent.EXTRA_TEXT) : getIntent().getDataString(); if (actionBar != null) { actionBar.setTitle(R.string.add_feed_label); } } else { throw new IllegalArgumentException("Activity must be started with feedurl argument!"); } if(feedUrl == null){ Toast toast = Toast.makeText(this.getApplicationContext(), "Feed URL not found.", Toast.LENGTH_SHORT); Log.e(TAG, "feedUrl is null."); toast.show(); <START> }else { <END> Log.d(TAG, "Activity was started with url " + feedUrl); setLoadingLayout(); if (savedInstanceState == null) { startFeedDownload(feedUrl, null, null); } else { startFeedDownload(feedUrl, savedInstanceState.getString("username"), savedInstanceState.getString("password")); } } }</code><technical_language>Please add a space else</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { setTheme(UserPreferences.getTheme()); super.onCreate(savedInstanceState); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } if (actionBar != null && getIntent() != null && getIntent().hasExtra(ARG_TITLE)) { actionBar.setTitle(getIntent().getStringExtra(ARG_TITLE)); } StorageUtils.checkStorageAvailability(this); String feedUrl = null; if (getIntent().hasExtra(ARG_FEEDURL)) { feedUrl = getIntent().getStringExtra(ARG_FEEDURL); } else if (TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND) || TextUtils.equals(getIntent().getAction(), Intent.ACTION_VIEW)) { feedUrl = TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND) ? getIntent().getStringExtra(Intent.EXTRA_TEXT) : getIntent().getDataString(); if (actionBar != null) { actionBar.setTitle(R.string.add_feed_label); } } if (feedUrl == null) { Log.e(TAG, "feedUrl is null."); new AlertDialog.Builder(OnlineFeedViewActivity.this). setNeutralButton(android.R.string.ok, (dialog, which) -> dialog.dismiss()). setTitle(R.string.error_label). setMessage(R.string.null_value_podcast_error).create().show(); } else { Log.d(TAG, "Activity was started with url " + feedUrl); setLoadingLayout(); if (savedInstanceState == null) { startFeedDownload(feedUrl, null, null); } else { startFeedDownload(feedUrl, savedInstanceState.getString("username"), savedInstanceState.getString("password")); } } }
Source:
<code>public Connection(String connectionstring) throws MalformedURLException { URL theurl = new URL(connectionstring); setProtocol(theurl.getProtocol()); host = theurl.getHost(); if (theurl.getPort() < 0) throw new MalformedURLException("Invalid port encountered: '" + theurl.getPort() + "'" ); setPort(Integer.toString(theurl.getPort())); setURIPath(theurl.getPath()); <START> options = new String[0]; <END> if (theurl.getQuery() != null) options = theurl.getQuery().split("&"); constructUrl(); credentials = new Credentials(); }</code><technical_language>options initialized null,</technical_language>

Target:
public Connection(String connectionstring) throws MalformedURLException { URL theurl = new URL(connectionstring); setProtocol(theurl.getProtocol()); host = theurl.getHost(); if (theurl.getPort() < 0) throw new MalformedURLException("Invalid port encountered: '" + theurl.getPort() + "'" ); setPort(Integer.toString(theurl.getPort())); setURIPath(theurl.getPath()); options = null; if (theurl.getQuery() != null) options = theurl.getQuery().split("&"); constructUrl(); credentials = new Credentials(); }
Source:
<code>void render(LinearLayout layout, boolean isListEmpty) { View emptyView = getViewToRender(); <START> if (layout.findViewById(emptyView.getId()) == null) { <END> layout.addView(emptyView); } if (emptyView != null) { if (!isListEmpty) { emptyView.setVisibility(View.GONE); } else { emptyView.setVisibility(View.VISIBLE); } } }</code><technical_language>do need do this. Empty view</technical_language>

Target:
void render(LinearLayout layout, boolean isListEmpty) { View emptyView = getViewToRender(); if (emptyView != null) { if (!isListEmpty) { emptyView.setVisibility(View.GONE); } else { emptyView.setVisibility(View.VISIBLE); } } }
Source:
<code>private void assertCurrentStateAtMost(Queries dao, States state) { dao.getVersion(namespace, useCase).ifPresent(currentVersion -> <START> Preconditions.checkState(currentVersion <= state.getSchemaVersion())); <END> }</code><technical_language>add a bit more information (e.g. namespace, use-case, current/intended version) args</technical_language>

Target:
private void assertCurrentStateAtMost(Queries dao, States state) { dao.getVersion(namespace, useCase).ifPresent(currentVersion -> Preconditions.checkState(currentVersion <= state.getSchemaVersion(), "Could not update migration state because it would cause us to go back in state version.", SafeArg.of("currentVersion", currentVersion), SafeArg.of("migrationState", state), SafeArg.of("migrationVersion", state.getSchemaVersion()))); }
Source:
<code>private void stopVDOService(Guid vdsId) { boolean succeeded = resourceManager.runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vdsId, Arrays.asList("vdo"), "stop")).getSucceeded(); <START> if (!succeeded) { <END> log.error("Failed to stop VDO service while moving the host '{}' to maintenance", getHostName(vdsId)); } }</code><technical_language>failure stop vdo service, activate move host original status</technical_language>

Target:
private void stopVDOService(Guid vdsId) { boolean succeeded = resourceManager.runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vdsId, Arrays.asList("vdo"), "stop")).getSucceeded(); if (!succeeded) { log.error("Failed to stop VDO service while moving the host '{}' to maintenance", getHostName(vdsId)); backend.runInternalAction(ActionType.ActivateVds, new VdsActionParameters(vdsId)); throw new RuntimeException(String.format("Failed to stop VDO services while moving the host '%s' to maintenance", getHostName(vdsId))); } }
Source:
<code>public static Symbol generateCastFunction(Symbol sourceSymbol, DataType targetType, boolean tryCast) { DataType sourceType = sourceSymbol.valueType(); <START> if (ArrayType.unnest(targetType).id() == OBJECT.id()) { return new Function( functionInfo(List.of(sourceType, targetType), targetType, tryCast), List.of(sourceSymbol, Literal.NULL)); } else { return new Function( functionInfo(List.of(sourceType), targetType, tryCast), List.of(sourceSymbol)); } <END> }</code><technical_language>sense encode return type cast function generally remove notion of type cast function names? treat object casts in a special way</technical_language>

Target:
public static Symbol generateCastFunction(Symbol sourceSymbol, DataType targetType, boolean tryCast) { DataType sourceType = sourceSymbol.valueType(); return new Function( functionInfo(List.of(sourceType, targetType), targetType, tryCast), List.of(sourceSymbol, Literal.NULL)); }
Source:
<code>public void testCallRemoteKieServerOperationWhenServerTemplateHasMoreThanZeroServerInstanceKeys() { final ServerInstanceKey serverInstanceKey = mock(ServerInstanceKey.class); final Collection<ServerInstanceKey> serverInstanceKeys = Collections.singletonList(serverInstanceKey); when(serverTemplate.getServerInstanceKeys()).thenReturn(serverInstanceKeys); doReturn(client).when(instanceManager).getClient(any()); final List<Container> containers = instanceManager.callRemoteKieServerOperation(serverTemplate, containerSpec, operation); <START> assertFalse(containers.isEmpty()); <END> }</code><technical_language>I assert precise size of containers collection</technical_language>

Target:
public void testCallRemoteKieServerOperationWhenServerTemplateHasMoreThanZeroServerInstanceKeys() { final ServerInstanceKey serverInstanceKey = mock(ServerInstanceKey.class); final Collection<ServerInstanceKey> serverInstanceKeys = Collections.singletonList(serverInstanceKey); when(serverTemplate.getServerInstanceKeys()).thenReturn(serverInstanceKeys); doReturn(client).when(instanceManager).getClient(any()); final List<Container> containers = instanceManager.callRemoteKieServerOperation(serverTemplate, containerSpec, operation); assertEquals(1, containers.size()); }
Source:
<code>findUnix() { <START> return findResolvConf("/etc/resolv.conf"); <END> }</code><technical_language>pass InputStream findResolvConf (and wrap Files.newInputStream(Paths.get("...")) auto-close try)</technical_language>

Target:
findUnix() { try (InputStream in = Files.newInputStream(Paths.get("/etc/resolv.conf"))) { return findResolvConf(in); } catch (Exception e) { return false; } }
Source:
<code>public void sendTextForSubscriber(int subId, String callingPackage, String destAddr, String scAddr, String text, PendingIntent sentIntent, PendingIntent deliveryIntent, boolean persistMessageForNonDefaultSmsApp) { if (!getSmsPermissions(subId).checkCallingCanSendText(persistMessageForNonDefaultSmsApp, callingPackage, "Sending SMS message")) { sendErrorInPendingIntent(sentIntent, SmsManager.RESULT_ERROR_GENERIC_FAILURE); return; } long token = Binder.clearCallingIdentity(); try { SubscriptionInfo info = <START> getSubscriptionInfo(subId); <END> if (isBluetoothSubscription(info)) { sendBluetoothText(info, destAddr, text, sentIntent, deliveryIntent); } else { sendIccText(subId, callingPackage, destAddr, scAddr, text, sentIntent, deliveryIntent, persistMessageForNonDefaultSmsApp); } } finally { Binder.restoreCallingIdentity(token); } }</code><technical_language>I clear calling identity for this call. sendIccText() involve default SMS app, uid/package name comparison stuff</technical_language>

Target:
public void sendTextForSubscriber(int subId, String callingPackage, String destAddr, String scAddr, String text, PendingIntent sentIntent, PendingIntent deliveryIntent, boolean persistMessageForNonDefaultSmsApp) { if (!getSmsPermissions(subId).checkCallingCanSendText(persistMessageForNonDefaultSmsApp, callingPackage, "Sending SMS message")) { sendErrorInPendingIntent(sentIntent, SmsManager.RESULT_ERROR_GENERIC_FAILURE); return; } long token = Binder.clearCallingIdentity(); SubscriptionInfo info; try { info = getSubscriptionInfo(subId); } finally { Binder.restoreCallingIdentity(token); } if (isBluetoothSubscription(info)) { sendBluetoothText(info, destAddr, text, sentIntent, deliveryIntent); } else { sendIccText(subId, callingPackage, destAddr, scAddr, text, sentIntent, deliveryIntent, persistMessageForNonDefaultSmsApp); } }
Source:
<code>public String getFQN() { String domain = getDomainControler(); String username = getUserName(); <START> if (username.contains("@") || StringUtils.isEmpty(domain)) { <END> return getUserName(); } else { return getUserName() + "@" + domain; } }</code><technical_language>username is null</technical_language>

Target:
public String getFQN() { String domain = getDomainControler(); String username = getUserName(); if (StringUtils.isEmpty(username) || username.contains("@") || StringUtils.isEmpty(domain)) { return username; } else { return username + "@" + domain; } }
Source:
<code>public ExecutorManager(final Props azkProps, final ExecutorLoader loader, final AlerterHolder alerterHolder, final CommonMetrics commonMetrics, final ExecutorApiGateway apiGateway) throws ExecutorManagerException { this.alerterHolder = alerterHolder; this.azkProps = azkProps; this.commonMetrics = commonMetrics; this.executorLoader = loader; this.apiGateway = apiGateway; this.setupExecutors(); this.loadRunningFlows(); this.queuedFlows = new QueuedExecutions(azkProps.getLong(AZKABAN_WEBSERVER_QUEUE_SIZE, 100000)); <START> this.maxConcurrentRunsOneFlow = azkProps.getInt(AZKABAN_MAX_NUM_CONCURRENT_FLOW, 30); <END> this.loadQueuedFlows(); this.cacheDir = new File(azkProps.getString("cache.directory", "cache")); this.executingManager = new ExecutingManagerUpdaterThread(); this.executingManager.start(); if (isMultiExecutorMode()) { setupMultiExecutorMode(); } final long executionLogsRetentionMs = azkProps.getLong("execution.logs.retention.ms", DEFAULT_EXECUTION_LOGS_RETENTION_MS); this.cleanerThread = new CleanerThread(executionLogsRetentionMs); this.cleanerThread.start(); }</code><technical_language>30 a variable</technical_language>

Target:
public ExecutorManager(final Props azkProps, final ExecutorLoader loader, final AlerterHolder alerterHolder, final CommonMetrics commonMetrics, final ExecutorApiGateway apiGateway) throws ExecutorManagerException { this.alerterHolder = alerterHolder; this.azkProps = azkProps; this.commonMetrics = commonMetrics; this.executorLoader = loader; this.apiGateway = apiGateway; this.setupExecutors(); this.loadRunningFlows(); this.queuedFlows = new QueuedExecutions(azkProps.getLong(AZKABAN_WEBSERVER_QUEUE_SIZE, 100000)); this.maxConcurrentRunsOneFlow = azkProps.getInt(AZKABAN_MAX_CONCURRENT_RUNS_ONEFLOW, DEFAULT_MAX_ONCURRENT_RUNS_ONEFLOW); this.loadQueuedFlows(); this.cacheDir = new File(azkProps.getString("cache.directory", "cache")); this.executingManager = new ExecutingManagerUpdaterThread(); this.executingManager.start(); if (isMultiExecutorMode()) { setupMultiExecutorMode(); } final long executionLogsRetentionMs = azkProps.getLong("execution.logs.retention.ms", DEFAULT_EXECUTION_LOGS_RETENTION_MS); this.cleanerThread = new CleanerThread(executionLogsRetentionMs); this.cleanerThread.start(); }
Source:
<code>public void checkAndUpdateSettings(LiveStreamPacketizerCupertino cupertinoPacketizer, IMediaStream stream) { if (stream.getClientId() >= 0) { return; } <START> updateStreamProperties(cupertinoPacketizer, stream.getName()); <END> }</code><technical_language>change method name setSegmentDuration</technical_language>

Target:
public void checkAndUpdateSettings(LiveStreamPacketizerCupertino cupertinoPacketizer, IMediaStream stream) { if (stream.getClientId() >= 0) { return; } setSegmentDuration(cupertinoPacketizer, stream.getName()); }
Source:
<code>public void registerClusterMapListener(ClusterMapChangeListener clusterMapChangeListener) { <START> if (helixClusterManager != null) { <END> helixClusterManager.registerClusterMapListener(clusterMapChangeListener); } }</code><technical_language>null? assume in other places</technical_language>

Target:
public void registerClusterMapListener(ClusterMapChangeListener clusterMapChangeListener) { helixClusterManager.registerClusterMapListener(clusterMapChangeListener); }
Source:
<code>protected void setSelection(@NonNull Set<@NonNull Integer> selection) { super.setSelection(selection); <START> Iterator<Color> lightColorsIt; <END> Iterator<Color> colorsIt; colorsIt = Iterators.cycle(COLORS); lightColorsIt = Iterators.cycle(LIGHT_COLORS); Set<Integer> currentSelections = getInternalSelections(); for (ISeries series : getChart().getSeriesSet().getSeries()) { Color lightColor = lightColorsIt.next(); Color color = colorsIt.next(); Color[] colors = ((ILineSeries) series).getSymbolColors(); if (currentSelections.isEmpty()) { Arrays.fill(colors, color); } else { Arrays.fill(colors, lightColor); } ((ILineSeries) series).setSymbolColors(colors); } }</code><technical_language>declaration assignation in line. This is c-ish</technical_language>

Target:
protected void setSelection(@NonNull Set<@NonNull Integer> selection) { super.setSelection(selection); Iterator<Color> colorsIt = Iterators.cycle(COLORS); Iterator<Color> lightColorsIt = Iterators.cycle(LIGHT_COLORS); Set<Integer> currentSelections = getInternalSelections(); for (ISeries series : getChart().getSeriesSet().getSeries()) { Color lightColor = lightColorsIt.next(); Color color = colorsIt.next(); Color[] colors = ((ILineSeries) series).getSymbolColors(); if (currentSelections.isEmpty()) { Arrays.fill(colors, color); } else { Arrays.fill(colors, lightColor); } ((ILineSeries) series).setSymbolColors(colors); } }
Source:
<code>public SpawnResult exec(Spawn spawn, SpawnExecutionContext context) throws ExecException, IOException, InterruptedException { <START> this.supportsMultiplexWorkers = Spawns.supportsMultiplexWorkers(spawn); <END> if (!Spawns.supportsWorkers(spawn) && !Spawns.supportsMultiplexWorkers(spawn)) { reporter.handle( Event.warn( String.format(ERROR_MESSAGE_PREFIX + REASON_NO_EXECUTION_INFO, spawn.getMnemonic()))); return fallbackRunner.exec(spawn, context); } context.report(ProgressStatus.SCHEDULING, getName()); return actuallyExec(spawn, context); }</code><technical_language>Yes, I this work (reliably), WorkerSpawnRunner instance is shared for worker strategy executions (multiplex non-multiplex). I this name of running worker actions change "multiplex-worker" "worker", depending executed action a multiplexed not. I immediately of a good solution for this, instantiating WorkerSpawnRunners (one for multiplexed workers, for non-multiplexed workers). code more complex. @susinmotion @jmmv a good idea</technical_language>

Target:
public SpawnResult exec(Spawn spawn, SpawnExecutionContext context) throws ExecException, IOException, InterruptedException { if (!Spawns.supportsWorkers(spawn) && !Spawns.supportsMultiplexWorkers(spawn)) { reporter.handle( Event.warn( String.format(ERROR_MESSAGE_PREFIX + REASON_NO_EXECUTION_INFO, spawn.getMnemonic()))); return fallbackRunner.exec(spawn, context); } context.report(ProgressStatus.SCHEDULING, WorkerKey.makeWorkerTypeName(Spawns.supportsMultiplexWorkers(spawn))); return actuallyExec(spawn, context); }
Source:
<code>private static void onUpgrade(final int oldVersionCode, final int newVersionCode) { <START> if(oldVersionCode < 1030000) { <END> new Thread() { public void run() { List<Feed> feeds = DBReader.getFeedList(context); for (Feed podcast : feeds) { List<FeedItem> episodes = DBReader.getFeedItemList(context, podcast); for (FeedItem episode : episodes) { FeedImage image = episode.getImage(); if (image != null && image.isDownloaded() && image.getFile_url() != null) { File imageFile = new File(image.getFile_url()); if (imageFile.exists()) { imageFile.delete(); } image.setFile_url(null); DBWriter.setFeedImage(context, image); } } } } }.start(); } }</code><technical_language>I version code check needs higher. people alpha this cleanup done</technical_language>

Target:
private static void onUpgrade(final int oldVersionCode, final int newVersionCode) { if(oldVersionCode < 1030099) { new Thread() { public void run() { List<Feed> feeds = DBReader.getFeedList(context); for (Feed podcast : feeds) { List<FeedItem> episodes = DBReader.getFeedItemList(context, podcast); for (FeedItem episode : episodes) { FeedImage image = episode.getImage(); if (image != null && image.isDownloaded() && image.getFile_url() != null) { File imageFile = new File(image.getFile_url()); if (imageFile.exists()) { imageFile.delete(); } image.setFile_url(null); DBWriter.setFeedImage(context, image); } } } } }.start(); } }
Source:
<code>public MuteStatusChangeEvent(IUser affected, IUser controller, boolean value, Long timestamp, String reason) { super(affected, controller, value); this.timestamp = timestamp; if (reason == null) { this.reason = null; } else { <START> this.reason = reason.isEmpty() ? null : reason; <END> } }</code><technical_language>reason 'empty'? if a stupid plugin empty witchhunting them, adding this weird oneoff check here</technical_language>

Target:
public MuteStatusChangeEvent(IUser affected, IUser controller, boolean value, Long timestamp, String reason) { super(affected, controller, value); this.timestamp = timestamp; this.reason = reason == null ? null : (reason.isEmpty() ? null : reason); }
Source:
<code>public JSONStringer toJSONStringerV2(JSONStringer js) { try { VoltTableRow row = cloneRow(); row.resetRowPosition(); js.array(); while (row.advanceRow()) { js.object(); for (int i = 0; i < getColumnCount(); i++) { js.key(getColumnName(i)); row.putJSONRep(i, js); } js.endObject(); } js.endArray(); } <START> catch (JSONException e) { <END> e.printStackTrace(); throw new RuntimeException("Failed to serialized a table to JSON V2.", e); } return js; }</code><technical_language>I throw this exception this method caller handle is catch for this</technical_language>

Target:
public JSONStringer toJSONStringerV2(JSONStringer js) throws JSONException{ VoltTableRow row = cloneRow(); row.resetRowPosition(); js.array(); while (row.advanceRow()) { js.object(); for (int i = 0; i < getColumnCount(); i++) { js.key(getColumnName(i)); row.putJSONRep(i, js); } js.endObject(); } js.endArray(); return js; }
Source:
<code><START> public FileMode getIndexFileMode(final DirCacheIterator indexIter) { <END> final FileMode wtMode = getEntryFileMode(); if (indexIter == null) { return wtMode; } final FileMode iMode = indexIter.getEntryFileMode(); if (getOptions().isFileMode() && iMode != FileMode.GITLINK && iMode != FileMode.TREE) { return wtMode; } if (FileMode.REGULAR_FILE == wtMode && FileMode.EXECUTABLE_FILE == iMode) { return iMode; } if (FileMode.EXECUTABLE_FILE == wtMode && FileMode.REGULAR_FILE == iMode) { return iMode; } if (FileMode.GITLINK == iMode && FileMode.TREE == wtMode) { return iMode; } if (FileMode.TREE == iMode && FileMode.GITLINK == wtMode) { return iMode; } return wtMode; }</code><technical_language>Hmm, playing native git I understand this change better. in native git tricky switch gitlink tree vice versa. this coding implements semantics native git. I lacking a test for line 935-937</technical_language>

Target:
public FileMode getIndexFileMode(final DirCacheIterator indexIter) { final FileMode wtMode = getEntryFileMode(); if (indexIter == null) { return wtMode; } final FileMode iMode = indexIter.getEntryFileMode(); if (getOptions().isFileMode() && iMode != FileMode.GITLINK && iMode != FileMode.TREE) { return wtMode; } if (!getOptions().isFileMode()) { if (FileMode.REGULAR_FILE == wtMode && FileMode.EXECUTABLE_FILE == iMode) { return iMode; } if (FileMode.EXECUTABLE_FILE == wtMode && FileMode.REGULAR_FILE == iMode) { return iMode; } } if (FileMode.GITLINK == iMode && FileMode.TREE == wtMode) { return iMode; } if (FileMode.TREE == iMode && FileMode.GITLINK == wtMode) { return iMode; } return wtMode; }
Source:
<code>public static Optional<Collection> getCollectionByVreId(Element element, Vres mappings, String vreId) { <START> return Arrays.asList(getEntityTypesOrDefault(element)) <END> .stream() .map(type -> mappings.getCollectionForType(type).get()) .filter(collection -> collection.getVreName().equals(vreId)) .findFirst(); }</code><technical_language>While it, Arrays.stream() (though this is valuable entitytypes is 2 items long</technical_language>

Target:
public static Optional<Collection> getCollectionByVreId(Element element, Vres mappings, String vreId) { return Arrays.stream(getEntityTypesOrDefault(element)) .map(type -> mappings.getCollectionForType(type).get()) .filter(collection -> collection.getVreName().equals(vreId)) .findFirst(); }
Source:
<code><START> public static void setDefaults(Properties conf) { <END> { Properties defaults = new Properties(); try { defaults.load(Utils.class.getResourceAsStream("defaults.properties")); for (Map.Entry<Object, Object> entry : defaults.entrySet()) { putIfAbsent(conf, (String) entry.getKey(), (String) entry.getValue()); } } catch (IOException e) { throw new RuntimeException(e); } } }</code><technical_language>if this utils... I passed calling class parameter get this defaults... multiple... pass InputStream..</technical_language>

Target:
public static void setDefaults(Properties conf) { { Properties defaults = new Properties(); try (Reader reader = new InputStreamReader(Utils.class.getResourceAsStream("defaults.properties"), Charset.forName("UTF-8"))) { defaults.load(reader); for (Map.Entry<Object, Object> entry : defaults.entrySet()) { putIfAbsent(conf, (String) entry.getKey(), (String) entry.getValue()); } } catch (IOException e) { throw new RuntimeException(e); } } }
Source:
<code>public MCCIIN000002UV01 processPatientDiscoveryAsyncReq(RespondingGatewayPRPAIN201305UV02SecuredRequestType request) { AssertionType assertion = getAssertion(context, null); return outboundPatientDiscoveryRequest.processPatientDiscoveryAsyncReq(request.getPRPAIN201305UV02(), assertion, request.getNhinTargetCommunities(), getWebContextProperties(context)); <START> } <END></code><technical_language>explain Entity Outbound requires WebContextProperties for PatientDiscoveryDeferredRequest service</technical_language>

Target:
public MCCIIN000002UV01 processPatientDiscoveryAsyncReq(RespondingGatewayPRPAIN201305UV02SecuredRequestType request) { AssertionType assertion = getAssertion(context, null); return outboundPatientDiscoveryRequest.processPatientDiscoveryAsyncReq(request.getPRPAIN201305UV02(), assertion, request.getNhinTargetCommunities()); }
Source:
<code>public <START> static ArrayList<Pseudostate> getInitialPsudoStates(Region <END> region) { ArrayList<Pseudostate> pseudoStates = new ArrayList<>(); for (Vertex vertex : region.getSubvertices()) { if (isInitialPseudoState(vertex)) { pseudoStates.add((Pseudostate) vertex); } } return pseudoStates; }</code><technical_language>returning ArrayList<> generic List<></technical_language>

Target:
public static List<Pseudostate> getInitialPsudoStates(Region region) { List<Pseudostate> pseudoStates = new ArrayList<>(); for (Vertex vertex : region.getSubvertices()) { if (isInitialPseudoState(vertex)) { pseudoStates.add((Pseudostate) vertex); } } return pseudoStates; }
Source:
<code>private void synchCTFState(MArea areaModel) { <START> List<MPartStack> stacks = findDirectStacks(areaModel); <END> int count = 0; for (MPartStack stack : stacks) { if (stack.isToBeRendered()) count++; } if (count > 1) ensureCTF(areaModel); else ensureComposite(areaModel); }</code><technical_language>more calls findElements in AreaRender, in methods called sychCTFState. updated? stacks passed parameter methods</technical_language>

Target:
private void synchCTFState(MArea areaModel) { List<MPartStack> stacks = findDirectStacks(areaModel); int count = 0; for (MPartStack stack : stacks) { if (stack.isToBeRendered()) count++; } if (count > 1) ensureCTF(areaModel, stacks); else ensureComposite(areaModel, stacks); }
Source:
<code>private StreamBlock pollPersistentDeque(boolean actuallyPoll) { BBContainer cont = null; BBContainer schemaCont = null; try { <START> if (m_reader.isReadFirstObjectOfSegment()) { <END> schemaCont = m_reader.getSchema(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY, false); } cont = m_reader.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY, false); } catch (IOException e) { exportLog.error(e); } if (cont == null) { return null; } else { cont.b().order(ByteOrder.LITTLE_ENDIAN); final BBContainer fcont = cont; long seqNo = cont.b().getLong(StreamBlock.SEQUENCE_NUMBER_OFFSET); int tupleCount = cont.b().getInt(StreamBlock.ROW_NUMBER_OFFSET); long uniqueId = cont.b().getLong(StreamBlock.UNIQUE_ID_OFFSET); StreamBlock block = new StreamBlock( fcont, schemaCont, seqNo, tupleCount, uniqueId, true); if (!actuallyPoll) { m_memoryDeque.offer(block); } return block; } }</code><technical_language>totally separating schema in a specific buffer export rows</technical_language>

Target:
private StreamBlock pollPersistentDeque(boolean actuallyPoll) { BBContainer cont = null; BBContainer schemaCont = null; try { if (m_reader.isStartOfSegment()) { schemaCont = m_reader.getSchema(-1, false, false); } cont = m_reader.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY, false); } catch (IOException e) { exportLog.error("Failed to poll from persistent binary deque:" + e); } if (cont == null) { return null; } else { long segmentIndex = m_reader.getSegmentIndex(); cont.b().order(ByteOrder.LITTLE_ENDIAN); final BBContainer fcont = cont; long seqNo = cont.b().getLong(StreamBlock.SEQUENCE_NUMBER_OFFSET); int tupleCount = cont.b().getInt(StreamBlock.ROW_NUMBER_OFFSET); long uniqueId = cont.b().getLong(StreamBlock.UNIQUE_ID_OFFSET); StreamBlock block = new StreamBlock( fcont, schemaCont, seqNo, tupleCount, uniqueId, segmentIndex, true); if (!actuallyPoll) { m_memoryDeque.offer(block); } return block; } }
Source:
<code>private void encodeRemainingNullsAsBits() { byte value = 0; <START> int mask = 0b1000_0000; <END> for (int i = 0; i < remainingNullsCount; i++) { value |= remainingNullsFromLastBatch[i] ? mask : 0; mask >>>= 1; } nullsBufferContainsNull |= (value != 0); ByteArrayUtils.writeByte(nullsBuffer, nullsBufferIndex, value); nullsBufferIndex++; }</code><technical_language>This logic is similar encodeNullsAsBits, hence, for consistency: - remove mask variable - fold nullsBufferIndex++ ByteArrayUtils.writeByte private void encodeRemainingNullsAsBits() { byte = 0; for (int i = 0; i < remainingNullsCount; i++) { |= remainingNullsFromLastBatch[i] ? 0b1000_0000 >>> i : 0; } nullsBufferContainsNull |= (value != 0); ByteArrayUtils.writeByte(nullsBuffer, nullsBufferIndex++, value); }</technical_language>

Target:
private int encodeRemainingNullsAsBits() { if (remainingNullsCount == 0) { return 0; } byte value = 0; for (int i = 0; i < remainingNullsCount; i++) { value |= remainingNullsFromLastBatch[i] ? 0b1000_0000 >>> i : 0; } nullsBufferContainsNull |= (value != 0); nullsBufferIndex = setByte(nullsBuffer, nullsBufferIndex, value); int padding = BITS_IN_BYTE - remainingNullsCount; remainingNullsCount = 0; return padding; }
Source:
<code><START> private double nullSafeArrayLength(long[] array) { <END> return null == array ? 0 : array.length; }</code><technical_language>This static technically</technical_language>

Target:
private static double nullSafeArrayLength(long[] array) { return null == array ? 0 : array.length; }
Source:
<code>public static PowerManagement map(VDS entity, PowerManagement template) { PowerManagement model = template != null ? template : new PowerManagement(); model.setType(entity.getpm_type()); model.setEnabled(entity.getpm_enabled()); model.setAddress(entity.getManagmentIp()); model.setUsername(entity.getpm_user()); if (entity.getPmOptionsMap() != null) { model.setOptions(map(entity.getPmOptionsMap(), null)); } if (entity.getPmProxyPreferences() != null) { PmProxies pmProxies = (model.getPmProxies() != null) ? model.getPmProxies() : new PmProxies(); <START> pmProxies.getPmProxy().clear(); <END> String[] proxies = StringUtils.split(entity.getPmProxyPreferences(), ","); for (String proxy : proxies) { PmProxy pmProxy = new PmProxy(); pmProxy.setPropietary(proxy); pmProxies.getPmProxy().add(pmProxy); } model.setPmProxies(pmProxies); } return model; }</code><technical_language>point for template of PmProxies if clearing (the List)</technical_language>

Target:
public static PowerManagement map(VDS entity, PowerManagement template) { PowerManagement model = template != null ? template : new PowerManagement(); model.setType(entity.getpm_type()); model.setEnabled(entity.getpm_enabled()); model.setAddress(entity.getManagmentIp()); model.setUsername(entity.getpm_user()); if (entity.getPmOptionsMap() != null) { model.setOptions(map(entity.getPmOptionsMap(), null)); } if (entity.getPmProxyPreferences() != null) { PmProxies pmProxies = new PmProxies(); String[] proxies = StringUtils.split(entity.getPmProxyPreferences(), ","); for (String proxy : proxies) { PmProxy pmProxy = new PmProxy(); pmProxy.setPropietary(proxy); pmProxies.getPmProxy().add(pmProxy); } model.setPmProxies(pmProxies); } return model; }
Source:
<code>public void synchronize(NewProjectHandler newProjectHandler, CancellationTokenSource tokenSource, IProgressMonitor monitor) throws CoreException { SynchronizeGradleBuildsOperation syncOperation = SynchronizeGradleBuildsOperation.forSingleGradleBuild(this, newProjectHandler); try { syncOperation.run(tokenSource, monitor); GradleMarkerManager.clear(this); } catch (Exception e) { GradleMarkerManager.clear(this); ToolingApiStatus status = ToolingApiStatus.from("Project synchronization" , e); if (status.severityMatches(IStatus.WARNING | IStatus.ERROR)) { GradleMarkerManager.addError(this, status); } <START> throw e; <END> } }</code><technical_language>I synchronization throw exception if problem handled adding error marker. some conditions continue (like import root project), in cases error is in synchronization process itself, in users's build</technical_language>

Target:
public void synchronize(NewProjectHandler newProjectHandler, CancellationTokenSource tokenSource, IProgressMonitor monitor) throws CoreException { SynchronizeGradleBuildsOperation syncOperation = SynchronizeGradleBuildsOperation.forSingleGradleBuild(this, newProjectHandler); try { GradleMarkerManager.clear(this); syncOperation.run(tokenSource, monitor); } catch (Exception e) { ToolingApiStatus status = ToolingApiStatus.from("Project synchronization" , e); if (status.severityMatches(IStatus.WARNING | IStatus.ERROR)) { GradleMarkerManager.addError(this, status); } throw e; } }
Source:
<code><START> default void interactBlockWith(Vector3i position, ItemStack itemStack, Direction side) { <END> interactBlockWith(checkNotNull(position, "position").getX(), position.getY(), position.getZ(), checkNotNull(itemStack, "itemStack"), checkNotNull(side, "side")); }</code><technical_language>Likewise</technical_language>

Target:
default boolean interactBlockWith(Vector3i position, ItemStack itemStack, Direction side) { return interactBlockWith(checkNotNull(position, "position").getX(), position.getY(), position.getZ(), checkNotNull(itemStack, "itemStack"), checkNotNull(side, "side")); }