auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
PrimitiveLongArrayQueue( int capacity ) { if ( capacity == 0 || (capacity & (capacity - 1)) != 0 ) { throw new IllegalArgumentException( "Capacity should be power of 2." ); } initValues( capacity ); }

Target:
PrimitiveLongArrayQueue( int capacity ) { if ( capacity == 0 || (capacity & (capacity - 1)) != 0 ) { throw new IllegalArgumentException( "Capacity should be power of 2. Requested capacity: " + capacity ); } initValues( capacity ); }
Source:
public void writeTo(OutputStream out) throws IOException { out.write(getBytesUnsafe(), offset, length); }

Target:
public void writeTo(OutputStream out) throws IOException { if (value.hasArray()) { out.write(value.array(), value.arrayOffset() + offset, length); } else { out.write(getBytesUnsafe(), 0, length); } }
Source:
public Response getStop (@PathParam("stopId") String stopIdString) { FeedScopedId stopId = GtfsLibrary.convertIdFromString(stopIdString); ApiStop stop = StopMapper.mapStop(index.stopForId.get(stopId)); if (stop != null) { return Response.status(Status.OK).entity(stop).build(); } else { return Response.status(Status.NOT_FOUND).entity(MSG_404).build(); } }

Target:
public Response getStop (@PathParam("stopId") String stopIdString) { FeedScopedId stopId = GtfsLibrary.convertIdFromString(stopIdString); Stop stop = getRoutingService().getStopForId().get(stopId); if (stop != null) { return Response.status(Status.OK).entity(stop).build(); } else { return Response.status(Status.NOT_FOUND).entity(MSG_404).build(); } }
Source:
public List<Diagnosis> getDiagnoses(Patient patient, Date fromDate) { EncounterSearchCriteria encounterSearchCriteria = new EncounterSearchCriteriaBuilder().setPatient(patient) .setFromDate(fromDate).createEncounterSearchCriteria(); List<Encounter> encounters = Context.getEncounterService().getEncounters(encounterSearchCriteria); List<Diagnosis> diagnoses = new ArrayList<>(); for (Encounter encounter : encounters) { diagnoses.addAll(encounter.getDiagnoses()); } return diagnoses; }

Target:
public List<Diagnosis> getDiagnoses(Patient patient, Date fromDate) { return diagnosisDAO.getActiveDiagnoses(patient, fromDate); }
Source:
public void testCallService_attributes_all_OK() throws InstallatorException, NodeExecutionException, IOException, KeyManagementException, NoSuchAlgorithmException { when(httpsClient.doHttpsPost(Mockito.anyString(), Mockito.anyString(),(Map<String,String>)Mockito.anyObject())).thenReturn(200); when(httpsClient.doHttpsGet(Mockito.anyString(), Mockito.anyString(),(Map<String,String>)Mockito.anyObject())).thenReturn(200); InputStream in = IOUtils.toInputStream(GET_NODES, "UTF-8"); when(entity.getContent()).thenReturn(in); puppetInstallator.callService(productInstance, host, attributeList, "install", "token"); }

Target:
public void testCallService_attributes_all_OK() throws InstallatorException, NodeExecutionException, IOException, KeyManagementException, NoSuchAlgorithmException { when( httpsClient.doHttps(Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), (Map<String, String>) Mockito.anyObject())).thenReturn(200); InputStream in = IOUtils.toInputStream(GET_NODES, "UTF-8"); when(entity.getContent()).thenReturn(in); puppetInstallator.callService(productInstance, host, attributeList, "install", "token"); }
Source:
public Object visit(ASTUserClass node, Object data) { if (Helper.isTestMethodOrClass(node)) { return data; } collectBenignVariables(node); List<ASTMethodCallExpression> methodCalls = node.findDescendantsOfType(ASTMethodCallExpression.class); for (ASTMethodCallExpression methodCall : methodCalls) { if (Helper.isMethodName(methodCall, CONFIGURATION, DISABLE_CRUD)) { addViolation(data, methodCall); } if (Helper.isMethodName(methodCall, SYSTEM, DEBUG)) { validateParameters(methodCall, data); } } return data; }

Target:
public Object visit(ASTUserClass node, Object data) { if (Helper.isTestMethodOrClass(node)) { return data; } collectBenignVariables(node); List<ASTMethodCallExpression> methodCalls = node.findDescendantsOfType(ASTMethodCallExpression.class); for (ASTMethodCallExpression methodCall : methodCalls) { if (Helper.isMethodName(methodCall, CONFIGURATION, DISABLE_CRUD)) { addViolation(data, methodCall); } if (Helper.isMethodName(methodCall, SYSTEM, DEBUG)) { validateParameters(methodCall, data); } } whiteListedVariables.clear(); return data; }
Source:
Page() throws IOException { Document hostDoc = HtmlDomUtil.clone(template); css = injectCssFile(hostDoc, "gerrit_sitecss", site.site_css); header = injectXmlFile(hostDoc, "gerrit_header", site.site_header); footer = injectXmlFile(hostDoc, "gerrit_footer", site.site_footer); final HostPageData pageData = new HostPageData(); pageData.plugnisUrls =getPluginUrls(); pageData.config = config; final StringWriter w = new StringWriter(); w.write("var " + HPD_ID + "="); json(pageData, w); w.write(";"); final Element data = HtmlDomUtil.find(hostDoc, HPD_ID); asScript(data); data.appendChild(hostDoc.createTextNode(w.toString())); data.appendChild(hostDoc.createComment(HPD_ID)); permutations = new HashMap<Permutation, Content>(); for (Permutation p : selector.getPermutations()) { final Document d = HtmlDomUtil.clone(hostDoc); Element nocache = HtmlDomUtil.find(d, "gerrit_module"); nocache.getParentNode().removeChild(nocache); p.inject(d); permutations.put(p, new Content(d)); } Element nocache = HtmlDomUtil.find(hostDoc, "gerrit_module"); asScript(nocache); nocache.setAttribute("src", noCacheName); permutations.put(null, new Content(hostDoc)); }

