auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void dispatch() { if (isDbInBadState()) { return; } if (CommCareApplication._().isConsumerApp() && !alreadyCheckedForAppFilesChange) { checkForChangedCCZ(); } CommCareApp currentApp = CommCareApplication._().getCurrentApp(); if (currentApp == null) { if (CommCareApplication._().usableAppsPresent()) { CommCareApplication._().initFirstUsableAppRecord(); dispatch(); } else { Intent i = new Intent(getApplicationContext(), CommCareSetupActivity.class); this.startActivityForResult(i, INIT_APP); } } else { try { CommCareApplication._().getSession(); } catch (SessionUnavailableException sue) { launchLoginScreen(); } ApplicationRecord currentRecord = currentApp.getAppRecord(); <START> if (currentApp.getAppResourceState() == CommCareApplication.STATE_CORRUPTED) { <END> handleDamagedApp(); } else if (!currentRecord.isUsable()) { boolean unseated = handleUnusableApp(currentRecord); if (unseated) { dispatch(); } } else if (this.getIntent().hasExtra(SESSION_REQUEST)) { handleExternalLaunch(); } else if (this.getIntent().hasExtra(AndroidShortcuts.EXTRA_KEY_SHORTCUT) && !shortcutExtraWasConsumed) { handleShortcutLaunch(); } else { launchHomeScreen(); } } }</code><technical_language>Hm, I originally wrote this, I intentionally ordered check for 2 states (if app resource state is corrupted, currently seated app is usable), _before_ checking for session expiration, end login screen a corrupted unusable app seated app. I hard evidence this is necessary, I want preserve behavior</technical_language>

Target:
private void dispatch() { if (isDbInBadState()) { return; } if (CommCareApplication._().isConsumerApp() && !alreadyCheckedForAppFilesChange) { checkForChangedCCZ(); } CommCareApp currentApp = CommCareApplication._().getCurrentApp(); if (currentApp == null) { if (CommCareApplication._().usableAppsPresent()) { CommCareApplication._().initFirstUsableAppRecord(); dispatch(); } else { Intent i = new Intent(getApplicationContext(), CommCareSetupActivity.class); this.startActivityForResult(i, INIT_APP); } } else { ApplicationRecord currentRecord = currentApp.getAppRecord(); try { if (currentApp.getAppResourceState() == CommCareApplication.STATE_CORRUPTED) { handleDamagedApp(); } else if (!currentRecord.isUsable()) { boolean unseated = handleUnusableApp(currentRecord); if (unseated) { dispatch(); } } else if (!CommCareApplication._().getSession().isActive()) { launchLoginScreen(); } else if (this.getIntent().hasExtra(SESSION_REQUEST)) { handleExternalLaunch(); } else if (this.getIntent().hasExtra(AndroidShortcuts.EXTRA_KEY_SHORTCUT) && !shortcutExtraWasConsumed) { handleShortcutLaunch(); } else { launchHomeScreen(); } } catch (SessionUnavailableException sue) { launchLoginScreen(); } } }
Source:
<code>private static boolean isValidRefExpression(final String s) { if (RefSpec.isWildcard(s)) { <START> return isValidRefExpression(s.replace('*', 'X')); <END> } else return Repository.isValidRefName(s) || Repository.isValidRefName(Constants.R_HEADS + s) || Repository.isValidRefName(Constants.R_TAGS + s); }</code><technical_language>A RefSpec src destination '*', is invalid. change, "refs/*/*" pass, though. Call RefSpec.isValid(s) wildcard replacement</technical_language>

Target:
private static boolean isValidRefExpression(final String s) { if (RefSpec.isWildcard(s)) { if (s.indexOf('*', s.indexOf('*') + 1) >= 0) { return false; } return isValidRefExpression(s.replace('*', 'X')); } else return Repository.isValidRefName(s) || Repository.isValidRefName(Constants.R_HEADS + s) || Repository.isValidRefName(Constants.R_TAGS + s); }
Source:
<code>public void controlResized(@Nullable ControlEvent e) { refreshDisplayTitles(); refreshDisplayLabels(); <START> fCloseButton.setLocation(fChart.getSize().x - fCloseButton.getSize().x - 5, 5); <END> }</code><technical_language>explain 5s</technical_language>

Target:
public void controlResized(@Nullable ControlEvent e) { refreshDisplayTitles(); refreshDisplayLabels(); fCloseButton.setLocation(fChart.getSize().x - fCloseButton.getSize().x - CLOSE_BUTTON_MARGIN, CLOSE_BUTTON_MARGIN); }
Source:
<code>public static <T extends Collection<E>,E> T deepMerge(final Iterable<? extends Iterable<?>> iterableOfIterables, final T collectionToFill) { Iterator<? extends Iterable<?>> iterator = iterableOfIterables.iterator(); <START> if (!iterator.hasNext()) { <END> return collectionToFill; } while (iterator.hasNext()) { deepMergeRecursion(iterator.next(), collectionToFill); } return collectionToFill; }</code><technical_language>This if statement is necessary while loop handle negative case</technical_language>

Target:
public static <T extends Collection<E>,E> T deepMerge(final Iterable<? extends Iterable<?>> iterableOfIterables, final T collectionToFill) { Iterator<? extends Iterable<?>> iterator = iterableOfIterables.iterator(); while (iterator.hasNext()) { deepMergeRecursion(iterator.next(), collectionToFill); } return collectionToFill; }
Source:
<code>private String concatenateList(final List<String> values) { <START> <END> StringBuilder builder = new StringBuilder(); for (int i = 0; i < values.size(); i++) { String value = values.get(i); builder.append(value); if (i < values.size() - 1) { builder.append(","); } } return builder.toString(); }</code><technical_language>foreach loop, append comma resize stringbuilder => shorter, clearer code, more efficient :)</technical_language>

Target:
private String concatenateList(final List<String> values) { StringBuilder builder = new StringBuilder(); for (String value : values) { builder.append(value); builder.append(","); } builder.setLength(Math.max(builder.length() - 1, 0)); return builder.toString(); }
Source:
<code><START> public static List<Field> getFields(final Class<?> sourceType) throws IllegalAccessException { <END> return Stream.of(sourceType.getDeclaredFields()).collect(Collectors.toList()); }</code><technical_language>IllegalAccessException is thrown, SecurityException</technical_language>

