auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void onShowErrata() { <START> logger.info(this.getClass().toString() + " onShowErrata"); END> if (getWindow() != null) { return; } HostErrataCountModel transferObj = new HostErrataCountModel(); transferObj.setTitle(messages.errataForHost(getName())); transferObj.setGuid(getGuid()); transferObj.setName(getName()); setWindow(transferObj); initCommands(transferObj); }</code><technical_language>This logger.debug trace</technical_language>

Target:
protected void onShowErrata() { if (getWindow() != null) { return; } HostErrataCountModel transferObj = new HostErrataCountModel(); transferObj.setTitle(messages.errataForHost(getName())); transferObj.setGuid(getGuid()); transferObj.setName(getName()); setWindow(transferObj); initCommands(transferObj); }
Source:
<code><START> public T withFactor(final IProperty<Double> spacingOption, final double factor) { <END> if (!factorMap.keySet().contains(spacingOption)) { throw new IllegalArgumentException( "'" + spacingOption.getId() + "' is not a configurable spacing option."); } if (spacingOption.getId().equals(getBaseSpacingOption().getId())) { throw new IllegalArgumentException("'" + spacingOption.getId() + "' is the base spacing option not allowed to use with 'withFactor'."); } factorMap.put(spacingOption, factor); return thisT(); }</code><technical_language>throw exceptions for negative factors (and values, for matter)</technical_language>

Target:
public T withFactor(final IProperty<Double> spacingOption, final double factor) { if (!factorMap.keySet().contains(spacingOption)) { throw new IllegalArgumentException( "'" + spacingOption.getId() + "' is not a configurable spacing option."); } if (factor < 0.0) { throw new IllegalArgumentException( "The factor for '" + spacingOption.getId() + "' must not be negative (" + factor + ")."); } if (spacingOption.getId().equals(getBaseSpacingOption().getId())) { throw new IllegalArgumentException("'" + spacingOption.getId() + "' is the base spacing option not allowed to use with 'withFactor'."); } factorMap.put(spacingOption, factor); return thisT(); }
Source:
<code>public void testQueriesFromQueryFile() throws Exception { URL resourceUrl = BaseClusterIntegrationTestSet.class.getClassLoader().getResource(getQueryFileName()); assertNotNull(resourceUrl); File queryFile = new File(resourceUrl.getFile()); try (BufferedReader reader = new BufferedReader(new FileReader(queryFile))) { while (true) { String queryString = reader.readLine(); if (queryString == null) { <START> return; <END> } if (queryString.startsWith("#") || queryString.isEmpty()) { continue; } JsonNode query = JsonUtils.stringToJsonNode(queryString); String pqlQuery = query.get("pql").asText(); JsonNode hsqls = query.get("hsqls"); List<String> sqlQueries = new ArrayList<>(); int length = hsqls.size(); for (int i = 0; i < length; i++) { sqlQueries.add(hsqls.get(i).asText()); } testQuery(pqlQuery, sqlQueries); } } }</code><technical_language>queryString.trim() include leading whitespaces # empty lines whitespaces</technical_language>

Target:
public void testQueriesFromQueryFile() throws Exception { URL resourceUrl = BaseClusterIntegrationTestSet.class.getClassLoader().getResource(getQueryFileName()); assertNotNull(resourceUrl); File queryFile = new File(resourceUrl.getFile()); try (BufferedReader reader = new BufferedReader(new FileReader(queryFile))) { String queryString; while ((queryString = reader.readLine()) != null) { queryString = queryString.trim(); if (queryString.startsWith("#") || queryString.isEmpty()) { continue; } JsonNode query = JsonUtils.stringToJsonNode(queryString); String pqlQuery = query.get("pql").asText(); JsonNode hsqls = query.get("hsqls"); List<String> sqlQueries = new ArrayList<>(); int length = hsqls.size(); for (int i = 0; i < length; i++) { sqlQueries.add(hsqls.get(i).asText()); } testQuery(pqlQuery, sqlQueries); } } }
Source:
<code>SimpleAjaxLink createFixCRSLink(String id, final IModel<ImportTask> itemModel) { return new SimpleAjaxLink(id, new Model("Fix...")) { @Override protected void onClick(AjaxRequestTarget target) { dialog.showOkCancel(target, new DialogDelegate() { @Override protected boolean onSubmit(AjaxRequestTarget target, Component contents) { try { ImporterWebUtils.importer().changed(itemModel.getObject()); } catch (IOException e) { <START> throw new RuntimeException(e); <END> } target.add(ImportTaskTable.this); return true; } @Override protected Component getContents(String id) { return new NoCRSPanel(id, itemModel); } }); } }; }</code><technical_language>Is a failure remove locking file worth throwing a stacktrace in UI? log a warning throw exception</technical_language>

Target:
SimpleAjaxLink createFixCRSLink(String id, final IModel<ImportTask> itemModel) { return new SimpleAjaxLink(id, new Model("Fix...")) { @Override protected void onClick(AjaxRequestTarget target) { dialog.showOkCancel(target, new DialogDelegate() { @Override protected boolean onSubmit(AjaxRequestTarget target, Component contents) { try { ImporterWebUtils.importer().changed(itemModel.getObject()); } catch (IOException e) { error(e); return false; } target.add(ImportTaskTable.this); return true; } @Override protected Component getContents(String id) { return new NoCRSPanel(id, itemModel); } }); } }; }
Source:
<code>public HttpEntity<?> convertOutbound(Message message, HttpEndpointConfiguration endpointConfiguration, TestContext context) { HttpMessage httpMessage = convertOutboundMessage(message); HttpHeaders httpHeaders = createHttpHeaders(httpMessage, endpointConfiguration); Object payload = httpMessage.getPayload(); if (httpMessage.getStatusCode() != null) { return new ResponseEntity<>(payload, httpHeaders, httpMessage.getStatusCode()); } else { for (Cookie cookie : httpMessage.getCookies()) { httpHeaders.add( <START> "Cookie", <END> cookie.getName() + "=" + context.replaceDynamicContentInString(cookie.getValue())); } } HttpMethod method = determineHttpMethod(endpointConfiguration, httpMessage); return createHttpEntity(httpHeaders, payload, method); }</code><technical_language>HttpHeaders.COOKIE constant instead of a String</technical_language>