Target:
Page() throws IOException { Document hostDoc = HtmlDomUtil.clone(template); css = injectCssFile(hostDoc, "gerrit_sitecss", site.site_css); header = injectXmlFile(hostDoc, "gerrit_header", site.site_header); footer = injectXmlFile(hostDoc, "gerrit_footer", site.site_footer); final HostPageData pageData = new HostPageData(); pageData.pluginUrls = getPluginUrls(); pageData.config = config; final StringWriter w = new StringWriter(); w.write("var " + HPD_ID + "="); json(pageData, w); w.write(";"); final Element data = HtmlDomUtil.find(hostDoc, HPD_ID); asScript(data); data.appendChild(hostDoc.createTextNode(w.toString())); data.appendChild(hostDoc.createComment(HPD_ID)); permutations = new HashMap<Permutation, Content>(); for (Permutation p : selector.getPermutations()) { final Document d = HtmlDomUtil.clone(hostDoc); Element nocache = HtmlDomUtil.find(d, "gerrit_module"); nocache.getParentNode().removeChild(nocache); p.inject(d); permutations.put(p, new Content(d)); } Element nocache = HtmlDomUtil.find(hostDoc, "gerrit_module"); asScript(nocache); nocache.setAttribute("src", noCacheName); permutations.put(null, new Content(hostDoc)); }
Source:
private WriteRequestValues getValues(String pType, Object pCurrentValue, JolokiaWriteRequest pRequest) throws AttributeNotFoundException, IllegalAccessException, InvocationTargetException { List<String> pathParts = pRequest.getPathParts(); Object newValue = pRequest.getValue(); if (pathParts != null && pathParts.size() > 0) { if (pCurrentValue == null ) { throw new IllegalArgumentException( "Cannot set value with path when parent object is not set"); } return context.getMandatoryService(Serializer.class).setInnerValue(pCurrentValue, newValue, pathParts); } else { return new WriteRequestValues(context.getMandatoryService(Serializer.class).deserialize(pType, newValue), pCurrentValue); } }

Target:
private Object[] getValues(String pType, Object pCurrentValue, JolokiaWriteRequest pRequest) throws AttributeNotFoundException, IllegalAccessException, InvocationTargetException { List<String> pathParts = pRequest.getPathParts(); Object newValue = pRequest.getValue(); if (pathParts != null && pathParts.size() > 0) { if (pCurrentValue == null ) { throw new IllegalArgumentException( "Cannot set value with path when parent object is not set"); } return new Object[] { pCurrentValue, context.getMandatoryService(Serializer.class).setInnerValue(pCurrentValue, newValue, pathParts) }; } else { return new Object[] { context.getMandatoryService(Serializer.class).deserialize(pType, newValue), pCurrentValue }; } }
Source:
public IStatus connect() { if (isConnected() && listener.secureStoreException == null) { return Status.OK_STATUS; } IStatus status = Status.OK_STATUS; listener.secureStoreException = null; try { IConnection connection = isNewConnection() ? createConnection(connectionFactory, connectionAuthenticationProvider) : this.selectedConnection; if(connection != null) { addConnectionListener(connection); if (connection.connect()) { connection.enablePromptCredentials(true); this.connection = connection; wizardModel.setConnection(connection); ConnectionsRegistrySingleton.getInstance().setRecent(connection); connection.notifyUsage(); } else { String message = NLS.bind("Unable to connect to {0}", connection.getHost()); OpenShiftCommonUIActivator.log(message, null); status = StatusFactory.errorStatus(OpenShiftCommonUIActivator.PLUGIN_ID, message); } } } catch (Exception e) { status = StatusFactory.errorStatus(OpenShiftCommonUIActivator.PLUGIN_ID, e.getMessage()); OpenShiftCommonUIActivator.log(e); } finally { removeConnectionListener(connection); } update(selectedConnection, connectionFactory, host, useDefaultHost, Status.OK_STATUS, status); return status; }

Target:
public IStatus connect() { if (isConnected() && listener.secureStoreException == null) { return Status.OK_STATUS; } IStatus status = Status.OK_STATUS; listener.secureStoreException = null; try { IConnection connection = createConnection(connectionFactory, connectionAuthenticationProvider); if(connection != null) { addConnectionListener(connection); if (connection.connect()) { connection.enablePromptCredentials(true); this.connection = connection; wizardModel.setConnection(connection); ConnectionsRegistrySingleton.getInstance().setRecent(connection); connection.notifyUsage(); } else { String message = NLS.bind("Unable to connect to {0}", connection.getHost()); OpenShiftCommonUIActivator.log(message, null); status = StatusFactory.errorStatus(OpenShiftCommonUIActivator.PLUGIN_ID, message); } } } catch (Exception e) { status = StatusFactory.errorStatus(OpenShiftCommonUIActivator.PLUGIN_ID, e.getMessage()); OpenShiftCommonUIActivator.log(e); } finally { removeConnectionListener(connection); } update(selectedConnection, connectionFactory, host, useDefaultHost, Status.OK_STATUS, status); return status; }
Source:
public Response createStaffMemberAddress(@PathParam("STAFFMEMBERID") Long staffMemberId, fi.pyramus.rest.model.Address address) { if (address == null) { return Response.status(Status.BAD_REQUEST).build(); } StaffMember staffMember = userController.findStaffMemberById(staffMemberId); if (staffMember == null) { return Response.status(Status.NOT_FOUND).build(); } if (staffMember.getArchived()) { return Response.status(Status.NOT_FOUND).build(); } if (!restSecurity.hasPermission(new String[] { UserPermissions.LIST_STAFFMEMBERADDRESES }, staffMember ) && !restSecurity.hasPermission(new String[] { PersonPermissions.PERSON_OWNER }, staffMember.getPerson() )) { return Response.status(Status.FORBIDDEN).build(); } Long contactTypeId = address.getContactTypeId(); Boolean defaultAddress = address.getDefaultAddress(); String name = address.getName(); String streetAddress = address.getStreetAddress(); String postalCode = address.getPostalCode(); String country = address.getCountry(); String city = address.getCity(); if ((contactTypeId == null) || (defaultAddress == null)) { return Response.status(Status.BAD_REQUEST).build(); } ContactType contactType = commonController.findContactTypeById(contactTypeId); if (contactType == null) { return Response.status(Status.BAD_REQUEST).build(); } return Response.ok( objectFactory.createModel(userController.addStaffMemberAddress(staffMember, contactType, defaultAddress, name, streetAddress, postalCode, city, country))) .build(); }

