auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void doStartThread() { assert thread == null; executor.execute(new Runnable() { @Override public void run() { thread = Thread.currentThread(); if (interrupted) { thread.interrupt(); } boolean success = false; updateLastExecutionTime(); try { SingleThreadEventExecutor.this.run(); success = true; } catch (Throwable t) { logger.warn("Unexpected exception from an event executor: ", t); } finally { for (;;) { int oldState = state; if (oldState >= ST_SHUTTING_DOWN || STATE_UPDATER.compareAndSet( SingleThreadEventExecutor.this, oldState, ST_SHUTTING_DOWN)) { break; } } if (success && gracefulShutdownStartTime == 0) { if (logger.isErrorEnabled()) { logger.error("Buggy " + EventExecutor.class.getSimpleName() + " implementation; " + SingleThreadEventExecutor.class.getSimpleName() + ".confirmShutdown() must " + "be called before run() implementation terminates."); } } try { for (;;) { if (confirmShutdown()) { break; } } } finally { try { cleanup(); } finally { STATE_UPDATER.set(SingleThreadEventExecutor.this, ST_TERMINATED); threadLock.release(); if (!taskQueue.isEmpty()) { if (logger.isWarnEnabled()) { logger.warn("An event executor terminated with " + "non-empty task queue (" + taskQueue.size() + ')'); } } FastThreadLocal.removeAll(); terminationFuture.setSuccess(null); } } } } }); }

Target:
private void doStartThread() { assert thread == null; executor.execute(new Runnable() { @Override public void run() { thread = Thread.currentThread(); if (interrupted) { thread.interrupt(); } boolean success = false; updateLastExecutionTime(); try { SingleThreadEventExecutor.this.run(); success = true; } catch (Throwable t) { logger.warn("Unexpected exception from an event executor: ", t); } finally { for (;;) { int oldState = state; if (oldState >= ST_SHUTTING_DOWN || STATE_UPDATER.compareAndSet( SingleThreadEventExecutor.this, oldState, ST_SHUTTING_DOWN)) { break; } } if (success && gracefulShutdownStartTime == 0) { if (logger.isErrorEnabled()) { logger.error("Buggy " + EventExecutor.class.getSimpleName() + " implementation; " + SingleThreadEventExecutor.class.getSimpleName() + ".confirmShutdown() must " + "be called before run() implementation terminates."); } } try { for (;;) { if (confirmShutdown()) { break; } } } finally { try { cleanup(); } finally { FastThreadLocal.removeAll(); STATE_UPDATER.set(SingleThreadEventExecutor.this, ST_TERMINATED); threadLock.release(); if (!taskQueue.isEmpty()) { if (logger.isWarnEnabled()) { logger.warn("An event executor terminated with " + "non-empty task queue (" + taskQueue.size() + ')'); } } terminationFuture.setSuccess(null); } } } } }); }
Source:
public int onStartCommand(Intent intent, int flags, int startId) { Log.d(TAG, "Trip service started"); Intent notificationIntent = new Intent(this, TripService.class); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); Notification notification = new NotificationCompat.Builder(getApplicationContext(), Application.CHANNEL_TRIP_PLAN_UPDATES_ID) .setSmallIcon(R.drawable.ic_stat_notification) .setContentTitle("Service running in foreground") .setContentText("OneBusAway will be running a service in foreground") .setContentIntent(pendingIntent).build(); startForeground(1001,notification); return handleCommand(intent, startId); }

Target:
public int onStartCommand(Intent intent, int flags, int startId) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { Intent notificationIntent = new Intent(this, TripService.class); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); String action = intent.getAction(); String foregroundNotifyTitle = Application.get().getResources() .getString(R.string.foreground_all_intent_title); String foregroundNotifyText = ""; if (ACTION_SCHEDULE.equals(action)) { foregroundNotifyText = Application.get().getResources() .getString(R.string.foreground_action_schedule_text); } else if (ACTION_POLL.equals(action)) { foregroundNotifyText = Application.get().getResources() .getString(R.string.foreground_action_poll_text); } else if (ACTION_NOTIFY.equals(action)) { foregroundNotifyText = Application.get().getResources() .getString(R.string.foreground_action_notify_text); } else { foregroundNotifyText = Application.get().getResources() .getString(R.string.foreground_action_cancel_text); } Notification notification = new NotificationCompat.Builder(getApplicationContext(), Application.CHANNEL_TRIP_PLAN_UPDATES_ID) .setSmallIcon(R.drawable.ic_stat_notification) .setContentTitle(foregroundNotifyTitle) .setContentText(foregroundNotifyText) .setContentIntent(pendingIntent).build(); startForeground(FOREGROUND_NOTIFICATION_ID, notification); } return handleCommand(intent, startId); }
Source:
private void callCreateCacheManagers() throws Throwable { try { log.debug("Creating cache managers"); createCacheManagers(); waitForClusterToForm(); log.debug("Cache managers created, ready to start the test"); } catch (Throwable th) { log.error("Error in test setup: ", th); throw th; } }

Target:
private void callCreateCacheManagers() throws Throwable { try { log.debug("Creating cache managers"); createCacheManagers(); log.debug("Cache managers created, ready to start the test"); } catch (Throwable th) { log.error("Error in test setup: ", th); throw th; } }
Source:
public ReviewerResult removeReviewer(String reviewId, String reviewerId, IProgressMonitor monitor) throws GerritException { Change.Id id = new Change.Id(id(reviewId)); String uri = "/a/changes/" + id.get() + "/reviewers/" + reviewerId; ReviewerResult reviewerResult = new ReviewerResult(); try { String result = restClient.executeDeleteRestRequest(uri, new ReviewerInput(reviewerId), String.class, null, monitor); } catch (GerritHttpException e) { if (e.getResponseCode() == HttpStatus.SC_NOT_FOUND) { reviewerResult .addError(new ReviewerResult.Error(ReviewerResult.Error.Type.ACCOUNT_NOT_FOUND, reviewerId)); } } ChangeDetail changeDetail = getChangeDetail(id.get(), monitor); List<ApprovalDetail> approvalDetails = new ArrayList<>(); for (ApprovalDetail approval : changeDetail.getApprovals()) { if (!approval.getAccount().equals(reviewerId)) { approvalDetails.add(approval); } } changeDetail.setApprovals(approvalDetails); reviewerResult.setChange(changeDetail); return reviewerResult; }