Target:
public HttpEntity<?> convertOutbound(Message message, HttpEndpointConfiguration endpointConfiguration, TestContext context) { HttpMessage httpMessage = convertOutboundMessage(message); HttpHeaders httpHeaders = createHttpHeaders(httpMessage, endpointConfiguration); Object payload = httpMessage.getPayload(); if (httpMessage.getStatusCode() != null) { return new ResponseEntity<>(payload, httpHeaders, httpMessage.getStatusCode()); } else { for (Cookie cookie : httpMessage.getCookies()) { httpHeaders.add( HttpHeaders.COOKIE, cookie.getName() + "=" + context.replaceDynamicContentInString(cookie.getValue())); } } HttpMethod method = determineHttpMethod(endpointConfiguration, httpMessage); return createHttpEntity(httpHeaders, payload, method); }
Source:
<code>public void updateStatusLabel(String statusMessage) { if (status != ReportStatus.CANCELED) { <START> logger.log(Level.INFO, "Report Progress Logger status update: {0}", statusMessage); <END> } }</code><technical_language>I "Report Progress Logger status update:" add logs, call site of message. Logging message report module sufficient</technical_language>

Target:
public void updateStatusLabel(String statusMessage) { if (status != ReportStatus.CANCELED) { logger.log(Level.INFO, statusMessage); } }
Source:
<code>public void onReceive(Context context, Intent intent) { Log.d(TAG, "Received intent"); if (intent == null || intent.getExtras() == null) { return; } KeyEvent event = (KeyEvent) intent.getExtras().get(Intent.EXTRA_KEY_EVENT); if (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount()==0) { ClientConfig.initialize(context); Intent serviceIntent = new Intent(context, PlaybackService.class); serviceIntent.putExtra(EXTRA_KEYCODE, event.getKeyCode()); serviceIntent.putExtra(EXTRA_SOURCE, event.getSource()); <START> context.startService(serviceIntent); END> } }</code><technical_language>This leads IllegalStateExceptions. I switched startforegroundservice > startService() method throws IllegalStateException if app targeting Android 8.0 method in a situation permitted create background services. > <LINK_0></technical_language>

Target:
public void onReceive(Context context, Intent intent) { Log.d(TAG, "Received intent"); if (intent == null || intent.getExtras() == null) { return; } KeyEvent event = (KeyEvent) intent.getExtras().get(Intent.EXTRA_KEY_EVENT); if (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount()==0) { ClientConfig.initialize(context); Intent serviceIntent = new Intent(context, PlaybackService.class); serviceIntent.putExtra(EXTRA_KEYCODE, event.getKeyCode()); serviceIntent.putExtra(EXTRA_SOURCE, event.getSource()); ContextCompat.startForegroundService(context, serviceIntent); } }
Source:
<code>public String toString() { return "Offset: " + offset + ", Size: " + getSize() + ", Deleted: " + isFlagSet(Flags.Delete_Index) + ", TTL Updated: " + isFlagSet(Flags.Ttl_Update_Index) + ", Undelete: " + isFlagSet(Flags.Undelete_Index) <START> + ", ExpiresAtMs: " + getExpiresAtMs() + ", Original Message Offset: " + getOriginalMessageOffset() + ( <END> formatVersion != PersistentIndex.VERSION_0 ? (", OperationTimeAtSecs " + getOperationTimeInMs() + ", AccountId " + getAccountId() + ", ContainerId " + getContainerId()) : "") + (formatVersion > PersistentIndex.VERSION_2 ? ", Life Version:" + lifeVersion : ""); }</code><technical_language>Replace isFlagSet(Flags.Undelete_Index) isUndelete(). for DELETE TTLUpdate</technical_language>

Target:
public String toString() { return "Offset: " + offset + ", Size: " + getSize() + ", Deleted: " + isDelete() + ", TTL Updated: " + isTTLUpdate() + ", Undelete: " + isUndelete() + ", ExpiresAtMs: " + getExpiresAtMs() + ", Original Message Offset: " + getOriginalMessageOffset() + (formatVersion != PersistentIndex.VERSION_0 ? (", OperationTimeAtSecs " + getOperationTimeInMs() + ", AccountId " + getAccountId() + ", ContainerId " + getContainerId()) : "") + ( formatVersion > PersistentIndex.VERSION_2 ? ", Life Version:" + lifeVersion : ""); }
Source:
<code>public AwsS3EnvironmentRepository build( AwsS3EnvironmentProperties environmentProperties) { <START> final AmazonS3ClientBuilder clientBuilder = AmazonS3ClientBuilder.standard(); <END> if (environmentProperties.getRegion() != null) { clientBuilder.withRegion(environmentProperties.getRegion()); } AwsS3EnvironmentRepository repository = new AwsS3EnvironmentRepository( clientBuilder.build(), environmentProperties.getBucket(), server); return repository; }</code><technical_language>I add ability override baseUrl of s3 client. This allow support for beta regions of S3, other s3 compatible storage APIs (GCS, Azure CS) <LINK_0></technical_language>