Target:
public static List<Field> getFields(final Class<?> sourceType) throws SecurityException { return Stream.of(sourceType.getDeclaredFields()).collect(Collectors.toList()); }
Source:
<code>private static int calculateValue(JavaContext context, Expression expression) { if (expression instanceof IntegralLiteral) { return ((IntegralLiteral) expression).astIntValue(); } JavaParser.ResolvedNode resolvedNode = context.resolve(expression); <START> if (resolvedNode instanceof JavaParser.ResolvedField) { <END> Object value = ((JavaParser.ResolvedField) resolvedNode).getValue(); if (value instanceof Integer) { return (Integer) value; } } if (expression instanceof BinaryExpression) { BinaryExpression binaryExpression = (BinaryExpression) expression; String operator = binaryExpression.astOperator().getSymbol(); int leftValue = calculateValue(context, binaryExpression.astLeft()); int rightValue = calculateValue(context, binaryExpression.astRight()); if (operator.equals("|")) { return leftValue | rightValue; } if (operator.equals("&")) { return leftValue & rightValue; } if (operator.equals("^")) { return leftValue ^ rightValue; } } return 0; }</code><technical_language>you, I prefer import classes (ResolvedField, ResolvedVariable etc)</technical_language>

Target:
private static int calculateValue(JavaContext context, Expression expression) { if (expression instanceof IntegralLiteral) { return ((IntegralLiteral) expression).astIntValue(); } ResolvedNode resolvedNode = context.resolve(expression); if (resolvedNode instanceof ResolvedField) { Object value = ((ResolvedField) resolvedNode).getValue(); if (value instanceof Integer) { return (Integer) value; } } if (expression instanceof BinaryExpression) { BinaryExpression binaryExpression = (BinaryExpression) expression; BinaryOperator operator = binaryExpression.astOperator(); int leftValue = calculateValue(context, binaryExpression.astLeft()); int rightValue = calculateValue(context, binaryExpression.astRight()); if (operator == BinaryOperator.BITWISE_OR) { return leftValue | rightValue; } if (operator == BinaryOperator.BITWISE_AND) { return leftValue & rightValue; } if (operator == BinaryOperator.BITWISE_XOR) { return leftValue ^ rightValue; } } return 0; }
Source:
<code>private void readVector(ColumnReader reader, ColumnVector vector, long current, long total) { ColumnDescriptor column = reader.getDescriptor(); int maxDefinitionLevel = column.getMaxDefinitionLevel(); int index = 0; int fixedLenByteArrayPosition = 0; for ( ; index < ColumnVector.DEFAULT_VECTOR_LENGTH; index++, current++) { if (current >= total) { vector.setNumberOfValues(index); <START> return; <END> } if (reader.getCurrentDefinitionLevel() == maxDefinitionLevel) { switch (column.getType()) { case BOOLEAN: BooleanColumnVector booleanColumnVector = (BooleanColumnVector) vector; booleanColumnVector.values[index] = reader.getBoolean(); break; case DOUBLE: DoubleColumnVector doubleColumnVector = (DoubleColumnVector) vector; doubleColumnVector.values[index] = reader.getDouble(); break; case FLOAT: FloatColumnVector floatColumnVector = (FloatColumnVector) vector; floatColumnVector.values[index] = reader.getFloat(); break; case INT32: IntColumnVector intColumnVector = (IntColumnVector) vector; intColumnVector.values[index] = reader.getInteger(); break; case INT64: LongColumnVector longColumnVector = (LongColumnVector) vector; longColumnVector.values[index] = reader.getLong(); break; case INT96: case FIXED_LEN_BYTE_ARRAY: ByteColumnVector fixedLenVector = (ByteColumnVector) vector; byte[] fixedLenBinary = reader.getBinary().getBytes(); System.arraycopy(fixedLenBinary, 0, fixedLenVector.values, fixedLenByteArrayPosition, fixedLenBinary.length); fixedLenByteArrayPosition += fixedLenBinary.length; break; default: throw new IllegalArgumentException("Unhandled column type " + column.getType()); } vector.isNull[index] = false; } else { vector.isNull[index] = true; } reader.consume(); } vector.setNumberOfValues(index); }</code><technical_language>add end condition for loop? index < ColumnVector.DEFAULT_VECTOR_LENGTH || index >= total</technical_language>

Target:
private void readVector(ColumnReader reader, ColumnVector vector, long current, long total) { ColumnDescriptor column = reader.getDescriptor(); int maxDefinitionLevel = column.getMaxDefinitionLevel(); int index = 0; for ( ; index < ColumnVector.MAX_VECTOR_LENGTH && current < total; index++, current++) { if (reader.getCurrentDefinitionLevel() == maxDefinitionLevel) { vector.readFrom(reader, index); vector.isNull[index] = false; } else { vector.isNull[index] = true; } reader.consume(); } vector.setNumberOfValues(index); }
Source:
<code>public RawQuery build() { <START> Checks.checkNotEmpty(query, "Please specify query string"); <END> return new RawQuery( query, args, tables ); }</code><technical_language>Static import</technical_language>

Target:
public RawQuery build() { checkNotEmpty(query, "Please specify query string"); return new RawQuery( query, args, tables ); }
Source:
<code>private static <T> T nonNullOrEqual(@Nullable T a, @Nullable T b, String errorMessageTemplate) throws ValidationException { if (a == null) { <START> return b; <END> } else { if (b == null || a.equals(b)) { return a; } else { throw new ValidationException(String.format(errorMessageTemplate, a, b)); } } }</code><technical_language>potentially return null if are. is ok</technical_language>

Target:
private static <T> T nonNullOrEqual(@Nullable T a, @Nullable T b, String errorMessageTemplate) throws ValidationException { if (a == null) { return b; } else if (b == null || a.equals(b)) { return a; } else { throw new ValidationException(String.format(errorMessageTemplate, a, b)); } }
Source:
<code>public String description() { return "Will collect information about the system and package everything in an archive. If you specify 'all', " + "everything will be included. You can also fine tune the selection by passing classifiers to the tool, " + "e.g 'logs tx threads'. For a complete list of all available classifiers call the tool with " + <START> "the '--list' flag. If no classifiers are passed, the default list of `logs configs` will be used." ; END> }</code><technical_language>nice if default list accessible constant this string include, out of sync in future</technical_language>

