auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof VmGuestAgentInterface)) { return false; } VmGuestAgentInterface other = (VmGuestAgentInterface) obj; return Objects.equals(getInterfaceName(), other.getInterfaceName()) && Objects.equals(getIpv4Addresses(), other.getIpv4Addresses()) && Objects.equals(getIpv6Addresses(), other.getIpv6Addresses()) && Objects.equals(getMacAddress(), other.getMacAddress()) && Objects.equals(getVmId(), other.getVmId()); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof VmGuestAgentInterface)) { return false; } VmGuestAgentInterface other = (VmGuestAgentInterface) obj; return Objects.equals(interfaceName, other.interfaceName) && Objects.equals(ipv4Addresses, other.ipv4Addresses) && Objects.equals(ipv6Addresses, other.ipv6Addresses) && Objects.equals(macAddress, other.macAddress) && Objects.equals(vmId, other.vmId); }
Source:
public void clickDeleteTableButton() { waitForElementByElement(iframe); driver.switchTo().frame(iframe); Actions actions = new Actions(driver); actions.contextClick(VisualModeTable).build().perform(); driver.switchTo().defaultContent(); driver.switchTo().frame(contextFrame); deleteItem.click(); driver.switchTo().defaultContent(); waitForElementNotPresent(articleTableBy); }

Target:
public void clickDeleteTableButton() { selectFromContextMenu(deleteItem); }
Source:
public void test_FirstPollStrategy_Earliest_NotEnforced_OnTopologyActivateDeactivate() throws Exception { try (Time.SimulatedTime simulatedTime = new Time.SimulatedTime()) { final int messageCount = 2; prepareSpout(messageCount); nextTuple_verifyEmitted_ack_resetCollectorMock(0); doNothing().when(consumerSpy).close(); spout.deactivate(); verifyAllMessagesCommitted(1, 1); spout.activate(); nextTuple_verifyEmitted_ack_resetCollectorMock(1); commitAndVerifyMessagesCommitted(messageCount, 2); } }

Target:
public void test_FirstPollStrategy_Earliest_NotEnforced_OnTopologyActivateDeactivate() throws Exception { final int messageCount = 2; prepareSpout(messageCount); nextTuple_verifyEmitted_ack_resetCollector(0); spout.deactivate(); verifyAllMessagesCommitted(1); consumerSpy = createConsumerSpy(); spout.activate(); nextTuple_verifyEmitted_ack_resetCollector(1); commitAndVerifyAllMessagesCommitted(messageCount); }
Source:
public CompilerPluginFacet() { pluginArtifact = DependencyArtifact.Compiler; dependencies = new ArrayList<DependencyBuilder>(0); executions = new ArrayList<Execution>(0); configurations = Arrays.asList(new ConfigurationElement[] { ConfigurationElementBuilder.create().setName("source").setText("1.7"), ConfigurationElementBuilder.create().setName("target").setText("1.7") }); }

Target:
public CompilerPluginFacet() { pluginArtifact = DependencyArtifact.Compiler; dependencies = new ArrayList<DependencyBuilder>(0); executions = new ArrayList<Execution>(0); configurations = Arrays.asList(new ConfigurationElement[] { ConfigurationElementBuilder.create().setName("source").setText("1.8"), ConfigurationElementBuilder.create().setName("target").setText("1.8") }); }
Source:
protected <E> void remove( final E entity, final AsyncCallback<Long> responder ) { try { if( entity == null ) throw new IllegalArgumentException( ExceptionMessage.NULL_ENTITY ); AsyncCallback<Object> removalCallback = new AsyncCallback<Object>() { @Override public void handleResponse( Object response ) { FootprintsManager.getInstance().Inner.removeFootprintForObject( BackendlessSerializer.serializeToMap( entity ), entity ); if( responder == null ) return; responder.handleResponse( ((Number) response).longValue() ); } @Override public void handleFault( BackendlessFault fault ) { if( responder != null ) responder.handleFault( fault ); } }; if( ReflectionUtil.hasField( entity.getClass(), Persistence.DEFAULT_OBJECT_ID_FIELD ) ) { Invoker.invokeAsync( PERSISTENCE_MANAGER_SERVER_ALIAS, "remove", new Object[] { Backendless.getApplicationId(), Backendless.getVersion(), getSimpleName( entity.getClass() ), entity }, removalCallback ); } else { String objectId = FootprintsManager.getInstance().getObjectId( entity ); Invoker.invokeAsync( PERSISTENCE_MANAGER_SERVER_ALIAS, "remove", new Object[] { Backendless.getApplicationId(), Backendless.getVersion(), getSimpleName( entity.getClass() ), objectId }, removalCallback ); } } catch( Throwable e ) { if( responder != null ) responder.handleFault( new BackendlessFault( e ) ); } }

Target:
protected <E> void remove( final E entity, final AsyncCallback<Long> responder ) { try { if( entity == null ) throw new IllegalArgumentException( ExceptionMessage.NULL_ENTITY ); AsyncCallback<Object> removalCallback = new AsyncCallback<Object>() { @Override public void handleResponse( Object response ) { FootprintsManager.getInstance().Inner.removeFootprintForObject( BackendlessSerializer.serializeToMap( entity ), entity ); if( responder == null ) return; responder.handleResponse( ((Number) response).longValue() ); } @Override public void handleFault( BackendlessFault fault ) { if( responder != null ) responder.handleFault( fault ); } }; Object entityArg = ReflectionUtil.hasField( entity.getClass(), Persistence.DEFAULT_OBJECT_ID_FIELD ) ? entity : FootprintsManager.getInstance().getObjectId( entity ); Invoker.invokeAsync( PERSISTENCE_MANAGER_SERVER_ALIAS, "remove", new Object[] { Backendless.getApplicationId(), Backendless.getVersion(), getSimpleName( entity.getClass() ), entityArg }, removalCallback ); } catch( Throwable e ) { if( responder != null ) responder.handleFault( new BackendlessFault( e ) ); } }
Source:
public static boolean makeMossy(Block block) { switch (block.getType()) { case COBBLESTONE: case DIRT: case COBBLE_WALL return true; case SMOOTH_BRICK: if (block.getData() == 0) { return true; } default: return false; } }