Target:
public Response createStaffMemberAddress(@PathParam("STAFFMEMBERID") Long staffMemberId, fi.pyramus.rest.model.Address address) { if (address == null) { return Response.status(Status.BAD_REQUEST).build(); } StaffMember staffMember = userController.findStaffMemberById(staffMemberId); if (staffMember == null) { return Response.status(Status.NOT_FOUND).build(); } if (staffMember.getArchived()) { return Response.status(Status.NOT_FOUND).build(); } if (!restSecurity.hasPermission(new String[] { UserPermissions.CREATE_STAFFMEMBERADDRESS }, staffMember ) && !restSecurity.hasPermission(new String[] { PersonPermissions.PERSON_OWNER }, staffMember.getPerson() )) { return Response.status(Status.FORBIDDEN).build(); } Long contactTypeId = address.getContactTypeId(); Boolean defaultAddress = address.getDefaultAddress(); String name = address.getName(); String streetAddress = address.getStreetAddress(); String postalCode = address.getPostalCode(); String country = address.getCountry(); String city = address.getCity(); if ((contactTypeId == null) || (defaultAddress == null)) { return Response.status(Status.BAD_REQUEST).build(); } ContactType contactType = commonController.findContactTypeById(contactTypeId); if (contactType == null) { return Response.status(Status.BAD_REQUEST).build(); } return Response.ok( objectFactory.createModel(userController.addStaffMemberAddress(staffMember, contactType, defaultAddress, name, streetAddress, postalCode, city, country))) .build(); }
Source:
public BitWriter(int initialCapacity, int pageSize, ByteBufferAllocator allocator) { this.allocator = allocator; this.baos = new CapacityByteArrayOutputStream(initialCapacity, pageSize, this.allocator); }

Target:
public BitWriter(int initialCapacity, int pageSize, ByteBufferAllocator allocator) { this.baos = new CapacityByteArrayOutputStream(initialCapacity, pageSize, allocator); }
Source:
public int writeToFile(JDBCSequentialFile file, byte[] data, boolean append) throws SQLException { try (Connection connection = connectionProvider.getConnection()) { Object largeObject = null; Long oid = getOID(file); try { connection.setAutoCommit(false); largeObject = largeObjectManager.open(connection, oid, PostgresLargeObjectManager.WRITE); if (append) { largeObjectManager.seek(largeObject, largeObjectManager.size(largeObject)); } else { largeObjectManager.truncate(largeObject, 0); } largeObjectManager.write(largeObject, data); largeObjectManager.close(largeObject); connection.commit(); } catch (Exception e) { connection.rollback(); throw e; } return data.length; } }

Target:
public int writeToFile(JDBCSequentialFile file, byte[] data, boolean append) throws SQLException { try (Connection connection = connectionProvider.getConnection()) { Long oid = getOID(file); try { connection.setAutoCommit(false); Object largeObject = largeObjectManager.open(connection, oid, PostgresLargeObjectManager.WRITE); if (append) { largeObjectManager.seek(largeObject, largeObjectManager.size(largeObject)); } else { largeObjectManager.truncate(largeObject, 0); } largeObjectManager.write(largeObject, data); largeObjectManager.close(largeObject); connection.commit(); } catch (Exception e) { connection.rollback(); throw e; } return data.length; } }
Source:
public void testPrintTreeOnMoreThanOneFile() throws Exception { exit.expectSystemExitWithStatus(-1); exit.checkAssertionAfterwards(() -> { assertEquals("Printing AST is allowed for only one file." + System.lineSeparator(), systemOut.getLog()); assertEquals("", systemErr.getLog()); }); Main.main("-t", getNonPackagePath( "checks/metrics")); }

Target:
public void testPrintTreeOnMoreThanOneFile() throws Exception { exit.expectSystemExitWithStatus(-1); exit.checkAssertionAfterwards(() -> { assertEquals("Printing AST is allowed for only one file." + System.lineSeparator(), systemOut.getLog()); assertEquals("", systemErr.getLog()); }); Main.main("-t", getPath("")); }
Source:
public void prenatalPhenotypeSetup(Set<String> enabledFields) throws Exception { String sectionName = "prenatalPhenotype"; String[] fieldIds = { "prenatal_phenotype", "prenatal_phenotype_code", "prenatal_phenotype_combined", "negative_prenatal_phenotype", "prenatal_phenotype_by_section" }; String[][] headerIds = { { "phenotype" }, { "code" }, { "phenotype", "code" }, { "negative" }, { "category" } }; Set<String> present = new HashSet<String>(); int counter = 0; for (String fieldId : fieldIds) { if (enabledFields.remove(fieldId)) { for (String headerId : headerIds[counter]) { present.add(headerId); } } counter++; } this.enabledHeaderIdsBySection.put(sectionName, present); this.prenatalPhenotypeHelper = new ConversionHelpers(); this.prenatalPhenotypeHelper .featureSetUp(present.contains("phenotype"), present.contains("negative"), present.contains("category")); }

Target:
public void prenatalPhenotypeSetup(Set<String> enabledFields) throws Exception { String sectionName = "prenatalPhenotype"; String[] fieldIds = { "prenatal_phenotype", "prenatal_phenotype_code", "prenatal_phenotype_combined", "negative_prenatal_phenotype", "prenatal_phenotype_by_section" }; String[][] headerIds = { { "phenotype" }, { "code" }, { "phenotype", "code" }, { "negative" }, { "category" } }; Set<String> present = addHeaders(fieldIds, headerIds, enabledFields); this.enabledHeaderIdsBySection.put(sectionName, present); this.prenatalPhenotypeHelper = new ConversionHelpers(); this.prenatalPhenotypeHelper .featureSetUp(present.contains("phenotype"), present.contains("negative"), present.contains("category")); }
Source:
void closeRevision() throws IOException { if (rev.Model == null || rev.Format == null) { if (page.Title.Text.endsWith(".js")) { rev.Model = "javascript"; rev.Format = "text/javascript"; } else if (page.Title.Text.endsWith(".css")) { rev.Model = "css"; rev.Format = "text/css"; } else { rev.Model = "wikitext"; rev.Format = "text/x-wiki"; } } writer.writeRevision(rev); rev = null; }

Target:
void closeRevision() throws IOException { writer.writeRevision(rev); rev = null; }
Source:
protected final void failIfNotIndexed() { if (isSearchable == false) { throw new IllegalArgumentException("Cannot search on field [" + name() + "] since it is not indexed."); } }