Target:
public String description() { return "Will collect information about the system and package everything in an archive. If you specify 'all', " + "everything will be included. You can also fine tune the selection by passing classifiers to the tool, " + "e.g 'logs tx threads'. For a complete list of all available classifiers call the tool with " + "the '--list' flag. If no classifiers are passed, the default list of `" + String.join( " ", DEFAULT_CLASSIFIERS ) + "` will be used." ; }
Source:
<code>public void testMultithreadAddGetDisjointRanges() throws InterruptedException { final int numAddThreads = 8; final int numGetThreads = 8; final int addsPerThread = 100000; final int getsPerThread = 100; final int totalNumberOfAdds = numAddThreads * addsPerThread; final CountDownLatch countDownLatch = new CountDownLatch(numAddThreads + numGetThreads); final Runnable[] threads = new Runnable[numAddThreads + numGetThreads]; for (int index = 0; index < numAddThreads; index++) { <START> threads[index] =new AddThread(countDownLatch, partitionManager, <END> index, numAddThreads, addsPerThread, IndexParity.ALL_INDEX); } for (int index = 0; index < numGetThreads; index++) { threads[index + numAddThreads] = new GetThread(countDownLatch, partitionManager, getsPerThread); } TestUtils.runConcurrently(threads); final boolean allThreadsFinished = countDownLatch.await(60, TimeUnit.SECONDS); assertTrue(MSG_THREADS_NOT_FINISHED, allThreadsFinished); assertEquals(MSG_SIZE_ASSERTION_FAIL, totalNumberOfAdds, partitionManager.getRangeSet(EVAL_ID, KEY).size()); }</code><technical_language>Add space = new</technical_language>

Target:
public void testMultithreadAddGetDisjointRanges() throws InterruptedException { final int numThreadsPerOperation = 8; final int addsPerThread = 100000; final int getsPerThread = 100; final int totalNumberOfAdds = numThreadsPerOperation * addsPerThread; final CountDownLatch countDownLatch = new CountDownLatch(2 * numThreadsPerOperation); final Runnable[] threads = new Runnable[2 * numThreadsPerOperation]; for (int index = 0; index < numThreadsPerOperation; index++) { threads[2 * index] = new RegisterThread(countDownLatch, partitionManager, index, numThreadsPerOperation, addsPerThread, IndexParity.ALL_INDEX); threads[2 * index + 1] = new GetThread(countDownLatch, partitionManager, getsPerThread); } TestUtils.runConcurrently(threads); final boolean allThreadsFinished = countDownLatch.await(60, TimeUnit.SECONDS); assertTrue(MSG_THREADS_NOT_FINISHED, allThreadsFinished); assertEquals(MSG_SIZE_ASSERTION, totalNumberOfAdds, partitionManager.getRangeSet(EVAL_ID, DATA_TYPE).size()); }
Source:
<code>public void testLineBreak() { builder.beginDocument(); builder.beginBlock(BlockType.PARAGRAPH, new Attributes()); builder.characters("line"); builder.lineBreak(); builder.characters("break"); builder.endBlock(); builder.endDocument(); String markup = out.toString(); TestUtil.println(markup); <START> assertEquals("line \nbreak\n\n", markup); <END> }</code><technical_language>re: spaces</technical_language>

Target:
public void testLineBreak() { builder.beginDocument(); builder.beginBlock(BlockType.PARAGRAPH, new Attributes()); builder.characters("line"); builder.lineBreak(); builder.characters("break"); builder.endBlock(); builder.endDocument(); assertMarkup("line \nbreak\n\n"); }
Source:
<code>default <R> Task<R> map(final Function1<? super T, ? extends R> func) { <START> return map("map: " + func.getClass().getName(), func); <END> }</code><technical_language>Accidental white spaces</technical_language>

Target:
default <R> Task<R> map(final Function1<? super T, ? extends R> func) { return map("map: " + _taskDescriptor.getDescription(func.getClass().getName()), func); }
Source:
<code>public Sequence<Object[]> runQuery(final DruidQuery druidQuery) { final Query query = druidQuery.getQuery(); final Query innerMostQuery = findInnerMostQuery(query); if (plannerContext.getPlannerConfig().isForceTimeCondition() && innerMostQuery.getIntervals().equals(Intervals.ONLY_ETERNITY)) { <START> throw new CannotBuildQueryException("Missing __time filter"); <END> } if (query instanceof TimeseriesQuery) { return executeTimeseries(druidQuery, (TimeseriesQuery) query); } else if (query instanceof TopNQuery) { return executeTopN(druidQuery, (TopNQuery) query); } else if (query instanceof GroupByQuery) { return executeGroupBy(druidQuery, (GroupByQuery) query); } else if (query instanceof ScanQuery) { return executeScan(druidQuery, (ScanQuery) query); } else if (query instanceof SelectQuery) { return executeSelect(druidQuery, (SelectQuery) query); } else { throw new ISE("Cannot run query of class[%s]", query.getClass().getName()); } }</code><technical_language>Suggest this error message mention time condition property, users encounter problem is query internal server error. e.g. "requireTimeCondition is enabled, queries include a filter condition __time column."</technical_language>

Target:
public Sequence<Object[]> runQuery(final DruidQuery druidQuery) { final Query query = druidQuery.getQuery(); final Query innerMostQuery = findInnerMostQuery(query); if (plannerContext.getPlannerConfig().isRequireTimeCondition() && innerMostQuery.getIntervals().equals(Intervals.ONLY_ETERNITY)) { throw new CannotBuildQueryException( "requireTimeCondition is enabled, all queries must include a filter condition on the __time column" ); } if (query instanceof TimeseriesQuery) { return executeTimeseries(druidQuery, (TimeseriesQuery) query); } else if (query instanceof TopNQuery) { return executeTopN(druidQuery, (TopNQuery) query); } else if (query instanceof GroupByQuery) { return executeGroupBy(druidQuery, (GroupByQuery) query); } else if (query instanceof ScanQuery) { return executeScan(druidQuery, (ScanQuery) query); } else if (query instanceof SelectQuery) { return executeSelect(druidQuery, (SelectQuery) query); } else { throw new ISE("Cannot run query of class[%s]", query.getClass().getName()); } }
Source:
<code>private HttpEntity<UserResource> getUser(UUID requestingUserId, String requestingDeviceIdStr, UUID userId, boolean isCreatedOnBuddyRequest, Optional<String> password) { try (CryptoSession cryptoSession = CryptoSession.start(password, () -> userService.canAccessPrivateData(requestingUserId))) { if (requestingUserId.equals(userId)) { <START> return getOwnUser(requestingUserId, requestingDeviceIdStr, userId, isCreatedOnBuddyRequest); <END> } return getBuddyUser(userId, requestingUserId); } }</code><technical_language>of requestingUserId userId is superfluous here, equal :smile:</technical_language>