Target:
public static boolean makeMossy(Block block) { switch (block.getType()) { case COBBLESTONE: case DIRT: return true; case SMOOTH_BRICK: case COBBLE_WALL: if (block.getData() == 0) { return true; } default: return false; } }
Source:
public void test_createXClasses() throws Exception { DocumentReference docRef = classDef.getClassRef(); XWikiDocument doc = ModelAccessStub.get().injectNewDoc(docRef).doc(); expect(getMock(ConfigurationSource.class).getProperty(ClassPackage.CFG_SRC_KEY)).andReturn( Arrays.asList(classPackage.getName())).anyTimes(); expect(getMock(ConfigurationSource.class).getProperty(ClassDefinition.CFG_SRC_KEY)).andReturn( null).anyTimes(); replayDefault(); creator.createXClasses(); creator.createXClasses(); verifyDefault(); assertEquals(1, ModelAccessStub.get().getInjectedDoc(docRef).getSavedCount()); assertEquals(classDef.isInternalMapping(), doc.getXClass().hasInternalCustomMapping()); @SuppressWarnings("unchecked") List<BaseCollection> xFields = new ArrayList<>(doc.getXClass().getFieldList()); assertEquals(classDef.getFields().size(), xFields.size()); int count = 0; for (ClassField<?> field : classDef.getFields()) { BaseCollection xField = xFields.get(count++); assertNotNull(xField); assertEquals(field.getName(), xField.getName()); } }

Target:
public void test_createXClasses() throws Exception { DocumentReference docRef = classDef.getClassRef(); XWikiDocument doc = ModelMock.get().mockDoc(docRef).doc(); expect(getMock(ConfigurationSource.class).getProperty(ClassPackage.CFG_SRC_KEY)).andReturn( Arrays.asList(classPackage.getName())).anyTimes(); expect(getMock(ConfigurationSource.class).getProperty(ClassDefinition.CFG_SRC_KEY)).andReturn( null).anyTimes(); replayDefault(); creator.createXClasses(); creator.createXClasses(); verifyDefault(); assertEquals(1, ModelMock.get().mockDoc(docRef).getSavedCount()); assertEquals(classDef.isInternalMapping(), doc.getXClass().hasInternalCustomMapping()); @SuppressWarnings("unchecked") List<BaseCollection> xFields = new ArrayList<>(doc.getXClass().getFieldList()); assertEquals(classDef.getFields().size(), xFields.size()); int count = 0; for (ClassField<?> field : classDef.getFields()) { BaseCollection xField = xFields.get(count++); assertNotNull(xField); assertEquals(field.getName(), xField.getName()); } }
Source:
public static List<String> getBrokersFromURL(String url) { if (url.startsWith("jdbc:")) { url = url.substring(5); } URI uri = URI.create(url); return getBrokersFromURI(uri); }

Target:
public static List<String> getBrokersFromURL(String url) { if (url.toLowerCase().startsWith("jdbc:")) { url = url.substring(5); } URI uri = URI.create(url); return getBrokersFromURI(uri); }
Source:
private static String toPatch(String type, PatchSet.Id diffBase, Patch.Key id) { PatchSet.Id ps = id.getParentKey(); Change.Id c = ps.getParentKey(); StringBuilder p = new StringBuilder(); p.append("/c/").append(c).append("/"); if (diffBase != null) { p.append(diffBase.get()).append(".."); } p.append(ps.get()).append("/").append(KeyUtil.encode(id.get())); if (type != null && !type.isEmpty()) { p.append(",").append(type); } return p.toString(); }

Target:
private static String toPatch(String type, PatchSet.Id diffBase, Patch.Key id) { return toPatch(type, diffBase, id.getParentKey(), id.get()); }
Source:
public static PublicKey loadPublicKey(String publicKey) throws NoSuchAlgorithmException, InvalidKeySpecException { byte[] decodedPublicKey = Base64Encoder.decode(publicKey); KeyFactory keyFactory = KeyFactory.getInstance(ALGORITHM, PROVIDER); ECParameterSpec parameterSpec; parameterSpec = ECNamedCurveTable.getParameterSpec(CURVE); ECCurve curve = parameterSpec.getCurve(); ECPoint point = curve.decodePoint(decodedPublicKey); ECPublicKeySpec pubSpec = new ECPublicKeySpec(point, parameterSpec); return keyFactory.generatePublic(pubSpec); }

Target:
public static PublicKey loadPublicKey(String publicKey) throws NoSuchAlgorithmException, InvalidKeySpecException { byte[] decodedPublicKey = Base64Encoder.decode(publicKey); KeyFactory keyFactory = KeyFactory.getInstance(ALGORITHM, PROVIDER); ECParameterSpec parameterSpec = ECNamedCurveTable.getParameterSpec(CURVE); ECCurve curve = parameterSpec.getCurve(); ECPoint point = curve.decodePoint(decodedPublicKey); ECPublicKeySpec pubSpec = new ECPublicKeySpec(point, parameterSpec); return keyFactory.generatePublic(pubSpec); }
Source:
public Mono<ClientResponse> filter(ClientRequest request, ExchangeFunction next) { return oauth2Token(request.attributes()) .map(oauth2Token -> bearer(request, oauth2Token)) .flatMap(next::exchange) .switchIfEmpty(Mono.defer(() -> next.exchange(request))); }

Target:
public Mono<ClientResponse> filter(ClientRequest request, ExchangeFunction next) { return oauth2Token(request.attributes()) .map(oauth2Token -> bearer(request, oauth2Token)) .defaultIfEmpty(request) .flatMap(next::exchange); }
Source:
public void testIncrementalReconfigInvokedOnHiearchicalQS() throws Exception { qu = new QuorumUtil(2); qu.disableJMXTest = true; qu.startAll(); ZooKeeper[] zkArr = ReconfigTest.createHandles(qu); ZooKeeperAdmin[] zkAdminArr = ReconfigTest.createAdminHandles(qu); ArrayList<String> members = new ArrayList<String>(); members.add("group.1=3:4:5"); members.add("group.2=1:2"); members.add("weight.1=0"); members.add("weight.2=0"); members.add("weight.3=1"); members.add("weight.4=1"); members.add("weight.5=1"); for (int i = 1; i <= 5; i++) { members.add("server." + i + "=127.0.0.1:" + qu.getPeer(i).peer.getQuorumAddress().getPort() + ":" + qu.getPeer(i).peer.getElectionAddress().getPort() + ";" + "127.0.0.1:" + qu.getPeer(i).peer.getClientPort()); } ReconfigTest.reconfig(zkAdminArr[1], null, null, members, -1); ReconfigTest.testNormalOperation(zkArr[1], zkArr[2]); List<String> leavingServers = new ArrayList<String>(); leavingServers.add("3"); try { zkAdminArr[1].reconfigure(null, leavingServers, null, -1, null); Assert.fail("Reconfig should have failed since the current config isn't Majority QS"); } catch (KeeperException.BadArgumentsException e) { } catch (Exception e) { Assert.fail("Should have been BadArgumentsException!"); } ReconfigTest.closeAllHandles(zkArr, zkAdminArr); }

