auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void run() { // Loops till QueueProcessorThread is shutdown while (!shutdown) { synchronized (this) { try { // start processing queue if active, other wait for sometime if (isActive) { processQueuedFlows(activeExecutorRefreshWindowInMilisec, activeExecutorRefreshWindowInFlows); } wait(QUEUE_PROCESSOR_WAIT_IN_MS); } catch (Exception e) { logger.info( "QueueProcessorThread Interrupted. Probably to shut down.", e); } } } }

Target:
public void run() { // Loops till QueueProcessorThread is shutdown while (!shutdown) { synchronized (this) { try { // start processing queue if active, other wait for sometime if (isActive) { processQueuedFlows(activeExecutorRefreshWindowInMilisec, activeExecutorRefreshWindowInFlows); } wait(QUEUE_PROCESSOR_WAIT_IN_MS); } catch (Exception e) { logger.error( "QueueProcessorThread Interrupted. Probably to shut down.", e); } } } }
Source:
public HllSketchMergeBufferAggregator( final ColumnValueSelector<HllSketch> selector, final int lgK, final TgtHllType tgtHllType, final int size ) { this.selector = selector; this.lgK = lgK; this.tgtHllType = tgtHllType; this.size = size; this.emptyUnion = new byte[size]; //noinspection ResultOfObjectAllocationIgnored (Union writes to "emptySketch" as a side effect of construction) new Union(lgK, WritableMemory.wrap(emptyUnion, ByteOrder.LITTLE_ENDIAN)); }

Target:
public HllSketchMergeBufferAggregator( final ColumnValueSelector<HllSketch> selector, final int lgK, final TgtHllType tgtHllType, final int size ) { this.selector = selector; this.lgK = lgK; this.tgtHllType = tgtHllType; this.size = size; this.emptyUnion = new byte[size]; //noinspection ResultOfObjectAllocationIgnored (Union writes to "emptyUnion" as a side effect of construction) new Union(lgK, WritableMemory.wrap(emptyUnion)); }
Source:
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) { try { // Ignore first call, which comes from onCreate() if (currentFormat != null) calc(); } catch (GeopointException e) { context.showToast(e.getMessage()); spinner.setSelection(currentFormat.ordinal()); return; } currentFormat = coordInputFormatEnum.fromInt(pos); settings.setCoordInputFormat(currentFormat); updateGUI(); }

Target:
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) { // Ignore first call, which comes from onCreate() if (currentFormat != null && !calc()) { // An error occurred, reset spinner to current format spinner.setSelection(currentFormat.ordinal()); return; } currentFormat = coordInputFormatEnum.fromInt(pos); settings.setCoordInputFormat(currentFormat); updateGUI(); }
Source:
public boolean visitTableWithType(String schemaName, String tableName, TableType type) { Preconditions .checkNotNull(type, "Error. Type information for table %s.%s provided is null.", schemaName, tableName); records.add(new Records.Table(IS_CATALOG_NAME, schemaName, tableName, type.toString())); return false; }

Target:
private void visitTableWithType(String schemaName, String tableName, TableType type) { Preconditions .checkNotNull(type, "Error. Type information for table %s.%s provided is null.", schemaName, tableName); records.add(new Records.Table(IS_CATALOG_NAME, schemaName, tableName, type.toString())); return; }
Source:
public boolean add(XWikiAttachment attachment) { return set(attachment) != null; }

Target:
public boolean add(XWikiAttachment attachment) { XWikiAttachment set = set(attachment); return set != attachment; }
Source:
public String toString() { return Objects.toStringHelper(this).add("liveWorkerNum", mLiveWorkerNum) .add("lostWorkerNum", mLostWorkerNum).add("capacityBytes", mCapacityBytes) .add("usedBytes", mUsedBytes).add("freeBytes", mFreeBytes) .add("capacityBytesOnTiers", mCapacityBytesOnTiers) .add("usedBytesOnTiers", mUsedBytesOnTiers).toString(); }

Target:
public String toString() { return Objects.toStringHelper(this).add("capacityBytes", mCapacityBytes) .add("capacityBytesOnTiers", mCapacityBytesOnTiers) .add("freeBytes", mFreeBytes) .add("liveWorkerNum", mLiveWorkerNum) .add("lostWorkerNum", mLostWorkerNum) .add("usedBytes", mUsedBytes) .add("usedBytesOnTiers", mUsedBytesOnTiers).toString(); }
Source:
private TreeLayer getTreeLayer() { NatTable natTable = (NatTable) getTableManager().getAdapter(NatTable.class); ILayer layer = natTable.getLayer(); if (layer instanceof PapyrusGridLayer) { PapyrusGridLayer gridLayer = (PapyrusGridLayer) layer; ILayer rowLayer = gridLayer.getRowHeaderLayer(); if (rowLayer instanceof RowHeaderHierarchicalLayerStack) { return ((RowHeaderHierarchicalLayerStack) rowLayer).getTreeLayer(); } } throw new UnknownError("TreeLayer has not been found"); //$NON-NLS-1$ }

Target:
private TreeLayer getTreeLayer() throws Exception { NatTable natTable = (NatTable) getTableManager().getAdapter(NatTable.class); ILayer layer = natTable.getLayer(); if (layer instanceof PapyrusGridLayer) { PapyrusGridLayer gridLayer = (PapyrusGridLayer) layer; ILayer rowLayer = gridLayer.getRowHeaderLayer(); if (rowLayer instanceof RowHeaderHierarchicalLayerStack) { return ((RowHeaderHierarchicalLayerStack) rowLayer).getTreeLayer(); } } throw new UnknownError("TreeLayer has not been found"); //$NON-NLS-1$ }
Source:
public void differentUrlForPostsAndVideo() { SearchInput searchInput = new SearchInput().searchInputValue(); SearchInput searchInputSubmit = new SearchInput().searchInputSubmit(); String URL = driver.getCurrentUrl(); Assert.assertEquals(URL, "http://qa.fandom.wikia.com/?s=TEST"); SearchInput postsResult = new SearchInput().searchResultsPosts(); String postUrl = driver.getCurrentUrl(); SearchInput videosResult = new SearchInput().searchResultsVideos(); String videoUrl = driver.getCurrentUrl(); Assert.assertNotEquals(postUrl, videoUrl); }

Target:
public void differentUrlForPostsAndVideo() { SearchInput searchInput = new SearchInput().searchInputValue(); SearchInput searchInputSubmit = new SearchInput().searchInputSubmit(); SearchInput postsResult = new SearchInput().searchResultsPosts(); String postUrl = driver.getCurrentUrl(); SearchInput videosResult = new SearchInput().searchResultsVideos(); String videoUrl = driver.getCurrentUrl(); Assert.assertNotEquals(postUrl, videoUrl); }
Source:
String convert(Blob blob) { if (blob.getLength() == 0L) { return ""; } try (InputStream stream = blob.getStream()) { Xml2TextHandler xml2text = new Xml2TextHandler(); return xml2text.parse(stream); } catch (IOException | SAXException | ParserConfigurationException e) { throw new ConversionException("Error during XML2Text conversion", e); } }

Target:
protected String convert(Blob blob) { if (blob.getLength() == 0L) { return ""; } try (InputStream stream = blob.getStream()) { Xml2TextHandler xml2text = new Xml2TextHandler(); return xml2text.parse(stream); } catch (IOException | SAXException | ParserConfigurationException e) { throw new ConversionException("Error during XML2Text conversion", blob, e); } }
Source:
private Long findFreeId(){ while(personRepository.findOne(lastId) != null){ // New person lastId++; } return lastId; }

Target:
private Long findFreeId(){ while(personRepository.exists(lastId)){ // New person lastId++; } return lastId; }
Source:
public void cameraDeviceCallsAreForwardedToCallback() throws InterruptedException { Assume.assumeTrue(mCameraId != null); mUseCase.addStateChangeListener( mCameraRepository.getCamera( getCameraIdForLensFacingUnchecked(mConfig.getLensFacing()))); mUseCase.doNotifyActive(); mCameraRepository.onGroupActive(mUseCaseGroup); // Wait for the CameraDevice.onOpened callback. mUseCase.mDeviceStateCallback.waitForOnOpened(1); mCameraRepository.onGroupInactive(mUseCaseGroup); // Wait for the CameraDevice.onClosed callback. mUseCase.mDeviceStateCallback.waitForOnClosed(1); }

Target:
public void cameraDeviceCallsAreForwardedToCallback() throws InterruptedException { mUseCase.addStateChangeListener( mCameraRepository.getCamera( getCameraIdForLensFacingUnchecked(mConfig.getLensFacing()))); mUseCase.doNotifyActive(); mCameraRepository.onGroupActive(mUseCaseGroup); // Wait for the CameraDevice.onOpened callback. mUseCase.mDeviceStateCallback.waitForOnOpened(1); mCameraRepository.onGroupInactive(mUseCaseGroup); // Wait for the CameraDevice.onClosed callback. mUseCase.mDeviceStateCallback.waitForOnClosed(1); }
Source:
public void setQueryTimeout( int seconds ) throws AlreadyClosedSqlException, InvalidParameterSqlException, SQLException { throwIfClosed(); super.setQueryTimeout(seconds); }

Target:
public void setQueryTimeout( int seconds ) throws AlreadyClosedSqlException, SQLException { throwIfClosed(); super.setQueryTimeout(seconds); }
Source:
private void safeCloseStream(Closeable stream) { if (stream != null) { try { stream.close(); } catch (IOException e) { // swallow error in this case Logger.e(TAG, "Failed to close the stream: ", "", ADALError.IO_EXCEPTION, e); } } }

Target:
private static void safeCloseStream(Closeable stream) { if (stream != null) { try { stream.close(); } catch (IOException e) { // swallow error in this case Logger.e(TAG, "Failed to close the stream: ", "", ADALError.IO_EXCEPTION, e); } } }
Source:
public void updateNode(final @Nonnull Node node) throws IOException { if (node == nodes.get(node.getNodeName())) { Queue.withLock(new Runnable() { @Override public void run() { jenkins.trimLabels(); } }); persistNode(node); } }

Target:
public boolean updateNode(final @Nonnull Node node) throws IOException { if (node == nodes.get(node.getNodeName())) { Queue.withLock(new Runnable() { @Override public void run() { jenkins.trimLabels(); } }); persistNode(node); return true; } return false; }
Source:
public void onSaveInstanceState(Bundle outState) { if (backStack != null) { // update the topmost entry in the backstack updateCurrentBackStackItem(); outState.putParcelableArrayList("backStack", backStack); } }

Target:
public void onSaveInstanceState(Bundle outState) { // update the topmost entry in the back stack updateCurrentBackStackItem(); outState.putParcelableArrayList("backStack", backStack); }
Source:
public Trader(String name, double cashInHand) { super(); this.name = name; this.cashInHand = cashInHand; this.position = new ArrayList<Order>(); this.ordersPlaced = new ArrayList<Order>(); }

Target:
public Trader(String name, double cashInHand) { //super(); this.name = name; this.cashInHand = cashInHand; this.position = new ArrayList<Order>(); this.ordersPlaced = new ArrayList<Order>(); }
Source:
private Iterable<ITask> getTasksAssosciatedWithReviewTask(ITask reviewTask) { String lookupUrl = reviewTask.getUrl(); // TODO: Fetch from mapping with the lookupUrl String taskUrl = "http://someurl"; AbstractRepositoryConnector repository = TasksUiPlugin.getRepositoryManager() .getConnectorForRepositoryTaskUrl(taskUrl); String taskId = repository.getTaskIdFromTaskUrl(taskUrl); String repositoryUrl = repository.getRepositoryUrlFromTaskUrl(taskUrl); ITask assosciatedTask = taskList.getTask(repositoryUrl, taskId); if (assosciatedTask == null) { return Collections.emptyList(); } return ImmutableSet.of(assosciatedTask); }

Target:
private ITask getTasksAssosciatedWithReviewTask(ITask reviewTask) { String lookupUrl = reviewTask.getUrl(); // TODO: Fetch from mapping with the lookupUrl String taskUrl = "http://someurl"; AbstractRepositoryConnector repository = TasksUiPlugin.getRepositoryManager() .getConnectorForRepositoryTaskUrl(taskUrl); String taskId = repository.getTaskIdFromTaskUrl(taskUrl); String repositoryUrl = repository.getRepositoryUrlFromTaskUrl(taskUrl); ITask assosciatedTask = taskList.getTask(repositoryUrl, taskId); return assosciatedTask; }
Source:
void thread2() { int[] vs1; synchronized (lock) { vs1 = values; state = 1; } int s; do { synchronized (lock) { s = state; } } while (s != 2); // Busy loop. int[] vs2; synchronized (lock) { vs2 = values; } int v1 = vs1[0]; int v2 = vs2[0]; System.out.println("b17689750TestMonitor failed: " + v1 + ", " + v2); }

Target:
void thread2() { int[] vs1; synchronized (lock) { vs1 = values; state = 1; } int s; do { synchronized (lock) { s = state; } } while (s != 2); // Busy loop. int[] vs2 = values; int v1 = vs1[0]; int v2 = vs2[0]; System.out.println("b17689750TestMonitor failed: " + v1 + ", " + v2); }
Source:
public ByteBufferReadableStreamChannel(List<ByteBuffer> bufferList) { if (bufferList == null || bufferList.isEmpty()) { throw new IllegalArgumentException("Input List of ByteBuffer cannot be null/empty for ByteBufferReadableStreamChannel"); } buffers = new ArrayList<>(bufferList); size = computeSize(bufferList); }

Target:
public ByteBufferReadableStreamChannel(List<ByteBuffer> bufferList) { if (bufferList == null || bufferList.isEmpty()) { throw new IllegalArgumentException( "Input List of ByteBuffer cannot be null/empty for ByteBufferReadableStreamChannel"); } buffers = bufferList; size = computeSize(bufferList); }
Source:
public void testStash() { try { // 1) call stash create command git.stashCreate().call(); readFile("Stash Created", git.getRepository().getWorkTree() + "/File1.txt"); // 2) call stash list git.stashList().call(); // 3) apply stash git.stashApply().call(); // 4) verify stash applied by outputting file readFile("Stash Created", git.getRepository().getWorkTree() + "/File1.txt"); } catch (Exception e) { e.printStackTrace(); } }

Target:
public void testStash() throws Exception { // 1) call stash create command git.stashCreate().call(); readFile("Stash Created", git.getRepository().getWorkTree() + "/File1.txt"); // 2) call stash list git.stashList().call(); // 3) apply stash git.stashApply().call(); // 4) verify stash applied by outputting file readFile("Stash Created", git.getRepository().getWorkTree() + "/File1.txt"); }
Source:
public static void tearDownTestCase() throws Exception { if(dataSource != null) { Connection con = dataSource.getConnection(); if(con != null) { // rollback any changes done to DB during the test case execution con.rollback(); } } }

Target:
public static void tearDownTestCase() throws Exception { }
Source:
private void putResize (K key, V value) { K[] keyTable = this.keyTable; V[] valueTable = this.valueTable; for (int i = place(key); ; i = (i + 1) & mask) { // space is available so we insert and break (resize is later) if (keyTable[i] == null) { keyTable[i] = key; valueTable[i] = value; break; } } if (++size >= threshold) { resize(keyTable.length << 1); } }

Target:
private void putResize (K key, V value) { K[] keyTable = this.keyTable; V[] valueTable = this.valueTable; for (int i = place(key); ; i = (i + 1) & mask) { // space is available so we insert and break if (keyTable[i] == null) { keyTable[i] = key; valueTable[i] = value; break; } } ++size; }
Source:
private void createDisabledImage() { if (this.disabledImage != null && !this.disabledImage.isDisposed()) disabledImage = new Image(this.image.getDevice(), this.image, SWT.IMAGE_DISABLE); }

Target:
private void createDisabledImage() { // Only create a new disabledImage when the disabledImage==null or // disposed to avoid a GDI Handler leak See Bug 486531 if (this.disabledImage == null || this.disabledImage.isDisposed()) if (this.image != null && !this.image.isDisposed()) disabledImage = new Image(this.image.getDevice(), this.image, SWT.IMAGE_DISABLE); }
Source:
public synchronized void releaseSample(DecoderInputBuffer sample) { sample.data.clear(); mSamplePool.offerLast(sample); }

Target:
public synchronized void releaseSample(DecoderInputBuffer sample) { sample.clear(); mSamplePool.offerLast(sample); }
Source:
public RepositoryObject getParent() { return driver.getParentObject(this); }

Target:
public RepositoryObject getParent() { // tombstone is not in the hierarchy, so doesn't have a parent return null; }
Source:
public String toString() { return toStringHelper(this) .omitNullValues() .add("equiCriteria", this.equiCriteria) .add("filter", filter.orElse(null)) .toString(); }

Target:
public String toString() { return toStringHelper(this) .omitNullValues() .add("equiCriteria", equiCriteria) .add("filter", filter.orElse(null)) .toString(); }
Source:
private void validateKeyPatternsInConfig(Dictionary<String, ?> config) { Enumeration<String> keys = config.keys(); while (keys.hasMoreElements()) { String key = keys.nextElement(); // the config-key enumeration contains additional keys that we // don't want to process here ... if ("service.pid".equals(key)) { continue; } Matcher matcher = EXTRACT_PLUGWISE_CONFIG_PATTERN.matcher(key); if (!matcher.matches()) { logger.error("Given plugwise-config-key '" + key + "' does not follow the expected pattern '<PlugwiseId>.<mac|type|port|interval>'"); continue; } } }

Target:
private void validateKeyPatternsInConfig(Dictionary<String, ?> config) { Enumeration<String> keys = config.keys(); while (keys.hasMoreElements()) { String key = keys.nextElement(); // the config-key enumeration contains additional keys that we // don't want to process here ... if ("service.pid".equals(key)) { continue; } Matcher matcher = EXTRACT_PLUGWISE_CONFIG_PATTERN.matcher(key); if (!matcher.matches()) { logger.warn("Given plugwise-config-key '" + key + "' does not follow the expected pattern '<PlugwiseId>.<mac|type|port|interval>'"); continue; } } }
Source:
ShardRewriter createShardRewriter( FileSystemContext fileSystemContext, FileSystem fileSystem, long transactionId, OptionalInt bucketNumber, UUID shardUuid, int shardRowCount, Optional<UUID> deltaShardUuid, boolean tableSupportsDeltaDelete, Map<String, Type> columns) { if (tableSupportsDeltaDelete) { return new DeltaShardRewriter( shardUuid, shardRowCount, deltaShardUuid, deletionExecutor, transactionId, bucketNumber, this, fileSystemContext, fileSystem); } else { return new InplaceShardRewriter( shardUuid, columns, deletionExecutor, transactionId, bucketNumber, nodeId, this, fileSystem, storageService, shardRecorder, backupManager); } }

Target:
ShardRewriter createShardRewriter( FileSystemContext fileSystemContext, FileSystem fileSystem, long transactionId, OptionalInt bucketNumber, UUID shardUuid, int shardRowCount, Optional<UUID> deltaShardUuid, boolean tableSupportsDeltaDelete, Map<String, Type> columns) { if (tableSupportsDeltaDelete) { return new DeltaShardRewriter( shardUuid, shardRowCount, deltaShardUuid, deletionExecutor, transactionId, bucketNumber, this, fileSystemContext, fileSystem); } return new InplaceShardRewriter( shardUuid, columns, deletionExecutor, transactionId, bucketNumber, nodeId, this, fileSystem, storageService, shardRecorder, backupManager); }
Source:
@Override public Long call() throws IOException{ String oldname = Thread.currentThread().getName(); Thread.currentThread().setName(oldname+"Decode-"+this.parent.columnChunkMetaData.toString()); this.parent.processPages(recordsToReadInThisPass); Thread.currentThread().setName(oldname); return recordsToReadInThisPass; }

Target:
@Override public Long call() throws IOException{ String oldname = Thread.currentThread().getName(); try { Thread.currentThread().setName(oldname + "Decode-" + this.parent.columnChunkMetaData.toString()); this.parent.processPages(recordsToReadInThisPass); return recordsToReadInThisPass; } finally { Thread.currentThread().setName(oldname); } }
Source:
private static void appendBodyColorsRule(StringBuilder buffer, RGB fgRGB, RGB bgRGB) { StringBuilder fg= new StringBuilder(); appendColor(fg, fgRGB); StringBuilder bg= new StringBuilder(); appendColor(bg, bgRGB); buffer.append("body {color:" + fg.toString() + "; background-color:" + bg.toString() + ";}"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ }

Target:
private static void appendBodyColorsRule(StringBuilder buffer, RGB fgRGB, RGB bgRGB) { StringBuilder fg= new StringBuilder(); appendColor(fg, fgRGB); StringBuilder bg= new StringBuilder(); appendColor(bg, bgRGB); buffer.append("body {color:"); //$NON-NLS-1$ appendColor(buffer, fgRGB); buffer.append("; background-color:"); //$NON-NLS-1$ appendColor(buffer, bgRGB); buffer.append(";}"); //$NON-NLS-1$ }
Source:
public void ensureSettingsSavedShowsFormIfValidationFails() throws Exception { doAnswer(invocation -> { Errors errors = (Errors) invocation.getArgument(1); errors.rejectValue("absenceSettings", "error"); return null; }).when(settingsValidator).validate(any(), any()); perform(post("/web/settings")) .andExpect(view().name("settings/settings_form")); }

Target:
public void ensureSettingsSavedShowsFormIfValidationFails() throws Exception { doAnswer(invocation -> { Errors errors = invocation.getArgument(1); errors.rejectValue("absenceSettings", "error"); return null; }).when(settingsValidator).validate(any(), any()); perform(post("/web/settings")) .andExpect(view().name("settings/settings_form")); }
Source:
private String extractConnectionKey(final iOSVariant iOSVariant) { final StringBuilder sb = new StringBuilder() .append(iOSVariant.getVariantID()) .append(iOSVariant.isProduction() ? "-prod" : "-dev"); return sb.toString(); }

Target:
private String extractConnectionKey(final iOSVariant iOSVariant) { final StringBuilder sb = new StringBuilder(iOSVariant.getVariantID()) .append(iOSVariant.isProduction() ? "-prod" : "-dev"); return sb.toString(); }
Source:
public void lockEdge() throws Exception { edgeLockTest(LockResource.LockMode.WRITE, LockResource.LockMode.READ, true); edgeLockTest(LockResource.LockMode.READ, LockResource.LockMode.WRITE, true); edgeLockTest(LockResource.LockMode.WRITE, LockResource.LockMode.WRITE, true); edgeLockTest(LockResource.LockMode.READ, LockResource.LockMode.READ, false); }

Target:
public void lockEdge() throws Exception { edgeLockTest(LockMode.WRITE, LockMode.READ, true); edgeLockTest(LockMode.READ, LockMode.WRITE, true); edgeLockTest(LockMode.WRITE, LockMode.WRITE, true); edgeLockTest(LockMode.READ, LockMode.READ, false); }
Source:
public static Response newResetResponse(Header header) { return newRestartResponse(header, newNoServerError()); }

Target:
public static Response newResetResponse(Header header) { return newResetResponse(header, newNoServerError()); }
Source:
protected void handleSwingDropTargetChanged(TreePath path, Transferable swingTransferable) { if (getUpdateSwingFromScoutLock().isAcquired()) { return; } // if (swingTransferable != null) { if (getScoutObject() != null) { final ITreeNode scoutNode = treePathToScoutNode(path); // notify Scout (asynchronous !) Runnable t = new Runnable() { @Override public void run() { getScoutObject().getUIFacade().fireNodeDropTargetChangedFromUI(scoutNode); } }; getSwingEnvironment().invokeScoutLater(t, 0); // end notify } } }

Target:
protected void handleSwingDropTargetChanged(TreePath path, Transferable swingTransferable) { if (getUpdateSwingFromScoutLock().isAcquired()) { return; } // if (swingTransferable != null && getScoutObject() != null) { final ITreeNode scoutNode = treePathToScoutNode(path); // notify Scout (asynchronous !) Runnable t = new Runnable() { @Override public void run() { getScoutObject().getUIFacade().fireNodeDropTargetChangedFromUI(scoutNode); } }; getSwingEnvironment().invokeScoutLater(t, 0); // end notify } }
Source:
public static PDPrintStyle getLineStyle (JSONObject oskariStyle) { PDPrintStyle style = new PDPrintStyle(); JSONObject stroke = JSONHelper.optJSONObject(oskariStyle, "stroke", () -> new JSONObject()); setStrokeStyle(style, stroke); // polygon doesn't have cap style setLabelStyle(style, oskariStyle); style.setLineCap(LINE_CAP_STYLE.getOrDefault(JSONHelper.optString(stroke,"lineCap"), 0)); return style; }

Target:
public static PDPrintStyle getLineStyle (JSONObject oskariStyle) { JSONObject stroke = oskariStyle.optJSONObject("stroke"); PDPrintStyle style = new PDPrintStyle(); setStrokeStyle(style, stroke); setLabelStyle(style, oskariStyle); return style; }
Source:
private void rollBackToTimestamp(long timestamp) { if (getVersionUnsafe() > timestamp) { try { rollbackObjectUnsafe(timestamp); // Rollback successfully got us to the right // version, we're done. if (getVersionUnsafe() == timestamp) { return; } } catch (NoRollbackException nre) { log.warn("Rollback[{}] to failed {}", this, timestamp, nre); resetUnsafe(); } } }

Target:
private void rollBackToTimestamp(long timestamp) { if (getVersionUnsafe() > timestamp) { try { rollbackObjectUnsafe(timestamp); } catch (NoRollbackException nre) { log.warn("Rollback[{}] to failed {}", this, timestamp, nre); resetUnsafe(); } } }
Source:
public void tearDown() throws Exception { FileUtils.deleteQuietly(nuxeoHome); // Restore or clear all the system properties manipulated by the current test originSystemProps.forEach((key, originValue) -> { if (originValue == null) { System.clearProperty(key); } else { System.setProperty(key, originValue); } }); originSystemProps.clear(); }

Target:
public void tearDown() throws Exception { FileUtils.deleteQuietly(nuxeoHome); // Restore or clear all the system properties manipulated by the current test originSystemProps.forEach((key, value) -> { if (value == null) { System.clearProperty(key); } else { System.setProperty(key, value); } }); originSystemProps.clear(); }
Source:
static int staticFunc() { InvokeStatic f = new InvokeStatic() { // Noncompliant @Override public String func(int n) { unknown(); staticFunc(); return 0; } }; return f.func(); }

Target:
static int staticFunc() { InvokeStatic f = new InvokeStatic() { // Noncompliant @Override public int func() { unknown(); staticFunc(); return 0; } }; return f.func(); }
Source:
private synchronized void resetGeneration() { this.generation = Generation.NO_GENERATION; rejoinNeeded = true; // only reset the state to un-joined when it is not already in rebalancing if (state != MemberState.REBALANCING) state = MemberState.UNJOINED; }

Target:
private synchronized void resetGeneration() { this.rejoinNeeded = true; this.generation = Generation.NO_GENERATION; }
Source:
public Path generateArtifact(URI uri, int size) throws IOException { new NpmPackageGenerator(Paths.get(uri)); buildPublishJson(); return getPackagePath(); }

Target:
public Path generateArtifact(URI uri, int size) throws IOException { buildPublishJson(); return getPackagePath(); }
Source:
public void nextTuple() { Utils.sleep(100); Random rand = new Random(); Integer value = rand.nextInt(1000); collector.emit(new Values(value)); }

Target:
public void nextTuple() { Utils.sleep(100); collector.emit(new Values(rand.nextInt(1000))); }
Source:
public void testMarkerOnLastLineNoNewline_495842() throws Exception { try(BufferedWriter writer = new BufferedWriter(new FileWriter(loadcode("", false)))) { writer.write(getAboveComment().trim()); } PreferenceConstants.getPreferenceStore().setValue(PreferenceConstants.ENSURE_NEWLINE_AT_EOF, true); indexFiles(); PreferenceConstants.getPreferenceStore().setValue(PreferenceConstants.ENSURE_NEWLINE_AT_EOF, false); String result = runQuickFixOneFile(); assertContainedIn("int func() { } // @suppress(\"No return\")", result); }

Target:
public void testMarkerOnLastLineNoNewline_495842() throws Exception { try(BufferedWriter writer = new BufferedWriter(new FileWriter(loadcode("", false)))) { writer.write(getAboveComment().trim()); } PreferenceConstants.getPreferenceStore().setValue(PreferenceConstants.ENSURE_NEWLINE_AT_EOF, false); indexFiles(); String result = runQuickFixOneFile(); PreferenceConstants.getPreferenceStore().setValue(PreferenceConstants.ENSURE_NEWLINE_AT_EOF, true); assertContainedIn("int func() { } // @suppress(\"No return\")", result); }
Source:
protected UfsStatus(UfsStatus status) { mIsDirectory = status.mIsDirectory; mName = status.mName; mOwner = status.mOwner; mGroup = status.mGroup; mMode = status.mMode; mLastModifiedTimeMs = status.mLastModifiedTimeMs; mXAttr = status.mXAttr; }

Target:
protected UfsStatus(UfsStatus status) { mIsDirectory = status.mIsDirectory; mName = status.mName; mOwner = status.mOwner; mGroup = status.mGroup; mMode = status.mMode; mLastModifiedTimeMs = status.mLastModifiedTimeMs; mXAttr = status.mXAttr == null ? null : new HashMap<>(status.mXAttr); }
Source:
JarFileUtils(IPostProcessor processor, String xmlPathInJar, List<String> testNames) { this.processor = processor; this.xmlPathInJar = xmlPathInJar; //Ensure that dynamic list operations supported this.testNames = (testNames == null ? null : new ArrayList<>(testNames)); }

Target:
JarFileUtils(IPostProcessor processor, String xmlPathInJar, List<String> testNames) { this.processor = processor; this.xmlPathInJar = xmlPathInJar; this.testNames = testNames; }
Source:
public String resolve(String variable, String defaultValue) { IVariableResolver delegate = new ExpressionResolver.SystemPropertiesVariableResolver(); //ignoring argument here, as we want to fall back on the propertiesProvider. String result = delegate.resolve(variable, null); if (result == null) { try { result = propertiesProvider.getValue(variable, defaultValue, new NullProgressMonitor()); } catch (CoreException e) { throw new ExpressionResolutionException(e); } } return result; }

Target:
public String resolve(String variable, String defaultValue) { IVariableResolver delegate = new ExpressionResolver.SystemPropertiesVariableResolver(); // ignoring default value first, as we want to fall back on the // propertiesProvider later. String result = delegate.resolve(variable, null); if (result == null) { result = propertiesProvider.getValue(variable, defaultValue); } return result; }
Source:
public void addChild(String name, Long id) { if (mChildren.put(name, id) == null) { mWeight.incrementAndGet(); } }

Target:
public void addChild(String name, Long id) { if (mChildren != null && mChildren.put(name, id) == null) { mWeight.incrementAndGet(); } }
Source:
void resetLogic() { for (int i = 0; i < fieldSize; i++) for (int j = 0; j < fieldSize; j++) fieldArray[i][j] = 0; playerMark = CROSS_MARK; aIMark = ZERO_MARK; turn = 0; //first turn autoGameEnabled = false; }

Target:
void resetLogic() { for (int i = 0; i < fieldSize; i++) for (int j = 0; j < fieldSize; j++) { fieldArray[i][j] = 0; } playerMark = CROSS_MARK; aIMark = ZERO_MARK; turn = 0; //first turn autoGameEnabled = false; }
Source:
public void actionPerformed(ActionEvent e) { if(e.getSource() == okButton){ //controller should be passed to this class only if there is need to modification content of Keystore. System.out.println(certControll); if (certControll != null) { certControll.setAddToKeystore(true); } this.dispose(); }else if(e.getSource() == cancelButton){ if (certControll != null) { certControll.setAddToKeystore(false); } this.dispose(); } }

Target:
public void actionPerformed(ActionEvent e) { if(e.getSource() == okButton){ //controller should be passed to this class only if there is need to modification content of Keystore. if (certControll != null) { certControll.setAddToKeystore(true); } this.dispose(); }else if(e.getSource() == cancelButton){ if (certControll != null) { certControll.setAddToKeystore(false); } this.dispose(); } }
Source:
public List<NimbusInfo> getAllNimbuses() { List<NimbusInfo> nimbusInfos = new ArrayList<>(); try { Collection<Participant> participants = leaderLatch.get().getParticipants(); for (Participant participant : participants) { nimbusInfos.add(Zookeeper.toNimbusInfo(participant)); } } catch (Exception e) { LOG.warn("failed to get nimbuses", e); } return nimbusInfos; }

Target:
public List<NimbusInfo> getAllNimbuses() throws Exception { List<NimbusInfo> nimbusInfos = new ArrayList<>(); Collection<Participant> participants = leaderLatch.get().getParticipants(); for (Participant participant : participants) { nimbusInfos.add(Zookeeper.toNimbusInfo(participant)); } return nimbusInfos; }
Source:
protected void doBegin() throws TransactionException { if (txManager == null) { throw new IllegalStateException(CoreMessages .objectNotRegistered("javax.transaction.TransactionManager", "Transaction Manager").getMessage()); } try { txManager.setTransactionTimeout(getTimeoutInSeconds()); txManager.begin(); synchronized (this) { transaction = txManager.getTransaction(); } } catch (Exception e) { throw new TransactionException(cannotStartTransaction("XA"), e); } }

Target:
protected void doBegin() throws TransactionException { if (txManager == null) { throw new IllegalStateException(objectNotRegistered("javax.transaction.TransactionManager", "Transaction Manager") .getMessage()); } try { txManager.setTransactionTimeout(getTimeoutInSeconds()); txManager.begin(); synchronized (this) { transaction = txManager.getTransaction(); } } catch (Exception e) { throw new TransactionException(cannotStartTransaction("XA"), e); } }
Source:
public void createReplyReplyDone() { createButton(buttonparent, buttonReply_ID, buttonReply_caption, true); createButton(buttonparent, buttonReplyDone_ID, buttonReplyDone_caption, true); buttonBar.pack(); }

Target:
private void createReplyReplyDone() { createButton(buttonparent, buttonReply_ID, buttonReply_caption, true); createButton(buttonparent, buttonReplyDone_ID, buttonReplyDone_caption, true); buttonBar.pack(); }
Source:
public DynamicState withPendingLocalization(Future<Void> pendingDownload) { return new DynamicState(this.state, this.newAssignment, this.container, this.currentAssignment, this.pendingLocalization, this.startTime, pendingDownload, this.profileActions, this.pendingStopProfileActions); }

Target:
public DynamicState withPendingLocalization(Future<Void> pendingDownload) { return withPendingLocalization(this.pendingLocalization, pendingDownload); }
Source:
public boolean verifyUser(String username, String password, ESClientVersionInfo clientVersionInfo) { try { final Optional<ESAuthenticationInformation> information = doVerifyUser(username, password, clientVersionInfo); if (!information.isPresent()) { /* to many bad attempts, otherwise we get an exception */ ModelUtil.logWarning( MessageFormat.format(Messages.LoginService_VerifyUserTooManyFailedRequests, username, delay)); } return information.isPresent(); } catch (final AccessControlException ex) { /* regular bad attempt */ return false; } }

Target:
public boolean verifyUser(String username, String password, ESClientVersionInfo clientVersionInfo) { try { final Optional<ESAuthenticationInformation> information = doVerifyUser(username, password, clientVersionInfo); if (!information.isPresent()) { /* too many bad attempts, otherwise we get an exception */ ModelUtil.logWarning( MessageFormat.format(Messages.LoginService_VerifyUserTooManyFailedRequests, username, delay)); } return true; } catch (final AccessControlException ex) { /* regular bad attempt */ return false; } }
Source:
public void test() throws Exception { ExternalBuildReport report = new ExternalBuildReport("http://some.url.com"); assertEquals("View External Report", report.getDisplayName()); assertEquals("graph.gif", report.getIconFileName()); assertEquals("graph.gif", report.getIconFileName()); assertEquals("http://some.url.com", report.getUrlName()); assertEquals(null, report.getTarget()); }

Target:
public void test() throws Exception { ExternalBuildReport report = new ExternalBuildReport("http://some.url.com"); assertEquals("View External Report", report.getDisplayName()); assertEquals("graph.gif", report.getIconFileName()); assertEquals("http://some.url.com", report.getUrlName()); assertEquals(null, report.getTarget()); }
Source:
public Double getValue() { //do not miss the last tuple try { estimator.accumulate(cx); } catch (ExecException ex) { throw new RuntimeException("Error while accumulating sample frequency: " + ex); } return estimator.getEntropy(); }

Target:
public Double getValue() { //do not miss the last tuple try { this.estimator.accumulate(this.cx); } catch (ExecException ex) { throw new RuntimeException("Error while accumulating sample frequency: " + ex); } return this.estimator.getEntropy(); }
Source:
private boolean usesCatalogsAsSchemas(DatabaseMetaData metaData) { boolean result = true; ResultSet rs = null; try { rs = metaData.getSchemas(); while (rs.next() && result) { result = false; } } catch (SQLException e) { throw JdbcUtils.wrapException(e, "retrieve schema and catalog metadata", JdbcActionType.METADATA); } finally { FileHelper.safeClose(rs); close(null); } return result; }

Target:
private boolean usesCatalogsAsSchemas(DatabaseMetaData metaData) { boolean result = true; ResultSet rs = null; try { rs = metaData.getSchemas(); while (rs.next() && result) { result = false; } } catch (SQLException e) { throw JdbcUtils.wrapException(e, "retrieve schema and catalog metadata", JdbcActionType.METADATA); } finally { FileHelper.safeClose(rs); } return result; }
Source:
private void header(@NonNull final BecauseYouReadCard card) { CardLargeHeaderView header = new CardLargeHeaderView(getContext()) .setTitle(card.title()) .setSubtitle(card.subtitle()) .setPageTitle(card.pageTitle().getDisplayText()) .setImage(card.image()); header(header); }

Target:
private void header(@NonNull final BecauseYouReadCard card) { CardLargeHeaderView header = new CardLargeHeaderView(getContext()) .setTitle(card.title()) .setSubtitle(card.subtitle()) .setPageTitle(card.pageTitle()) .setImage(card.image()); header(header); }
Source:
public void testSimpleAnnotation() { assertGeneratedMatches( Lists.newArrayList("import javax.annotation.Nullable;"), Lists.newArrayList("@Nullable"), Lists.newArrayList("@javax.annotation.Nullable")); }

Target:
public void testSimpleAnnotation() { assertGeneratedMatches( ImmutableList.of("import javax.annotation.Nullable;"), ImmutableList.of("@Nullable"), ImmutableList.of("@javax.annotation.Nullable")); }
Source:
public Layers(EntityLivingBase entity, RenderLivingBase<T> entityRenderer, LayerRenderer<T> layerRenderer, double x, double y, double z) { super(entity, entityRenderer, x, y, z); this.layerRenderer = layerRenderer; }

Target:
protected Layers(EntityLivingBase entity, RenderLivingBase<T> entityRenderer, LayerRenderer<T> layerRenderer, double x, double y, double z) { super(entity, entityRenderer, x, y, z); this.layerRenderer = layerRenderer; }
Source:
public boolean isKeyFrame(byte[] buff, int off, int len) { if (buff == null || len < 1 || buff.length < len) { return false; } int nalType = buff[off] & kTypeMask; // Single NAL Unit Packet if (nalType == kFuA) { // Fragmented NAL units (FU-A). if (parseFuaNaluForKeyFrame(buff, off, len)) { return true; } } else { if (parseSingleNaluForKeyFrame(buff, off, len)) { return true; } } return false; }

Target:
public static boolean isKeyFrame(byte[] buff, int off, int len) { if (buff == null || buff.length < off + Math.max(len, 1)) { return false; } int nalType = buff[off] & kTypeMask; // Single NAL Unit Packet if (nalType == kFuA) { // Fragmented NAL units (FU-A). if (parseFuaNaluForKeyFrame(buff, off, len)) { return true; } } else { if (parseSingleNaluForKeyFrame(buff, off, len)) { return true; } } return false; }
Source:
public boolean isOpen() { return mBaseTransport.isOpen() && mTransport != null && mTransport.isOpen(); }

Target:
public boolean isOpen() { return mTransport != null && mTransport.isOpen(); }
Source:
public boolean supportsBitmapIndex(final BitmapIndexSelector selector) { // We can operate on bitmap indexes if this is a constant expression, or if it reads one column that has // an index and does not have multiple values. The lack of multiple values is important because expression // filters treat multi-value arrays as nulls, which doesn't permit index based filtering. return requiredBindings.isEmpty() || (requiredBindings.size() == 1 && selector.getBitmapIndex(Iterables.getOnlyElement(requiredBindings)) != null && !selector.hasMultipleValues(Iterables.getOnlyElement(requiredBindings))); }

Target:
public boolean supportsBitmapIndex(final BitmapIndexSelector selector) { if (requiredBindings.isEmpty()) { // Constant expression. return true; } else if (requiredBindings.size() == 1) { // Single-column expression. We can use bitmap indexes if this column has an index and does not have // multiple values. The lack of multiple values is important because expression filters treat multi-value // arrays as nulls, which doesn't permit index based filtering. final String column = Iterables.getOnlyElement(requiredBindings); return selector.getBitmapIndex(column) != null && !selector.hasMultipleValues(column); } else { // Multi-column expression. return false; } }
Source:
private boolean isFailedEqualityComparison(Throwable exception) { if (!(exception instanceof ConditionNotSatisfiedError)) return false; final ConditionNotSatisfiedError conditionNotSatisfiedError = (ConditionNotSatisfiedError) exception; Condition condition = conditionNotSatisfiedError.getCondition(); ExpressionInfo expr = condition.getExpression(); return expr != null && expr.isEqualityComparison() && // it is equality conditionNotSatisfiedError.getCause() == null; // and it is not failed because of exception }

Target:
private boolean isFailedEqualityComparison(Throwable exception) { if (!(exception instanceof ConditionNotSatisfiedError)) return false; ConditionNotSatisfiedError conditionNotSatisfiedError = (ConditionNotSatisfiedError) exception; Condition condition = conditionNotSatisfiedError.getCondition(); ExpressionInfo expr = condition.getExpression(); return expr != null && expr.isEqualityComparison() && // it is equality conditionNotSatisfiedError.getCause() == null; // and it is not failed because of exception }
Source:
public final RedirectAction getLogoutRedirectAction(final WebContext context) { // it's an AJAX request -> unauthorized (instead of a redirection) if (ajaxRequestResolver.isAjax(context)) { logger.info("AJAX request detected -> returning 401"); cleanRequestedUrl(context); return null; } // authentication has already been tried -> unauthorized final String attemptedAuth = (String) context.getSessionAttribute(getName() + ATTEMPTED_AUTHENTICATION_SUFFIX); if (CommonHelper.isNotBlank(attemptedAuth)) { return null; } init(context); return retrieveLogoutRedirectAction(context); }

Target:
public final RedirectAction getLogoutRedirectAction(final WebContext context) { init(context); return retrieveLogoutRedirectAction(context); }
Source:
public void setMainTabSelectedItem(Erratum selectedItem) { logger.info("setMainTabSelectedItem"); //$NON-NLS-1$ updateErrataDetailFormPanel(selectedItem); }

Target:
public void setMainTabSelectedItem(Erratum selectedItem) { updateErrataDetailFormPanel(selectedItem); }
Source:
public EurekaArchaius2InstanceConfig(Config config, String namespace, DataCenterInfo dcInfo) { this.defaultAppGroup = config.getString(FALLBACK_APP_GROUP_KEY, Values.UNKNOWN_APPLICATION); this.namespace = namespace; this.config = config.getPrefixedView(namespace); this.dcInfo = dcInfo; // TODO: Remove this when DiscoveryManager is finally no longer used DiscoveryManager.getInstance().setEurekaInstanceConfig(this); }

Target:
public EurekaArchaius2InstanceConfig(Config config, String namespace, DataCenterInfo dcInfo) { this.defaultAppGroup = config.getString(FALLBACK_APP_GROUP_KEY, Values.UNKNOWN_APPLICATION); this.namespace = namespace; this.config = config.getPrefixedView(namespace); this.dcInfo = dcInfo; }
Source:
private Map<String, String> makeParserFields() { final Map<String, String> fieldMapping = Maps.newHashMap(); for (final SchemaPath sp : getColumns()) { final String drillField = sp.getRootSegment().getPath(); try { final String parserField = HttpdParser.parserFormattedFieldName(drillField); fieldMapping.put(drillField, parserField); } catch (Exception e) { LOG.info("Putting field: " + drillField + " into map", e); } } return fieldMapping; }

Target:
private Map<String, String> makeParserFields() { Map<String, String> fieldMapping = new HashMap<>(); for (final SchemaPath sp : getColumns()) { String drillField = sp.getRootSegment().getPath(); try { String parserField = HttpdParser.parserFormattedFieldName(drillField); fieldMapping.put(drillField, parserField); } catch (Exception e) { LOG.info("Putting field: " + drillField + " into map", e); } } return fieldMapping; }
Source:
public long skip(long n) { if (n > 0) { long skip = bytes.length - pos; if (skip > n) skip = n; pos += skip; return skip; } else { int idx = Math.min(bytes.length, pos); long skip = idx + n; pos = (int) skip; return skip; } }

Target:
public long skip(long n) { if (n > 0) { long skip = bytes.length - pos; if (skip > n) skip = n; pos += skip; return skip; } else { int idx = Math.min(bytes.length, pos); long skip = idx + n; // Calculate max to avoid skipping before offset pos = (int) Math.max(skip, offset); return skip; } }
Source:
protected void reloadCache() { schemaMappingCache.invalidateAll(); // this preloads the list of schema names Set<String> schemas = getSchemaNames(); // invalidate and remove from the schema table mapping all records, start from scratch for (String key : schemaTableMapping.keySet()) { schemaTableMapping.get(key).invalidateAll(); schemaTableMapping.remove(key); } for (final String schema : schemas) { // this preloads the list of table names for each schema getTableNames(schema); } }

Target:
protected void reloadCache() { schemaMappingCache.invalidateAll(); // this preloads the list of schema names Set<String> schemas = getSchemaNames(); // invalidate and remove from the schema table mapping all records, start from scratch schemaTableMapping.keySet().forEach(key -> { schemaTableMapping.get(key).invalidateAll(); }); schemaTableMapping.clear(); for (final String schema : schemas) { // this preloads the list of table names for each schema getTableNames(schema); } }
Source:
private RelNode possiblyWrapRootWithOuterLimitFromContext( RelRoot root ) { Object outerLimitObj = plannerContext.getQueryContext().get(PlannerContext.CTX_SQL_OUTER_LIMIT); if (outerLimitObj == null) { return root.rel; } Long outerLimit = DimensionHandlerUtils.convertObjectToLong(outerLimitObj, true); if (outerLimit == null) { return root.rel; } return LogicalSort.create( root.rel, root.collation, makeBigIntLiteral(0), makeBigIntLiteral(outerLimit) ); }

Target:
private RelNode possiblyWrapRootWithOuterLimitFromContext( RelRoot root ) { Object outerLimitObj = plannerContext.getQueryContext().get(PlannerContext.CTX_SQL_OUTER_LIMIT); Long outerLimit = DimensionHandlerUtils.convertObjectToLong(outerLimitObj, true); if (outerLimit == null) { return root.rel; } return LogicalSort.create( root.rel, root.collation, makeBigIntLiteral(0), makeBigIntLiteral(outerLimit) ); }
Source:
public void removeServiceEventListener(Object listener) { assert getExecutor().isInExecutorThread(); ListenerEntry entry = new ListenerEntry(listener, null); if (DsfDebugOptions.DEBUG && DsfDebugOptions.DEBUG_SESSION && DsfDebugOptions.DEBUG_SESSION_LISTENERS) { String msg = new Formatter().format( "%s %s removed as a service listener to %s (id=%s)", //$NON-NLS-1$ DsfPlugin.getDebugTime(), LoggingUtils.toString(listener), LoggingUtils.toString(this), getId() ).toString(); DsfDebugOptions.trace(msg); } fListeners.remove(entry); }

Target:
public void removeServiceEventListener(Object listener) { assert getExecutor().isInExecutorThread(); ListenerEntry entry = new ListenerEntry(listener, null); if (DsfDebugOptions.DEBUG_SESSION_LISTENERS) { String msg = new Formatter().format( "%s %s removed as a service listener to %s (id=%s)", //$NON-NLS-1$ DsfPlugin.getDebugTime(), LoggingUtils.toString(listener), LoggingUtils.toString(this), getId() ).toString(); DsfDebugOptions.trace(msg); } fListeners.remove(entry); }
Source:
public void deleteIfExists(File path, String user, String logPrefix) throws IOException { LOG.info("Deleting path {}", path); Path p = path.toPath(); if (Files.exists(p)) { try { FileUtils.forceDelete(path); } catch (FileNotFoundException ignored) } }

Target:
public void deleteIfExists(File path, String user, String logPrefix) throws IOException { //by default no need to do this as a different user deleteIfExists(path); }
Source:
protected void releaseTransport(Transport transport) { if (dedicatedTransport == null) { //we aren't using this transport. we can release it super.releaseTransport(transport); } }

Target:
protected void releaseTransport(Transport transport) { if (dedicatedTransport != transport) { //we aren't using this transport. we can release it super.releaseTransport(transport); } }
Source:
public synchronized void deleteFile() { closeFile(); File historyTreeFile = fConfig.getStateFile(); try { if (!historyTreeFile.delete()) { /* We didn't succeed in deleting the file */ Activator.getDefault().logError("Failed to delete" + historyTreeFile.getName()); //$NON-NLS-1$ } } catch (SecurityException e) { Activator.getDefault().logError(e.getMessage(), e); } }

Target:
public synchronized void deleteFile() { closeFile(); File historyTreeFile = fConfig.getStateFile(); if (!historyTreeFile.delete()) { /* We didn't succeed in deleting the file */ Activator.getDefault().logError("Failed to delete" + historyTreeFile.getName()); //$NON-NLS-1$ } }