Target:
private HttpEntity<UserResource> getUser(UUID requestingUserId, String requestingDeviceIdStr, UUID userId, boolean isCreatedOnBuddyRequest, Optional<String> password) { try (CryptoSession cryptoSession = CryptoSession.start(password, () -> userService.canAccessPrivateData(requestingUserId))) { if (requestingUserId.equals(userId)) { return getOwnUser(requestingUserId, requestingDeviceIdStr, isCreatedOnBuddyRequest); } return getBuddyUser(userId, requestingUserId); } }
Source:
<code>public void testBackgroundCallWaitingWithTimeouts() throws Exception { final Object sync = new Object(); Task<Integer> task = Task.callInBackground(new Callable<Integer>() { public Integer call() throws Exception { synchronized (sync) { sync.wait(); } return 5; } }); assertFalse(task.waitForCompletion(100, TimeUnit.MILLISECONDS)); synchronized (sync) { sync.notify(); } task.waitForCompletion(); assertTrue(task.waitForCompletion(100, TimeUnit.MILLISECONDS)); assertEquals(5, task.getResult().intValue()); <START> } <END></code><technical_language>want verify code path task.waitForCompletion returns true if completed calling it</technical_language>

Target:
public void testBackgroundCallWaitingWithTimeouts() throws Exception { final Object sync = new Object(); Task<Integer> task = Task.callInBackground(new Callable<Integer>() { public Integer call() throws Exception { synchronized (sync) { sync.wait(); Thread.sleep(100); } return 5; } }); assertFalse(task.waitForCompletion(100, TimeUnit.MILLISECONDS)); synchronized (sync) { sync.notify(); } assertTrue(task.waitForCompletion(1000, TimeUnit.MILLISECONDS)); assertTrue(task.waitForCompletion(100, TimeUnit.MILLISECONDS)); assertEquals(5, task.getResult().intValue()); }
Source:
<code><START> public String getKey() { <END> return remote + " " + directory; }</code><technical_language>this public? implementation detail of config file format</technical_language>

Target:
private String getKey() { return Subscriber.getKey(remote, directory); }
Source:
<code>public void run() { final String prefKey = UIPreferences.RESOURCEHISTORY_SHOW_FIRST_PARENT_ONLY_DEFAULT; Repository repo = historyPage.getCurrentRepo(); if (repo != null) { String <START> repoSepcificKey <END> = getRepoSpecificKey(repo, prefKey); boolean newBoolean = isChecked(); if (newBoolean == historyPage.store.getBoolean(prefKey)) { historyPage.store.setToDefault(repoSepcificKey); } else { String newValue = newBoolean ? IPreferenceStore.TRUE : IPreferenceStore.FALSE; historyPage.store.putValue(repoSepcificKey, newValue); } historyPage.saveStoreIfNeeded(); } historyPage.refresh(); }</code><technical_language>Spe</technical_language>

Target:
public void run() { final String prefKey = UIPreferences.RESOURCEHISTORY_SHOW_FIRST_PARENT_ONLY_DEFAULT; Repository repo = historyPage.getCurrentRepo(); if (repo != null) { String repoSpecificKey = getRepoSpecificKey(repo, prefKey); boolean newBoolean = isChecked(); if (newBoolean == historyPage.store.getBoolean(prefKey)) { historyPage.store.setToDefault(repoSpecificKey); } else { String newValue = newBoolean ? IPreferenceStore.TRUE : IPreferenceStore.FALSE; historyPage.store.putValue(repoSpecificKey, newValue); } historyPage.saveStoreIfNeeded(); } historyPage.refresh(); }
Source:
<code>private BiFunction<ITimeEvent, Long, Map<String, String>> getTooltipResolver(ITimeGraphDataProvider<? extends TimeGraphEntryModel> provider) { return (event, time) -> { Long entryId = null; synchronized (fEntries) { entryId = fEntryIds.get(event.getEntry(), provider); } if (entryId == null) { return Collections.emptyMap(); } Builder<@NonNull String, @NonNull Object> builder = ImmutableMap.builder(); builder.put(DataProviderParameterUtils.REQUESTED_TIME_KEY, Collections.singletonList(time)); builder.put(DataProviderParameterUtils.REQUESTED_ITEMS_KEY, Collections.singletonList(entryId)); <START> if (event instanceof TimeEvent) { IOutputElement model = ((TimeEvent) event).getModel(); if (model != null) { builder.put(DataProviderParameterUtils.REQUESTED_ELEMENT_KEY, model); } } <END> TmfModelResponse<Map<String, String>> response = provider.fetchTooltip(builder.build(), new NullProgressMonitor()); Map<String, String> tooltip = response.getModel(); return (tooltip == null) ? Collections.emptyMap() : tooltip; }; }</code><technical_language>detect kind of element is send REQUESTED_ELEMENT_KEY REQUESTED_ELEMENT_TYPE_KEY</technical_language>

Target:
private BiFunction<ITimeEvent, Long, Map<String, String>> getTooltipResolver(ITimeGraphDataProvider<? extends TimeGraphEntryModel> provider) { return (event, time) -> { Long entryId = null; synchronized (fEntries) { entryId = fEntryIds.get(event.getEntry(), provider); } if (entryId == null) { return Collections.emptyMap(); } IOutputElement element = null; if (event instanceof TimeEvent) { element = ((TimeEvent) event).getModel(); } Map<@NonNull String, @NonNull Object> parameters = getFetchTooltipParameters(time, entryId, element); TmfModelResponse<Map<String, String>> response = provider.fetchTooltip(parameters, new NullProgressMonitor()); Map<String, String> tooltip = response.getModel(); return (tooltip == null) ? Collections.emptyMap() : tooltip; }; }
Source:
<code>public static <T> byte[] encode(AtomicCoder<T> coder, T original) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); coder.encode(original, bos, null); <START> bos.flush(); <END> return bos.toByteArray(); }</code><technical_language>nit: I flush a BAOS is a no-op</technical_language>