Target:
public void testIncrementalReconfigInvokedOnHiearchicalQS() throws Exception { qu = new QuorumUtil(2); qu.disableJMXTest = true; qu.startAll(); ZooKeeper[] zkArr = ReconfigTest.createHandles(qu); ZooKeeperAdmin[] zkAdminArr = ReconfigTest.createAdminHandles(qu); ArrayList<String> members = new ArrayList<String>(); members.add("group.1=3:4:5"); members.add("group.2=1:2"); members.add("weight.1=0"); members.add("weight.2=0"); members.add("weight.3=1"); members.add("weight.4=1"); members.add("weight.5=1"); for (int i = 1; i <= 5; i++) { members.add("server." + i + "=127.0.0.1:" + qu.getPeer(i).peer.getQuorumAddress().getPort() + ":" + qu.getPeer(i).peer.getElectionAddress().getPort() + ";" + "127.0.0.1:" + qu.getPeer(i).peer.getClientPort()); } ReconfigTest.reconfig(zkAdminArr[1], null, null, members, -1); ReconfigTest.testNormalOperation(zkArr[1], zkArr[2]); List<String> leavingServers = new ArrayList<String>(); leavingServers.add("3"); try { zkAdminArr[1].reconfigure(null, leavingServers, null, -1, null); fail("Reconfig should have failed since the current config isn't Majority QS"); } catch (KeeperException.BadArgumentsException e) { } catch (Exception e) { fail("Should have been BadArgumentsException!"); } ReconfigTest.closeAllHandles(zkArr, zkAdminArr); }
Source:
public int compareTo(final OrganisationPreviousName o) { return getName().compareTo(o.getName()); }

Target:
public int compareTo(final OrganisationPreviousName o) { final int compare = this.getEndDate().compareTo(o.getEndDate()); if (compare == 0) { final int nameCompare = this.getName().compareTo(o.getName()); return nameCompare; } else { return compare; } }
Source:
public String getDisplayName() { return "Send a delayed Gerrit approval"; }

Target:
public String getDisplayName() { return Messages.SendDelayedGerritApproval(); }
Source:
public boolean isSortable() { if(url.pathType() == RedditURLParser.USER_POST_LISTING_URL) { final UserPostListingURL.Type type = url.asUserPostListURL().type; return (type != UserPostListingURL.Type.SAVED && type != UserPostListingURL.Type.UPVOTED && type != UserPostListingURL.Type.DOWNVOTED && type != UserPostListingURL.Type.HIDDEN); } return (url.pathType() == RedditURLParser.SUBREDDIT_POST_LISTING_URL) || (url.pathType() == RedditURLParser.MULTIREDDIT_POST_LISTING_URL) || (url.pathType() == RedditURLParser.SEARCH_POST_LISTING_URL); }

Target:
public boolean isSortable() { if(url.pathType() == RedditURLParser.USER_POST_LISTING_URL) { return (url.asUserPostListURL().type == UserPostListingURL.Type.SUBMITTED); } return (url.pathType() == RedditURLParser.SUBREDDIT_POST_LISTING_URL) || (url.pathType() == RedditURLParser.MULTIREDDIT_POST_LISTING_URL) || (url.pathType() == RedditURLParser.SEARCH_POST_LISTING_URL); }
Source:
public void verifyHistoryPageHeader(String targetText) { Assertion.assertStringContains(targetText, getModeName()); PageObjectLogging.log("verifyHistoryPageHeader", "verifying the summary shows " + targetText, true); }

Target:
public void verifyHistoryPageHeader(String targetText) { Assertion.assertStringContains(targetText, getModeName()); PageObjectLogging.log( "verifyHistoryPageHeader", "The summary shows " + targetText, true ); }
Source:
public static ClientConfig fromServiceConfig(ServiceConfiguration serviceConfig) { ClientConfig clientConfig = new ClientConfig(); if (serviceConfig.security().isPresent()) { clientConfig.ssl(SslSocketFactories.createSslSocketFactory(serviceConfig.security().get()), (X509TrustManager) SslSocketFactories.createTrustManagers(serviceConfig.security().get())[0]); } if (serviceConfig.connectTimeout().isPresent()) { clientConfig.connectTimeout(serviceConfig.connectTimeout().get()); } if (serviceConfig.readTimeout().isPresent()) { clientConfig.readTimeout(serviceConfig.readTimeout().get()); } if (serviceConfig.writeTimeout().isPresent()) { clientConfig.writeTimeout(serviceConfig.writeTimeout().get()); } if (serviceConfig.proxyConfiguration().isPresent()) { clientConfig.proxy(serviceConfig.proxyConfiguration().get()); } return clientConfig; }

Target:
public static ClientConfig fromServiceConfig(ServiceConfiguration serviceConfig) { ClientConfig.Builder clientConfig = builder(); if (serviceConfig.security().isPresent()) { clientConfig.sslSocketFactory(SslSocketFactories.createSslSocketFactory(serviceConfig.security().get())); clientConfig.trustManager( (X509TrustManager) SslSocketFactories.createTrustManagers(serviceConfig.security().get())[0]); } clientConfig.connectTimeout(serviceConfig.connectTimeout().or(CONNECT_TIMEOUT)); clientConfig.readTimeout(serviceConfig.readTimeout().or(READ_TIMEOUT)); clientConfig.writeTimeout(serviceConfig.writeTimeout().or(WRITE_TIMEOUT)); clientConfig.proxy(serviceConfig.proxyConfiguration()); return clientConfig.build(); }
Source:
public void testSMSSendingExploit() throws Exception { int inboxSizeBeforeExploit = getSMSInboxSize(); TelephonyManager telephonyManager = (TelephonyManager) getContext().getSystemService(Context.TELEPHONY_SERVICE); if(!telephonyManager.isSmsCapable()) { return; } SmsManager manager = SmsManager.getDefault(); manager.sendTextMessage("25578", null, "STOP", null, null); SystemClock.sleep(250); int inboxSizeAfterExploit = getSMSInboxSize(); assertTrue("Device is vulnerable to bug #22314646!! For more information " + "please refer - <LINK_0>" + "opt/telephony/+/ce058be%5E!/", inboxSizeBeforeExploit == inboxSizeAfterExploit); }

