auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void parallelAnnotation(JSONObject op, StringBuilder sb) { Boolean parallel = (Boolean) op.get("parallelOperator"); if (parallel != null && parallel) { sb.append("@parallel(width="); Object width = op.get("width"); if (width instanceof Integer) { sb.append(Integer.toString((int) width)); <START> } <END> else if (width instanceof Long) { sb.append(Long.toString((long) width)); } else { JSONObject jo = (JSONObject) width; String jsonType = (String) jo.get("type"); if (TYPE_SUBMISSION_PARAMETER.equals(jsonType)) sb.append(stvHelper.generateCompParamName((JSONObject) jo.get("value"))); else throw new IllegalArgumentException("Unsupported parallel width specification: " + jo); } Boolean partitioned = (Boolean) op.get("partitioned"); if (partitioned != null && partitioned) { String parallelInputPortName = (String) op .get("parallelInputPortName"); parallelInputPortName = splBasename(parallelInputPortName); sb.append(", partitionBy=[{port=" + parallelInputPortName + ", attributes=[__spl_hash]}]"); } sb.append(")\n"); } }</code><technical_language>is necessary / benefit of adding code support a Long parallel width? Integer is large enough</technical_language>

Target:
private void parallelAnnotation(JSONObject op, StringBuilder sb) { Boolean parallel = (Boolean) op.get("parallelOperator"); if (parallel != null && parallel) { sb.append("@parallel(width="); Object width = op.get("width"); if (width instanceof Integer) { sb.append(Integer.toString((int) width)); } else if (width instanceof Long) { sb.append(Integer.toString(((Long)width).intValue())); } else { JSONObject jo = (JSONObject) width; String jsonType = (String) jo.get("type"); if (TYPE_SUBMISSION_PARAMETER.equals(jsonType)) sb.append(stvHelper.generateCompParamName((JSONObject) jo.get("value"))); else throw new IllegalArgumentException("Unsupported parallel width specification: " + jo); } Boolean partitioned = (Boolean) op.get("partitioned"); if (partitioned != null && partitioned) { String parallelInputPortName = (String) op .get("parallelInputPortName"); parallelInputPortName = splBasename(parallelInputPortName); sb.append(", partitionBy=[{port=" + parallelInputPortName + ", attributes=[__spl_hash]}]"); } sb.append(")\n"); } }
Source:
<code>public boolean isOverutilized() { <START> return memoryManager.isOverUtilized(); <END> }</code><technical_language>ok capitalization. needs consistent. overutilized 2 lines is capitalized differently</technical_language>

Target:
public boolean isOverutilized() { return memoryManager.isOverutilized(); }
Source:
<code>public static void main(String... args) { <START> Thread.setDefaultUncaughtExceptionHandler(new FileExceptionHandler(ExceptionHandler.ExceptionType.CLIENT)); <END> if (Context.getJavaVersion() >= 9) { UILog.log("Parabot", "Parabot doesn't support Java 9+ currently. Please downgrade to Java 8 to ensure Parabot is working correctly."); } if (!System.getProperty("os.arch").contains("64")) { UILog.log("Parabot", "You are not running a 64-bit version of Java, this might cause the client to lag or crash unexpectedly.\r\n" + "It is recommended to upgrade to a 64-bit version."); } parseArgs(args); Directories.validate(); Core.verbose(TranslationHelper.translate("DEBUG_MODE") + Core.inDebugMode()); try { Core.verbose(TranslationHelper.translate("SETTING_LOOK_AND_FEEL") + UIManager.getSystemLookAndFeelClassName()); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Throwable t) { t.printStackTrace(); } if (!Core.inDebugMode() && Core.hasValidation() && !Core.isValid()) { if (Core.newVersionAlert() == JOptionPane.YES_OPTION) { Core.downloadNewVersion(); return; } } Core.verbose(TranslationHelper.translate("VALIDATION_ACCOUNT_MANAGER")); AccountManager.validate(); if (username != null && password != null) { new BotUI(username, password); username = null; password = null; return; } Core.verbose(TranslationHelper.translate("STARTING_LOGIN_GUI")); new BotUI(null, null); }</code><technical_language>this disabled for time</technical_language>

Target:
public static void main(String... args) { if (Context.getJavaVersion() >= 9) { UILog.log("Parabot", "Parabot doesn't support Java 9+ currently. Please downgrade to Java 8 to ensure Parabot is working correctly."); } if (!System.getProperty("os.arch").contains("64")) { UILog.log("Parabot", "You are not running a 64-bit version of Java, this might cause the client to lag or crash unexpectedly.\r\n" + "It is recommended to upgrade to a 64-bit version."); } parseArgs(args); Directories.validate(); Core.verbose(TranslationHelper.translate("DEBUG_MODE") + Core.inDebugMode()); try { Core.verbose(TranslationHelper.translate("SETTING_LOOK_AND_FEEL") + UIManager.getSystemLookAndFeelClassName()); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Throwable t) { t.printStackTrace(); } if (!Core.inDebugMode() && Core.hasValidation() && !Core.isValid()) { if (Core.newVersionAlert() == JOptionPane.YES_OPTION) { Core.downloadNewVersion(); return; } } Core.verbose(TranslationHelper.translate("VALIDATION_ACCOUNT_MANAGER")); AccountManager.validate(); if (username != null && password != null) { new BotUI(username, password); username = null; password = null; return; } Core.verbose(TranslationHelper.translate("STARTING_LOGIN_GUI")); new BotUI(null, null); }
Source:
<code>public CompletableFuture<Object> visitPrepareCommand(TxInvocationContext ctx, PrepareCommand command) { return CompletableFuture.supplyAsync(() -> { try { return txHandler.visitPrepareCommand(null, command); <START> } catch (Throwable throwable) { <END> throw CompletableFutures.asCompletionException(throwable); } }, executor); }</code><technical_language>IMO TransactionHandler longer implement visitPrepareCommand, methods called other handlers renamed clear external API methods of Visitor for internal only</technical_language>

Target:
public CompletionStage<Void> visitPrepareCommand(TxInvocationContext ctx, PrepareCommand command) { return CompletableFuture.runAsync(() -> txHandler.handlePrepareCommand(command), executor); }
Source:
<code>public User login(String email, String password) throws SQLException { User user = QueryBuilder.create(dataSource, getQuery("database.loginUser")) <START> .setString("email", email.trim().toLowerCase()) <END> .executeQuerySingle(User.class); if (user != null && user.isPasswordValid(password)) { return user; } else { return null; } }</code><technical_language>I agree trimming, I understand need lower-case it</technical_language>