Target:
public AwsS3EnvironmentRepository build( AwsS3EnvironmentProperties environmentProperties) { final AmazonS3ClientBuilder clientBuilder = AmazonS3ClientBuilder.standard(); if (environmentProperties.getRegion() != null) { clientBuilder.withRegion(environmentProperties.getRegion()); } final AmazonS3 client = clientBuilder.build(); if (environmentProperties.getEndpoint() != null) { client.setEndpoint(environmentProperties.getEndpoint()); } AwsS3EnvironmentRepository repository = new AwsS3EnvironmentRepository(client, environmentProperties.getBucket(), server); return repository; }
Source:
<code>public List<PartitionDescProto> getPartitionsByAlgebra(PartitionsByAlgebraProto request) throws UndefinedDatabaseException, UndefinedTableException, UndefinedPartitionMethodException, PartitionNotFoundException, UnsupportedException { List<PartitionDescProto> list = null; try { String databaseName = request.getDatabaseName(); String tableName = request.getTableName(); TableDescProto tableDesc = getTable(databaseName, tableName); String filter = getFilter(databaseName, tableName, tableDesc.getPartition().getExpressionSchema().getFieldsList() , request.getAlgebra()); list = getPartitionsByFilterFromHiveMetaStore(databaseName, tableName, filter); <START> } catch (UnsupportedException ue) { <END> throw ue; } catch (Exception se) { throw new TajoInternalError(se); } return list; }</code><technical_language>throw this exception</technical_language>

Target:
public List<PartitionDescProto> getPartitionsByAlgebra(PartitionsByAlgebraProto request) throws UndefinedDatabaseException, UndefinedTableException, UndefinedPartitionMethodException, UnsupportedException { List<PartitionDescProto> list = null; try { String databaseName = request.getDatabaseName(); String tableName = request.getTableName(); if (!existDatabase(databaseName)) { throw new UndefinedDatabaseException(tableName); } if (!existTable(databaseName, tableName)) { throw new UndefinedTableException(tableName); } if (!existPartitionMethod(databaseName, tableName)) { throw new UndefinedPartitionMethodException(tableName); } TableDescProto tableDesc = getTable(databaseName, tableName); String filter = getFilter(databaseName, tableName, tableDesc.getPartition().getExpressionSchema().getFieldsList() , request.getAlgebra()); list = getPartitionsFromHiveMetaStore(databaseName, tableName, filter); } catch (UnsupportedException ue) { throw ue; } catch (Exception se) { throw new TajoInternalError(se); } return list; }
Source:
<code>public <T> BeanBuilder<T> addBean() { Class<? extends Extension> extensionClass = getReceiver().getClass(); <START> BeanManagerImpl beanManager = getOrCreateBeanDeployment(extensionClass).getBeanManager(); <END> BeanBuilderImpl<T> builder = new BeanBuilderImpl<T>(beanManager, extensionClass); additionalBeans.add(new BeanRegistration(builder, beanManager)); return builder; }</code><technical_language>fine extension class default bean class. defer determining beanManager if a bean class is provided explicitly, BM for this explicit class. Current eager approach impossible</technical_language>

Target:
public <T> BeanBuilder<T> addBean() { BeanBuilderImpl<T> builder = new BeanBuilderImpl<T>(getReceiver().getClass(), getBeanDeployments(), getDeployment(), getContexts(), getBeanManager()); additionalBeans.add(new BeanRegistration(builder)); return builder; }
Source:
<code>public void setUp() { <START> Mockito.doCallRealMethod().when(inventoryCommonValidator) <END> .validateTransactionNotes(Mockito.anyString(), Mockito.any( BindingResult.class)); }</code><technical_language>do call real method</technical_language>

Target:
public void setUp() { }
Source:
<code>public String toRevision(final Project.NameKey project, final PatchSet ps) { ParamertizedString pattern = new ParamertizedString(type.getRevision()); final Map<String, String> p = new HashMap<String, String>(); String proj_qs = URL.encodeQueryString(project.get()); p.put("project", proj_qs); <START> p.put("project_path", proj_qs.replace("%2F", "/")); <END> p.put("commit", URL.encodeQueryString(ps.getRevision().get())); return baseUrl + pattern.replace(p); }</code><technical_language>values necessary here? gitweb OK "/" instead of %2F in project name in non-path link format. means need this extra variable replace %2F / setting "project" "branch" values</technical_language>

Target:
public String toRevision(final Project.NameKey project, final PatchSet ps) { ParamertizedString pattern = new ParamertizedString(type.getRevision()); final Map<String, String> p = new HashMap<String, String>(); p.put("project", URL.encodeQueryString(project.get()).replace("%2F", "/")); p.put("commit", URL.encodeQueryString(ps.getRevision().get())); return baseUrl + pattern.replace(p); }
Source:
<code>protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (StringUtils.isEmpty(request.getParameter(SSOUtils.POST_ACTION_URL))) { throw new RuntimeException("No post action url found in request."); } boolean enableBasicAuth = false; <START> String strVal = request.getSession().getServletContext().getInitParameter("enable-basic-auth"); <END> if (StringUtils.isNotEmpty(strVal)) { enableBasicAuth = Boolean.parseBoolean(strVal); } if (enableBasicAuth) { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_EXTERNAL_URI + request.getQueryString()); } else { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_PHASE2_URI + request.getQueryString()); } }</code><technical_language>basic application context, place read, parse store</technical_language>