Target:
public static <T> byte[] encode(AtomicCoder<T> coder, T original) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); coder.encode(original, bos, null); return bos.toByteArray(); }
Source:
<code>public synchronized void sendStatus() { byte protocolVersion = getVersion().getCode(); int networkId = config.networkId(); final BigInteger totalDifficulty; final byte[] bestHash; if (syncManager.isFastSyncRunning()) { bestHash = blockstore.getBlockHashByNumber(0); Block genesis = blockstore.getBlockByHash(bestHash); totalDifficulty = genesis.getDifficultyBI(); } else { bestHash = blockstore.getBestBlock().getHash(); totalDifficulty = blockchain.getTotalDifficulty(); } <START> StatusMessage msg = new StatusMessage(protocolVersion, networkId, END> ByteUtil.bigIntegerToBytes(totalDifficulty), bestHash, blockstore.getBlockHashByNumber(0)); sendMessage(msg); ethState = EthState.STATUS_SENT; sendNextHeaderRequest(); }</code><technical_language>this change if contracts' code a part of genesis file</technical_language>

Target:
public synchronized void sendStatus() { byte protocolVersion = getVersion().getCode(); int networkId = config.networkId(); final BigInteger totalDifficulty; final byte[] bestHash; if (syncManager.isFastSyncRunning()) { bestHash = blockstore.getBlockHashByNumber(0); Block genesis = blockstore.getBlockByHash(bestHash); totalDifficulty = genesis.getDifficultyBI(); } else { bestHash = blockstore.getBestBlock().getHash(); totalDifficulty = blockchain.getTotalDifficulty(); } StatusMessage msg = new StatusMessage(protocolVersion, networkId, ByteUtil.bigIntegerToBytes(totalDifficulty), bestHash, config.getGenesis().getHash()); sendMessage(msg); ethState = EthState.STATUS_SENT; sendNextHeaderRequest(); }
Source:
<code>private ItemsToPush missingRevisionsToJsonDocs( Map<String, DocumentRevisionTree> allTrees, Map<String, Set<String>> revisions) { ItemsToPush itemsToPush = new ItemsToPush(); for(Map.Entry<String, Set<String>> e : revisions.entrySet()) { String docId = e.getKey(); Set<String> missingRevisions = e.getValue(); DocumentRevisionTree tree = allTrees.get(docId); for(String rev : missingRevisions) { long sequence = tree.lookup(docId, rev).getSequence(); List<DocumentRevision> path = tree.getPathForNode(sequence); DocumentRevision dr = path.get(0); List<? extends Attachment> atts = this.sourceDb.getDbCore().attachmentsForRevision(dr); Map<String, Object> json = RevisionHistoryHelper.revisionHistoryToJson(path, atts); <START> MultipartAttachmentWriter mpw = RevisionHistoryHelper.addMultiparts(path, atts); <END> if (mpw == null) { itemsToPush.serializedDocs.add(sJsonHelper.toJson(json)); } else { itemsToPush.multiparts.add(mpw); } } } return itemsToPush; }</code><technical_language>do this first, avoid call revisionHistoryToJson if end sending multipart</technical_language>

Target:
private ItemsToPush missingRevisionsToJsonDocs( Map<String, DocumentRevisionTree> allTrees, Map<String, Set<String>> revisions) { ItemsToPush itemsToPush = new ItemsToPush(); for(Map.Entry<String, Set<String>> e : revisions.entrySet()) { String docId = e.getKey(); Set<String> missingRevisions = e.getValue(); DocumentRevisionTree tree = allTrees.get(docId); for(String rev : missingRevisions) { long sequence = tree.lookup(docId, rev).getSequence(); List<DocumentRevision> path = tree.getPathForNode(sequence); DocumentRevision dr = path.get(0); List<? extends Attachment> atts = this.sourceDb.getDbCore().attachmentsForRevision(dr); Map<String, Object> json = RevisionHistoryHelper.revisionHistoryToJson(path, atts, this.config.pushAttachmentsInline); MultipartAttachmentWriter mpw = RevisionHistoryHelper.createMultipartWriter(path, atts, this.config.pushAttachmentsInline); if (mpw == null) { itemsToPush.serializedDocs.add(sJsonHelper.toJson(json)); } else { itemsToPush.multiparts.add(mpw); } } } return itemsToPush; }
Source:
<code>public static long getPropertyAsLong(Properties props, String propertyName, long defaultValue) { String value = props.getProperty(propertyName, "").trim(); if (value.isEmpty()) { return defaultValue; } try { return Long.parseLong(value); <START> } catch (NumberFormatException e) { <END> throw new IllegalArgumentException( "Property " + propertyName + " must be a number in Kinesis importer configuration."); } }</code><technical_language>do need check for negative values</technical_language>

Target:
public static long getPropertyAsLong(Properties props, String propertyName, long defaultValue) { String value = props.getProperty(propertyName, "").trim(); if (value.isEmpty()) { return defaultValue; } try { long val = Long.parseLong(value); if (val <= 0) { throw new IllegalArgumentException( "Value of " + propertyName + " should be positive, but current value is " + val); } return val; } catch (NumberFormatException e) { throw new IllegalArgumentException( "Property " + propertyName + " must be a number in Kinesis importer configuration."); } }
Source:
<code>public static List<ITmfStateInterval> queryHistoryRange(ITmfStateSystem ss, int attributeQuark, long t1, long t2) throws AttributeNotFoundException, StateSystemDisposedException { List<ITmfStateInterval> intervals; ITmfStateInterval currentInterval; long ts, tEnd; if (t2 < t1) { throw new <START> TimeRangeException("Start:" <END> + t1 + ", End:" + t2); } if (t2 > ss.getCurrentEndTime()) { tEnd = ss.getCurrentEndTime(); } else { tEnd = t2; } intervals = new ArrayList<>(); currentInterval = ss.querySingleState(t1, attributeQuark); intervals.add(currentInterval); ts = currentInterval.getEndTime(); while (ts != -1 && ts < tEnd) { ts++; currentInterval = ss.querySingleState(ts, attributeQuark); intervals.add(currentInterval); ts = currentInterval.getEndTime(); } return intervals; }</code><technical_language>add quark, state system here? from</technical_language>