Target:
protected final void failIfNotIndexed() { if (isIndexed == false) { throw new IllegalArgumentException("Cannot search on field [" + name() + "] since it is not indexed."); } }
Source:
LockFreeSetImpl() { this.head = new Node(); }

Target:
public LockFreeSetImpl() { this.head = new Node(); }
Source:
public void testStorageOrdered() { final String namePrefix = randomValidStringOfLength(31); final Storage storage2 = repository.createStorage( createStorage(namePrefix + "2", ZookeeperConnection.valueOf("exhibitor://exaddress:8181/path"))); final Storage storage1 = repository.createStorage( createStorage(namePrefix + "1", ZookeeperConnection.valueOf("exhibitor://exaddress:8181/path"))); final Storage storage3 = repository.createStorage( createStorage(namePrefix + "3", ZookeeperConnection.valueOf("exhibitor://exaddress:8181/path"))); final List<Storage> storages = repository.listStorages().stream() .filter(st -> st.getId() != null) .filter(st -> st.getId().startsWith(namePrefix)) .collect(Collectors.toList()); assertEquals(3, storages.size()); assertEquals(storage1, storages.get(0)); assertEquals(storage2, storages.get(1)); assertEquals(storage3, storages.get(2)); }

Target:
public void testStorageOrdered() { final String namePrefix = randomValidStringOfLength(31); final Storage storage2 = repository.createStorage( createStorage(namePrefix + "2", ZookeeperConnection.valueOf("exhibitor://exaddress1:8181/path3"))); final Storage storage1 = repository.createStorage( createStorage(namePrefix + "1", ZookeeperConnection.valueOf("exhibitor://exaddress2:8181/path2"))); final Storage storage3 = repository.createStorage( createStorage(namePrefix + "3", ZookeeperConnection.valueOf("exhibitor://exaddress3:8181/path1"))); final List<Storage> storages = repository.listStorages().stream() .filter(st -> st.getId() != null) .filter(st -> st.getId().startsWith(namePrefix)) .collect(Collectors.toList()); assertEquals(3, storages.size()); assertEquals(storage1, storages.get(0)); assertEquals(storage2, storages.get(1)); assertEquals(storage3, storages.get(2)); }
Source:
private void initialize() { ColorServer colorServer = new ColorServer(); fileOpenController.dbPathProperty().set(welcomeController.getListedPaths()); fileOpenController.graphProperty().addListener((obj, oldV, newV) -> { strainView = new StrainView(colorServer, newV); constructView(strainView, phyloView); }); fileOpenController.treeProperty().addListener((obj, oldV, newV) -> { phyloView = new PhylogeneticView(colorServer); phyloView.rootProperty().set(newV); }); welcomeController.dbProperty().addListener((obj, oldV, newV) -> { strainView = new StrainView(colorServer, newV); phyloView = new PhylogeneticView(colorServer); constructView(strainView, phyloView); }); }

Target:
private void initialize() { ColorServer colorServer = new ColorServer(); fileOpenController.dbPathProperty().set(welcomeController.getListedPaths()); fileOpenController.graphProperty().addListener((obj, oldV, newV) -> { strainView = new StrainView(colorServer, newV); constructView(); }); fileOpenController.treeProperty().addListener((obj, oldV, newV) -> { phyloView = new PhylogeneticView(colorServer); phyloView.rootProperty().set(newV); }); welcomeController.dbProperty().addListener((obj, oldV, newV) -> { strainView = new StrainView(colorServer, newV); phyloView = new PhylogeneticView(colorServer); constructView(); }); }
Source:
private static Request wrap(final Request req) { final AtomicBoolean seen = new AtomicBoolean(false); return new RqOf( req::head, () -> { if (!seen.getAndSet(true)) { throw new IllegalStateException( "It's not allowed to call body() more than once" ); } return req.body(); } ); }

Target:
private static Request wrap(final Request req) { final AtomicBoolean seen = new AtomicBoolean(false); return new RequestOf( req::head, () -> { if (!seen.getAndSet(true)) { throw new IllegalStateException( "It's not allowed to call body() more than once" ); } return req.body(); } ); }
Source:
protected void checkFreemMarkerOutput(boolean outputIsInFile, String output, String alternateOutput, String... runFile) { String outputExpected = ""; if (outputIsInFile) { String outputFilepath = getResourceAbsolutePath( Activator.PLUGIN_ID, output); outputExpected = readOutputFromFile(outputFilepath); } else { outputExpected = output; } runJavaFile(runFile); ConsoleView cv = new ConsoleView(); cv.open(); try { new WaitUntil(new ConsoleHasText(outputExpected), TimePeriod.NORMAL, false); } catch (CoreLayerException exc) { exc.printStackTrace(); } String consoleText = cv.getConsoleText(); if (!consoleText.equals(outputExpected)) { log.error("Console text doesn't correspond with expected text"); log.dump("Console text:\n" + consoleText); log.dump("Expected text:\n" + outputExpected); } compareConsoleToOutput(consoleText, outputExpected, alternateOutput); }

Target:
protected void checkFreemMarkerOutput(boolean outputIsInFile, String output, String alternateOutput, String... runFile) { String outputExpected = ""; if (outputIsInFile) { String outputFilepath = getResourceAbsolutePath( Activator.PLUGIN_ID, output); outputExpected = readOutputFromFile(outputFilepath); } else { outputExpected = output; } runJavaFile(runFile); new WaitUntil(new ConsoleHasText(outputExpected), TimePeriod.NORMAL, false); ConsoleView cv = new ConsoleView(); cv.open(); String consoleText = cv.getConsoleText(); if (!consoleText.equals(outputExpected)) { log.error("Console text doesn't correspond with expected text"); log.dump("Console text:\n" + consoleText); log.dump("Expected text:\n" + outputExpected); } compareConsoleToOutput(consoleText, outputExpected, alternateOutput); }
Source:
public void shouldSkipSiteReportGeneration() throws Exception { File testDir = prepareSiteTest("/pit-site-skip"); File siteParentDir = buildFile(testDir, "target", "site"); verifier.executeGoal("site"); assertThat(siteParentDir.exists()).isEqualTo(true); assertThat(buildFile(siteParentDir, "pit-reports").exists()).isEqualTo(false); assertThat(buildFile(siteParentDir, "index.html").exists()).isEqualTo(true); assertThat(buildFile(siteParentDir, "project-reports.html").exists()).isEqualTo(false); }