Target:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (StringUtils.isEmpty(request.getParameter(SSOUtils.POST_ACTION_URL))) { throw new RuntimeException("No post action url found in request."); } boolean enableBasicAuth = (boolean) request.getSession().getServletContext().getAttribute(SSOUtils.ENABLE_BASIC_AUTH); request.getSession(true).setAttribute(SSOUtils.PARAMS_MAP, new HashMap<>(request.getParameterMap())); if (enableBasicAuth) { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_EXTERNAL_URI); } else { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_PHASE2_URI); } }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); move = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.logo_anim); logo = findViewById(R.id.logo); AnimationSet set = new AnimationSet(true); fadeIn = new AlphaAnimation(0,1); fadeIn.setInterpolator(new AccelerateInterpolator()); fadeIn.setDuration(1000); set.addAnimation(fadeIn); set.addAnimation(move); logo.startAnimation(set); new Thread(){ @Override public void run() { super.run(); try { Thread.sleep(4500); Intent intent = new Intent(SplashActivity.this, LoginActivity.class); startActivity(intent); } catch (InterruptedException e) { <START> e.printStackTrace(); <END> } } }.start(); }</code><technical_language>is of this while a user running mobile application</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); Animation move = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.splash_screen_logo_anim); ImageView logo = findViewById(R.id.logo); AnimationSet set = new AnimationSet(true); Animation fadeIn = new AlphaAnimation(0,1); fadeIn.setInterpolator(new AccelerateInterpolator()); fadeIn.setDuration(1000); set.addAnimation(fadeIn); set.addAnimation(move); logo.startAnimation(set); new Thread(){ @Override public void run() { super.run(); try { Thread.sleep(SPLASH_TIMER); Intent intent = new Intent(SplashActivity.this, LoginActivity.class); startActivity(intent); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return; } } }.start(); }
Source:
<code>public void signInOnLocalDoesNotSetCookieWithSSL() throws Exception { String json = TestUtils.createJson( "{'study':'" + TEST_STUDY_ID_STRING + "','email':'email@email.com','password':'bar'}"); response = mockPlayContextWithJson(json); when(controller.bridgeConfig.getEnvironment()).thenReturn(Environment.LOCAL); when(controller.bridgeConfig.get("webservices.url")).thenReturn("http://localhost:9000"); UserSession session = createSession(null, null); when(authenticationService.signIn(any(), any(), any())).thenReturn(session); controller.signIn(); verify(response).setCookie(BridgeConstants.SESSION_TOKEN_HEADER, TEST_SESSION_TOKEN, BridgeConstants.BRIDGE_SESSION_EXPIRE_IN_SECONDS, "/", <START> BridgeConfigFactory.getConfig().get("webservices.url"), false, false); <END> }</code><technical_language>This fail in Travis, mock bridgeConfig return localhost, in travis, this picks dev config</technical_language>

Target:
public void signInOnLocalDoesNotSetCookieWithSSL() throws Exception { String json = TestUtils.createJson( "{'study':'" + TEST_STUDY_ID_STRING + "','email':'email@email.com','password':'bar'}"); response = mockPlayContextWithJson(json); when(controller.bridgeConfig.getEnvironment()).thenReturn(Environment.LOCAL); UserSession session = createSession(null, null); when(authenticationService.signIn(any(), any(), any())).thenReturn(session); controller.signIn(); verify(response).setCookie(BridgeConstants.SESSION_TOKEN_HEADER, TEST_SESSION_TOKEN, BridgeConstants.BRIDGE_SESSION_EXPIRE_IN_SECONDS, "/", WEBSERVICES_URL, false, false); }
Source:
<code>protected void handleJSON(HttpServletRequest request, HttpServletResponse response, final JSONObject json) throws IOException { if (request.getPathInfo().equalsIgnoreCase("/load")) { scoreBoard.runInBatch(new Runnable() { <START> public void run() { <END> scoreBoard.reset(); ScoreBoardJSONSetter.set(scoreBoard, json); } }); } else if (request.getPathInfo().equalsIgnoreCase("/merge")) { scoreBoard.runInBatch(new Runnable() { public void run() { ScoreBoardJSONSetter.set(scoreBoard, json); } }); } else { response.sendError(HttpServletResponse.SC_NOT_FOUND, "Must specify to load or merge"); } response.setContentType("text/plain"); response.setStatus(HttpServletResponse.SC_OK); }</code><technical_language>This tagged @Override</technical_language>

Target:
protected void handleJSON(HttpServletRequest request, HttpServletResponse response, final JSONObject json) throws IOException { if (request.getPathInfo().equalsIgnoreCase("/load")) { scoreBoard.runInBatch(new Runnable() { @Override public void run() { scoreBoard.reset(); ScoreBoardJSONSetter.set(scoreBoard, json); } }); } else if (request.getPathInfo().equalsIgnoreCase("/merge")) { scoreBoard.runInBatch(new Runnable() { @Override public void run() { ScoreBoardJSONSetter.set(scoreBoard, json); } }); } else { response.sendError(HttpServletResponse.SC_NOT_FOUND, "Must specify to load or merge"); } response.setContentType("text/plain"); response.setStatus(HttpServletResponse.SC_OK); }
Source:
<code>public ServiceBusReceiverAsyncClient buildAsyncClient() { final MessagingEntityType entityType = validateEntityPaths(logger, connectionStringEntityName, topicName, queueName); final String entityPath; switch (entityType) { case QUEUE: entityPath = queueName; break; case TOPIC: if (isNullOrEmpty(subscriptionName)) { throw logger.logExceptionAsError(new IllegalStateException(String.format( "topicName (%s) must have a subscriptionName associated with it.", topicName))); } entityPath = topicName; break; default: throw logger.logExceptionAsError( new IllegalArgumentException("Unknown entity type: " + entityType)); } if (prefetchCount < 1) { throw logger.logExceptionAsError(new IllegalArgumentException(String.format( "prefetchCount (%s) cannot be less than 1.", prefetchCount))); } final MessageLockContainer messageLockContainer = new MessageLockContainer(); final ServiceBusConnectionProcessor connectionProcessor = getOrCreateConnectionProcessor(messageSerializer); <START> final ReceiverOptions receiverOptions = new ReceiverOptions(receiveMode, prefetchCount); <END> return new ServiceBusReceiverAsyncClient(connectionProcessor.getFullyQualifiedNamespace(), entityPath, entityType, receiverOptions, connectionProcessor, tracerProvider, messageSerializer, messageLockContainer, ServiceBusClientBuilder.this::onClientClose); }</code><technical_language>options propagated here</technical_language>