Target:
public void testSMSSendingExploit() throws Exception { TelephonyManager telephonyManager = (TelephonyManager) getContext().getSystemService(Context.TELEPHONY_SERVICE); if(!telephonyManager.isSmsCapable()) { return; } int inboxSizeBeforeExploit = getSMSInboxSize(); SmsManager manager = SmsManager.getDefault(); manager.sendTextMessage("25578", null, "STOP", null, null); SystemClock.sleep(250); int inboxSizeAfterExploit = getSMSInboxSize(); assertTrue("Device is vulnerable to bug #22314646!! For more information " + "please refer - <LINK_0>" + "opt/telephony/+/ce058be%5E!/", inboxSizeBeforeExploit == inboxSizeAfterExploit); }
Source:
public void testUnZipInvalidFile() { String usrDir = System.getProperty("java.io.tmpdir"); long currentTimeMillis = System.currentTimeMillis(); File zipFolder = new File(usrDir + File.separator + currentTimeMillis); if (!zipFolder.exists()) { zipFolder.mkdirs(); } File unzipFolder = new File(usrDir + File.separator + currentTimeMillis + 1); if (!unzipFolder.exists()) { unzipFolder.mkdirs(); } String file = new File(zipFolder, "testzp.zip").getAbsolutePath(); FileOutputStream fileOutputStream = null; try { fileOutputStream = new FileOutputStream(file); IOUtil.copyCompletely(getClass().getResourceAsStream("/resources/zip-slip.zip"), fileOutputStream); Util.unZipFile(file, unzipFolder.getAbsolutePath(), 8, new NullProgressMonitor()); String[] unzippedFiles = unzipFolder.list(); assertNotNull(unzippedFiles); assertTrue(unzippedFiles.length == 1); } catch (IOException e) { assertTrue(e.getMessage().contains("Invalid output path")); } finally { try { if (fileOutputStream != null) { fileOutputStream.close(); } } catch (IOException e) { } try { ZipToFile.deleteDirectory(zipFolder); ZipToFile.deleteDirectory(unzipFolder); } catch (Exception e) { } } }

Target:
public void testUnZipInvalidFile() throws IOException { File zipFolder = Files.createTempDirectory("zipfolder").toFile(); File unzipFolder = Files.createTempDirectory("unzipfolder").toFile(); String file = new File(zipFolder, "testzp.zip").getAbsolutePath(); FileOutputStream fileOutputStream = null; try { fileOutputStream = new FileOutputStream(file); IOUtil.copyCompletely(getClass().getResourceAsStream("/resources/zip-slip.zip"), fileOutputStream); Util.unZipFile(file, unzipFolder.getAbsolutePath(), 8, new NullProgressMonitor()); } catch (IOException e) { assertTrue(e.getMessage().contains("Invalid output path")); } finally { try { if (fileOutputStream != null) { fileOutputStream.close(); } } catch (IOException e) { LOGGER.error(e.getMessage(), e); } try { ZipToFile.deleteDirectory(zipFolder); ZipToFile.deleteDirectory(unzipFolder); } catch (Exception e) { LOGGER.error(e.getMessage(), e); } } }
Source:
public RedirectAction getRedirectAction(final WebContext context) { init(); if (ajaxRequestResolver.isAjax(context)) { logger.info("AJAX request detected -> returning 401"); RedirectAction action = redirectActionBuilder.redirect(context); cleanRequestedUrl(context); final String url = action.getLocation(); if (CommonHelper.isNotBlank(url)) { context.setResponseHeader(HttpConstants.LOCATION_HEADER, url); } throw HttpAction.unauthorized(context); } final String attemptedAuth = (String) context.getSessionStore().get(context, getName() + ATTEMPTED_AUTHENTICATION_SUFFIX).get(); if (CommonHelper.isNotBlank(attemptedAuth)) { cleanAttemptedAuthentication(context); cleanRequestedUrl(context); throw HttpAction.unauthorized(context); } return redirectActionBuilder.redirect(context); }