Target:
public User login(String email, String password) throws SQLException { User user = QueryBuilder.create(dataSource, getQuery("database.loginUser")) .setString("email", email.trim()) .executeQuerySingle(User.class); if (user != null && user.isPasswordValid(password)) { return user; } else { return null; } }
Source:
<code>public <T> Mono<CosmosAsyncItemResponse<T>> replaceItem( T item, String itemId, PartitionKey partitionKey, CosmosItemRequestOptions options) { Document doc = CosmosItemProperties.fromObject(item); if (options == null) { options = new CosmosItemRequestOptions(); } ModelBridgeInternal.setPartitionKey(options, partitionKey); @SuppressWarnings("unchecked") Class<T> itemType = (Class<T>) item.getClass(); final CosmosItemRequestOptions requestOptions = options; return withContext(context -> replaceItem(itemType, itemId, doc, requestOptions,context)).subscriberContext(reactorContext -> { Optional<String> master = reactorContext.getOrEmpty(TracerProvider.MASTER_CALL); if (master.isPresent()) { reactorContext = reactorContext.put(TracerProvider.NESTED_CALL, true); } <START> return reactorContext.put(TracerProvider.MASTER_CALL, true); <END> }); }</code><technical_language>factor out this code, other places? e.g, java return withContext(context -> replaceItem(itemType, itemId, doc, requestOptions,context)) .subscriberContext(reactorContext -> factoredOutFunc())</technical_language>

Target:
public <T> Mono<CosmosItemResponse<T>> replaceItem( T item, String itemId, PartitionKey partitionKey, CosmosItemRequestOptions options) { Document doc = CosmosItemProperties.fromObject(item); if (options == null) { options = new CosmosItemRequestOptions(); } ModelBridgeInternal.setPartitionKey(options, partitionKey); @SuppressWarnings("unchecked") Class<T> itemType = (Class<T>) item.getClass(); if(!database.getClient().getTracerProvider().isEnabled()){ return replaceItemInternal(itemType, itemId, doc, options); } final CosmosItemRequestOptions requestOptions = options; return withContext(context -> replaceItemInternal(itemType, itemId, doc, requestOptions,context)); }
Source:
<code>public void testScanFilterAndProjectOperator() throws Exception { DriverContext driverContext = testPreparer.newDriverContext(); SourceOperator operator = testPreparer.newScanFilterAndProjectOperator(driverContext); assertEquals(driverContext.getSystemMemoryUsage(), 0); for (int i = 0; i < 54; i++) { assertFalse(operator.isFinished()); operator.getOutput(); <START> assertBetweenInclusive(driverContext.getSystemMemoryUsage(), 20_000L, 699_999L); <END> } assertFalse(operator.isFinished()); operator.getOutput(); assertBetweenInclusive(driverContext.getSystemMemoryUsage(), 400L, 600L); assertNull(operator.getOutput()); assertTrue(operator.isFinished()); assertBetweenInclusive(driverContext.getSystemMemoryUsage(), 400L, 600L); }</code><technical_language>range tighter</technical_language>

Target:
public void testScanFilterAndProjectOperator() throws Exception { DriverContext driverContext = testPreparer.newDriverContext(); SourceOperator operator = testPreparer.newScanFilterAndProjectOperator(driverContext); assertEquals(driverContext.getSystemMemoryUsage(), 0); for (int i = 0; i < 50; i++) { assertFalse(operator.isFinished()); assertNotNull(operator.getOutput()); assertBetweenInclusive(driverContext.getSystemMemoryUsage(), 90_000L, 499_999L); } assertNull(operator.getOutput()); assertTrue(operator.isFinished()); assertBetweenInclusive(driverContext.getSystemMemoryUsage(), 0L, 500L); }
Source:
<code>private FilePath createWindowsSshAskpass(SSHUserPrivateKey sshUser) throws IOException, InterruptedException { FilePath ssh = workspace.createTempFile("pass", ".bat"); ssh.write("echo \"" + Secret.toString(sshUser.getPassphrase()) + "\"", null); <START> ssh.chmod(0700); <END> return ssh; }</code><technical_language>do expect this do windows :-)</technical_language>

Target:
private FilePath createWindowsSshAskpass(SSHUserPrivateKey sshUser) throws IOException, InterruptedException { FilePath ssh = workspace.createTextTempFile("pass", ".bat", "echo \"" + quoteWindowsCredentials(Secret.toString(sshUser.getPassphrase())) + "\"", false); return ssh; }
Source:
<code>public ListOperationParameters buildListOperationParameters(IndexedRecord record) { listOpeParms = new ListOperationParameters(); listOpeParms.setApiMode(api); listOpeParms.setOperation(operation.name()); listOpeParms.setStrict(dieOnError); if (use_soap_api) { listOpeParms.setListKeyType(record.get(inputSchema.getField(FIELD_LIST_KEY_TYPE).pos()).toString()); listOpeParms.setListKeyValue(record.get(inputSchema.getField(FIELD_LIST_KEY_VALUE).pos()).toString()); listOpeParms.setLeadKeyType(record.get(inputSchema.getField(FIELD_LEAD_KEY_TYPE).pos()).toString()); listOpeParms.setLeadKeyValue( <START> new String[] { String.valueOf(record.get(inputSchema.getField(FIELD_LEAD_KEY_VALUE).pos())) }); <END> } else { listOpeParms.setListId((Integer) record.get(inputSchema.getField(FIELD_LIST_ID).pos())); listOpeParms.setLeadIds(new Integer[] { (Integer) record.get(inputSchema.getField(FIELD_LEAD_ID).pos()) }); } LOG.debug("[buildParameters] {}.", listOpeParms); return listOpeParms; }</code><technical_language>some question this: Sting.valueOf( ) change null "null" . is work expect ? I remember parameters required. I understand that, ListKeyType/ListKeyValue/LeadKeyType/LeadKeyType passed input component null. avoid LeadKeyValue NPE issue</technical_language>