Target:
public void shouldSkipSiteReportGeneration() throws Exception { File testDir = prepareSiteTest("/pit-site-skip"); File siteParentDir = buildFilePath(testDir, "target", "site"); verifier.executeGoal("site"); assertThat(siteParentDir).exists(); assertThat(buildFilePath(siteParentDir, "pit-reports")).doesNotExist(); assertThat(buildFilePath(siteParentDir, "index.html")).exists(); assertThat(buildFilePath(siteParentDir, "project-reports.html")).doesNotExist(); }
Source:
public static boolean isExpiredPresignedUrl(final String presignedUrl, final Date now) { final Map<String, String> urlMap = Splitter.on('&').trimResults().withKeyValueSeparator("=").split(presignedUrl.split("\\?")[1]); try { final Long expiration = Long.parseLong(urlMap.get("Expires")); final Long nowSecs = now.getTime() / 1000L; return (nowSecs > expiration); } catch (Exception e) { LOGGER.error("Invalid pre-signed URL."); return true; } }

Target:
public static boolean isExpiredPresignedUrl(final String presignedUrl, final Date now) { final Map<String, String> urlMap = Splitter.on('&').trimResults().withKeyValueSeparator("=").split(presignedUrl.split("\\?")[1]); if (now == null) { LOGGER.error("Invalid date parameter in pre-signed URL check."); return true; } try { final Long expiration = Long.parseLong(urlMap.get("Expires")); final Long nowSecs = now.getTime() / 1000L; return (nowSecs > expiration); } catch (NumberFormatException e) { LOGGER.error("Invalid pre-signed URL."); return true; } }
Source:
private boolean changeDefaultFolder() { Element folder = (Element) mConfig.getDocumentElement() .getElementsByTagName("folder").item(0); String deviceModel = Build.MODEL .replace(" ", "_") .toLowerCase(Locale.US) .replaceAll("[^a-z0-9_-]", ""); String deviceId = deviceModel + "_" + generateRandomString(DEVICE_ID_APPENDIX_LENGTH); folder.setAttribute("label", mContext.getString(R.string.default_folder_label)); folder.setAttribute("id", mContext.getString(R.string.default_folder_id, deviceId)); folder.setAttribute("path", Environment .getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath()); folder.setAttribute("type", "readonly"); folder.setAttribute("fsWatcherEnabled", "true"); folder.setAttribute("fsWatcherDelayS", "10"); return true; }

Target:
private boolean changeDefaultFolder() { Element folder = (Element) mConfig.getDocumentElement() .getElementsByTagName("folder").item(0); String deviceModel = Build.MODEL .replace(" ", "_") .toLowerCase(Locale.US) .replaceAll("[^a-z0-9_-]", ""); String defaultFolderId = deviceModel + "_" + generateRandomString(FOLDER_ID_APPENDIX_LENGTH); folder.setAttribute("label", mContext.getString(R.string.default_folder_label)); folder.setAttribute("id", mContext.getString(R.string.default_folder_id, defaultFolderId)); folder.setAttribute("path", Environment .getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath()); folder.setAttribute("type", "readonly"); folder.setAttribute("fsWatcherEnabled", "true"); folder.setAttribute("fsWatcherDelayS", "10"); return true; }
Source:
private static BloomKFilter evaluateBloomFilter(ExprNodeDesc desc, Configuration configuration, boolean resolveDynamicValue ) throws HiveException, IOException { if(!resolveDynamicValue) { return new BloomKFilter(1); } else { BytesWritable bw = (BytesWritable) ExprNodeEvaluatorFactory.get(desc, configuration) .evaluate(null); byte[] bytes = new byte[bw.getLength()]; System.arraycopy(bw.getBytes(), 0, bytes, 0, bw.getLength()); InputStream in = new NonSyncByteArrayInputStream(bytes); return BloomKFilter.deserialize(in); } }

Target:
private static BloomKFilter evaluateBloomFilter(ExprNodeDesc desc, Configuration configuration, boolean resolveDynamicValue) throws HiveException, IOException { if (!resolveDynamicValue) { return new BloomKFilter(1); } else { BytesWritable bw = (BytesWritable) ExprNodeEvaluatorFactory.get(desc, configuration).evaluate(null); return BloomKFilter.deserialize(ByteBuffer.wrap(bw.getBytes())); } }
Source:
private void makeChange(StringBuilder buffer, String format, Object... args) throws FormatterException { if (args == null) { return; } Object o = null; int pattern = format.indexOf(":"); if (pattern == -1) { pattern = format.length(); } StringTokenizer st = new StringTokenizer(format.substring( 0, pattern), "."); try { String ind = st.nextToken(); if (ind.charAt(0) == '-' || ind.charAt(0) == '+') { throw new FormatterException("Incorrect index"); } o = args[Integer.parseInt(ind)]; } catch (Exception e) { throw new FormatterException("Incorrect index"); } while(st.hasMoreTokens()) { o = getField(o, st.nextToken()); } if (o == null) { return; } if (pattern == format.length()) { buffer.append(o.toString()); } else { StringFormatterExtension sfe = null; for (int i = 0; i < extensions.size(); ++i) { if (extensions.get(i).supports(o.getClass())) { sfe = extensions.get(i); break; } } if (sfe == null) { throw new FormatterException("No available extension"); } sfe.format(buffer, o, format.substring(pattern + 1)); } }