Target:
public ReviewerResult removeReviewer(String reviewId, String reviewerId, IProgressMonitor monitor) throws GerritException { Change.Id id = new Change.Id(id(reviewId)); String uri = "/a/changes/" + id.get() + "/reviewers/" + reviewerId; ReviewerResult reviewerResult = new ReviewerResult(); try { String result = restClient.executeDeleteRestRequest(uri, new ReviewerInput(reviewerId), String.class, null, monitor); } catch (GerritHttpException e) { if (e.getResponseCode() == HttpStatus.SC_NOT_FOUND) { reviewerResult.addError(new ReviewerResult.Error(null, reviewerId)); } } ChangeDetail changeDetail = getChangeDetail(id.get(), monitor); List<ApprovalDetail> approvalDetails = new ArrayList<>(); for (ApprovalDetail approval : changeDetail.getApprovals()) { if (!approval.getAccount().equals(reviewerId)) { approvalDetails.add(approval); } } changeDetail.setApprovals(approvalDetails); reviewerResult.setChange(changeDetail); return reviewerResult; }
Source:
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { GoogleAnalyticsUtils.reportPrefActivityEntry(GoogleAnalyticsFields.CATEGORY_CC_PREFS); setupUI(); initPrefs(); loadPrefs(); }

Target:
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { GoogleAnalyticsUtils.reportPrefActivityEntry(getAnalyticsCategory()); setTitle(); initPrefsFile(); loadPrefs(); }
Source:
private boolean InitializeStorage() { boolean returnValue = false; if (getStoragePool() == null || StoragePoolStatus.Uninitialized == getStoragePool().getStatus() || StoragePoolStatus.Maintenance == getStoragePool().getStatus()) { returnValue = true; connectPoolSucceeded = true; } else { ConnectHostToStoragePoolServersParameters params = new ConnectHostToStoragePoolServersParameters(getStoragePool(), getVds()); Backend.getInstance().runInternalAction(VdcActionType.ConnectHostToStoragePoolServers, params); EventResult connectResult = connectHostToPool(); returnValue = connectResult == null ? false : connectResult.isSuccess(); connectPoolSucceeded = returnValue; if (!returnValue) { problematicDomains = (List<StorageDomainStatic>) connectResult.getResultData(); } } return returnValue; }

Target:
private boolean InitializeStorage() { boolean returnValue = false; if (getStoragePool() == null || StoragePoolStatus.Uninitialized == getStoragePool().getStatus() || StoragePoolStatus.Maintenance == getStoragePool().getStatus()) { returnValue = true; connectPoolSucceeded = true; } else { ConnectHostToStoragePoolServersParameters params = new ConnectHostToStoragePoolServersParameters(getStoragePool(), getVds()); Backend.getInstance().runInternalAction(VdcActionType.ConnectHostToStoragePoolServers, params); EventResult connectResult = connectHostToPool(); if (connectResult != null) { returnValue = connectResult.isSuccess(); problematicDomains = (List<StorageDomainStatic>) connectResult.getResultData(); } connectPoolSucceeded = returnValue; } return returnValue; }
Source:
public Definitions toDefinitions() { Definitions definitions = bpmn2.createDefinitions(); DefinitionsPropertyWriter p = propertyWriterFactory.of(definitions); ProcessPropertyWriter pp = processConverter.convertProcess(); Node<Definition<BPMNDiagram>, ?> node = converterFactory.context.firstNode(); BPMNDiagram definition = node.getContent().getDefinition(); BaseDiagramSet diagramSet = definition.getDiagramSet(); p.setExporter("jBPM Process Modeler"); p.setExporterVersion("2.0"); p.setProcess(pp.getProcess()); p.setDiagram(pp.getBpmnDiagram()); p.setRelationship(pp.getRelationship()); p.setWSDLImports(diagramSet.getImports().getValue().getWSDLImports()); p.addAllRootElements(pp.getItemDefinitions()); p.addAllRootElements(pp.getRootElements()); p.addAllRootElements(pp.getInterfaces()); pp.getProcess().getFlowElements().addAll(pp.getDataObjects()); return definitions; }

Target:
public Definitions toDefinitions() { Definitions definitions = bpmn2.createDefinitions(); DefinitionsPropertyWriter p = propertyWriterFactory.of(definitions); ProcessPropertyWriter pp = processConverter.convertProcess(); Node<Definition<BPMNDiagram>, ?> node = converterFactory.context.firstNode(); BPMNDiagram definition = node.getContent().getDefinition(); BaseDiagramSet diagramSet = definition.getDiagramSet(); p.setExporter("jBPM Process Modeler"); p.setExporterVersion("2.0"); p.setProcess(pp.getProcess()); p.setDiagram(pp.getBpmnDiagram()); p.setRelationship(pp.getRelationship()); p.setWSDLImports(diagramSet.getImports().getValue().getWSDLImports()); p.addAllRootElements(pp.getItemDefinitions()); p.addAllRootElements(pp.getRootElements()); p.addAllRootElements(pp.getInterfaces()); return definitions; }
Source:
public void actionPerformed(ActionEvent arg0) { Layouts layoutType = (Layouts) jcb.getSelectedItem(); try { Network network = g_array[graph_index]; Layout<Integer> layout = createLayout(layoutType, network); layout.setInitializer(vv.getGraphLayout()); layout.setSize(vv.getSize()); System.err.println("using graph " + graph_names[graph_index]); System.err.println("using layout: " + layout.getClass()); LayoutTransition<Integer, Number> lt = new LayoutTransition<Integer, Number>( vv, vv.getModel().getLayoutMediator(), new LayoutMediator(network, layout)); Animator animator = new Animator(lt); animator.start(); vv.getRenderContext().getMultiLayerTransformer().setToIdentity(); vv.repaint(); } catch (Exception e) { e.printStackTrace(); } }