Target:
public ListOperationParameters buildListOperationParameters(IndexedRecord record) { listOpeParms = new ListOperationParameters(); listOpeParms.setApiMode(api); listOpeParms.setOperation(operation.name()); listOpeParms.setStrict(dieOnError); if (use_soap_api) { listOpeParms.setListKeyType(String.valueOf(record.get(inputSchema.getField(FIELD_LIST_KEY_TYPE).pos()))); listOpeParms.setListKeyValue(String.valueOf(record.get(inputSchema.getField(FIELD_LIST_KEY_VALUE).pos()))); listOpeParms.setLeadKeyType(String.valueOf(record.get(inputSchema.getField(FIELD_LEAD_KEY_TYPE).pos()))); listOpeParms.setLeadKeyValue( new String[] { String.valueOf(record.get(inputSchema.getField(FIELD_LEAD_KEY_VALUE).pos())) }); } else { listOpeParms.setListId((Integer) record.get(inputSchema.getField(FIELD_LIST_ID).pos())); listOpeParms.setLeadIds(new Integer[] { (Integer) record.get(inputSchema.getField(FIELD_LEAD_ID).pos()) }); } LOG.debug("[buildParameters] {}.", listOpeParms); return listOpeParms; }
Source:
<code>public void testAppendMissingTarget() throws Throwable { try { getFileSystem().append(target).close(); } catch (Exception ex) { <START> handleExpectedException(ex); <END> } }</code><technical_language>again, test is longer a test of behavior of filesystem</technical_language>