Target:
public RedirectAction getRedirectAction(final WebContext context) { init(); if (ajaxRequestResolver.isAjax(context)) { logger.info("AJAX request detected -> returning 401"); RedirectAction action = redirectActionBuilder.redirect(context); cleanRequestedUrl(context); final String url = action.getLocation(); if (CommonHelper.isNotBlank(url)) { context.setResponseHeader(HttpConstants.LOCATION_HEADER, url); } throw HttpAction.unauthorized(context); } context .getSessionStore().get(context, getName() + ATTEMPTED_AUTHENTICATION_SUFFIX) .ifPresent( attemptedAuth -> { if (CommonHelper.isNotBlank((String) attemptedAuth)) { cleanAttemptedAuthentication(context); cleanRequestedUrl(context); throw HttpAction.unauthorized(context); } }); return redirectActionBuilder.redirect(context); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.presentation_activity); ButterKnife.bind(this); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar() .setHomeAsUpIndicator(new IconDrawable(this, IoniconsIcons.ion_android_close) .colorRes(R.color.white) .actionBarSize()); preferencesManager = new PreferencesManager(this); dataSource = new DataSource(this); listId = getIntent().getIntExtra(LIST_ID_KEY, 0); listState = dataSource.getChoosingStateListInfo(listId); settings = dataSource.getChoosingSettings(listId); textToSpeechManager = new TextToSpeechManager(this, this); presentationManager = new PresentationManager(this, namesList); DividerItemDecoration itemDecorator = new DividerItemDecoration(this, DividerItemDecoration.VERTICAL); itemDecorator.setDrawable(lineDivider); namesList.addItemDecoration(itemDecorator); chooseNameAdapter = new ChooseNameAdapter(); namesList.setAdapter(chooseNameAdapter); int numNames = settings.getNumNamesToChoose(); header.setText(NameUtils.getChoosingMessage(this, listId, numNames)); setTextSizeDialog = new MaterialDialog.Builder(this) .title(R.string.set_text_size_title) .customView(R.layout.set_text_size, true) .positiveText(android.R.string.yes) .negativeText(android.R.string.no) .onPositive((@NonNull MaterialDialog dialog, @NonNull DialogAction which) -> { int newTextSize = setTextViewHolder.textSizeSlider.getProgress() + 1; preferencesManager.setPresentationTextSize(newTextSize); }) .onNegative((@NonNull MaterialDialog dialog, @NonNull DialogAction which) -> { setTextViewHolder.revertSetting(); }) .build(); setTextViewHolder = new SetTextSizeViewHolder(setTextSizeDialog.getCustomView()); chooseNames(); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.presentation_activity); ButterKnife.bind(this); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar() .setHomeAsUpIndicator(new IconDrawable(this, IoniconsIcons.ion_android_close) .colorRes(R.color.white) .actionBarSize()); preferencesManager = new PreferencesManager(this); dataSource = new DataSource(this); listId = getIntent().getIntExtra(LIST_ID_KEY, 0); listState = dataSource.getChoosingStateListInfo(listId); settings = dataSource.getChoosingSettings(listId); textToSpeechManager = new TextToSpeechManager(this, this); presentationManager = new PresentationManager(this, namesList, settings.getAutomaticTts()); presentationAdapter = new PresentationAdapter(); presentationAdapter.setTextSize(preferencesManager.getPresentationTextSize() * 8); presentationAdapter.setTextColor(preferencesManager.getPresentationTextColor(textNormalColor)); namesList.setAdapter(presentationAdapter); int numNames = settings.getNumNamesToChoose(); header.setText(NameUtils.getChoosingMessage(this, listId, numNames)); setTextSizeDialog = new PresentationTextSizeDialog(this, this); colorChooserDialog = new PresentationColorChooserDialog(this, preferencesManager); chooseNames(); }
Source:
private void determineNumberOfValidGroupLines(Rect newRootViewDimensions) { FrameLayout header = (FrameLayout)findViewById(R.id.form_entry_header); TextView groupLabel = ((TextView)header.findViewById(R.id.form_entry_group_label)); int contentSize = newRootViewDimensions.height(); View navBar = this.findViewById(R.id.nav_pane); int headerSize = navBar.getHeight(); if(headerSize == 0) { headerSize = this.getResources().getDimensionPixelSize(R.dimen.new_progressbar_minheight); } int availableWindow = contentSize - headerSize - getActionBarSize(); int questionFontSize = getFontSizeInPx(); int spaceRequested = questionFontSize * 6; int spaceAvailable = availableWindow - spaceRequested; int defaultHeaderSpace = this.getResources().getDimensionPixelSize(R.dimen.content_min_margin) * 2; float textSize = groupLabel.getTextSize(); int numberOfGroupLinesAllowed = (int)((spaceAvailable - defaultHeaderSpace) / textSize); if(numberOfGroupLinesAllowed < 0) { numberOfGroupLinesAllowed = 0; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { if (groupLabel.getMaxLines() == numberOfGroupLinesAllowed) { return; } } if(numberOfGroupLinesAllowed <= 0) { this.mGroupForcedInvisible = true; updateGroupViewVisibility(); groupLabel.setMaxLines(0); } else { this.mGroupForcedInvisible = false; updateGroupViewVisibility(); groupLabel.setMaxLines(numberOfGroupLinesAllowed); } }

Target:
private void determineNumberOfValidGroupLines(Rect newRootViewDimensions) { FrameLayout header = (FrameLayout)findViewById(R.id.form_entry_header); TextView groupLabel = ((TextView)header.findViewById(R.id.form_entry_group_label)); int contentSize = newRootViewDimensions.height(); View navBar = this.findViewById(R.id.nav_pane); int headerSize = navBar.getHeight(); if(headerSize == 0) { headerSize = this.getResources().getDimensionPixelSize(R.dimen.new_progressbar_minheight); } int availableWindow = contentSize - headerSize - getActionBarSize(); int questionFontSize = getFontSizeInPx(); int spaceRequested = questionFontSize * 6; int spaceAvailable = availableWindow - spaceRequested; int defaultHeaderSpace = this.getResources().getDimensionPixelSize(R.dimen.content_min_margin) * 2; float textSize = groupLabel.getTextSize(); int numberOfGroupLinesAllowed = (int)((spaceAvailable - defaultHeaderSpace) / textSize); if(numberOfGroupLinesAllowed < 0) { numberOfGroupLinesAllowed = 0; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { if (groupLabel.getMaxLines() == numberOfGroupLinesAllowed) { return; } } if(numberOfGroupLinesAllowed == 0) { this.mGroupForcedInvisible = true; updateGroupViewVisibility(); groupLabel.setMaxLines(0); } else { this.mGroupForcedInvisible = false; updateGroupViewVisibility(); groupLabel.setMaxLines(numberOfGroupLinesAllowed); } }
Source:
public void close() throws Exception { try { try { invokeFinishBundle(); } finally { if (pythonFunctionRunner != null) { pythonFunctionRunner.close(); pythonFunctionRunner = null; } } } finally { super.close(); } }

Target:
public void close() throws Exception { try { invokeFinishBundle(); } finally { super.close(); } }
Source:
protected IStructuredSelection getViewerSelection() { return fViewerPart.getViewer().getStructuredSelection(); }

Target:
protected ISelection getViewerSelection() { return fViewerPart.getViewer().getSelection(); }
Source:
void removeTemporaryWs() throws ServerException, ConflictException { final int count = 100; int skip = 0; List<WorkspaceImpl> workspaces = workspaceDao.getWorkspaces(true, skip, count); while (!workspaces.isEmpty()) { for (WorkspaceImpl workspace : workspaces) { workspaceDao.remove(workspace.getId()); } skip = skip + count; workspaces = workspaceDao.getWorkspaces(true, skip, count); } }

Target:
void removeTemporaryWs() throws ServerException { final int count = 100; int skip = 0; List<WorkspaceImpl> workspaces = workspaceDao.getWorkspaces(true, skip, count); while (!workspaces.isEmpty()) { for (WorkspaceImpl workspace : workspaces) { try { workspaceDao.remove(workspace.getId()); } catch (ServerException | ConflictException e) { LOG.error("Unable to cleanup temporary workspace {}. Reason is {}",workspace.getId(), e.getLocalizedMessage()); } } skip = skip + count; workspaces = workspaceDao.getWorkspaces(true, skip, count); } }
Source:
protected boolean executePendingPreparedStatements() throws SQLException { boolean exec = false; for (Map.Entry<PreparedStatement, Integer> preparedStatementIntegerEntry : pStatements.entrySet()) { if (preparedStatementIntegerEntry.getValue() > 0) { preparedStatementIntegerEntry.getKey().executeBatch(); pStatements.put(preparedStatementIntegerEntry.getKey(), 0); exec = true; } } return exec; }

Target:
protected boolean executePendingPreparedStatements() throws SQLException { boolean exec = false; for (PreparedStatement p : pStatements.keySet()) { if (pStatements.get(p) > 0) { p.executeBatch(); pStatements.put(p, 0); exec = true; } } return exec; }
Source:
public void testSetAndGetLocalTimeZone() { configuration.setString("table.local-time-zone", "Asia/Shanghai"); configByConfiguration.addConfiguration(configuration); configByMethod.setLocalTimeZone(ZoneId.of("Asia/Shanghai")); assertEquals(Integer.valueOf(5000), configByMethod.getMaxGeneratedCodeLength()); assertEquals(Integer.valueOf(5000), configByConfiguration.getMaxGeneratedCodeLength()); }

Target:
public void testSetAndGetLocalTimeZone() { configuration.setString("table.local-time-zone", "Asia/Shanghai"); configByConfiguration.addConfiguration(configuration); configByMethod.setLocalTimeZone(ZoneId.of("Asia/Shanghai")); assertEquals(ZoneId.of("Asia/Shanghai"), configByMethod.getLocalTimeZone()); assertEquals(ZoneId.of("Asia/Shanghai"), configByConfiguration.getLocalTimeZone()); }
Source:
protected CompletionStage<Void> flushHeaders() { CompletionStage<Void> ret = CompletableFuture.completedFuture(null); if (headersFlushed) return ret; headersFlushed = true; RuntimeDelegate delegate = RuntimeDelegate.getInstance(); for (String key : headers.keySet()) { List<Object> objs = headers.get(key); for (Object obj : objs) { String value; RuntimeDelegate.HeaderDelegate headerDelegate = delegate .createHeaderDelegate(obj.getClass()); if (headerDelegate != null) { value = headerDelegate.toString(obj); } else { value = obj.toString(); } ret = stream.asyncWrite(key.getBytes()) .thenCompose(v -> stream.asyncWrite(": ".getBytes())) .thenCompose(v -> stream.asyncWrite(value.getBytes())) .thenCompose(v -> stream.asyncWrite("\r\n".getBytes())); } } return ret.thenCompose(v -> stream.asyncWrite("\r\n".getBytes())); }

Target:
protected CompletionStage<Void> flushHeaders() { CompletionStage<Void> ret = CompletableFuture.completedFuture(null); if (headersFlushed) return ret; headersFlushed = true; RuntimeDelegate delegate = RuntimeDelegate.getInstance(); for (String key : headers.keySet()) { List<Object> objs = headers.get(key); for (Object obj : objs) { String value; RuntimeDelegate.HeaderDelegate headerDelegate = delegate .createHeaderDelegate(obj.getClass()); if (headerDelegate != null) { value = headerDelegate.toString(obj); } else { value = obj.toString(); } ret = stream.asyncWrite(key.getBytes(StandardCharsets.US_ASCII)) .thenCompose(v -> stream.asyncWrite(AbstractMultipartWriter.COLON_SPACE_BYTES)) .thenCompose(v -> stream.asyncWrite(value.getBytes(StandardCharsets.US_ASCII))) .thenCompose(v -> stream.asyncWrite(AbstractMultipartWriter.LINE_SEPARATOR_BYTES)); } } return ret.thenCompose(v -> stream.asyncWrite(AbstractMultipartWriter.LINE_SEPARATOR_BYTES)); }
Source:
public void setUpOntology() throws ComponentLookupException, IOException, SolrServerException, CacheException { this.cache = mock(Cache.class); SolrOntologyServiceInitializer externalServicesAccess = this.mocker.getInstance(SolrOntologyServiceInitializer.class); when(externalServicesAccess.getCache()).thenReturn(this.cache); this.server = mock(SolrServer.class); when(externalServicesAccess.getServer()).thenReturn(this.server); this.ontologyService = this.mocker.getComponentUnderTest(); this.ontologyServiceResult = this.ontologyService.reindex(null); }

Target:
public void setUpOntology() throws ComponentLookupException, IOException, SolrServerException, CacheException { this.cache = mock(Cache.class); SolrOntologyServiceInitializer externalServicesAccess = this.mocker.getInstance(SolrOntologyServiceInitializer.class); when(externalServicesAccess.getCache()).thenReturn(this.cache); this.server = mock(SolrServer.class); when(externalServicesAccess.getServer()).thenReturn(this.server); this.ontologyService = this.mocker.getComponentUnderTest(); }
Source:
static boolean isFormatFlowed(String contentType) { if (TEXT_PLAIN.equalsIgnoreCase(getHeaderParameter(contentType, null))) { return HEADER_FORMAT_FLOWED.equalsIgnoreCase(getHeaderParameter(contentType, HEADER_PARAM_FORMAT)); } return false; }

Target:
static boolean isFormatFlowed(String contentType) { String mimeType = getHeaderParameter(contentType, null); if (isSameMimeType(TEXT_PLAIN, mimeType)) { String formatParameter = getHeaderParameter(contentType, HEADER_PARAM_FORMAT); return HEADER_FORMAT_FLOWED.equalsIgnoreCase(formatParameter); } return false; }
Source:
private void processStatement(String lisFileName, VCastLisFileParser lisFileParser, int fileNum, int functionNum, VCastFunction function, VCastStatementCoverage statementCoverageItem, Map<String, JSONObject> discrepancies) { Integer functionNumber = function.getFindex(); Integer lineNumber = statementCoverageItem.getLine(); Pair<String, Boolean> lineData = null; Discrepancy newDiscrepancy = new Discrepancy(); try { lineData = lisFileParser.getSourceCodeForLine(functionNumber, lineNumber); } catch (OseeArgumentException ex) { throw new OseeCoreException(ex, "Error(OseeArgumentException) parsing *.LIS file: [%s]. %s", function.getName()); } catch (IOException ex) { throw new OseeCoreException(ex, "Error(IOException) parsing *.LIS file: [%s]. %s", function.getName()); } if (lineData != null) { newDiscrepancy.setText(lineData.getFirst().trim()); newDiscrepancy.setLocation(lineNumber); String id = String.valueOf(Lib.generateUuid()); newDiscrepancy.setId(id); discrepancies.put(id, new JSONObject(newDiscrepancy)); if (lineData.getSecond()) { String datId = generateDatId(fileNum, functionNum, lineNumber); datIdsCoveredByException.add(datId); } } }

Target:
private void processStatement(String lisFileName, VCastLisFileParser lisFileParser, int fileNum, int functionNum, VCastFunction function, VCastStatementCoverage statementCoverageItem, Map<String, JSONObject> discrepancies) { Integer functionNumber = function.getFindex(); Integer lineNumber = statementCoverageItem.getLine(); Pair<String, Boolean> lineData = null; Discrepancy newDiscrepancy = new Discrepancy(); try { lineData = lisFileParser.getSourceCodeForLine(functionNumber, lineNumber); } catch (Exception ex) { throw new OseeCoreException(ex, "Error parsing LIS file: [%s], on function [%s]", lisFileName, function.getName()); } if (lineData != null) { newDiscrepancy.setText(lineData.getFirst().trim()); newDiscrepancy.setLocation(lineNumber); String id = String.valueOf(Lib.generateUuid()); newDiscrepancy.setId(id); discrepancies.put(id, new JSONObject(newDiscrepancy)); if (lineData.getSecond()) { String datId = generateDatId(fileNum, functionNum, lineNumber); datIdsCoveredByException.add(datId); } } }
Source:
protected boolean executeAnalysis(final IProgressMonitor monitor) { String directory = TmfTraceManager.getSupplementaryFileDir(getTrace()); final File htFile = new File(directory + getSsFileName()); final ITmfStateProvider htInput = getStateProvider(); if (htInput == null) { return false; } try { fStateSystem = TmfStateSystemFactory.newFullHistory(htFile, htInput, true); } catch (TmfTraceException e) { return false; } return true; }

Target:
protected boolean executeAnalysis(final IProgressMonitor monitor) { final ITmfStateProvider htInput = createStateProvider(); if (htInput == null) { return false; } try { StateSystemBackend backend = getBackend(); switch (backend) { case FULL: case PARTIAL: String directory = TmfTraceManager.getSupplementaryFileDir(getTrace()); final File htFile = new File(directory + getSsFileName()); if (backend.equals(StateSystemBackend.FULL)) { fStateSystem = TmfStateSystemFactory.newFullHistory(htFile, htInput, true); } else { fStateSystem = TmfStateSystemFactory.newPartialHistory(htFile, htInput, true); } break; case INMEM: fStateSystem = TmfStateSystemFactory.newInMemHistory(htInput, true); break; case NULL: fStateSystem = TmfStateSystemFactory.newNullHistory(htInput); break; default: break; } } catch (TmfTraceException e) { return false; } return true; }
Source:
public void visitClassDeclaration(ClassDeclarationTree tree) { Symbol classSymbol = createSymbol(tree.name(), Symbol.Kind.CLASS); enterScope(tree); classScope = currentScope; scopeBySymbol.put(classSymbol, classScope); scan(tree.name()); NamespaceNameTree superClass = tree.superClass(); if(superClass != null) { scan(superClass.namespaces()); Symbol superClassSymbol = resolveSymbol(superClass.name()); classScope.superClassScope = scopeBySymbol.get(superClassSymbol); } scan(tree.superInterfaces()); createMemberSymbols(tree); scan(tree.members()); classScope = null; leaveScope(); }

Target:
public void visitClassDeclaration(ClassDeclarationTree tree) { Symbol classSymbol = createSymbol(tree.name(), Symbol.Kind.CLASS); enterScope(tree); classScope = currentScope; scan(tree.name()); NamespaceNameTree superClass = tree.superClass(); if(superClass != null) { scan(superClass.namespaces()); Symbol superClassSymbol = resolveSymbol(superClass.name()); classScope.superClassScope = scopeBySymbol.get(superClassSymbol); } scopeBySymbol.put(classSymbol, classScope); scan(tree.superInterfaces()); createMemberSymbols(tree); scan(tree.members()); classScope = null; leaveScope(); }
Source:
protected void onSetUpAfterOpeningDesignerPerspective() throws Exception { sessionAirdResource = new UIResource(designerProject, FILE_DIR, SESSION_FILE); localSession = designerPerspective.openSessionFromFile(sessionAirdResource); diagram = localSession.getLocalSessionBrowser().perCategory().selectViewpoint("Design").selectRepresentation("Entities").selectDiagramInstance("aaaa package entities").open(); editor = diagram.getEditor(); }

Target:
protected void onSetUpAfterOpeningDesignerPerspective() throws Exception { sessionAirdResource = new UIResource(designerProject, FILE_DIR, SESSION_FILE); localSession = designerPerspective.openSessionFromFile(sessionAirdResource); editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), "Entities", "aaaa package entities", DDiagram.class); DialectEditor dialectEditor = (DialectEditor) editor.getReference().getEditor(false); diagram = dialectEditor.getRepresentation(); }
Source:
public void agentLoads() throws IOException, InterruptedException { final String buildDirectory = (String) System.getProperties().get("buildDirectory"); final String finalName = (String) System.getProperties().get("finalName"); final int port = 1234; final String config = getClass().getClassLoader().getResource("test.yml").getFile(); final String javaagent = "-javaagent:" + buildDirectory + "/" + finalName + ".jar=" + port + ":" + config; final String javaHome = System.getenv("JAVA_HOME"); final String java; if (javaHome != null && javaHome.equals("")) { java = javaHome + "/bin/java"; } else { java = "java"; } final Process app = new ProcessBuilder() .command(java, javaagent, "-cp", buildClasspath(), "io.prometheus.jmx.TestApplication") .start(); app.getInputStream().read(); InputStream stream = new URL("http://localhost:" + port + "/metrics").openStream(); BufferedReader contents = new BufferedReader(new InputStreamReader(stream)); boolean found = false; while (!found) { String line = contents.readLine(); if (line == null) { break; } if (line.contains("jmx_scrape_duration_seconds")) { found = true; } } assertThat("Expected metric not found", found); app.getOutputStream().write('\n'); app.getOutputStream().flush(); final int exitcode = app.waitFor(); int len; byte[] buffer = new byte[100]; while ((len = app.getErrorStream().read(buffer)) != -1) { System.out.write(buffer, 0, len); } assertThat("Application did not exit cleanly", exitcode == 0); }