Target:
public void actionPerformed(ActionEvent arg0) { Layouts layoutType = (Layouts) jcb.getSelectedItem(); try { Network network = g_array[graph_index]; Layout<Integer> layout = createLayout(layoutType, network); layout.setInitializer(vv.getGraphLayout()); layout.setSize(vv.getSize()); LayoutTransition<Integer, Number> lt = new LayoutTransition<Integer, Number>( vv, vv.getModel().getLayoutMediator(), new LayoutMediator(network, layout)); Animator animator = new Animator(lt); animator.start(); vv.getRenderContext().getMultiLayerTransformer().setToIdentity(); vv.repaint(); } catch (Exception e) { e.printStackTrace(); } }
Source:
void init(Drawable drawable, GCData data, long gdkGC) { if (GTK.GTK3) { if (data.foregroundRGBA != null) data.state &= ~FOREGROUND; if (data.backgroundRGBA != null) data.state &= ~(BACKGROUND | BACKGROUND_BG); } else { if (data.foreground != null) data.state &= ~FOREGROUND; if (data.background != null) data.state &= ~(BACKGROUND | BACKGROUND_BG); } if (data.font != null) data.state &= ~FONT; Image image = data.image; if (image != null) { image.memGC = this; if (image.transparentPixel != -1) image.destroyMask(); } this.drawable = drawable; this.data = data; handle = gdkGC; long cairo = data.cairo = handle; Cairo.cairo_set_fill_rule(cairo, Cairo.CAIRO_FILL_RULE_EVEN_ODD); data.state &= ~(BACKGROUND | FOREGROUND | FONT | LINE_WIDTH | LINE_CAP | LINE_JOIN | LINE_STYLE | DRAW_OFFSET); setClipping(data.clipRgn); initCairo(); if ((data.style & SWT.MIRRORED) != 0) { if (GTK.GTK_VERSION >= OS.VERSION (3, 14, 0) && OS.CAIRO_CONTEXT_REUSE) { int[] w = new int[1], h = new int[1]; getSize(w, h); Cairo.cairo_translate(cairo, w[0], 0); Cairo.cairo_scale(cairo, -1.0, 1.0); } else { Cairo.cairo_set_matrix(data.cairo, identity()); } } if (cairoTransformationMatrix == null) cairoTransformationMatrix = new double[6]; Cairo.cairo_get_matrix(data.cairo, cairoTransformationMatrix); clipping = getClipping(); }

Target:
void init(Drawable drawable, GCData data, long gdkGC) { if (GTK.GTK3) { if (data.foregroundRGBA != null) data.state &= ~FOREGROUND; if (data.backgroundRGBA != null) data.state &= ~(BACKGROUND | BACKGROUND_BG); } else { if (data.foreground != null) data.state &= ~FOREGROUND; if (data.background != null) data.state &= ~(BACKGROUND | BACKGROUND_BG); } if (data.font != null) data.state &= ~FONT; Image image = data.image; if (image != null) { image.memGC = this; if (image.transparentPixel != -1) image.destroyMask(); } this.drawable = drawable; this.data = data; handle = gdkGC; long cairo = data.cairo = handle; Cairo.cairo_set_fill_rule(cairo, Cairo.CAIRO_FILL_RULE_EVEN_ODD); data.state &= ~(BACKGROUND | FOREGROUND | FONT | LINE_WIDTH | LINE_CAP | LINE_JOIN | LINE_STYLE | DRAW_OFFSET); setClipping(data.clipRgn); initCairo(); if ((data.style & SWT.MIRRORED) != 0) { if (GTK.GTK_VERSION >= OS.VERSION (3, 14, 0) && OS.CAIRO_CONTEXT_REUSE) { int[] w = new int[1], h = new int[1]; getSize(w, h); Cairo.cairo_translate(cairo, w[0], 0); Cairo.cairo_scale(cairo, -1.0, 1.0); } else { Cairo.cairo_set_matrix(data.cairo, identity()); } } if (OS.CAIRO_CONTEXT_REUSE) { if (cairoTransformationMatrix == null) cairoTransformationMatrix = new double[6]; Cairo.cairo_get_matrix(data.cairo, cairoTransformationMatrix); clipping = getClipping(); } }
Source:
public PomJsonReaderDefault(String path, String jsonName) { String jsonPath = path + jsonName; if (!Files.exists(Paths.get(jsonPath))) { throw new RuntimeException("no " + jsonName + " in the provided path :" + path); } InputStream fis = null; JsonReader reader = null; try { fis = new FileInputStream(jsonPath); reader = Json.createReader(fis); pomObject = reader.readObject(); reader.close(); } catch (Exception e) { logger.error(e.getMessage()); throw new RuntimeException(e.getMessage()); } finally { if (fis != null) { try { fis.close(); } catch (IOException ex) { logger.warn(ex.getMessage(), ex); } } if (reader != null) { reader.close(); } } }

Target:
public PomJsonReaderDefault(String path, String jsonName) { String jsonPath = path + jsonName; if (!Files.exists(Paths.get(jsonPath))) { throw new RuntimeException("no " + jsonName + " in the provided path :" + path); } try (FileInputStream fis = new FileInputStream(jsonPath); JsonReader reader = Json.createReader(fis)) { pomObject = reader.readObject(); } catch (Exception e) { logger.error(e.getMessage()); throw new RuntimeException(e.getMessage()); } }
Source:
public static void main(String[] args) { SpringApplication application = new SpringApplication(); String command = extractCommand(args); if ("initHome".equals(command)) { application.setSources(Collections.<Object>singleton(InitHome.class)); application.setWebEnvironment(false); } else { application.setSources(Collections.<Object>singleton(Osiam.class)); application.addListeners(new OsiamHome()); } application.setDefaultProperties(DEFAULT_PROPERTIES); application.run(args); }

Target:
public static void main(String[] args) { SpringApplication application = new SpringApplication(); String command = extractCommand(args); if ("initHome".equals(command)) { application.setSources(Collections.<Object>singleton(InitHome.class)); application.setWebEnvironment(false); } else { application.setSources(Collections.<Object>singleton(Osiam.class)); } application.addListeners(new OsiamHome()); application.setDefaultProperties(DEFAULT_PROPERTIES); application.run(args); }
Source:
public void testUploadWithAllParametersSet() throws IOException { String key = getRandomString(); String bucket = getRandomString(); transferUtility.upload(key, inputStream, UploadOptions.builder() .bucket(bucket) .objectMetadata(metadata) .cannedAcl(cannedAcl) .transferListener(listener) .build()); verify(transferUtility, times(1)).upload(eq(bucket), eq(key), any(File.class), eq(metadata), eq(cannedAcl), eq(listener)); transferUtility.getDbUtil().closeDB(); }

Target:
public void testUploadWithAllParametersSet() throws IOException { String key = getRandomString(); String bucket = getRandomString(); transferUtility.upload(key, inputStream, UploadOptions.builder() .bucket(bucket) .objectMetadata(metadata) .cannedAcl(cannedAcl) .transferListener(listener) .build()); verify(transferUtility, times(1)).upload(eq(bucket), eq(key), any(File.class), eq(metadata), eq(cannedAcl), eq(listener)); }
Source:
public static void showGutenbergCompatibilityWarningDialog(Context ctx, FragmentManager fragmentManager, PostModel post, SiteModel site) { GutenbergWarningFragmentDialog gutenbergCompatibilityDialog = new GutenbergWarningFragmentDialog(); gutenbergCompatibilityDialog.initialize(TAG_GUTENBERG_CONFIRM_DIALOG, post.isPage(), post.getRemotePostId()); gutenbergCompatibilityDialog.show(fragmentManager, TAG_GUTENBERG_CONFIRM_DIALOG); Map<String, Object> properties = new HashMap<>(); if (!post.isLocalDraft()) { properties.put("post_id", post.getRemotePostId()); } properties.put("is_page", post.isPage()); properties.put(AnalyticsUtils.HAS_GUTENBERG_BLOCKS_KEY, true); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.GUTENBERG_WARNING_CONFIRM_DIALOG_SHOWN, site, properties); }