Target:
public void testAppendMissingTarget() throws Throwable { try { FSDataOutputStream out = getFileSystem().append(target); out.close(); fail("expected a failure"); } catch (Exception e) { handleExpectedException(e); } }
Source:
<code>public static boolean verifyOozieJobStatus(OozieClient client, String processName, ENTITY_TYPE entityType, Job.Status expectedStatus) throws OozieClientException, InterruptedException { for (int seconds = 0; seconds < 20; seconds++) { Job.Status status = getOozieJobStatus(client, processName, entityType); logger.info("Current status: " + status); if (status == expectedStatus) { return true; } <START> TimeUnit.SECONDS.sleep(5); <END> } return false; }</code><technical_language>java for (int seconds = 0; seconds < 20; seconds++) { this changed. this code: java for (int seconds = 0; seconds < 100; seconds+=5) {</technical_language>

Target:
public static boolean verifyOozieJobStatus(OozieClient client, String processName, ENTITY_TYPE entityType, Job.Status expectedStatus) throws OozieClientException, InterruptedException { for (int seconds = 0; seconds < 100; seconds+=5) { Job.Status status = getOozieJobStatus(client, processName, entityType); logger.info("Current status: " + status); if (status == expectedStatus) { return true; } TimeUnit.SECONDS.sleep(5); } return false; }
Source:
<code>public ConsumerMethodModel getMethodModel(String method) { Optional<Map.Entry<Method, ConsumerMethodModel>> consumerMethodModelEntry = methodModels.entrySet().stream().filter(entry -> entry.getKey().getName().equals(method)).findFirst(); <START> return consumerMethodModelEntry.isPresent() ? consumerMethodModelEntry.get().getValue() : null; <END> }</code><technical_language>IDE hint: java return consumerMethodModelEntry.map(Map.Entry::getValue).orElse(null);</technical_language>

Target:
public ConsumerMethodModel getMethodModel(String method) { Optional<Map.Entry<Method, ConsumerMethodModel>> consumerMethodModelEntry = methodModels.entrySet().stream().filter(entry -> entry.getKey().getName().equals(method)).findFirst(); return consumerMethodModelEntry.map(Map.Entry::getValue).orElse(null); }
Source:
<code>public <T> CollectionFuture<Map<Integer, CollectionOperationStatus>> asyncBopPipedInsertBulk( String key, Map<Long, T> elements, CollectionAttributes attributesForCreate, Transcoder<T> tc) { if (elements.size() <= CollectionPipedInsert.MAX_PIPED_ITEM_COUNT) { <START> BTreePipedInsert<T> store = new BTreePipedInsert<T>(key, elements, <END> (attributesForCreate != null), attributesForCreate, tc); return asyncCollectionPipedInsert(key, store); } else { List<CollectionPipedInsert<T>> storeList = new ArrayList<CollectionPipedInsert<T>>(); PartitionedMap<Long, T> list = new PartitionedMap<Long, T>( elements, CollectionPipedInsert.MAX_PIPED_ITEM_COUNT); for (int i = 0; i < list.size(); i++) { storeList .add(new BTreePipedInsert<T>(key, list.get(i), (attributesForCreate != null), attributesForCreate, tc)); } return asyncCollectionPipedInsert(key, storeList); } }</code><technical_language>store</technical_language>

Target:
public <T> CollectionFuture<Map<Integer, CollectionOperationStatus>> asyncBopPipedInsertBulk( String key, Map<Long, T> elements, CollectionAttributes attributesForCreate, Transcoder<T> tc) { if (elements.size() <= CollectionPipedInsert.MAX_PIPED_ITEM_COUNT) { BTreePipedInsert<T> insert = new BTreePipedInsert<T>(key, elements, (attributesForCreate != null), attributesForCreate, tc); return asyncCollectionPipedInsert(key, insert); } else { List<CollectionPipedInsert<T>> insertList = new ArrayList<CollectionPipedInsert<T>>(); PartitionedMap<Long, T> list = new PartitionedMap<Long, T>( elements, CollectionPipedInsert.MAX_PIPED_ITEM_COUNT); for (int i = 0; i < list.size(); i++) { insertList .add(new BTreePipedInsert<T>(key, list.get(i), (attributesForCreate != null), attributesForCreate, tc)); } return asyncCollectionPipedInsert(key, insertList); } }
Source:
<code><START> public Optional<T> lazyGet() <END> { return Optional.ofNullable(instance); }</code><technical_language>synchronized -- this class is thread-safe guaranteed happens-before producing consuming</technical_language>

Target:
public synchronized Optional<T> lazyGet() { return Optional.ofNullable(instance); }
Source:
<code>public static String repeat(String s, int n) { if (n < 1) { return ""; } int len = s.length() * n; StringBuilder buf = new StringBuilder(len); for (int i = 0; i < n; i++) { buf.append(s); } <START> return buf.toString(); <END> }</code><technical_language>L257~262, Strings.repeat</technical_language>

Target:
public static String repeat(String s, int n) { if (n < 1) { return ""; } return Strings.repeat(s, n); }
Source:
<code>private static String getLocalizedState(Context c, String state, int percentage) { switch (state) { case "idle": return c.getString(R.string.state_idle); case "scanning": return c.getString(R.string.state_scanning); <START> case "cleaning": return c.getString(R.string.state_cleaning); <END> case "syncing": return c.getString(R.string.state_syncing, percentage); case "error": return c.getString(R.string.state_error); case "unknown": return c.getString(R.string.state_unknown); case "": return c.getString(R.string.state_paused); } Log.w(TAG, "Unexpected folder state " + state); return ""; }</code><technical_language>this state exist..</technical_language>

Target:
private static String getLocalizedState(Context c, String state, int percentage) { switch (state) { case "idle": return c.getString(R.string.state_idle); case "scanning": return c.getString(R.string.state_scanning); case "syncing": return c.getString(R.string.state_syncing, percentage); case "error": return c.getString(R.string.state_error); case "unknown": return c.getString(R.string.state_unknown); default: return state; } }
Source:
<code>protected void onFinishInflate() { super.onFinishInflate(); View.inflate(getContext(), R.layout.merge_login_view, this); loginButton = Views.findById(this, R.id.sign_in_button); <START> loginButton.setSize(SignInButton.SIZE_WIDE); <END> }</code><technical_language>set in xml</technical_language>

Target:
protected void onFinishInflate() { super.onFinishInflate(); View.inflate(getContext(), R.layout.merge_login_view, this); loginButton = Views.findById(this, R.id.sign_in_button); }
Source:
<code>static int decodeInt(byte[] addr, int index) { <START> return ByteBuffer.wrap(addr, index, 4).getInt(); <END> }</code><technical_language>I suggest check endianess decode array reduce GC</technical_language>

Target:
static int decodeInt(byte[] addr, int index) { return (addr[index] & 0xff) << 24 | (addr[index + 1] & 0xff) << 16 | (addr[index + 2] & 0xff) << 8 | addr[index + 3] & 0xff; }
Source:
<code>private void resurrectCheckpoints() { ExecutorService executorService = Executors.newFixedThreadPool(numOfWorkers, new ThreadFactoryBuilder() .setNameFormat("FastObjectLoaderResurrectCheckpointsThread-%d").build()); CompletableFuture[] cfs = new CompletableFuture[streamsMetaData.size()]; int i = 0; try { for (Map.Entry<UUID, StreamMetaData> entry : streamsMetaData.entrySet()) { cfs[i++] = CompletableFuture.runAsync(() -> { CheckPoint checkPoint = null; try { checkPoint = entry.getValue().getLatestCheckPoint(); if (checkPoint == null) { log.info("resurrectCheckpoints[{}]: Truncated checkpoint for this stream", Utils.toReadableId(entry.getKey())); return; } for (long address : checkPoint.getAddresses()) { updateCorfuObject(getLogData(runtime, loadInCache, address)); } <START> } catch (Throwable t) { <END> if (checkPoint != null) { log.error("resurrectCheckpoints: error on addresses {}", checkPoint.getAddresses()); } log.error("resurrectCheckpoints: ", t); throw t; } }, executorService); } executorService.shutdown(); executorService.awaitTermination(timeoutInMinutesForLoading, TimeUnit.MINUTES); for (CompletableFuture future : cfs) { if (!future.isDone() || future.isCancelled() || future.isCompletedExceptionally()) { throw new FastObjectLoaderException("Failed to load checkpoints"); } } } catch (InterruptedException ie) { Thread.currentThread().interrupt(); throw new FastObjectLoaderException("Failed to resurrectCheckpoints"); } finally { executorService.shutdownNow(); } }</code><technical_language>Throwable is broad, more specific</technical_language>

Target:
private void resurrectCheckpoints() { ExecutorService executorService = Executors.newFixedThreadPool(numOfWorkers, new ThreadFactoryBuilder() .setNameFormat("FastObjectLoaderResurrectCheckpointsThread-%d").build()); CompletableFuture[] cfs = new CompletableFuture[streamsMetaData.size()]; int i = 0; try { for (Map.Entry<UUID, StreamMetaData> entry : streamsMetaData.entrySet()) { cfs[i++] = CompletableFuture.runAsync(() -> { CheckPoint checkPoint = entry.getValue().getLatestCheckPoint(); try { if (checkPoint == null) { log.info("resurrectCheckpoints[{}]: Truncated checkpoint for this stream", Utils.toReadableId(entry.getKey())); return; } for (long address : checkPoint.getAddresses()) { updateCorfuObject(getLogData(runtime, loadInCache, address)); } } catch (Throwable t) { log.error("resurrectCheckpoints[{}]: error on addresses {}", checkPoint.getCheckPointId(), checkPoint.getAddresses(), t); throw t; } }, executorService); } executorService.shutdown(); executorService.awaitTermination(timeoutInMinutesForLoading, TimeUnit.MINUTES); for (CompletableFuture future : cfs) { if (!future.isDone() || future.isCancelled() || future.isCompletedExceptionally()) { throw new FastObjectLoaderException("Failed to load checkpoints"); } } } catch (InterruptedException ie) { Thread.currentThread().interrupt(); throw new FastObjectLoaderException("Failed to resurrectCheckpoints"); } finally { executorService.shutdownNow(); } }
Source:
<code>public Message decodeLogData(@Nonnull final CloudWatchLogEvent logEvent, @Nonnull final String logGroup, @Nonnull final String logStream) { try { final FlowLogMessage flowLogMessage = FlowLogMessage.fromLogEvent(logEvent); if (flowLogMessage == null) { return null; } final String source = configuration.getString(CloudTrailCodec.Config.CK_OVERRIDE_SOURCE, "aws-flowlogs"); final Message result = new Message( buildSummary(flowLogMessage), source, flowLogMessage.getTimestamp() ); result.addFields(buildFields(flowLogMessage)); <START> result.addField("aws_log_group", logGroup); <END> result.addField("aws_log_stream", logStream); result.addField(AWS.SOURCE_GROUP_IDENTIFIER, true); return result; } catch (Exception e) { throw new RuntimeException("Could not deserialize AWS FlowLog record.", e); } }</code><technical_language>Please extract key names constants existing AWS class in CloudWatchFlowLogCodec in CloudWatchRawLogCodec</technical_language>

Target:
public Message decodeLogData(@Nonnull final CloudWatchLogEvent logEvent, @Nonnull final String logGroup, @Nonnull final String logStream) { try { final FlowLogMessage flowLogMessage = FlowLogMessage.fromLogEvent(logEvent); if (flowLogMessage == null) { return null; } final String source = configuration.getString(CloudTrailCodec.Config.CK_OVERRIDE_SOURCE, "aws-flowlogs"); final Message result = new Message( buildSummary(flowLogMessage), source, flowLogMessage.getTimestamp() ); result.addFields(buildFields(flowLogMessage)); result.addField(AWS.FIELD_LOG_GROUP, logGroup); result.addField(AWS.FIELD_LOG_STREAM, logStream); result.addField(AWS.SOURCE_GROUP_IDENTIFIER, true); return result; } catch (Exception e) { throw new RuntimeException("Could not deserialize AWS FlowLog record.", e); } }
Source:
<code>public FlatRow next() throws IOException { while (true) { try { FlatRow result = currentDelegate.next(); if (result != null) { requestManager.updateLastFoundKey(result.getRowKey()); currentErrorBackoff = null; <START> timeoutRetryCount = null; <END> } return result; } catch (ScanTimeoutException rte) { closeRpcContext(); closeCurrentDelegate(); ReadRowsRequest newRequest = handleScanTimeout(rte); currentDelegate = scannerFactory.createScanner(newRequest); this.rpcContext = rpcMetrics.timeRpc(); } catch (IOExceptionWithStatus ioe) { closeRpcContext(); closeCurrentDelegate(); ReadRowsRequest newRequest = handleIOException(ioe); currentDelegate = scannerFactory.createScanner(newRequest); this.rpcContext = rpcMetrics.timeRpc(); } } }</code><technical_language>error prone initialize AtomicInteger in constructor & set 0</technical_language>

Target:
public FlatRow next() throws IOException { while (true) { try { FlatRow result = currentDelegate.next(); if (result != null) { requestManager.updateLastFoundKey(result.getRowKey()); currentErrorBackoff = null; timeoutRetryCount = 0; } return result; } catch (ScanTimeoutException rte) { closeRpcContext(); closeCurrentDelegate(); ReadRowsRequest newRequest = handleScanTimeout(rte); currentDelegate = scannerFactory.createScanner(newRequest); this.rpcContext = rpcMetrics.timeRpc(); } catch (IOExceptionWithStatus ioe) { closeRpcContext(); closeCurrentDelegate(); ReadRowsRequest newRequest = handleIOException(ioe); currentDelegate = scannerFactory.createScanner(newRequest); this.rpcContext = rpcMetrics.timeRpc(); } } }
Source:
<code>private static Iterable<Long> getList(Context context) { Optional<String> strLists = new NullSafe<>(PreferenceManager.getDefaultSharedPreferences(context) .getString(PREFERENCE_KEY, null)); Log.v(RecentlyUsedLists.class.getSimpleName(), "getList: " + strLists.value("empty")); if (!strLists.isPresent()) { return new EmptyIterable<>(); } return new Mapped<>(cs -> Long.valueOf(cs.toString()), new Filtered<>( new Split(strLists.value(), ','), <START> Objects::nonNull)); <END> }</code><technical_language>This check sense. Split iterate null. need check for String "null". original issue a null reference, "null" string representation of a long value</technical_language>

Target:
private static List<Long> getList(Context context) { Optional<String> listStrOpt = new NullSafe<>(PreferenceManager.getDefaultSharedPreferences(context).getString(PREFERENCE_KEY, null)); Log.v(RecentlyUsedLists.class.getSimpleName(), "getList: " + listStrOpt.value("empty")); if (!listStrOpt.isPresent()) { return new ArrayList<>(0); } String listStr = listStrOpt.value(); if (listStr.contains("null")) { setList(context, toList(new Fluent<>(new Split(listStr, ',')) .mapped(Object::toString) .filtered(s -> !s.isEmpty()) .filtered(s -> !s.equals("null")) .mapped(Long::valueOf))); return getList(context); } return toList(new Fluent<>(new Split(listStr, ',')) .mapped(Object::toString) .filtered(s -> !s.isEmpty()) .mapped(Long::valueOf)); }
Source:
<code>public String toString() { ToStringHelper toStringHelper = toStringHelper(this) .add("outputSymbolAliases", this.outputSymbolAliases); <START> if (expectedOutputSymbolCount.isPresent()) { <END> toStringHelper.add("expectedOutputSymbolCount", expectedOutputSymbolCount); } if (expectedRows.isPresent()) { toStringHelper.add("expectedRows", expectedRows); } return toStringHelper.toString(); }</code><technical_language>do this fluently ToStringHelper.omitNulls(). I readability is better</technical_language>

Target:
public String toString() { return toStringHelper(this) .omitNullValues() .add("outputSymbolAliases", outputSymbolAliases) .add("expectedOutputSymbolCount", expectedOutputSymbolCount) .add("expectedRows", expectedRows) .toString(); }
Source:
<code>public void visitNode(Tree tree) { if (!hasSemantic()) { return; } ClassTree classTree = (ClassTree) tree; <START> if (isNonStatic(classTree)) { <END> List<MethodTree> methodsToAnalyze = Lists.newArrayList(); List<VariableSymbol> staticNonFinalFields = Lists.newArrayList(); extractMembers(classTree, staticNonFinalFields, methodsToAnalyze); checkMethods(staticNonFinalFields, methodsToAnalyze); } }</code><technical_language>static of class matters</technical_language>

Target:
public void visitNode(Tree tree) { super.visitNode(tree); if (tree.is(Kind.METHOD)) { withinStaticMethod.push(isMethodStatic((MethodTree) tree)); } else if (hasSemantic() && !isInSyncBlock() && isInInstancecMethod()) { if (tree.is(ASSIGNMENT_EXPRESSIONS)) { checkAssignement(((AssignmentExpressionTree) tree).variable()); } else if (tree.is(UNARY_EXPRESSIONS)) { checkAssignement(((UnaryExpressionTree) tree).expression()); } } }
Source:
<code>private CompletableFuture<Boolean> updatedSharedWithCache(FileWrapper file, Set<String> usersToAdd, SharedWithCache.Access access) { return file.getPath(network).thenCompose(path -> { <START> network.sharedWithCache.addSharedWith(access, file.getPointer().capability, usersToAdd); <END> CompletableFuture<Boolean> res = new CompletableFuture<>(); res.complete(true); return res; }); }</code><technical_language>path required</technical_language>

Target:
private CompletableFuture<Boolean> updatedSharedWithCache(FileWrapper file, Set<String> usersToAdd, SharedWithCache.Access access) { sharedWithCache.addSharedWith(access, file.getPointer().capability, usersToAdd); CompletableFuture<Boolean> res = new CompletableFuture<>(); res.complete(true); return res; }
Source:
<code>private GlusterVolumeTaskStatusEntity fetchTaskStatusDetails() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeRebalanceStatus, new GlusterVolumeVDSParameters(getUpServerId(clusterId), volume.getName())); GlusterVolumeTaskStatusEntity entity = (GlusterVolumeTaskStatusEntity)returnValue.getReturnValue(); <START> List<Step> stepsList = getDbFacade().getStepDao().getStepsByExternalId(volume.getAsyncTask().getStepId()); <END> if (stepsList != null && !stepsList.isEmpty()) { entity.setStartTime(stepsList.get(0).getStartTime()); } return entity; }</code><technical_language>Please add null check for volume.getAsyncTask()</technical_language>