Target:
public ServiceBusReceiverAsyncClient buildAsyncClient() { final MessagingEntityType entityType = validateEntityPaths(logger, connectionStringEntityName, topicName, queueName); final String entityPath; switch (entityType) { case QUEUE: entityPath = queueName; break; case TOPIC: if (isNullOrEmpty(subscriptionName)) { throw logger.logExceptionAsError(new IllegalStateException(String.format( "topicName (%s) must have a subscriptionName associated with it.", topicName))); } entityPath = topicName; break; default: throw logger.logExceptionAsError( new IllegalArgumentException("Unknown entity type: " + entityType)); } if (prefetchCount < 1) { throw logger.logExceptionAsError(new IllegalArgumentException(String.format( "prefetchCount (%s) cannot be less than 1.", prefetchCount))); } final MessageLockContainer messageLockContainer = new MessageLockContainer(); final ServiceBusConnectionProcessor connectionProcessor = getOrCreateConnectionProcessor(messageSerializer); final ReceiverOptions receiverOptions = new ReceiverOptions(receiveMode, prefetchCount, sessionId); return new ServiceBusReceiverAsyncClient(connectionProcessor.getFullyQualifiedNamespace(), entityPath, entityType, receiverOptions, connectionProcessor, tracerProvider, messageSerializer, messageLockContainer, ServiceBusClientBuilder.this::onClientClose); }
Source:
<code>private void showAlertDialogOnNewSettingNewTheme(Theme newTheme) { AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this); <START> dialogBuilder.setMessage(String.format(getString(R.string.theme_prompt), newTheme.getName(), newTheme.getAuthor())); <END> dialogBuilder.setNegativeButton(R.string.theme_done, null); dialogBuilder.setPositiveButton(R.string.theme_manage_site, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { finish(); } }); AlertDialog alertDialog = dialogBuilder.create(); alertDialog.show(); }</code><technical_language>Select another string if author is empty string: <LINK_0></technical_language>

Target:
private void showAlertDialogOnNewSettingNewTheme(Theme newTheme) { AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this); String thanksMessage = String.format(getString(R.string.theme_prompt), newTheme.getName()); if (!newTheme.getAuthor().isEmpty()) { thanksMessage = thanksMessage + String.format(getString(R.string.theme_by_author_prompt_append), newTheme.getAuthor()); } dialogBuilder.setMessage(thanksMessage); dialogBuilder.setNegativeButton(R.string.theme_done, null); dialogBuilder.setPositiveButton(R.string.theme_manage_site, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { finish(); } }); AlertDialog alertDialog = dialogBuilder.create(); alertDialog.show(); }
Source:
<code>public void parse(InputStream historyFile, JobKey jobKey) throws ProcessingException { try { jobHistoryListener = new JobHistoryListener(jobKey); JobHistoryCopy.parseHistoryFromIS(historyFile, jobHistoryListener); } catch (IOException ioe) { LOG.error(" Exception during parsing hadoop 1.0 file " + ioe.getMessage()); <START> LOG.error(ioe.getStackTrace()); <END> throw new ProcessingException( " Unable to parse history file in function parse, " + "cannot process this record!" + jobKey + " error: " + ioe.getMessage()); } }</code><technical_language>I LOG.error("your log message", ioe); do 2 lines doing</technical_language>

Target:
public void parse(InputStream historyFile, JobKey jobKey) throws ProcessingException { try { jobHistoryListener = new JobHistoryListener(jobKey); JobHistoryCopy.parseHistoryFromIS(historyFile, jobHistoryListener); } catch (IOException ioe) { LOG.error(" Exception during parsing hadoop 1.0 file ", ioe); throw new ProcessingException( " Unable to parse history file in function parse, " + "cannot process this record!" + jobKey + " error: " , ioe); } }
Source:
<code>public String toString() { <START> StringBuilder sb = new StringBuilder(); <END> sb.append("class Handler {\n"); sb.append(" exec: ").append(toIndentedString(exec)).append("\n"); sb.append("}"); return sb.toString(); }</code><technical_language>toString() formatting</technical_language>

Target:
public String toString() { return "Handler{" + "exec=" + exec + '}'; }
Source:
<code>public boolean accepts(String spec, LocationRegistry registry) { if (BasicLocationRegistry.isResolverPrefixForSpec(this, spec, true)) return true; <START> JcloudsSpecParser details = JcloudsSpecParser.parse(spec, false); <END> if (details==null) return false; if (details.isProvider() || details.isApi()) return true; return false; }</code><technical_language>this pass true for dryrun, calling parse</technical_language>

Target:
public boolean accepts(String spec, LocationRegistry registry) { if (BasicLocationRegistry.isResolverPrefixForSpec(this, spec, true)) return true; JcloudsSpecParser details = JcloudsSpecParser.parse(spec, true); if (details==null) return false; if (details.isProvider() || details.isApi()) return true; return false; }
Source:
<code>public static void getPushNotificationSettings(Context context, RestRequest.Listener listener, RestRequest.ErrorListener errorListener) { if (!AccountHelper.isSignedInWordPressDotCom()) { return; } if (TextUtils.isEmpty(GCMRegistrar.getRegistrationId(context))) { AppLog.e(T.NOTIFS, "can't get push notification settings, gcm token is null."); } SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context); String deviceID = settings.getString(WPCOM_PUSH_DEVICE_SERVER_ID, null); <START> WordPress.getRestClientUtilsV1_1().get("/me/notifications/settings/?device_id=" + deviceID, listener, errorListener); <END> }</code><technical_language>this is a weird if deviceID is null, endpoint ends /me/notifications/settings/?device_id=null. works functionally, though. leave ?device_id= if is null instead</technical_language>

Target:
public static void getPushNotificationSettings(Context context, RestRequest.Listener listener, RestRequest.ErrorListener errorListener) { if (!AccountHelper.isSignedInWordPressDotCom()) { return; } if (TextUtils.isEmpty(GCMRegistrar.getRegistrationId(context))) { AppLog.e(T.NOTIFS, "can't get push notification settings, gcm token is null."); } SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context); String deviceID = settings.getString(WPCOM_PUSH_DEVICE_SERVER_ID, null); String settingsEndpoint = WPCOM_SETTINGS_ENDPOINT; if (!TextUtils.isEmpty(deviceID)) { settingsEndpoint += "?device_id=" + deviceID; } WordPress.getRestClientUtilsV1_1().get(settingsEndpoint, listener, errorListener); }
Source:
<code>public DirFileLookuper(String path) { <START> if (!Strings.isEmpty(path)) { <END> this.dir = new File(path); } }</code><technical_language>good. If path is setup - this.dir null - pushing NullPointerException level down</technical_language>