Target:
public static void showGutenbergCompatibilityWarningDialog(Context ctx, FragmentManager fragmentManager, PostModel post, SiteModel site) { GutenbergWarningFragmentDialog gutenbergCompatibilityDialog = new GutenbergWarningFragmentDialog(); gutenbergCompatibilityDialog.initialize(post.getRemotePostId(), post.isPage()); gutenbergCompatibilityDialog.show(fragmentManager, "tag_gutenberg_confirm_dialog"); trackGutenbergDialogEvent(AnalyticsTracker.Stat.GUTENBERG_WARNING_CONFIRM_DIALOG_SHOWN, post, site); }
Source:
private double calcSilhouetteCoefficient(double d1, double d2) { if (d1 < d2) { return 1.0 - (d1 / d2); } else if (d1 == d2) { return 0; } else { return (d2 / d1) - 1.0; } }

Target:
private double calcSilhouetteCoefficient(double d1, double d2) { if (d1 < d2) { return 1.0 - (d1 / d2); } else if (d1 > d2) { return (d2 / d1) - 1.0; } return 0.0; }
Source:
public boolean computeWithPrimaryLocked(Object key, Runnable r) throws PrimaryBucketLockException { int bucketId = PartitionedRegionHelper.getHashKey(this, null, key, null, null); BucketRegion br; try { br = this.dataStore.getInitializedBucketForId(key, bucketId); } catch (ForceReattemptException e) { throw new BucketMovedException(e); } try { if (!br.doLockForPrimary(false)) { return false; } } catch (PrimaryBucketException e) { throw new PrimaryBucketLockException("retry since primary lock failed: " + e); } try { r.run(); } finally { br.doUnlockForPrimary(); } return true; }

Target:
public void computeWithPrimaryLocked(Object key, Runnable r) throws PrimaryBucketLockException { int bucketId = PartitionedRegionHelper.getHashKey(this, null, key, null, null); BucketRegion br; try { br = this.dataStore.getInitializedBucketForId(key, bucketId); } catch (ForceReattemptException e) { throw new BucketMovedException(e); } try { br.doLockForPrimary(false); } catch (PrimaryBucketException e) { throw new PrimaryBucketLockException("retry since primary lock failed: " + e); } try { r.run(); } finally { br.doUnlockForPrimary(); } }
Source:
public boolean isObstructed() { Location current = getTopLeftCorner(); BlockFace right = getRightFace(); for (int y = 0; y < art.getBlockHeight(); y++) { for (int x = 0; x < art.getBlockWidth(); x++) { if (!canHoldPainting(current)) { return true; } current = current.getBlock().getRelative(right).getLocation(); } current = current.getBlock().getRelative(BlockFace.DOWN).getLocation(); current.subtract(right.getModX() * art.getBlockWidth(), 0, right.getModZ() * art.getBlockWidth()); } return !this.world.getEntityManager().getEntitiesInside(this.boundingBox, this).isEmpty(); }

Target:
public boolean isObstructed() { Location current = getTopLeftCorner(); BlockFace right = getRightFace(); for (int y = 0; y < art.getBlockHeight(); y++) { for (int x = 0; x < art.getBlockWidth(); x++) { if (!canHoldPainting(current)) { return true; } current = current.getBlock().getRelative(right).getLocation(); } current = current.getBlock().getRelative(BlockFace.DOWN).getLocation(); current.subtract(right.getModX() * art.getBlockWidth(), 0, right.getModZ() * art.getBlockWidth()); } List<Entity> entitiesInside = this.world.getEntityManager().getEntitiesInside(this.boundingBox, this); return entitiesInside.stream().anyMatch(e -> e instanceof Hanging); }
Source:
public void onStreamCreate(IMediaStream stream) { logger.debug("onStreamCreate - [" + stream.getName() + "]"); stream.addClientListener(actionListener); }

Target:
public void onStreamCreate(IMediaStream stream) { LiveStreamListener actionListener = new LiveStreamListener(); logger.debug("onStreamCreate - [" + stream.getName() + "]"); WMSProperties props = stream.getProperties(); synchronized (props) { props.setProperty(STREAM_ACTION_PROPERTY, actionListener); } stream.addClientListener(actionListener); }
Source:
public void call(Iterator<BulkImportPartition> importPartitions) throws Exception { init(importPartitions); Configuration conf = HConfiguration.unwrapDelegate(); LoadIncrementalHFiles loader = new LoadIncrementalHFiles(conf); FileSystem fs = FileSystem.get(URI.create(bulkImportDirectory), conf); for (Long conglomId : partitionMap.keySet()) { PartitionFactory tableFactory= SIDriver.driver().getTableFactory(); Partition partition=tableFactory.getTable(Long.toString(conglomId)); List<BulkImportPartition> partitionList = partitionMap.get(conglomId); Path path = new Path(partitionList.get(0).getFilePath()); if (!fs.exists(path)) { fs.mkdirs(path); } for (int i = 1; i < partitionList.size(); ++i) { Path sourceDir = new Path(partitionList.get(i).getFilePath()); if (fs.exists(sourceDir)) { FileStatus[] statuses = fs.listStatus(sourceDir); for (FileStatus status : statuses) { Path filePath = status.getPath(); Path destPath = new Path(path, filePath.getName()); fs.rename(filePath, destPath); if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "Move file %s to ", filePath.toString(), destPath.toString()); } } fs.delete(sourceDir.getParent(), true); } } loader.doBulkLoad(path.getParent(), (HTable) ((SkeletonHBaseClientPartition)partition).unwrapDelegate()); fs.delete(path, true); } }