Target:
private void makeChange(StringBuilder buffer, String format, Object... args) throws FormatterException { if (args == null) { return; } Object o = null; int pattern = format.indexOf(":"); if (pattern == -1) { pattern = format.length(); } StringTokenizer st = new StringTokenizer(format.substring( 0, pattern), "."); try { String ind = st.nextToken(); if (!Character.isDigit(ind.charAt(0))) { throw new FormatterException("Incorrect index"); } o = args[Integer.parseInt(ind)]; } catch (Exception e) { throw new FormatterException("Incorrect index"); } while(st.hasMoreTokens()) { o = getField(o, st.nextToken()); } if (o == null) { return; } if (pattern == format.length()) { buffer.append(o.toString()); } else { StringFormatterExtension sfe = null; for (int i = 0; i < extensions.size(); ++i) { if (extensions.get(i).supports(o.getClass())) { sfe = extensions.get(i); break; } } if (sfe == null) { throw new FormatterException("No available extension"); } sfe.format(buffer, o, format.substring(pattern + 1)); } }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Metadata metadata = (Metadata) o; if (container != null ? !container.equals(metadata.container) : metadata.container != null) { return false; } if (!Arrays.equals(aggregators, metadata.aggregators)) { return false; } return !(queryGranularity != null ? !queryGranularity.equals(metadata.queryGranularity) : metadata.queryGranularity != null); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Metadata metadata = (Metadata) o; if (!container.equals(metadata.container)) { return false; } if (!Arrays.equals(aggregators, metadata.aggregators)) { return false; } return !(queryGranularity != null ? !queryGranularity.equals(metadata.queryGranularity) : metadata.queryGranularity != null); }
Source:
public void testGetProcessInstancesCustomWithoutVars() { query = new SqlQueryDefinition("jbpmProcessSearchWithoutVars", dataSourceJNDIname); query.setExpression("select p. PROCESSINSTANCEID, p.PROCESSID, p.PROCESSNAME, p.PROCESSVERSION, " + "p.STATUS, p.EXTERNALID, pr.STARTDATE, p.USER_IDENTITY, p.PROCESSINSTANCEDESCRIPTION, " + "p.CORRELATIONKEY, p.PARENTPROCESSINSTANCEID, pr.LASTMODIFICATIONDATE " + "from PROCESSINSTANCELOG p " + "inner join PROCESSINSTANCEINFO pr on p.PROCESSINSTANCEID = pr.INSTANCEID"); queryService.registerQuery(query); processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "org.jbpm.writedocument"); assertNotNull(processInstanceId); List<ProcessInstanceCustomDesc> processInstanceLogs = queryService.query(query.getName(), ProcessInstanceCustomQueryMapper.get(), new QueryContext()); assertNotNull(processInstanceLogs); assertEquals(1, processInstanceLogs.size()); processService.abortProcessInstance(processInstanceId); processInstanceId = null; }

Target:
public void testGetProcessInstancesCustomWithoutVars() { query = new SqlQueryDefinition("jbpmProcessSearchWithoutVars", dataSourceJNDIname); query.setExpression("select p.PROCESSINSTANCEID, p.PROCESSID, p.PROCESSNAME, p.PROCESSVERSION, " + "p.STATUS, p.EXTERNALID, pr.STARTDATE, p.USER_IDENTITY, p.PROCESSINSTANCEDESCRIPTION, " + "p.CORRELATIONKEY, p.PARENTPROCESSINSTANCEID, pr.LASTMODIFICATIONDATE " + "from PROCESSINSTANCELOG p inner join PROCESSINSTANCEINFO pr on p.PROCESSINSTANCEID = pr.INSTANCEID"); queryService.registerQuery(query); processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "org.jbpm.writedocument"); assertNotNull(processInstanceId); List<ProcessInstanceCustomDesc> processInstanceLogs = queryService.query(query.getName(), ProcessInstanceCustomQueryMapper.get(), new QueryContext()); assertNotNull(processInstanceLogs); assertEquals(1, processInstanceLogs.size()); processService.abortProcessInstance(processInstanceId); processInstanceId = null; }
Source:
public TransactorCache getTransactorCache() { if (cache == null) { createTransactorCache(); } return cache; }

Target:
public synchronized TransactorCache getTransactorCache() { checkIfClosed(); if (cache == null) { cache = new TransactorCache(config); } else if (cache.getStatus() == TcStatus.CLOSED) { throw new IllegalStateException("TransactorCache is closed!"); } return cache; }
Source:
public Partition moveToSessionId(final String sessionId, final Collection<String> existingSessionIds) { switch (state) { case UNASSIGNED: return toState(State.ASSIGNED, sessionId, null); case ASSIGNED: if (sessionId.equals(this.session)) { return toState(State.ASSIGNED, sessionId, null); } else if (!existingSessionIds.contains(this.session)) { return toState(State.ASSIGNED, sessionId, null); } else { return toState(State.REASSIGNING, this.session, sessionId); } case REASSIGNING: if (!existingSessionIds.contains(this.session)) { return toState(State.ASSIGNED, sessionId, null); } else if (this.session.equals(sessionId)) { return toState(State.ASSIGNED, sessionId, null); } else { return toState(State.REASSIGNING, this.session, sessionId); } default: throw new IllegalStateException("Unsupported current state " + state); } }

Target:
public Partition moveToSessionId(final String sessionId, final Collection<String> existingSessionIds) { switch (state) { case UNASSIGNED: return toState(State.ASSIGNED, sessionId, null); case ASSIGNED: case REASSIGNING: if (sessionId.equals(this.session)) { return toState(State.ASSIGNED, sessionId, null); } else if (!existingSessionIds.contains(this.session)) { return toState(State.ASSIGNED, sessionId, null); } else { return toState(State.REASSIGNING, this.session, sessionId); } default: throw new IllegalStateException("Unsupported current state " + state); } }
Source:
public String toString() { final StringBuffer sb = new StringBuffer(60).append("[cmd=").append(_cmd); if (_data != null && _data.length > 0) { sb.append(", {"); for (AuSetAttribute d : (AuSetAttribute[]) _data) { sb.append(d); } sb.append('}'); } return sb.append(']').toString(); }

Target:
public String toString() { final StringBuilder sb = new StringBuilder(60).append("[cmd=").append(_cmd); if (_data != null && _data.length > 0) { sb.append(", {"); for (AuSetAttribute d : (AuSetAttribute[]) _data) { sb.append(d); } sb.append('}'); } return sb.append(']').toString(); }
Source:
public static DirectoryUser mapPrincipalRecord(final ExtensionProxy extension, final ExtMap principalRecord) { DirectoryUser directoryUser = null; if (principalRecord != null) { String name = principalRecord.<String> get(Authz.PrincipalRecord.NAME); directoryUser = new DirectoryUser( extension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME), principalRecord.<String> get(Authz.PrincipalRecord.NAMESPACE), principalRecord.<String> get(Authz.PrincipalRecord.ID), name.contains("@") ? name.substring(0, name.indexOf("@")) : name ); directoryUser.setDepartment(principalRecord.<String> get(Authz.PrincipalRecord.DEPARTMENT)); directoryUser.setFirstName(principalRecord.<String> get(Authz.PrincipalRecord.FIRST_NAME)); directoryUser.setLastName(principalRecord.<String> get(Authz.PrincipalRecord.LAST_NAME)); directoryUser.setEmail(principalRecord.<String> get(Authz.PrincipalRecord.EMAIL)); directoryUser.setTitle(principalRecord.<String> get(Authz.PrincipalRecord.TITLE)); List<DirectoryGroup> directoryGroups = new ArrayList<DirectoryGroup>(); List<ExtMap> groups = principalRecord.<List<ExtMap>> get(Authz.PrincipalRecord.GROUPS); if (groups != null) { for (ExtMap group : groups) { directoryGroups.add(mapGroupRecord(extension, group)); } } directoryUser.setGroups(directoryGroups); } return directoryUser; }