Target:
public DirFileLookuper(String path) { this.dir = new File(path); }
Source:
<code>public void canSustainConcurrentModification() { final DefaultPackageManager.IntentComparator intentComparator = new DefaultPackageManager.IntentComparator(); Intent mockedIntent1 = mock(Intent.class); <START> when(mockedIntent1.getAction()).thenReturn("actionstring0", (String) null); <END> Intent mockedIntent2 = mock(Intent.class); when(mockedIntent2.getAction()).thenReturn("actionstring1", (String) null); Assertions.assertThat(intentComparator.compare(mockedIntent1, mockedIntent2)).isEqualTo(-1); }</code><technical_language>a real Intent object mocking</technical_language>

Target:
public void canSustainConcurrentModification() { final DefaultPackageManager.IntentComparator intentComparator = new DefaultPackageManager.IntentComparator(); Intent intent1 = new Intent("actionstring0"); Intent intent2 = new Intent("actionstring1"); Assertions.assertThat(intentComparator.compare(intent1, intent2)).isEqualTo(-1); }
Source:
<code>public TestRowExpressionTranslator() { this.functionManager = METADATA.getFunctionManager(); this.functionResolution = new FunctionResolution(functionManager); this.determinismEvaluator = new RowExpressionDeterminismEvaluator(functionManager); this.sqlToRowExpressionTranslator = new TestingRowExpressionTranslator(METADATA); <START> } <END></code><technical_language>cover: 1) Function a rule, translate? 2) Function name signature (for example input types different)? 3) Function is hidden, not. 4) Simple operators as: +, -, ></technical_language>

Target:
public TestRowExpressionTranslator() { this.functionManager = METADATA.getFunctionManager(); this.sqlToRowExpressionTranslator = new TestingRowExpressionTranslator(METADATA); }
Source:
<code>public boolean checkClientSecret(final OAuthRegisteredService registeredService, final String clientSecret) { LOGGER.debug("Found: in secret check", registeredService); final String registeredServiceClientSecret = registeredService.getClientSecret(); final boolean isClientSecretNeeded = ( "".equals(registeredServiceClientSecret) )? false : true; <START> if (isClientSecretNeeded && !StringUtils.equals(registeredServiceClientSecret, clientSecret)) { <END> LOGGER.error("Wrong client secret for service: [{}]", registeredService); return false; } return true; }</code><technical_language>if (StringUtils.isNotBlank(registeredService.getClientSecret()) ... )</technical_language>

Target:
public boolean checkClientSecret(final OAuthRegisteredService registeredService, final String clientSecret) { LOGGER.debug("Found: in secret check", registeredService); if (StringUtils.isNotBlank(registeredService.getClientSecret()) && !StringUtils.equals(registeredService.getClientSecret(), clientSecret)) { LOGGER.error("Wrong client secret for service: [{}]", registeredService); return false; } return true; }
Source:
<code>protected boolean set(EntityArmorStand container, Vector3d value) { <START> container.getDataWatcher().updateObject(16, VecHelper.toRotation(value)); <END> return true; }</code><technical_language>setRightLegRotation method</technical_language>

Target:
protected boolean set(EntityArmorStand container, Vector3d value) { container.setRightLegRotation(VecHelper.toRotation(value)); return true; }
Source:
<code><START> public static boolean isGerritVersion(String verString) { <END> return verString != null && GERRIT_SSHD_REPLY.matcher(verString).matches(); }</code><technical_language>if move test package org.eclipse.egit.core.op this method need public</technical_language>

Target:
static boolean isGerritVersion(String verString) { return verString != null && GERRIT_SSHD_REPLY.matcher(verString).matches(); }
Source:
<code>public void writeRepositoryConfigFile() { if (repositoryConfigurationFile != null) { <START> try (ObjectOutputStream out = new ObjectOutputStream( <END> new BufferedOutputStream(new FileOutputStream(repositoryConfigurationFile)))) { Set<RepositoryConfiguration> tempConfigs; synchronized (repositoryConfigurations) { tempConfigs = new HashSet<RepositoryConfiguration>(repositoryConfigurations.values()); } if (tempConfigs.size() > 0) { out.writeInt(tempConfigs.size()); for (RepositoryConfiguration repositoryConfiguration : tempConfigs) { if (repositoryConfiguration != null) { out.writeObject(repositoryConfiguration); } } } } catch (IOException e) { StatusHandler.log(new Status(IStatus.WARNING, BugzillaCorePlugin.ID_PLUGIN, 0, "Failed to write repository configuration cache", e)); } } }</code><technical_language>I this is right place create stream. Consider creating a new try-with-resource lines 828-834 instead, leave this try block is, remove finally</technical_language>

Target:
public void writeRepositoryConfigFile() { if (repositoryConfigurationFile != null) { try { Set<RepositoryConfiguration> tempConfigs; synchronized (repositoryConfigurations) { tempConfigs = new HashSet<RepositoryConfiguration>(repositoryConfigurations.values()); } if (tempConfigs.size() > 0) { try (ObjectOutputStream out = new ObjectOutputStream( new BufferedOutputStream(new FileOutputStream(repositoryConfigurationFile)))) { out.writeInt(tempConfigs.size()); for (RepositoryConfiguration repositoryConfiguration : tempConfigs) { if (repositoryConfiguration != null) { out.writeObject(repositoryConfiguration); } } } } } catch (IOException e) { StatusHandler.log(new Status(IStatus.WARNING, BugzillaCorePlugin.ID_PLUGIN, 0, "Failed to write repository configuration cache", e)); } } }
Source:
<code>private <T> Key.ComplexKey addObjects(T... keys) { if (!canAddKeys) { <START> throw new IllegalArgumentException("Can't add keys after EndKey has been added"); <END> } for (T key : keys) { json.add(gson.toJsonTree(key)); } return this; }</code><technical_language>I this IllegalStateException</technical_language>