Target:
private GlusterVolumeTaskStatusEntity fetchTaskStatusDetails() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeRebalanceStatus, new GlusterVolumeVDSParameters(getUpServerId(clusterId), volume.getName())); GlusterVolumeTaskStatusEntity entity = (GlusterVolumeTaskStatusEntity)returnValue.getReturnValue(); List<Step> stepsList = getDbFacade().getStepDao().getStepsByExternalId(asyncTask.getStepId()); if (stepsList != null && !stepsList.isEmpty()) { entity.setStartTime(stepsList.get(0).getStartTime()); } return entity; }
Source:
<code>public <T> void query() throws Exception { String query = "SELECT * FROM r"; Consumer<CosmosAsyncContainer> func = (container) -> { InternalObjectNode docDefinition = getDocumentDefinition(); container.createItem(docDefinition).block(); CosmosQueryRequestOptions requestOptions = new CosmosQueryRequestOptions(); <START> CosmosPagedFlux<InternalObjectNode> queryFlux = container.queryItems(query, requestOptions, InternalObjectNode.class); <END> FeedResponseListValidator<InternalObjectNode> queryValidator = new FeedResponseListValidator.Builder<InternalObjectNode>() .totalSize(1) .numberOfPages(1) .build(); validateQuerySuccess(queryFlux.byPage(10), queryValidator); }; createDeleteContainerWithSameName(func); }</code><technical_language>InternalObjectNode is internal construct, please in new tests? a Pojo Object bellow ObjectNode. java static class POJO { public String mypk; public String id; } I some of existing tests InternalObjectNode, for new tests InternalObjectNode</technical_language>