Target:
public static List<ITmfStateInterval> queryHistoryRange(ITmfStateSystem ss, int attributeQuark, long t1, long t2) throws AttributeNotFoundException, StateSystemDisposedException { List<ITmfStateInterval> intervals; ITmfStateInterval currentInterval; long ts, tEnd; if (t2 < t1) { throw new TimeRangeException(ss.getSSID() + " Start:" + t1 + ", End:" + t2); } if (t2 > ss.getCurrentEndTime()) { tEnd = ss.getCurrentEndTime(); } else { tEnd = t2; } intervals = new ArrayList<>(); currentInterval = ss.querySingleState(t1, attributeQuark); intervals.add(currentInterval); ts = currentInterval.getEndTime(); while (ts != -1 && ts < tEnd) { ts++; currentInterval = ss.querySingleState(ts, attributeQuark); intervals.add(currentInterval); ts = currentInterval.getEndTime(); } return intervals; }
Source:
<code>public int getSegmentCount(long periodDurationUs) { if( endNumber != C.INDEX_UNSET) { return endNumber; <START> } else if (segmentTimeline != null) { <END> return segmentTimeline.size(); } else if (periodDurationUs != C.TIME_UNSET) { long durationUs = (duration * C.MICROS_PER_SECOND) / timescale; return (int) Util.ceilDivide(periodDurationUs, durationUs); } else { return DashSegmentIndex.INDEX_UNBOUNDED; } }</code><technical_language>I timeline priority, if set</technical_language>

Target:
public int getSegmentCount(long periodDurationUs) { if (segmentTimeline != null) { return segmentTimeline.size(); } else if (endNumber != C.INDEX_UNSET) { return (int) (endNumber - startNumber + 1); } else if (periodDurationUs != C.TIME_UNSET) { long durationUs = (duration * C.MICROS_PER_SECOND) / timescale; return (int) Util.ceilDivide(periodDurationUs, durationUs); } else { return DashSegmentIndex.INDEX_UNBOUNDED; } }
Source:
<code><START> public Option getOrAddStaticOption(String optionKey, String value) { <END> Option option = options.get(optionKey); if (option == null) { option = new Option(optionKey, value, null); options.put(optionKey, option); } return option; }</code><technical_language>Remove public</technical_language>

Target:
Option getOrAddStaticOption(String optionKey, String value) { Option option = options.get(optionKey); if (option == null) { option = new Option(optionKey, value, null); options.put(optionKey, option); } return option; }
Source:
<code>for (int i = 0; i < n; i++) { RelDataType type = opBinding.getOperandType(i); if (SqlTypeUtil.isString(type) || SqlTypeUtil.isCharacter(type)) { return type; <START> } else if (SqlTypeUtil.isDouble(type)) { <END> hasDouble = true; } }</code><technical_language>more SQL types Druid types need account for 'extras' too. (They show literals, etc.) For example a DECIMAL FLOAT show want treat doubles for purposes of this logic. do this mapping Calcites.getValueTypeForSqlTypeName - try checking out</technical_language>

Target:
for (int i = 0; i < n; i++) { RelDataType type = opBinding.getOperandType(i); SqlTypeName sqlTypeName = type.getSqlTypeName(); ValueType valueType = Calcites.getValueTypeForSqlTypeName(sqlTypeName); if (valueType == ValueType.STRING) { returnSqlTypeName = sqlTypeName; break; } else if (valueType == ValueType.DOUBLE || valueType == ValueType.FLOAT) { returnSqlTypeName = SqlTypeName.DOUBLE; hasDouble = true; } else if (valueType == ValueType.LONG && !hasDouble) { returnSqlTypeName = SqlTypeName.BIGINT; } else if (sqlTypeName != SqlTypeName.NULL) { throw new IAE("Argument %d has invalid type: %s", i, sqlTypeName); } }
Source:
<code>protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException { String fullPath = request.getParameter("fullPath"); String action = request.getParameter("sakai_action"); String overwrite = request.getParameter("overwrite"); logger.debug("Received action: "+action+" for file: "+fullPath); checkRunData(request); if(fullPath != null) { String uploadMax = ServerConfigurationService.getString("content.upload.max"); String siteQuota = ServerConfigurationService.getString("siteQuota@org.sakaiproject.content.api.ContentHostingService"); Long fileSize = Long.parseLong(request.getHeader("content-length")); if((uploadMax != null && !"".equals(uploadMax)) && (fileSize /1024L / 1024L) > Long.parseLong(uploadMax)){ addAlert(getState(request), rb.getFormattedMessage("alert.over-per-upload-quota", new Object[]{uploadMax})); } else if ((siteQuota != null && !"".equals(siteQuota)) && (fileSize /1024L / 1024L) > Long.parseLong(siteQuota)) { addAlert(getState(request), rb.getFormattedMessage("alert.over-site-upload-quota", new Object[]{siteQuota})); } else { JetspeedRunData rundata = (JetspeedRunData) request.getAttribute(ATTR_RUNDATA); if (checkCSRFToken(request,rundata,action)) { <START> doDragDropUpload(request, response, fullPath, overwrite); <END> } } } else { if (action!=null) { JetspeedRunData rundata = (JetspeedRunData) request.getAttribute(ATTR_RUNDATA); if (checkCSRFToken(request,rundata,action)) { super.doPost(request, response); } } else { logger.warn("Action null and file null in ResourcesHelperAction"); } } }</code><technical_language>remove this parameter move line 1885 line 1994</technical_language>

Target:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException { String fullPath = request.getParameter("fullPath"); String action = request.getParameter("sakai_action"); logger.debug("Received action: "+action+" for file: "+fullPath); checkRunData(request); if(fullPath != null) { String uploadMax = ServerConfigurationService.getString("content.upload.max"); String siteQuota = ServerConfigurationService.getString("siteQuota@org.sakaiproject.content.api.ContentHostingService"); Long fileSize = Long.parseLong(request.getHeader("content-length")); if((uploadMax != null && !"".equals(uploadMax)) && (fileSize /1024L / 1024L) > Long.parseLong(uploadMax)){ addAlert(getState(request), rb.getFormattedMessage("alert.over-per-upload-quota", new Object[]{uploadMax})); } else if ((siteQuota != null && !"".equals(siteQuota)) && (fileSize /1024L / 1024L) > Long.parseLong(siteQuota)) { addAlert(getState(request), rb.getFormattedMessage("alert.over-site-upload-quota", new Object[]{siteQuota})); } else { JetspeedRunData rundata = (JetspeedRunData) request.getAttribute(ATTR_RUNDATA); if (checkCSRFToken(request,rundata,action)) { doDragDropUpload(request, response, fullPath); } } } else { if (action!=null) { JetspeedRunData rundata = (JetspeedRunData) request.getAttribute(ATTR_RUNDATA); if (checkCSRFToken(request,rundata,action)) { super.doPost(request, response); } } else { logger.warn("Action null and file null in ResourcesHelperAction"); } } }
Source:
<code><START> private String loadExistingUUID() { <END> File eclipseUUIDFile = new File(System.getProperty("user.home") + UUID_PATH); if (!eclipseUUIDFile.exists()) return null; InputStream in = null; try { in = new BufferedInputStream(new FileInputStream(eclipseUUIDFile)); Properties prop = new Properties(); prop.load(in); return (String) prop.get(PROP_UUID); } catch (IOException e) { return null; } finally { if (in != null) { try { in.close(); } catch (IOException e) { } } } }</code><technical_language>add like: if(System.getProperty(PROP_UUID) != null) { return System.getProperty(PROP_UUID); } product creators disable setting property want</technical_language>