Target:
public void call(Iterator<BulkImportPartition> importPartitions) throws Exception { init(importPartitions); Configuration conf = HConfiguration.unwrapDelegate(); LoadIncrementalHFiles loader = new LoadIncrementalHFiles(conf); FileSystem fs = FileSystem.get(URI.create(bulkImportDirectory), conf); PartitionFactory tableFactory= SIDriver.driver().getTableFactory(); for (Long conglomId : partitionMap.keySet()) { Partition partition=tableFactory.getTable(Long.toString(conglomId)); List<BulkImportPartition> partitionList = partitionMap.get(conglomId); Path path = new Path(partitionList.get(0).getFilePath()); if (!fs.exists(path)) { fs.mkdirs(path); } for (int i = 1; i < partitionList.size(); ++i) { Path sourceDir = new Path(partitionList.get(i).getFilePath()); if (fs.exists(sourceDir)) { FileStatus[] statuses = fs.listStatus(sourceDir); for (FileStatus status : statuses) { Path filePath = status.getPath(); Path destPath = new Path(path, filePath.getName()); fs.rename(filePath, destPath); if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "Move file %s to %s", filePath.toString(), destPath.toString()); } } fs.delete(sourceDir.getParent(), true); } } loader.doBulkLoad(path.getParent(), (HTable) ((SkeletonHBaseClientPartition)partition).unwrapDelegate()); fs.delete(path, true); } }
Source:
private static List<Identity> getSshIdentities(final Optional<AgentProxy> agentProxyOpt) { final ImmutableList.Builder<Identity> listBuilder = ImmutableList.builder(); if (agentProxyOpt.isPresent()) { try { final List<Identity> identities = agentProxyOpt.get().list(); for (final Identity identity : identities) { if (identity.getPublicKey().getAlgorithm().equals("RSA")) { listBuilder.add(identity); } } } catch (Exception e) { log.debug("Couldn't get identities from tls-agent", e); } } return listBuilder.build(); }

Target:
private static List<Identity> getSshIdentities(final Optional<AgentProxy> agentProxyOpt) { final ImmutableList.Builder<Identity> listBuilder = ImmutableList.builder(); if (agentProxyOpt.isPresent()) { try { final List<Identity> identities = agentProxyOpt.get().list(); for (final Identity identity : identities) { if (identity.getPublicKey().getAlgorithm().equals("RSA")) { listBuilder.add(identity); } } } catch (Exception e) { log.debug("Couldn't get identities from ssh-agent", e); } } return listBuilder.build(); }
Source:
public UserDevfile create(UserDevfile userDevfile) throws ConflictException, ServerException, NotFoundException { requireNonNull(userDevfile); try { Account account = accountDao.getByName(userDevfile.getNamespace()); UserDevfileImpl userDevfileImpl = new UserDevfileImpl(userDevfile, account); doCreate(userDevfileImpl); return userDevfileImpl; } catch (DuplicateKeyException ex) { throw new ConflictException( format( "Devfile with name '%s' already exists in current account '%s'", userDevfile.getName(), userDevfile.getNamespace())); } catch (IntegrityConstraintViolationException ex) { throw new ConflictException( "Could not create devfile with creator that refers on non-existent user"); } catch (RuntimeException ex) { throw new ServerException(ex.getMessage(), ex); } }

Target:
public UserDevfile create(UserDevfile userDevfile) throws ConflictException, ServerException { requireNonNull(userDevfile); try { Account account = accountDao.getByName(userDevfile.getNamespace()); UserDevfileImpl userDevfileImpl = new UserDevfileImpl(userDevfile, account); doCreate(userDevfileImpl); return userDevfileImpl; } catch (DuplicateKeyException ex) { throw new ConflictException( format( "Devfile with name '%s' already exists in the specified account '%s'", userDevfile.getName(), userDevfile.getNamespace())); } catch (IntegrityConstraintViolationException ex) { throw new ConflictException( "Could not create devfile with creator that refers to a non-existent user"); } catch (RuntimeException ex) { throw new ServerException(ex.getMessage(), ex); } catch (NotFoundException e) { throw new ConflictException( format( "Not able to create devfile in requested namespace %s bacause it is not found", userDevfile.getNamespace())); } }
Source:
public CommandContext resetLock() { this.lock = new EngineLock(); return this; }

Target:
public CommandContext resetLock() { setLock(new EngineLock()); return this; }
Source:
private void buildCredentialsByUri(Uri uri) { if (uri == null) throw new NullPointerException("uri is null"); this.uri = Uri.parse(uri.getScheme() + "://" + uri.getHost() + ":" + uri.getPort() + uri.getPath() + ((uri.getQuery() != null) ? "?" + uri.getQuery() : "")); if (uri.getUserInfo() != null) { String[] values = uri.getUserInfo().split(":"); this.username = values[0]; this.password = values[1]; if (username == null) throw new IllegalStateException("username is null"); if (password == null) throw new IllegalStateException("password is null"); } this.uri = uri; }