Target:
public void agentLoads() throws IOException, InterruptedException { final String buildDirectory = (String) System.getProperties().get("buildDirectory"); final String finalName = (String) System.getProperties().get("finalName"); final int port = Integer.parseInt((String) System.getProperties().get("it.port")); final String config = getClass().getClassLoader().getResource("test.yml").getFile(); final String javaagent = "-javaagent:" + buildDirectory + "/" + finalName + ".jar=" + port + ":" + config; final String javaHome = System.getenv("JAVA_HOME"); final String java; if (javaHome != null && javaHome.equals("")) { java = javaHome + "/bin/java"; } else { java = "java"; } final Process app = new ProcessBuilder() .command(java, javaagent, "-cp", buildClasspath(), "io.prometheus.jmx.TestApplication") .start(); try { app.getInputStream().read(); InputStream stream = new URL("http://localhost:" + port + "/metrics").openStream(); BufferedReader contents = new BufferedReader(new InputStreamReader(stream)); boolean found = false; while (!found) { String line = contents.readLine(); if (line == null) { break; } if (line.contains("jmx_scrape_duration_seconds")) { found = true; } } assertThat("Expected metric not found", found); app.getOutputStream().write('\n'); try { app.getOutputStream().flush(); } catch (IOException ignored) { } } finally { final int exitcode = app.waitFor(); int len; byte[] buffer = new byte[100]; while ((len = app.getErrorStream().read(buffer)) != -1) { System.out.write(buffer, 0, len); } assertThat("Application did not exit cleanly", exitcode == 0); } }
Source:
private void addTextAsNewTag(ActionEvent event) { String inputText = inputTextField.getText(); if (StringUtil.isNotBlank(inputText)) { T newTag = stringConverter.fromString(inputText); if ((newTag != null) && !tags.contains(newTag)&&(tags.isEmpty()||this.allowsMultiple)) { tags.add(newTag); inputTextField.clear(); } } }