Target:
private String loadExistingUUID() { File eclipseUUIDFile = new File(System.getProperty("user.home") + UUID_PATH); if (!eclipseUUIDFile.exists()) return null; try(InputStream in = new BufferedInputStream(new FileInputStream(eclipseUUIDFile))) { Properties prop = new Properties(); prop.load(in); return (String) prop.get(PROP_UUID); } catch (IOException e) { return null; } }
Source:
<code>private void updateDeploymentConfigurationWithEncryptedKeys(Map<String, String> encryptedKeyMap) throws ConfigParserException { try { List<String> lines = Files.readAllLines(Paths.get(deploymentConfigurationPath)); try (BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(deploymentConfigurationPath), StandardCharsets.UTF_8))) { boolean found = false; for (String line : lines) { if (found) { <START> if (StringUtils.isNotEmpty(StringUtils.substringBetween(line.trim(), <END> ConfigConstants.SECTION_PREFIX, ConfigConstants.SECTION_SUFIX))) { found = false; } else { StringTokenizer stringTokenizer = new StringTokenizer(line, ConfigConstants.KEY_VALUE_SEPERATOR); if (stringTokenizer.hasMoreTokens()) { String key = stringTokenizer.nextToken(); String value = encryptedKeyMap.get(key.trim()); line = key.concat(" = \"").concat(value).concat("\""); } } } else { if (ConfigConstants.SECRETS_SECTION.equals(line.trim())) { found = true; } } bufferedWriter.write(line); bufferedWriter.newLine(); } bufferedWriter.flush(); } } catch (IOException e) { throw new ConfigParserException("Error while writing encrypted values into deployment file", e); } }</code><technical_language>a regex match match [.+]</technical_language>

Target:
private void updateDeploymentConfigurationWithEncryptedKeys(Map<String, String> encryptedKeyMap) throws ConfigParserException { try { List<String> lines = Files.readAllLines(Paths.get(deploymentConfigurationPath)); try (BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(deploymentConfigurationPath), StandardCharsets.UTF_8))) { boolean found = false; for (String line : lines) { if (found) { if (line.matches("[.+]")) { found = false; } else { StringTokenizer stringTokenizer = new StringTokenizer(line, ConfigConstants.KEY_VALUE_SEPERATOR); if (stringTokenizer.hasMoreTokens()) { String key = stringTokenizer.nextToken(); String value = encryptedKeyMap.get(key.trim()); line = key.concat(" = \"").concat(value).concat("\""); } } } else { if (ConfigConstants.SECRETS_SECTION.equals(line.trim())) { found = true; } } bufferedWriter.write(line); bufferedWriter.newLine(); } bufferedWriter.flush(); } } catch (IOException e) { throw new ConfigParserException("Error while writing encrypted values into deployment file", e); } }
Source:
<code>Tracing tracing( @Value("${spring.zipkin.service.name:${spring.application.name:default}}") String serviceName, Propagation.Factory factory, CurrentTraceContext currentTraceContext, Reporter<zipkin2.Span> reporter, Sampler sampler, ErrorParser errorParser, SleuthProperties sleuthProperties) { Tracing.Builder builder = Tracing.newBuilder().sampler(sampler) <START> .errorParser(errorParser) <END> .localServiceName( "".equals(serviceName) ? DEFAULT_SERVICE_NAME : serviceName) .propagationFactory(factory).currentTraceContext(currentTraceContext) .spanReporter(adjustedReporter(reporter)) .traceId128Bit(sleuthProperties.isTraceId128()) .supportsJoin(sleuthProperties.isSupportsJoin()); for (FinishedSpanHandler finishedSpanHandlerFactory : this.finishedSpanHandlers) { builder.addFinishedSpanHandler(finishedSpanHandlerFactory); } return builder.build(); }</code><technical_language>default default service name is coming Spring. I hardcode</technical_language>

Target:
Tracing tracing( @Value("${spring.zipkin.service.name:${spring.application.name:default}}") String serviceName, Propagation.Factory factory, CurrentTraceContext currentTraceContext, Reporter<zipkin2.Span> reporter, Sampler sampler, ErrorParser errorParser, SleuthProperties sleuthProperties) { Tracing.Builder builder = Tracing.newBuilder().sampler(sampler) .errorParser(errorParser) .localServiceName(StringUtils.isEmpty(serviceName) ? DEFAULT_SERVICE_NAME : serviceName) .propagationFactory(factory).currentTraceContext(currentTraceContext) .spanReporter(adjustedReporter(reporter)) .traceId128Bit(sleuthProperties.isTraceId128()) .supportsJoin(sleuthProperties.isSupportsJoin()); for (FinishedSpanHandler finishedSpanHandlerFactory : this.finishedSpanHandlers) { builder.addFinishedSpanHandler(finishedSpanHandlerFactory); } return builder.build(); }
Source:
<code>public EventData addContext(String key, Object value) { <START> Objects.requireNonNull(key); <END> Objects.requireNonNull(value); this.context = context.addData(key, value); return this; }</code><technical_language>Add messages Objects.requireNotNull(key, "message..."). Also, add @throws NullPointerException ..</technical_language>