Target:
private void buildCredentialsByUri(Uri uri) { if (uri == null) throw new NullPointerException("uri is null"); this.uri = uri; if (uri.getUserInfo() != null) { String[] values = uri.getUserInfo().split(":"); this.username = values[0]; this.password = values[1]; if (username == null) throw new IllegalStateException("username is null"); if (password == null) throw new IllegalStateException("password is null"); } }
Source:
private void assignActive() { final int totalCapacity = 1; if(sumCapacity(clients.value()) > 0) { totalCapacity = sumCapacity(clients.value(); } final int tasksPerThread = taskIds.size() / totalCapacity; final Set<TaskId> assigned = new HashSet<>(); for (final Map.Entry<TaskId, ID> entry : previousActiveTaskAssignment.entrySet()) { final TaskId taskId = entry.getKey(); if (taskIds.contains(taskId)) { final ClientState client = clients.get(entry.getValue()); if (client.hasUnfulfilledQuota(tasksPerThread)) { assignTaskToClient(assigned, taskId, client); } } } final Set<TaskId> unassigned = new HashSet<>(taskIds); unassigned.removeAll(assigned); for (final Iterator<TaskId> iterator = unassigned.iterator(); iterator.hasNext(); ) { final TaskId taskId = iterator.next(); final Set<ID> clientIds = previousStandbyTaskAssignment.get(taskId); if (clientIds != null) { for (final ID clientId : clientIds) { final ClientState client = clients.get(clientId); if (client.hasUnfulfilledQuota(tasksPerThread)) { assignTaskToClient(assigned, taskId, client); iterator.remove(); break; } } } } final List<TaskId> sortedTasks = new ArrayList<>(unassigned); Collections.sort(sortedTasks); for (final TaskId taskId : sortedTasks) { allocateTaskWithClientCandidates(taskId, clients.keySet(), true); } }

Target:
private void assignActive() { final int totalCapacity; if(sumCapacity(clients.value()) > 0) { totalCapacity = sumCapacity(clients.value(); } else { totalCapacity = 1; } final int tasksPerThread = taskIds.size() / totalCapacity; final Set<TaskId> assigned = new HashSet<>(); for (final Map.Entry<TaskId, ID> entry : previousActiveTaskAssignment.entrySet()) { final TaskId taskId = entry.getKey(); if (taskIds.contains(taskId)) { final ClientState client = clients.get(entry.getValue()); if (client.hasUnfulfilledQuota(tasksPerThread)) { assignTaskToClient(assigned, taskId, client); } } } final Set<TaskId> unassigned = new HashSet<>(taskIds); unassigned.removeAll(assigned); for (final Iterator<TaskId> iterator = unassigned.iterator(); iterator.hasNext(); ) { final TaskId taskId = iterator.next(); final Set<ID> clientIds = previousStandbyTaskAssignment.get(taskId); if (clientIds != null) { for (final ID clientId : clientIds) { final ClientState client = clients.get(clientId); if (client.hasUnfulfilledQuota(tasksPerThread)) { assignTaskToClient(assigned, taskId, client); iterator.remove(); break; } } } } final List<TaskId> sortedTasks = new ArrayList<>(unassigned); Collections.sort(sortedTasks); for (final TaskId taskId : sortedTasks) { allocateTaskWithClientCandidates(taskId, clients.keySet(), true); } }
Source:
public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { String groupKey = this.target.name(); String commandKey = method.getName(); HystrixCommand.Setter setter = HystrixCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); HystrixCommand<Object> hystrixCommand = new HystrixCommand<Object>(setter) { @Override protected Object run() throws Exception { try { return HystrixInvocationHandler.this.dispatch.get(method).invoke(args); } catch (Exception e) { throw e; } catch (Throwable t) { throw new Exception(t); } } }; if (HystrixCommand.class.isAssignableFrom(method.getReturnType())) { return hystrixCommand; } return hystrixCommand.execute(); }

Target:
public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { String groupKey = this.target.name(); String commandKey = method.getName(); HystrixCommand.Setter setter = HystrixCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); HystrixCommand<Object> hystrixCommand = new HystrixCommand<Object>(setter) { @Override protected Object run() throws Exception { try { return HystrixInvocationHandler.this.dispatch.get(method).invoke(args); } catch (Exception e) { throw e; } catch (Throwable t) { throw (Error)t; } } }; if (HystrixCommand.class.isAssignableFrom(method.getReturnType())) { return hystrixCommand; } return hystrixCommand.execute(); }
Source:
private SipURI addCustomHeadersForToUri (String customHeaders, SipURI to) { for (String customHeader: customHeaders.split("&")) { to.setHeader(customHeader.split("=")[0], customHeader.split("=")[1]); } return to; }

Target:
private SipURI addCustomHeadersForToUri (String customHeaders, SipURI to) { for (String customHeader: customHeaders.split("&")) { if (customHeader.contains("=")) { to.setHeader(customHeader.split("=")[0], customHeader.split("=")[1]); } else { String msg = String.format("Custom header %s not properly formatted", customHeader); if (logger.isDebugEnabled()) { logger.debug(msg); } } } return to; }
Source:
public IBean<T> getExactBean(Class<?> beanClazz) { return getExactBean(CollectionUtility.arrayList(m_beans), beanClazz); }

Target:
public IBean<T> getExactBean(Class<?> beanClazz) { List<IBean<T>> beans = CollectionUtility.arrayList(m_beans); Collections.sort(beans, ORDER_COMPARATOR); return getExactBean(beans, beanClazz); }
Source:
private static CompletableFuture<Void> completeAsyncWrapper(IMessageReceiver receiver, UUID lockToken) { try { return receiver.completeAsync(lockToken); } catch (Throwable t) { CompletableFuture<Void> excetionalFuture = new CompletableFuture<Void>(); excetionalFuture.completeExceptionally(t); return excetionalFuture; } }

Target:
private static CompletableFuture<Void> completeAsyncWrapper(IMessageReceiver receiver, UUID lockToken) { try { return receiver.completeAsync(lockToken); } catch (Throwable t) { CompletableFuture<Void> exceptionalFuture = new CompletableFuture<Void>(); exceptionalFuture.completeExceptionally(t); return exceptionalFuture; } }
Source:
public CommandLine parseOptions(String[] args) { final Options options = getOptions(); CommandLineParser parser = new DefaultParser(); CommandLine cmdLine = null; try { cmdLine = parser.parse(options, args); } catch (ParseException e) { printHelpAndExit("severe parsing command line options: " + e.getMessage(), options); } if (cmdLine.hasOption(HELP_OPTION.getOpt())) { printHelpAndExit(options, 0); } if (!cmdLine.hasOption(OPERATION_OPTION.getOpt())) { throw new IllegalStateException(OPERATION_OPTION.getLongOpt() +" is a mandatory parameter"); } if (cmdLine.hasOption(DRY_RUN_OPTION.getOpt()) && !cmdLine.hasOption(LOG_FILE_OPTION.getOpt())) { throw new IllegalStateException("Log file with "+TABLE_OPTION.getLongOpt() + " is mandatory if " + DRY_RUN_OPTION.getLongOpt() +" is passed"); } if (!(cmdLine.hasOption(TABLE_OPTION.getOpt())) && !(cmdLine.hasOption(TABLE_CSV_FILE_OPTION.getOpt()))) { throw new IllegalStateException("Tables and indexes list should be passed in either with" +TABLE_OPTION.getLongOpt() + " or " + TABLE_CSV_FILE_OPTION.getLongOpt()); } if (!((cmdLine.hasOption(HOST_OPTION.getOpt())) && (cmdLine.hasOption(PORT_OPTION.getOpt())))) { throw new IllegalStateException(HOST_OPTION.getLongOpt() +" and " + PORT_OPTION.getLongOpt() +" are mandatory parameters"); } return cmdLine; }