Target:
public <T> void query() throws Exception { String query = "SELECT * FROM r"; Consumer<CosmosAsyncContainer> func = (container) -> { TestObject docDefinition = getDocumentDefinition(); container.createItem(docDefinition).block(); CosmosQueryRequestOptions requestOptions = new CosmosQueryRequestOptions(); CosmosPagedFlux<TestObject> queryFlux = container.queryItems(query, requestOptions, TestObject.class); FeedResponseListValidator<TestObject> queryValidator = new FeedResponseListValidator.Builder<TestObject>() .totalSize(1) .numberOfPages(1) .build(); validateQuerySuccess(queryFlux.byPage(10), queryValidator); }; createDeleteContainerWithSameName(func); }
Source:
<code>public int process(boolean shouldForceWrite) throws IOException { forceWriteQueueSize.dec(); if (isMarker) { return 0; } try { if (shouldForceWrite) { long startTime = MathUtils.nowInNano(); this.logFile.forceWrite(false); journalSyncStats.registerSuccessfulEvent(MathUtils.elapsedNanos(startTime), TimeUnit.NANOSECONDS); } <START> LOG.info("setCurLogMark at {}", lastLogMark.getCurMark()); <END> LOG.info("setCurLogMark at {}, {}", this.logId, this.lastFlushedPosition); lastLogMark.setCurLogMark(this.logId, this.lastFlushedPosition); for (int i = 0; i < forceWriteWaiters.size(); i++) { QueueEntry qe = forceWriteWaiters.get(i); if (qe != null) { cbThreadPool.execute(qe); } } return forceWriteWaiters.size(); } finally { closeFileIfNecessary(); } }</code><technical_language>reason add logging lines</technical_language>