Target:
public EventData addContext(String key, Object value) { Objects.requireNonNull(key, "The 'key' parameter cannot be null."); Objects.requireNonNull(value, "The 'value' parameter cannot be null."); this.context = context.addData(key, value); return this; }
Source:
<code>public HQLQueryPlan getHQLQueryPlan(String queryString, boolean shallow, Map<String,Filter> enabledFilters) throws QueryException, MappingException { final HQLQueryPlanKey key = new HQLQueryPlanKey( queryString, shallow, enabledFilters ); HQLQueryPlan value = (HQLQueryPlan) queryPlanCache.get( key ); boolean stats = factory.getStatistics().isStatisticsEnabled(); if ( value == null ) { <START> final long startTime = System.nanoTime(); <END> LOG.tracev( "Unable to locate HQL query plan in cache; generating ({0})", queryString ); value = new HQLQueryPlan( queryString, shallow, enabledFilters, factory ); if ( stats ) { final long endTime = System.nanoTime(); final long microseconds = TimeUnit.MICROSECONDS.convert( endTime - startTime, TimeUnit.NANOSECONDS ); factory.getStatistics().queryCompiled( queryString, microseconds ); } queryPlanCache.putIfAbsent( key, value ); } else { LOG.tracev( "Located HQL query plan in cache ({0})", queryString ); if(stats) { factory.getStatistics().queryPlanCacheHit( queryString ); } } return value; }</code><technical_language>nice if skip statistics enabled. System.nanoTime() adds some overhead</technical_language>

Target:
public HQLQueryPlan getHQLQueryPlan(String queryString, boolean shallow, Map<String, Filter> enabledFilters) throws QueryException, MappingException { final HQLQueryPlanKey key = new HQLQueryPlanKey( queryString, shallow, enabledFilters ); HQLQueryPlan value = (HQLQueryPlan) queryPlanCache.get( key ); boolean stats = factory.getStatistics().isStatisticsEnabled(); if ( value == null ) { final long startTime = ( stats ) ? System.nanoTime() : 0L; LOG.tracev( "Unable to locate HQL query plan in cache; generating ({0})", queryString ); value = new HQLQueryPlan( queryString, shallow, enabledFilters, factory ); if ( stats ) { final long endTime = System.nanoTime(); final long microseconds = TimeUnit.MICROSECONDS.convert( endTime - startTime, TimeUnit.NANOSECONDS ); factory.getStatistics().queryCompiled( queryString, microseconds ); } queryPlanCache.putIfAbsent( key, value ); } else { LOG.tracev( "Located HQL query plan in cache ({0})", queryString ); if ( stats ) { factory.getStatistics().queryPlanCacheHit( queryString ); } } return value; }
Source:
<code>private int containsFunctionByIds(Set<Integer> functionIds) { <START> if (this instanceof AbstractValueExpression) { <END> return -1; } List<AbstractExpression> functionsList = findAllFunctionSubexpressions(); for (AbstractExpression funcExpr : functionsList) { assert (funcExpr instanceof FunctionExpression); if (functionIds.contains(((FunctionExpression) funcExpr).getFunctionId())) { return ((FunctionExpression) funcExpr).getFunctionId(); } } return -1; }</code><technical_language>Do need this here? When? belong findAllFunctionsSubexpressions()</technical_language>

Target:
private int containsFunctionByIds(Set<Integer> functionIds) { List<AbstractExpression> functionsList = findAllFunctionSubexpressions(); for (AbstractExpression funcExpr : functionsList) { assert (funcExpr instanceof FunctionExpression); if (functionIds.contains(((FunctionExpression) funcExpr).getFunctionId())) { return ((FunctionExpression) funcExpr).getFunctionId(); } } return -1; }
Source:
<code>private void performRename(ExecutionEvent event) { Shell activeShell= HandlerUtil.getActiveShell(event); Object newNameValue= HandlerUtil.getVariable(event, LTK_RENAME_COMMAND_NEWNAME_PARAMETER_KEY); String newName= null; if (newNameValue instanceof String) { newName= (String) newNameValue; } else if (newNameValue != null) { RefactoringUIPlugin.logErrorMessage(NLS.bind(RefactoringUIMessages.RenameResourceHandler_ERROR_EXPECTED_STRING, newNameValue.getClass().getName())); } ISelection sel= HandlerUtil.getCurrentSelection(event); if (sel instanceof IStructuredSelection) { IResource resource= getCurrentResource((IStructuredSelection) sel); if (resource != null) { RenameResourceWizard refactoringWizard; Change change= null; RefactoringProcessor processor= null; if (newName != null) { refactoringWizard= new RenameResourceWizard(resource, newName); processor= ((ProcessorBasedRefactoring) refactoringWizard.getRefactoring()).getProcessor(); change= getChange(refactoringWizard); refactoringWizard= new RenameResourceWizard(resource, newName); } else { refactoringWizard= new RenameResourceWizard(resource); } try { <START> if (newName == null || change == null || isCompositeChange(change) || !(processor instanceof RenameResourceProcessor)) { <END> RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(refactoringWizard); op.run(activeShell, RefactoringUIMessages.RenameResourceHandler_title); } else { change.perform(new NullProgressMonitor()); } } catch (InterruptedException e) { } catch (CoreException e) { RefactoringUIPlugin.log(e); } } } }</code><technical_language>Ok, fine</technical_language>

Target:
private void performRename(ExecutionEvent event) { Shell activeShell= HandlerUtil.getActiveShell(event); Object newNameValue= HandlerUtil.getVariable(event, LTK_RENAME_COMMAND_NEWNAME_PARAMETER_KEY); String newName= null; if (newNameValue instanceof String) { newName= (String) newNameValue; } ISelection sel= HandlerUtil.getCurrentSelection(event); if (sel instanceof IStructuredSelection) { IResource resource= getCurrentResource((IStructuredSelection) sel); if (resource != null) { RenameResourceWizard refactoringWizard; Change change= null; RefactoringProcessor processor= null; if (newName != null) { refactoringWizard= new RenameResourceWizard(resource, newName); processor= ((ProcessorBasedRefactoring) refactoringWizard.getRefactoring()).getProcessor(); change= getChange(refactoringWizard); refactoringWizard= new RenameResourceWizard(resource, newName); } else { refactoringWizard= new RenameResourceWizard(resource); } try { if (newName == null || change == null || isCompositeChange(change) || !(processor instanceof RenameResourceProcessor)) { RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(refactoringWizard); op.run(activeShell, RefactoringUIMessages.RenameResourceHandler_title); } else { change.perform(new NullProgressMonitor()); } } catch (InterruptedException e) { } catch (CoreException e) { RefactoringUIPlugin.log(e); } } } }