Target:
public CommandLine parseOptions(String[] args) { final Options options = getOptions(); CommandLineParser parser = new DefaultParser(); CommandLine cmdLine = null; try { cmdLine = parser.parse(options, args); } catch (ParseException e) { printHelpAndExit("severe parsing command line options: " + e.getMessage(), options); } if (cmdLine.hasOption(HELP_OPTION.getOpt())) { printHelpAndExit(options, 0); } if (!cmdLine.hasOption(OPERATION_OPTION.getOpt())) { throw new IllegalStateException(OPERATION_OPTION.getLongOpt() +" is a mandatory parameter"); } if (cmdLine.hasOption(DRY_RUN_OPTION.getOpt()) && !cmdLine.hasOption(LOG_FILE_OPTION.getOpt())) { throw new IllegalStateException("Log file with "+TABLE_OPTION.getLongOpt() + " is mandatory if " + DRY_RUN_OPTION.getLongOpt() +" is passed"); } if (!(cmdLine.hasOption(TABLE_OPTION.getOpt())) && !(cmdLine.hasOption(TABLE_CSV_FILE_OPTION.getOpt()))) { throw new IllegalStateException("Tables list should be passed in either with" +TABLE_OPTION.getLongOpt() + " or " + TABLE_CSV_FILE_OPTION.getLongOpt()); } if ((cmdLine.hasOption(TABLE_OPTION.getOpt())) && (cmdLine.hasOption(TABLE_CSV_FILE_OPTION.getOpt()))) { throw new IllegalStateException("Tables list passed in with" +TABLE_OPTION.getLongOpt() + " and " + TABLE_CSV_FILE_OPTION.getLongOpt() + "; specify only one."); } return cmdLine; }
Source:
public void postDrawEvent(ITimeEvent event, Rectangle bounds, GC gc) { if (fAverageCharWidth == null) { fAverageCharWidth = gc.getFontMetrics().getAverageCharWidth(); } if (bounds.width <= fAverageCharWidth) { return; } if (!(event instanceof FlamegraphEvent)) { return; } String funcSymbol = ""; ITmfTrace activeTrace = TmfTraceManager.getInstance().getActiveTrace(); if (activeTrace != null) { if (event instanceof FlamegraphEvent) { FlamegraphEvent fGEvent = (FlamegraphEvent) event; ISymbolProvider symbolProvider = SymbolProviderManager.getInstance().getSymbolProvider(activeTrace); funcSymbol = getFuntionSymbol(fGEvent, symbolProvider); } } gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_WHITE)); Utils.drawText(gc, funcSymbol, bounds.x, bounds.y, bounds.width, bounds.height, true, true); }

Target:
public void postDrawEvent(ITimeEvent event, Rectangle bounds, GC gc) { if (fAverageCharWidth == null) { fAverageCharWidth = gc.getFontMetrics().getAverageCharWidth(); } if (bounds.width <= fAverageCharWidth) { return; } if (!(event instanceof FlamegraphEvent)) { return; } String funcSymbol = ""; ITmfTrace activeTrace = TmfTraceManager.getInstance().getActiveTrace(); if (activeTrace != null) { FlamegraphEvent fgEvent = (FlamegraphEvent) event; ISymbolProvider symbolProvider = SymbolProviderManager.getInstance().getSymbolProvider(activeTrace); funcSymbol = getFuntionSymbol(fgEvent, symbolProvider); } gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_WHITE)); Utils.drawText(gc, funcSymbol, bounds.x, bounds.y, bounds.width, bounds.height, true, true); }
Source:
public Iterable<IBuildResult> getPatchSetBuildStatuses() { return this.patchSetBuildStatues.values(); }

Target:
public Iterable<IBuildResult> getPatchSetBuildStatuses() { return ImmutableSet.copyOf(this.patchSetBuildStatuses.values()); }
Source:
RegistryResponseType registerDocumentSetBUnsecured(RespondingGatewayRegisterDocumentSetRequestType request) { RegistryResponseType response = null; try { setTargetCommunitiesVersion(request.getNhinTargetCommunities(), SPEC_1_0); response = outboundDocDataSubmission.registerDocumentSetB(request.getRegisterDocumentSetRequest(), request.getAssertion(), request.getNhinTargetCommunities(), request.getUrl()); } catch (Exception e) { LOG.error("Failed to send request to Nwhin: {}", e); throw new ErrorEventException(e, "Unable to call Nhin Doc Data Submission"); } return response; }

Target:
RegistryResponseType registerDocumentSetBUnsecured(RespondingGatewayRegisterDocumentSetRequestType request) { RegistryResponseType response = null; try { setTargetCommunitiesVersion(request.getNhinTargetCommunities(), SPEC_1_0); response = outboundDocDataSubmission.registerDocumentSetB(request.getRegisterDocumentSetRequest(), request.getAssertion(), request.getNhinTargetCommunities(), request.getUrl()); } catch (Exception e) { throw new ErrorEventException(e, "Unable to call Nhin Doc Data Submission"); } return response; }
Source:
public void validateConfig() { if (Strings.isNullOrEmpty(this.path)) { throw new IllegalArgumentException("Path cannot be empty."); } else if (Strings.isNullOrEmpty(this.nodePath)) { throw new IllegalArgumentException("Node path cannot be empty."); } else if (Strings.isNullOrEmpty(this.tableName)) { throw new IllegalArgumentException("Table Name cannot be empty."); } else if (!this.actionAfterProcess.equalsIgnoreCase("NONE") && this.reprocessingReq.equalsIgnoreCase("YES")) { throw new IllegalArgumentException("Please select either 'After Processing Action' or 'Reprocessing " + "Required', both cannot be applied at same time."); } else if ((this.actionAfterProcess.equalsIgnoreCase("ARCHIVE") || this.actionAfterProcess.equalsIgnoreCase("MOVE")) && Strings.isNullOrEmpty(this.targetFolder)) { throw new IllegalArgumentException("Target folder cannot be Empty for Action = " + actionAfterProcess + "."); } }

Target:
void validateConfig() { Preconditions.checkArgument(!Strings.isNullOrEmpty(path), "Path cannot be empty."); Preconditions.checkArgument(!Strings.isNullOrEmpty(nodePath), "Node path cannot be empty."); Preconditions.checkArgument(!Strings.isNullOrEmpty(tableName), "Table name cannot be empty."); Preconditions.checkArgument(tableExpiryPeriod != null, "Table expiry period cannot be empty."); Preconditions.checkArgument(!Strings.isNullOrEmpty(temporaryFolder), "Temporary folder cannot be empty."); boolean onlyOneActionRequired = !actionAfterProcess.equalsIgnoreCase("NONE") && isReprocessingRequired(); Preconditions.checkArgument(!onlyOneActionRequired, "Please select either 'After Processing Action' or " + "'Reprocessing Required'; both cannot be applied at the same time."); boolean targetFolderEmpty = (actionAfterProcess.equalsIgnoreCase("ARCHIVE") || actionAfterProcess.equalsIgnoreCase("MOVE")) && Strings.isNullOrEmpty(targetFolder); Preconditions.checkArgument(!targetFolderEmpty, "Target folder cannot be empty for Action = '" + actionAfterProcess + "'."); }
Source:
public static SearchFragment newInstance(String query, long feed, String feedTitle) { SearchFragment fragment = newInstance(query); fragment.getArguments().putLong(ARG_FEED, feed); FEED_TITLE = feedTitle; return fragment; }