Target:
public int process(boolean shouldForceWrite) throws IOException { forceWriteQueueSize.dec(); if (isMarker) { return 0; } try { if (shouldForceWrite) { long startTime = MathUtils.nowInNano(); this.logFile.forceWrite(false); journalSyncStats.registerSuccessfulEvent(MathUtils.elapsedNanos(startTime), TimeUnit.NANOSECONDS); } LOG.info("setCurLogMark at {}", lastLogMark.getCurMark()); LOG.info("setCurLogMark at {}, {}", this.logId, this.lastFlushedPosition); lastLogMark.setCurLogMark(this.logId, this.lastFlushedPosition); for (int i = 0; i < forceWriteWaiters.size(); i++) { QueueEntry qe = forceWriteWaiters.get(i); if (qe != null) { cbThreadPool.execute(qe); } journalCbQueueSize.inc(); } return forceWriteWaiters.size(); } finally { closeFileIfNecessary(); } }
Source:
<code><START> public void execute() throws InsufficientCapacityException, ConcurrentOperationException { <END> User callerUser = _accountService.getActiveUser(CallContext.current().getCallingUserId()); Account callerAccount = _accountService.getActiveAccountById(callerUser.getAccountId()); Vpc result = _networkService.migrateVpcNetwork(getId(), getVpcOfferingId(), getTierNetworkOfferings(), callerAccount, callerUser, getResume()); if (result != null) { VpcResponse response = _responseGenerator.createVpcResponse(ResponseObject.ResponseView.Restricted, result); response.setResponseName(getCommandName()); setResponseObject(response); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to migrate vpc"); } }</code><technical_language>exceptions needed</technical_language>

Target:
public void execute() { User callerUser = _accountService.getActiveUser(CallContext.current().getCallingUserId()); Account callerAccount = _accountService.getActiveAccountById(callerUser.getAccountId()); Vpc result = _networkService.migrateVpcNetwork(getId(), getVpcOfferingId(), getTierNetworkOfferings(), callerAccount, callerUser, getResume()); if (result != null) { VpcResponse response = _responseGenerator.createVpcResponse(ResponseObject.ResponseView.Restricted, result); response.setResponseName(getCommandName()); setResponseObject(response); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to migrate vpc"); } }
Source:
<code>private void vmInitEnabledChanged() { if(!getVmInitEnabled().getEntity()) { getSysprepEnabled().setEntity(false); getCloudInitEnabled().setEntity(false); } else { getSysprepEnabled().setEntity(getIsWindowsOS()); getCloudInitEnabled().setEntity(!getIsWindowsOS()); autoSetHostname(); if (getSysprepEnabled().getEntity()) { <START> getVmInitModel().updateSysprepDomain(null); <END> } } }</code><technical_language>do this: getVmInitModel().updateSysprepDomain(getVmInitModel().getSysprepDomain().getSelectedItem()); consistent rest of dialog of sysprep config (e.g. submitting dialog do: enable sysprep, add a domain, disable sysprep, enable sysprep -> domain is there)</technical_language>

Target:
private void vmInitEnabledChanged() { if(!getVmInitEnabled().getEntity()) { getSysprepEnabled().setEntity(false); getCloudInitEnabled().setEntity(false); } else { getSysprepEnabled().setEntity(getIsWindowsOS()); getCloudInitEnabled().setEntity(!getIsWindowsOS()); autoSetHostname(); if (getSysprepEnabled().getEntity()) { getVmInitModel().updateSysprepDomain(getVmInitModel().getSysprepDomain().getSelectedItem()); } } }
Source:
<code>public boolean mkdirs(Path f, FsPermission permission) throws IOException { LOG.trace("mkdir() path:{} ", f); String key = pathToKey(f); <START> if (StringUtils.isEmpty(key)) { <END> return false; } return mkdir(f); }</code><technical_language>earlier isEmpty</technical_language>

Target:
public boolean mkdirs(Path f, FsPermission permission) throws IOException { LOG.trace("mkdir() path:{} ", f); String key = pathToKey(f); if (isEmpty(key)) { return false; } return mkdir(f); }
Source:
<code>protected boolean validateSignature(SignedJWT jwtToken) { boolean valid = false; if (JWSObject.State.SIGNED == jwtToken.getState()) { if (jwtToken.getSignature() != null) { try { RSAPublicKey publicKey = parseRSAPublicKey(publicKeyPath); JWSVerifier verifier = new RSASSAVerifier(publicKey); if (verifier != null && jwtToken.verify(verifier)) { valid = true; } else { <START> <END> } } catch (Exception e) { LOGGER.info("Exception in validateSignature nothing to worry", e); } } } return valid; }</code><technical_language>Log</technical_language>

Target:
protected boolean validateSignature(SignedJWT jwtToken) { boolean valid = false; if (JWSObject.State.SIGNED == jwtToken.getState()) { if (jwtToken.getSignature() != null) { try { RSAPublicKey publicKey = parseRSAPublicKey(publicKeyPath); JWSVerifier verifier = new RSASSAVerifier(publicKey); if (verifier != null && jwtToken.verify(verifier)) { valid = true; } } catch (Exception e) { LOGGER.info("Exception in validateSignature", e); } } } return valid; }
Source:
<code>public void dumpTopRequestPath(PrintWriter pwriter, String requestTypeName, int queryMaxDepth) { <START> if (queryMaxDepth < 1) return; <END> PathStatsQueue pathStatsQueue = immutableRequestsMap.get(requestTypeName); if (pathStatsQueue == null) { pwriter.println("Can not find path stats for type: " + requestTypeName); return; } else { pwriter.println("The top requests of type: " + requestTypeName); } Map<String, Integer> combinedMap; final int maxDepth = Math.min(queryMaxDepth, REQUEST_PREPROCESS_PATH_DEPTH); combinedMap = pathStatsQueue.collectStats(maxDepth); logTopPaths(combinedMap, entry -> pwriter.println(entry.getKey() + " : " + entry.getValue())); }</code><technical_language>nit: add curly braces</technical_language>

Target:
public void dumpTopRequestPath(PrintWriter pwriter, String requestTypeName, int queryMaxDepth) { if (queryMaxDepth < 1) { return; } PathStatsQueue pathStatsQueue = immutableRequestsMap.get(requestTypeName); if (pathStatsQueue == null) { pwriter.println("Can not find path stats for type: " + requestTypeName); return; } else { pwriter.println("The top requests of type: " + requestTypeName); } Map<String, Integer> combinedMap; final int maxDepth = Math.min(queryMaxDepth, REQUEST_PREPROCESS_PATH_DEPTH); combinedMap = pathStatsQueue.collectStats(maxDepth); logTopPaths(combinedMap, entry -> pwriter.println(entry.getKey() + " : " + entry.getValue())); }
Source:
<code>public void testCalculationOfTaskExecutorUtilization() throws Exception { try (final SlotPoolImpl slotPool = createAndSetUpSlotPool()) { slotPool.registerTaskManager(taskManagerLocation.getResourceID()); final TaskManagerLocation firstTaskManagerLocation = new LocalTaskManagerLocation(); final TaskManagerLocation secondTaskManagerLocation = new LocalTaskManagerLocation(); <START> final List<AllocationID> firstTaskManagersSlots = offerSlots(firstTaskManagerLocation, slotPool, 4); <END> final List<AllocationID> secondTaskManagersSlots = offerSlots(secondTaskManagerLocation, slotPool, 4); slotPool.allocateAvailableSlot(new SlotRequestId(), firstTaskManagersSlots.get(0)); slotPool.allocateAvailableSlot(new SlotRequestId(), firstTaskManagersSlots.get(1)); slotPool.allocateAvailableSlot(new SlotRequestId(), secondTaskManagersSlots.get(3)); final Collection<SlotInfoWithUtilization> availableSlotsInformation = slotPool.getAvailableSlotsInformation(); final Map<TaskManagerLocation, Double> utilizationPerTaskExecutor = ImmutableMap.of( firstTaskManagerLocation, 2.0 / 4, secondTaskManagerLocation, 1.0 / 4); for (SlotInfoWithUtilization slotInfoWithUtilization : availableSlotsInformation) { final double expectedTaskExecutorUtilization = utilizationPerTaskExecutor.get(slotInfoWithUtilization.getTaskManagerLocation()); assertThat(slotInfoWithUtilization.getTaskExecutorUtilization(), is(closeTo(expectedTaskExecutorUtilization, 0.1))); } } }</code><technical_language>changing registerAndOfferSlots offerSlots? IIRC, a location registered offering slots it</technical_language>

Target:
public void testCalculationOfTaskExecutorUtilization() throws Exception { try (final SlotPoolImpl slotPool = createAndSetUpSlotPool(resourceManagerGateway)) { final TaskManagerLocation firstTaskManagerLocation = new LocalTaskManagerLocation(); final TaskManagerLocation secondTaskManagerLocation = new LocalTaskManagerLocation(); final List<AllocationID> firstTaskManagersSlots = registerAndOfferSlots(firstTaskManagerLocation, slotPool, 4); final List<AllocationID> secondTaskManagersSlots = registerAndOfferSlots(secondTaskManagerLocation, slotPool, 4); slotPool.allocateAvailableSlot(new SlotRequestId(), firstTaskManagersSlots.get(0)); slotPool.allocateAvailableSlot(new SlotRequestId(), firstTaskManagersSlots.get(1)); slotPool.allocateAvailableSlot(new SlotRequestId(), secondTaskManagersSlots.get(3)); final Collection<SlotInfoWithUtilization> availableSlotsInformation = slotPool.getAvailableSlotsInformation(); final Map<TaskManagerLocation, Double> utilizationPerTaskExecutor = ImmutableMap.of( firstTaskManagerLocation, 2.0 / 4, secondTaskManagerLocation, 1.0 / 4); for (SlotInfoWithUtilization slotInfoWithUtilization : availableSlotsInformation) { final double expectedTaskExecutorUtilization = utilizationPerTaskExecutor.get(slotInfoWithUtilization.getTaskManagerLocation()); assertThat(slotInfoWithUtilization.getTaskExecutorUtilization(), is(closeTo(expectedTaskExecutorUtilization, 0.1))); } } }
Source:
<code>public void testOperatorsImplemented() { for (Type type : typeRegistry.getTypes()) { if (type.isComparable()) { Stream.of(IS_DISTINCT_FROM, EQUAL, NOT_EQUAL) <START> .forEach(operatorType -> functionRegistry.resolveOperator(operatorType, ImmutableList.of(type, type))); <END> functionRegistry.resolveOperator(HASH_CODE, ImmutableList.of(type)); } if (type.isOrderable()) { Stream.of(GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL) .forEach(operatorType -> functionRegistry.resolveOperator(operatorType, ImmutableList.of(type, type))); } } }</code><technical_language>putting operator line, this: functionRegistry.resolveOperator(EQUAL, ImmutableList.of(type, type)); functionRegistry.resolveOperator(NOT_EQUAL, ImmutableList.of(type, type)); functionRegistry.resolveOperator(IS_DISTINCT_FROM, ImmutableList.of(type, type)) I repetition pretty minimal. easier for readers understand is missing this test fails. ditto for orderable operators</technical_language>

Target:
public void testOperatorsImplemented() { for (Type type : typeRegistry.getTypes()) { if (type.isComparable()) { functionRegistry.resolveOperator(EQUAL, ImmutableList.of(type, type)); functionRegistry.resolveOperator(NOT_EQUAL, ImmutableList.of(type, type)); functionRegistry.resolveOperator(IS_DISTINCT_FROM, ImmutableList.of(type, type)); functionRegistry.resolveOperator(HASH_CODE, ImmutableList.of(type)); } if (type.isOrderable()) { functionRegistry.resolveOperator(LESS_THAN, ImmutableList.of(type, type)); functionRegistry.resolveOperator(LESS_THAN_OR_EQUAL, ImmutableList.of(type, type)); functionRegistry.resolveOperator(GREATER_THAN_OR_EQUAL, ImmutableList.of(type, type)); functionRegistry.resolveOperator(GREATER_THAN, ImmutableList.of(type, type)); } } }
Source:
<code>private Session getSession(URI sessionModelURI, boolean restore) { Session sessionFromURI = null; try { sessionFromURI = SessionManager.INSTANCE.getExistingSession(sessionModelURI); sessionFromURI = <START> trySessionOpening(sessionModelURI, restore); <END> } catch (SiriusResourceVersionMismatchException e) { UICallBack uiCallback = SiriusEditPlugin.getPlugin().getUiCallback(); if (uiCallback != null && uiCallback.askSessionReopeningWithResourceVersionMismatch(e)) { try { MigrationUtil.ignoreVersionMismatch = true; sessionFromURI = trySessionOpening(sessionModelURI, restore); } catch (OperationCanceledException ex) { sessionFromURI = null; status = new Status(IStatus.CANCEL, SiriusEditPlugin.ID, ex.getLocalizedMessage(), ex); } catch (RuntimeException ex) { sessionFromURI = null; status = new Status(IStatus.ERROR, SiriusEditPlugin.ID, ex.getLocalizedMessage(), ex); } finally { MigrationUtil.ignoreVersionMismatch = false; } } } catch (OperationCanceledException e) { sessionFromURI = null; status = new Status(IStatus.CANCEL, SiriusEditPlugin.ID, e.getLocalizedMessage(), e); } catch (RuntimeException e) { sessionFromURI = null; status = new Status(IStatus.ERROR, SiriusEditPlugin.ID, e.getLocalizedMessage(), e); } return sessionFromURI; }</code><technical_language>IMO, put in trySessionOpening getSessionInstruction SiriusResourceVersionMismatchException retry. open, uiSession creation opening. This simplify modified code avoid double try catch duplicated code</technical_language>

Target:
private Session getSession(URI sessionModelURI, boolean restore) { Session sessionFromURI; try { sessionFromURI = SessionManager.INSTANCE.getExistingSession(sessionModelURI); if (sessionFromURI == null && restore) { status = Status.OK_STATUS; sessionFromURI = attemptSessionGetting(sessionModelURI); if (sessionFromURI != null && !sessionFromURI.isOpen()) { sessionFromURI.open(new NullProgressMonitor()); } } if (sessionFromURI != null && sessionFromURI.isOpen()) { IEditingSession uiSession = SessionUIManager.INSTANCE.getUISession(sessionFromURI); if (uiSession == null && restore) { uiSession = SessionUIManager.INSTANCE.getOrCreateUISession(sessionFromURI); } if (uiSession != null && !uiSession.isOpen()) { uiSession.open(); } } } catch (OperationCanceledException e) { sessionFromURI = null; status = new Status(IStatus.CANCEL, SiriusEditPlugin.ID, e.getLocalizedMessage(), e); } catch (RuntimeException e) { sessionFromURI = null; status = new Status(IStatus.ERROR, SiriusEditPlugin.ID, e.getLocalizedMessage(), e); } return sessionFromURI; }
Source:
<code>public void init(Cache<?, ?> cache, GlobalConfiguration globalConfiguration, Configuration configuration, GlobalSecurityManager globalSecurityManager) { <START> this.globalConfiguration = globalConfiguration.security(); <END> this.configuration = configuration.security().authorization(); this.authzHelper = new AuthorizationHelper(this.globalConfiguration, AuditContext.CACHE, cache.getName(), globalSecurityManager.getGlobalACLCache()); }</code><technical_language>converted a local variable</technical_language>

Target:
public void init(Cache<?, ?> cache, GlobalConfiguration globalConfiguration, Configuration configuration, GlobalSecurityManager globalSecurityManager) { this.configuration = configuration.security().authorization(); this.authzHelper = new AuthorizationHelper(globalConfiguration.security(), AuditContext.CACHE, cache.getName(), (ConcurrentMap<CachePrincipalPair, SubjectACL>) globalSecurityManager.globalACLCache()); }