Target:
public static DirectoryUser mapPrincipalRecord(final ExtensionProxy extension, final ExtMap principalRecord) { DirectoryUser directoryUser = null; if (principalRecord != null) { directoryUser = new DirectoryUser( extension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME), principalRecord.<String> get(Authz.PrincipalRecord.NAMESPACE), principalRecord.<String> get(Authz.PrincipalRecord.ID), principalRecord.<String> get(Authz.PrincipalRecord.NAME) ); directoryUser.setDepartment(principalRecord.<String> get(Authz.PrincipalRecord.DEPARTMENT)); directoryUser.setFirstName(principalRecord.<String> get(Authz.PrincipalRecord.FIRST_NAME)); directoryUser.setLastName(principalRecord.<String> get(Authz.PrincipalRecord.LAST_NAME)); directoryUser.setEmail(principalRecord.<String> get(Authz.PrincipalRecord.EMAIL)); directoryUser.setTitle(principalRecord.<String> get(Authz.PrincipalRecord.TITLE)); List<DirectoryGroup> directoryGroups = new ArrayList<DirectoryGroup>(); List<ExtMap> groups = principalRecord.<List<ExtMap>> get(Authz.PrincipalRecord.GROUPS); if (groups != null) { for (ExtMap group : groups) { directoryGroups.add(mapGroupRecord(extension, group)); } } directoryUser.setGroups(directoryGroups); } return directoryUser; }
Source:
public void setEntity(EntityLocal entity) { checkArgument(entity instanceof MemberReplaceable, "Replacer must take a DynamicCluster, not %s", entity); Sensor<?> failureSensorToMonitor = checkNotNull(getConfig(FAILURE_SENSOR_TO_MONITOR), "failureSensorToMonitor"); super.setEntity(entity); subscribeToMembers((Group)entity, failureSensorToMonitor, new SensorEventListener<Object>() { @Override public void onEvent(SensorEvent<Object> event) { onDetectedFailure(event); } }); }

Target:
public void setEntity(EntityLocal entity) { checkArgument(entity instanceof MemberReplaceable, "ServiceReplacer must take a MemberReplaceable, not %s", entity); Sensor<?> failureSensorToMonitor = checkNotNull(getConfig(FAILURE_SENSOR_TO_MONITOR), "failureSensorToMonitor"); super.setEntity(entity); subscribeToMembers((Group)entity, failureSensorToMonitor, new SensorEventListener<Object>() { @Override public void onEvent(SensorEvent<Object> event) { onDetectedFailure(event); } }); }
Source:
private CoreHookDefinition(UUID id, HookDefinition delegate) { this.id = requireNonNull(id); this.delegate = delegate; try { this.tagExpression = TagExpressionParser.parse(delegate.getTagExpression()); } catch (TagExpressionException tee) { throw new IllegalArgumentException(String.format("%s at '%s'", tee.getMessage(), delegate.getLocation()), tee); } }

Target:
private CoreHookDefinition(UUID id, HookDefinition delegate) { this.id = requireNonNull(id); this.delegate = delegate; try { this.tagExpression = TagExpressionParser.parse(delegate.getTagExpression()); } catch (TagExpressionException tee) { throw new IllegalArgumentException( String.format("Invalid tag expression at '%s'", delegate.getLocation()), tee); } }
Source:
void notifyChatRoomMemberUpdated(ChatRoomMember chatMember, Presence presence) { super.notifyChatRoomMemberUpdated(chatMember, presence); TranslationLanguageExtension translationLanguage = presence.getExtension( TranslationLanguageExtension.ELEMENT_NAME, TranslationLanguageExtension.NAMESPACE); if(translationLanguage != null) { String identifier = getParticipantIdentifier(chatMember); String language = translationLanguage.getTranslationLanguage(); this.transcriber.updateParticipantLanguage(identifier, language); } }

Target:
void notifyChatRoomMemberUpdated(ChatRoomMember chatMember, Presence presence) { super.notifyChatRoomMemberUpdated(chatMember, presence); String identifier = getParticipantIdentifier(chatMember); TranslationLanguageExtension translationLanguageExtension = presence.getExtension( TranslationLanguageExtension.ELEMENT_NAME, TranslationLanguageExtension.NAMESPACE); if(translationLanguageExtension != null) { String language = translationLanguageExtension.getTranslationLanguage(); this.transcriber.updateParticipantLanguage(identifier, language); } else { this.transcriber.updateParticipantLanguage(identifier, null); } }
Source:
public void testConcurrency() { final ServerTemplate serverTemplate = templateStorage.load(serverTemplateId); marshal("application/xml", serverTemplate); Thread disconnect = new Thread(() -> disconnect()); disconnect.start(); String response = marshal("application/xml", serverTemplate); LOGGER.info(response); }

Target:
public void testConcurrency() { final ServerTemplate serverTemplate = templateStorage.load(serverTemplateId); marshal("application/xml", serverTemplate); Thread disconnect = new Thread(() -> disconnect()); disconnect.start(); String response = marshal("application/xml", serverTemplate); assertNotNull(response); }
Source:
public ModuleMetadata findOne(String metadataPath) { ModuleMetadata metadata = null; try { byte[] data = zkConnection.getClient().getData().forPath(metadataPath); if (data != null) { Map<String, String> optionsMap = new HashMap<String, String>(); Map<String, String> metadataMap = mapBytesUtility.toMap(data); String moduleId = getModuleId(metadataPath); String containerId = getContainerId(metadataPath); for (String propertyKey : metadataMap.keySet()) { String propertyValue = metadataMap.get(propertyKey); if (!propertyKey.startsWith(XD_MODULE_PROPERTIES_PREFIX) && !StringUtils.isEmpty(propertyValue)) { resolveModuleOptionValues(optionsMap, metadataMap, propertyKey, propertyValue); } } String moduleProperties = (!optionsMap.isEmpty()) ? MapUtils.toProperties(optionsMap).toString() : ""; metadata = new ModuleMetadata(moduleId, containerId, moduleProperties); } } catch (Exception e) { ZooKeeperUtils.wrapAndThrowIgnoring(e, NoNodeException.class); } return metadata; }