Target:
public static SearchFragment newInstance(String query, long feed, String feedTitle) { SearchFragment fragment = newInstance(query); fragment.getArguments().putLong(ARG_FEED, feed); fragment.getArguments().putString(ARG_FEED_NAME, feedTitle); return fragment; }
Source:
public void testeEditarUsuario() throws ParseException { LoginService loginService = new LoginService(); assertTrue(loginService.verificarUsuarioESenha("Administrador", "123456")); AdministracaoDeUsuariosService administracaoDeUsuarioService = new AdministracaoDeUsuariosService(); List<UsuarioModel> usuariosList = administracaoDeUsuarioService.listarUsuarios(); UsuarioModel usuario = usuariosList.get(3); assertEquals(usuario.Usuario, "Professor3"); assertEquals(usuario.Senha, "123456"); assertEquals(usuario.profile, Perfil.PROFESSOR); try { administracaoDeUsuarioService.editarUsuario("SenhaEditadaTeste", Perfil.FUNCIONARIO, usuario.id); UsuarioModel usuarioEditado = administracaoDeUsuarioService.obterUsuario("Professor3"); assertEquals(usuarioEditado.Usuario, "Professor3"); assertEquals(usuarioEditado.Senha, "SenhaEditadaTeste"); assertEquals(usuarioEditado.profile, Perfil.FUNCIONARIO); } catch (Exception ex) { Logger.getLogger(cst23Test.class.getName()).log(Level.SEVERE, null, ex); } }

Target:
public void testeEditarUsuario() throws ParseException, Exception { LoginService loginService = new LoginService(); assertTrue(loginService.verificarUsuarioESenha( "Administrador", "123456")); AdministracaoDeUsuariosService administracaoDeUsuarioService = new AdministracaoDeUsuariosService(); List<UsuarioModel> usuariosList = administracaoDeUsuarioService.listarUsuarios(); UsuarioModel usuario = usuariosList.get(3); assertEquals(usuario.Usuario, "Professor3"); assertEquals(usuario.Senha, "123456"); assertEquals(usuario.profile, Perfil.PROFESSOR); try { administracaoDeUsuarioService.editarUsuario( "SenhaEditadaTeste", Perfil.PROFESSOR, usuario.id); UsuarioModel usuarioEditado = administracaoDeUsuarioService.obterUsuario("Professor3"); assertEquals(usuarioEditado.Usuario, "Professor3"); assertEquals(usuarioEditado.Senha, "SenhaEditadaTeste"); assertTrue(loginService.verificarUsuarioESenha( "Professor3", "SenhaEditadaTeste")); } catch (NonexistentEntityException ex) { Logger.getLogger(cst23Test.class.getName()).log(Level.SEVERE, null, ex); } }
Source:
public String getXcodeprojPath() throws ArgumentParserException { try { return this.cmd.getOptionValue(XCODE_INTEGRATION_OPT); } catch (NumberFormatException e) { throw new ArgumentParserException("Invalid value provided for string argument " + XCODE_INTEGRATION_OPT + "."); } }

Target:
public String getXcodeprojPath() { return cmd != null ? cmd.getOptionValue(XCODE_INTEGRATION_OPT) : null; }
Source:
public void updateContainer(String id, KieContainerInstance kieContainerInstance, Map<String, Object> parameters) { parameters.put(UPDATING_CONTAINER_PARAM, Boolean.TRUE); disposeContainer(id, kieContainerInstance, parameters); createContainer(id, kieContainerInstance, parameters); }

Target:
public void updateContainer(String id, KieContainerInstance kieContainerInstance, Map<String, Object> parameters) { parameters.put(IS_DISPOSE_CONTAINER_PARAM, Boolean.FALSE); disposeContainer(id, kieContainerInstance, parameters); createContainer(id, kieContainerInstance, parameters); }
Source:
public DocumentModel createComment(DocumentModel docModel, String comment) { throw new UnsupportedOperationException(); }

Target:
public DocumentModel createComment(DocumentModel docModel, String comment) { throw new UnsupportedOperationException("This service implementation does not implement deprecated API."); }
Source:
public void rejectsNonDiamondOperatorUsage() throws Exception { final String file = "InvalidDiamondsUsage.java"; final Collection<Violation> results = this.runValidation( file, false ); final String violation = StringUtils.join( "[27]: Better to use diamond operator where possible ", "(DiamondOperatorCheck)" ); MatcherAssert.assertThat(results, Matchers.hasSize(1)); MatcherAssert.assertThat( results, Matchers.hasItem( new CheckstyleValidatorTest.ViolationMatcher( violation, file ) ) ); }

Target:
public void rejectsNonDiamondOperatorUsage() throws Exception { final String file = "InvalidDiamondsUsage.java"; MatcherAssert.assertThat( this.runValidation(file, false), Matchers.contains( new CheckstyleValidatorTest.ViolationMatcher( "[21]: Use diamond operator (DiamondOperatorCheck)", file ) ) ); }
Source:
public SSymbol(final String value) { string = value; numberOfSignatureArguments = determineNumberOfSignatureArguments(); if (VmSettings.KOMPOS_TRACING || VmSettings.TRACK_SNAPSHOT_ENTITIES) { symbolId = (short) idGenerator.getAndIncrement(); if (VmSettings.TRACK_SNAPSHOT_ENTITIES) { SnapshotBackend.registerSymbol(this); } } else { symbolId = 0; } }

Target:
public SSymbol(final String value) { string = value; numberOfSignatureArguments = determineNumberOfSignatureArguments(); if (VmSettings.KOMPOS_TRACING || VmSettings.TRACK_SNAPSHOT_ENTITIES) { symbolId = (short) idGenerator.getAndIncrement(); if (VmSettings.KOMPOS_TRACING) { TracingBackend.logSymbol(this); } if (VmSettings.TRACK_SNAPSHOT_ENTITIES) { SnapshotBackend.registerSymbol(this); } } else { symbolId = 0; } }
Source:
private CertificateDTO addCertByChild(List<CertificateDTO> toList, List<CertificateDTO> fromList, CertificateDTO child){ if (null != child && CollectionUtils.isNotEmpty(fromList)) { for(CertificateDTO cert : fromList){ if(child.getAuthorityKeyID().compareTo(cert.getSubjectKeyID())==0){ toList.add(cert); fromList.remove(cert); return cert; } } } return null; }

Target:
private CertificateDTO addCertByChild(List<CertificateDTO> toList, List<CertificateDTO> fromList, CertificateDTO child){ if (null != child && CollectionUtils.isNotEmpty(fromList)) { for(CertificateDTO cert : fromList){ if (child.getAuthorityKeyID().equals(cert.getSubjectKeyID())) { toList.add(0, cert); fromList.remove(cert); return cert; } } } return null; }