Target:
private void addTextAsNewTag(ActionEvent event) { String inputText = inputTextField.getText(); if (StringUtil.isNotBlank(inputText)) { T newTag = stringConverter.fromString(inputText); if ((newTag != null) && !tags.contains(newTag) && (tags.isEmpty() || this.properties.contains(FieldProperty.MULTIPLE_ENTRY_LINK))) { tags.add(newTag); inputTextField.clear(); } } }
Source:
public void persistCommand(VdcActionType parentCommand, boolean enableCallback) { persistCommand(parentCommand, getContext(), enableCallback, false); }

Target:
public void persistCommand(VdcActionType parentCommand, boolean enableCallback) { persistCommand(parentCommand, getContext(), enableCallback, callbackTriggeredByEvent()); }
Source:
private void edit(String key, String value) throws IOException { Requester requester = root.retrieve().method("POST"); if (!key.equals("name")) requester.with("name", name); requester.with(key, value).method("PATCH").withUrlPath(getApiTailUrl("")).to(); }

Target:
private void edit(String key, String value) throws IOException { Requester requester = root.createRequest(); if (!key.equals("name")) requester.with("name", name); requester.with(key, value).method("PATCH").withUrlPath(getApiTailUrl("")).send(); }
Source:
public static OnmsTopologyPort create(OnmsTopologyVertex vertex, Integer index) throws OnmsTopologyException { if (vertex == null) { throw new OnmsTopologyException("Canno create port, vertex is null"); } if (index != null) { return new OnmsTopologyPort(vertex.getId()+":"+index,vertex,index); } return new OnmsTopologyPort(vertex.getId()+":-1",vertex,-1); }