Target:
private <T> Key.ComplexKey addObjects(T... keys) { if (!canAddKeys) { throw new IllegalStateException("Cannot add keys after addHighSentinel() has been called"); } for (T key : keys) { json.add(gson.toJsonTree(key)); } return this; }
Source:
<code>public void validateQueryStringAndGiveColorFeedback(TextField querySource, String queryString) { Matcher queryValidation = queryPattern.matcher(queryString.strip()); if (queryValidation.matches()) { if (containsYearAndYearRange(queryString)) { <START> querySource.setStyle("-fx-background-color: rgba(240, 128, 128, 0.5);"); <END> querySource.setTooltip(new Tooltip(Localization.lang("The query cannot contain a year and year-range field."))); } else { querySource.setStyle("-fx-background-color: rgba(50, 205, 50, 0.5);"); querySource.setTooltip(new Tooltip(Localization.lang("This search contains entries that match all specified terms."))); } } else { querySource.setStyle("-fx-background-color: rgba(240, 128, 128, 0.5);"); querySource.setTooltip(new Tooltip(Localization.lang("This query uses an unsupported syntax."))); } }</code><technical_language>Pseudo-classes instead of hardcoding colors here. gui/util/ViewModelListCellFactory</technical_language>

Target:
public void validateQueryStringAndGiveColorFeedback(TextField querySource, String queryString) { Matcher queryValidation = queryPattern.matcher(queryString.strip()); if (!queryString.strip().isBlank() && !queryValidation.matches()) { Matcher laxQueryValidation = laxQueryPattern.matcher(queryString.strip()); if (laxQueryValidation.matches()) { setPseudoClassToUnsupported(querySource); querySource.setTooltip(new Tooltip(Localization.lang("This query uses unsupported fields."))); } else { setPseudoClassToInvalid(querySource); querySource.setTooltip(new Tooltip(Localization.lang("This query uses unsupported syntax."))); } } else if (containsYearAndYearRange(queryString)) { setPseudoClassToInvalid(querySource); querySource.setTooltip(new Tooltip(Localization.lang("The query cannot contain a year and year-range field."))); } else { setPseudoClassToValid(querySource); } }
Source:
<code>private boolean isEnrollLink(String strUrl) { if (actionListener != null && strUrl != null && strUrl.startsWith(URL_TYPE_ENROLL)) { Uri uri = Uri.parse(strUrl); <START> String query = uri.getQuery(); <END> if (query != null) { query = query.trim(); String[] params = query.split("&"); Map<String, String> queryParams = new HashMap<>(); for (String q : params) { int equalsIndex = q.indexOf('='); if (equalsIndex <= 0) { queryParams.put(q, null); } else { String key = q.substring(0, equalsIndex); String value = equalsIndex < q.length() - 1 ? q.substring(equalsIndex + 1) : null; queryParams.put(key, value); } } String courseId = queryParams.get("course_id"); if (courseId != null) { boolean emailOptIn = Boolean.parseBoolean(queryParams.get("email_opt_in")); actionListener.onClickEnroll(courseId, emailOptIn); logger.debug("found enroll URL: " + strUrl); return true; } } } return false; }</code><technical_language>I uri.getQueryParameter(String)</technical_language>

Target:
private boolean isEnrollLink(String strUrl) { if (actionListener != null && strUrl != null && strUrl.startsWith(URL_TYPE_ENROLL)) { Uri uri = Uri.parse(strUrl); String courseId = uri.getQueryParameter("course_id"); if (courseId != null) { boolean emailOptIn = Boolean.parseBoolean(uri.getQueryParameter("email_opt_in")); actionListener.onClickEnroll(courseId, emailOptIn); logger.debug("found enroll URL: " + strUrl); return true; } } return false; }
Source:
<code>public static void start() { synchronized (lock) { if (forklift != null && forklift.isRunning()) return; try { activemq = new BrokerService(); activemq.addConnector("tcp://127.0.0.1:61618"); activemq.setDataDirectoryFile(Files.createTempDir()); activemq.start(); <START> System.out.println("HEY" + activemq.getDataDirectoryFile()); <END> connector = new ActiveMQConnector(brokerUrl); connector.start(); forklift = new Forklift(); forklift.start(connector); count++; } catch (Throwable e) { e.printStackTrace(); } } }</code><technical_language>need this test log</technical_language>

Target:
public static void start() { synchronized (lock) { if (forklift != null && forklift.isRunning()) return; try { activemq = new BrokerService(); activemq.addConnector("tcp://127.0.0.1:61618"); activemq.setDataDirectoryFile(Files.createTempDir()); activemq.start(); connector = new ActiveMQConnector(brokerUrl); connector.start(); forklift = new Forklift(); forklift.start(connector); count++; } catch (Throwable e) { e.printStackTrace(); } } }
Source:
<code>private void initCoordinator(Process p, AffinityTopologyVersion topVer) { Set<UUID> aliveSrvNodesIds = new HashSet<>(); for (ClusterNode node : ctx.discovery().serverNodes(topVer)) { <START> if (ctx.discovery().alive(node)) <END> aliveSrvNodesIds.add(node.id()); } synchronized (mux) { if (p.initCrdFut.isDone()) return; assert p.remaining.isEmpty(); p.remaining.addAll(aliveSrvNodesIds); p.initCrdFut.onDone(); } }</code><technical_language>filter nodes here? receive NODE_FAILED event if some node is already. Do test for it? - node fail master key change</technical_language>

Target:
private void initCoordinator(Process p, AffinityTopologyVersion topVer) { synchronized (mux) { if (p.initCrdFut.isDone()) return; assert p.remaining.isEmpty(); p.remaining.addAll(F.viewReadOnly(ctx.discovery().serverNodes(topVer), F.node2id())); p.initCrdFut.onDone(); } }
Source:
<code>public void validate(final T credentials) { try { <START> final UserProfile profile = this.cache.get(credentials, new Callable<UserProfile>() { <END> @Override public UserProfile call() throws Exception { logger.debug("Delegating authentication to {}...", delegate); delegate.validate(credentials); final UserProfile profile = credentials.getUserProfile(); logger.debug("Cached authentication result"); return profile; } }); credentials.setUserProfile(profile); logger.debug("Found cached credential. Using cached profile {}...", profile); } catch (final Exception e) { throw new TechnicalException(e); } }</code><technical_language>OK. Thanks. In case, in current algorithm, do put data in cache</technical_language>