Target:
public ModuleMetadata findOne(String metadataPath) { ModuleMetadata metadata = null; try { byte[] data = zkConnection.getClient().getData().forPath(metadataPath); if (data != null) { Map<String, String> metadataMap = mapBytesUtility.toMap(data); String moduleId = getModuleId(metadataPath); String containerId = getContainerId(metadataPath); Map<String, String> resolvedOptions = resolveModuleOptionValues(metadataMap); String moduleProperties = (resolvedOptions.isEmpty()) ? "" : MapUtils.toProperties(resolvedOptions).toString(); metadata = new ModuleMetadata(moduleId, containerId, moduleProperties); } } catch (Exception e) { ZooKeeperUtils.wrapAndThrowIgnoring(e, NoNodeException.class); } return metadata; }
Source:
protected boolean validateFreeSpace(StorageDomainValidator storageDomainValidator, List<DiskImage> disksList) { for (DiskImage disk : disksList) { disk.setVolumeType(VolumeType.Sparse); disk.setvolumeFormat(VolumeFormat.COW); } return validate(storageDomainValidator.hasSpaceForNewDisks(disksList)); }

Target:
protected boolean validateFreeSpace(StorageDomainValidator storageDomainValidator, List<DiskImage> disksList) { Collection<DiskImage> disks = ImagesHandler.getDisksDummiesForStorageAllocations(disksList); return validate(storageDomainValidator.hasSpaceForNewDisks(disks)); }
Source:
public static void InitDictionaries() { log.info("Start initializing dictionaries"); _managersDictionary.clear(); for (Version ver : Config.<HashSet<Version>> GetValue(ConfigValues.SupportedClusterLevels)) { _managersDictionary.put(ver, new CpuFlagsManager(ver)); } log.info("Finished initializing dictionaries" + CpuFlagsManagerHandler.class.getSimpleName()); }

Target:
public static void InitDictionaries() { log.info("Start initializing dictionaries"); _managersDictionary.clear(); for (Version ver : Config.<HashSet<Version>> GetValue(ConfigValues.SupportedClusterLevels)) { _managersDictionary.put(ver, new CpuFlagsManager(ver)); } log.info("Finished initializing dictionaries"); }
Source:
public RuleResult process(PacketContext pktCtx) { if (condition.matches(pktCtx)) { result.matched = true; pktCtx.jlog().debug( "Condition matched on device chain with action and condition {}", pktCtx.currentDevice(), chainId, action, condition); if (meter != null) pktCtx.addFlowTag(meter); if (apply(pktCtx)) return result; } return Chain.CONTINUE(); }

Target:
public Pair<RuleResult, Boolean> process(PacketContext pktCtx) { if (condition.matches(pktCtx)) { pktCtx.jlog().debug( "Condition matched on device chain with action and condition {}", pktCtx.currentDevice(), chainId, action, condition); if (meter != null) pktCtx.addFlowTag(meter); if (apply(pktCtx)) return Pair.of(result, true); } return Pair.of(Chain.CONTINUE(), false); }
Source:
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException { validateParams(); Host host = _resourceService.getHost(getHostId()); if (host == null) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to find host by ID: " + getHostId()); } PowerOperation powerOperation = PowerOperation.valueOf(getOutOfBandManagementPowerOperation()); CallContext.current().setEventDetails("Host Id: " + host.getId() + " Action: " + powerOperation.toString()); CallContext.current().putContextParameter(Host.class, host.getUuid()); OutOfBandManagementResponse response = outOfBandManagementService.executeOutOfBandManagementPowerOperation(host, powerOperation, getActionTimeout()); response.setResponseName(getCommandName()); setResponseObject(response); }

Target:
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException { final Host host = _resourceService.getHost(getHostId()); if (host == null) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to find host by ID: " + getHostId()); } final PowerOperation powerOperation = PowerOperation.valueOf(getPowerAction()); CallContext.current().setEventDetails("Host Id: " + host.getId() + " Action: " + powerOperation.toString()); CallContext.current().putContextParameter(Host.class, host.getUuid()); final OutOfBandManagementResponse response = outOfBandManagementService.executeOutOfBandManagementPowerOperation(host, powerOperation, getActionTimeout()); response.setResponseName(getCommandName()); setResponseObject(response); }
Source:
public static IgniteParameters load(Properties properties) { return new IgniteParameters( properties.getProperty(PROP_HOST, IgniteBackendConstants.DEFAULT_IGNITE_HOST), properties.getProperty(PROP_PORT, IgniteBackendConstants.DEFAULT_IGNITE_PORT), properties.getProperty(PROP_SCHEMA, null), properties.getProperty(PROP_USER, null), properties.getProperty(PROP_PASSWORD, null), properties.getProperty(PROP_ADDITIONALS, null)); }

Target:
public static IgniteParameters load(Properties properties) { return new IgniteParameters( properties.getProperty(IgniteBackendConstants.PROP_HOST, IgniteBackendConstants.DEFAULT_IGNITE_HOST), properties.getProperty(IgniteBackendConstants.PROP_PORT, IgniteBackendConstants.DEFAULT_IGNITE_PORT), properties.getProperty(IgniteBackendConstants.PROP_SCHEMA), properties.getProperty(IgniteBackendConstants.PROP_USER), properties.getProperty(IgniteBackendConstants.PROP_PASSWORD), properties.getProperty(IgniteBackendConstants.PROP_ADDITIONALS)); }
Source:
public Certificate viewCertificate() { if (selectedTSCertificate != null) { oldAlias = selectedTSCertificate.getAlias(); RequestContext.getCurrentInstance().execute("PF('viewCertDlg').show();"); } else { HelperUtil.addMessageError(TRUST_STORE_MSG, "Please choose a certificate to view details"); } return selectedTSCertificate; }

Target:
public Certificate viewCertificate() { return viewCert("viewCertDlg", TRUST_STORE_MSG); }