Target:
public static OnmsTopologyPort create(OnmsTopologyVertex vertex, Integer index) throws OnmsTopologyException { if (vertex == null) { throw new OnmsTopologyException("Cannot create port, vertex is null"); } if (index != null) { return new OnmsTopologyPort(vertex.getId()+":"+index,vertex,index); } return new OnmsTopologyPort(vertex.getId()+":-1",vertex,-1); }
Source:
protected void executeCommand() { VDSReturnValue vdsReturnaValue = Backend.getInstance().getResourceManager() .RunVdsCommand(VDSCommandType.StopRebalanceGlusterVolume, new GlusterVolumeVDSParameters(upServer.getId(), getGlusterVolumeName())); setSucceeded(vdsReturnaValue.getSucceeded()); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED, vdsReturnaValue.getVdsError() .getMessage()); return; } GlusterAsyncTask asyncTask = getGlusterVolume().getAsyncTask(); List<Step> steps = DbFacade.getInstance().getStepDao().getStepsByExternalId(asyncTask.getTaskId()); for (Step step : steps) { step.markStepEnded(JobExecutionStatus.ABORTED); endStepJob(step); clearVolumeTaskAndReleaseLock(); } getReturnValue().setActionReturnValue(vdsReturnaValue); }

Target:
protected void executeCommand() { VDSReturnValue vdsReturnaValue = Backend.getInstance().getResourceManager() .RunVdsCommand(VDSCommandType.StopRebalanceGlusterVolume, new GlusterVolumeVDSParameters(upServer.getId(), getGlusterVolumeName())); setSucceeded(vdsReturnaValue.getSucceeded()); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED, vdsReturnaValue.getVdsError() .getMessage()); return; } GlusterAsyncTask asyncTask = getGlusterVolume().getAsyncTask(); Step step = DbFacade.getInstance().getStepDao().getStepsByExternalId(asyncTask.getTaskId()).get(0); step.markStepEnded(JobExecutionStatus.ABORTED); step.setDescription("Rebalancing operation Aborted by the user"); endStepJob(step); clearVolumeTaskAndReleaseLock(); getReturnValue().setActionReturnValue(vdsReturnaValue); }
Source:
public void handleRow(int index, Values row) { if (row.length() == 0) { return; } if (!dictionary.hasMappings()) { dictionary.determineMappingFromHeadings(row, false); process.log(ProcessLog.info().withMessage(dictionary.getMappingAsString())); } else { Watch w = Watch.start(); try { Context ctx = filterEmptyValues(dictionary.load(row, false)); if (!isEmptyContext(ctx)) { handleRow(index, ctx); } } catch (HandledException e) { process.handle(Exceptions.createHandled() .to(Log.BACKGROUND) .withNLSKey("LineBasedJob.errorInRow") .set("row", index) .set("message", e.getMessage()) .handle()); } catch (Exception e) { process.handle(Exceptions.handle() .to(Log.BACKGROUND) .error(e) .withNLSKey("LineBasedJob.failureInRow") .set("row", index) .handle()); } finally { process.addTiming(NLS.get("LineBasedJob.row"), w.elapsedMillis()); } } }

Target:
public void handleRow(int index, Values row) { if (row.length() == 0) { return; } if (!dictionary.hasMappings()) { dictionary.determineMappingFromHeadings(row, false); process.log(ProcessLog.info().withMessage(dictionary.getMappingAsString())); } else { Watch watch = Watch.start(); try { Context context = filterEmptyValues(dictionary.load(row, false)); if (!isEmptyContext(context)) { handleRow(index, context); } } catch (HandledException e) { process.handle(Exceptions.createHandled() .to(Log.BACKGROUND) .withNLSKey("LineBasedJob.errorInRow") .set("row", index) .set("message", e.getMessage()) .handle()); } catch (Exception e) { process.handle(Exceptions.handle() .to(Log.BACKGROUND) .error(e) .withNLSKey("LineBasedJob.failureInRow") .set("row", index) .handle()); } finally { process.addTiming(NLS.get("LineBasedJob.row"), watch.elapsedMillis()); } } }