Target:
public void validate(final T credentials) { try { final UserProfile profile = this.cache.get(credentials); credentials.setUserProfile(profile); logger.debug("Found cached credential. Using cached profile {}...", profile); } catch (Exception e) { throw new CredentialsException(e); } }
Source:
<code>public void TestRoadblock_001( String wikiName, String article, String screenImageUrl, Dimension windowResolution, int skinWidth, String skinLeftSide, String skinRightSide ) { String testedPage = urlBuilder.getUrlForPath(wikiName, article); AdsBaseObject wikiPage = new AdsBaseObject(driver, testedPage, windowResolution); wikiPage.verifyRoadblockServedAfterMultiplePageViews( testedPage, screenImageUrl, windowResolution, <START> skinWidth, skinLeftSide, skinRightSide, 3 <END> ); }</code><technical_language>I 3 = pageviews method description, avoid magic number '3'</technical_language>

Target:
public void TestRoadblock_001( String wikiName, String article, String screenImageUrl, Dimension windowResolution, int skinWidth, String skinLeftSide, String skinRightSide ) { String testedPage = urlBuilder.getUrlForPath(wikiName, article); AdsBaseObject wikiPage = new AdsBaseObject(driver, testedPage, windowResolution); wikiPage.verifyRoadblockServedAfterMultiplePageViews( testedPage, screenImageUrl, windowResolution, skinWidth, skinLeftSide, skinRightSide, pageViewsCount ); }
Source:
<code>private Optional<Resource> getRawResource(String id) { if (isEmpty(id)) { throw new IllegalArgumentException("Resource id must be not null"); } IspnResource ispnResource = (IspnResource) resource.get(id); <START> return Optional.ofNullable(ispnResource == null ? null : ispnResource.getResource()); <END> }</code><technical_language>important, "return Optional.ofNullable(ispnResource).map(IspnResource::getResource)"</technical_language>

Target:
private Optional<Resource> getRawResource(String id) { if (isEmpty(id)) { throw new IllegalArgumentException("Resource id must be not null"); } return Optional.ofNullable((IspnResource) resource.get(id)).map(IspnResource::getResource); }
Source:
<code>public int nextBatch() throws IOException { filePosition += currentBatchSize; currentPosition += currentBatchSize; if (nextRowInGroup >= currentGroupRowCount) { if (!advanceToNextRowGroup()) { filePosition = fileRowCount; currentPosition = totalRowCount; return -1; } } currentBatchSize = toIntExact(min(nextBatchSize, min(maxBatchSize, currentGroupRowCount - nextRowInGroup))); for (StreamReader column : streamReaders) { if (column != null) { column.prepareNextRead(currentBatchSize); } } nextRowInGroup += currentBatchSize; <START> nextBatchSize = currentBatchSize * BATCH_SIZE_GROWTH_FACTOR; <END> validateWritePageChecksum(); return currentBatchSize; }</code><technical_language>I cap this MAX_BATCH_SIZE</technical_language>

Target:
public int nextBatch() throws IOException { filePosition += currentBatchSize; currentPosition += currentBatchSize; if (nextRowInGroup >= currentGroupRowCount) { if (!advanceToNextRowGroup()) { filePosition = fileRowCount; currentPosition = totalRowCount; return -1; } } currentBatchSize = toIntExact(min(nextBatchSize, maxBatchSize)); nextBatchSize = min(currentBatchSize * BATCH_SIZE_GROWTH_FACTOR, MAX_BATCH_SIZE); currentBatchSize = toIntExact(min(currentBatchSize, currentGroupRowCount - nextRowInGroup)); for (StreamReader column : streamReaders) { if (column != null) { column.prepareNextRead(currentBatchSize); } } nextRowInGroup += currentBatchSize; validateWritePageChecksum(); return currentBatchSize; }
Source:
<code>public String resolve(HttpRequest request) { <START> String path = request.getURI().getPath(); <END> return path != null ? path : ""; }</code><technical_language>Is this template actual path</technical_language>

Target:
public String resolve(HttpRequest request) { return request.getMethod().name(); }
Source:
<code>private boolean isResourceNamespaced(JDefinedClass resourceClass) { <START> switch (resourceClass.name()) { <END> case "MutatingWebhookConfiguration": case "ValidatingWebhookConfiguration": case "CustomResourceDefinition": case "ComponentStatus": case "Namespace": case "Node": case "PersistentVolume": case "PodSecurityPolicy": case "ClusterRoleBinding": case "ClusterRole": case "PriorityClass": case "StorageClass": return false; default: return true; } }</code><technical_language>if avoid hardcoding strings [here](<LINK_0>, great. good me</technical_language>

Target:
private boolean isResourceNamespaced(JDefinedClass resourceClass) { return !NON_NAMESPACED_RESOURCES.contains(resourceClass.name()); }
Source:
<code>private String createViolationMessage(org.codenarc.rule.Violation codeNarcViolation, Rule rule) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(rule.getName()); <START> if (codeNarcViolation.getMessage() != null) { <END> stringBuilder.append(": ").append(codeNarcViolation.getMessage()); } return stringBuilder.toString(); }</code><technical_language>StringUtils.isNotBlank maybe</technical_language>

Target:
private String createViolationMessage(org.codenarc.rule.Violation codeNarcViolation, Rule rule) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(rule.getName()); if (StringUtils.isNotBlank(codeNarcViolation.getMessage())) { stringBuilder.append(": ").append(codeNarcViolation.getMessage()); } return stringBuilder.toString(); }