auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ElasticsearchTableDescription( @JsonProperty("tableName") String tableName, @JsonProperty("schemaName") String schemaName, @JsonProperty("host") String host, @JsonProperty("port") int port, @JsonProperty("clusterName") String clusterName, @JsonProperty("index") String index, @JsonProperty("indexExactMatch") boolean indexExactMatch, @JsonProperty("type") String type, @JsonProperty("columns") Optional<List<ElasticsearchColumn>> columns) { checkArgument(!isNullOrEmpty(tableName), "tableName is null or empty"); checkArgument(!isNullOrEmpty(host), "host is null or empty"); checkArgument(!isNullOrEmpty(clusterName), "clusterName is null or empty"); checkArgument(!isNullOrEmpty(index), "index is null or empty"); checkArgument(!isNullOrEmpty(type), "type is null or empty"); requireNonNull(columns, "columns is null"); this.tableName = tableName; this.schemaName = schemaName; this.host = host; this.port = port; this.clusterName = clusterName; this.index = index; this.indexExactMatch = indexExactMatch; this.type = type; this.columns = columns; }

Target:
public ElasticsearchTableDescription( @JsonProperty("tableName") String tableName, @JsonProperty("schemaName") String schemaName, @JsonProperty("host") String host, @JsonProperty("port") int port, @JsonProperty("clusterName") String clusterName, @JsonProperty("index") String index, @JsonProperty("indexExactMatch") boolean indexExactMatch, @JsonProperty("type") String type, @JsonProperty("columns") Optional<List<ElasticsearchColumn>> columns) { checkArgument(!isNullOrEmpty(tableName), "tableName is null or empty"); checkArgument(!isNullOrEmpty(schemaName), "schemaName is null or empty"); checkArgument(!isNullOrEmpty(host), "host is null or empty"); checkArgument(!isNullOrEmpty(clusterName), "clusterName is null or empty"); checkArgument(!isNullOrEmpty(index), "index is null or empty"); checkArgument(!isNullOrEmpty(type), "type is null or empty"); requireNonNull(columns, "columns is null"); this.tableName = tableName; this.schemaName = schemaName; this.host = host; this.port = port; this.clusterName = clusterName; this.index = index; this.indexExactMatch = indexExactMatch; this.type = type; this.columns = columns; }
Source:
protected boolean validate() { List<Pair<VM, VmDevice>> vmsForDisk = vmDao.getVmsWithPlugInfo(getDiskImage().getId()); DiskValidator diskValidator = new DiskValidator(getDiskImage()); if (!validate(diskValidator.isDiskPluggedToVmsThatAreNotDown(false, vmsForDisk))) { StorageDomainStatic destDomain = storageDomainStaticDao.get(getParameters().getStorageDomainId()); if (destDomain.isBackup == true) { return false; } } return true; }

Target:
protected boolean validate() { List<Pair<VM, VmDevice>> vmsForDisk = vmDao.getVmsWithPlugInfo(getDiskImage().getId()); DiskValidator diskValidator = new DiskValidator(getDiskImage()); if (!validate(diskValidator.isDiskPluggedToVmsThatAreNotDown(false, vmsForDisk))) { StorageDomainStatic destDomain = storageDomainStaticDao.get(getParameters().getStorageDomainId()); if (destDomain.isBackup() == true) { return false; } } return true; }
Source:
protected void notifyChanged(final BufferChangedEvent event) { ListenerList<IBufferChangedListener> listeners; synchronized(this) { listeners = this.changeListeners; } if (listeners != null) { Iterator<IBufferChangedListener> iterator = listeners.iterator(); while (iterator.hasNext()) { final IBufferChangedListener listener = iterator.next(); SafeRunner.run(new ISafeRunnable() { public void handleException(Throwable exception) { Util.log(exception, "Exception occurred in listener of buffer change notification"); } public void run() throws Exception { listener.bufferChanged(event); } }); } } }

Target:
protected void notifyChanged(final BufferChangedEvent event) { ListenerList<IBufferChangedListener> listeners = this.changeListeners; if (listeners != null) { Iterator<IBufferChangedListener> iterator = listeners.iterator(); while (iterator.hasNext()) { final IBufferChangedListener listener = iterator.next(); SafeRunner.run(new ISafeRunnable() { public void handleException(Throwable exception) { Util.log(exception, "Exception occurred in listener of buffer change notification"); } public void run() throws Exception { listener.bufferChanged(event); } }); } } }
Source:
public StudentAttributes makeStudent(String enrollLine, String courseId) throws EnrollException { if (enrollLine.isEmpty()) { throw new EnrollException(ERROR_ENROLL_LINE_EMPTY); } String[] columns = splitLineIntoColumns(enrollLine); boolean hasMissingFields = columns.length <= teamColumnIndex || columns.length <= nameColumnIndex || columns.length <= emailColumnIndex; if (hasMissingFields) { throw new EnrollException(ERROR_ENROLL_LINE_TOOFEWPARTS); } String paramTeam = columns[teamColumnIndex].trim(); String paramName = columns[nameColumnIndex].trim(); String paramEmail = columns[emailColumnIndex].trim(); String paramComment = ""; if (hasComment && columns.length > commentColumnIndex) { paramComment = columns[commentColumnIndex].trim(); } String paramSection = Const.DEFAULT_SECTION; if (hasSection && columns.length > sectionColumnIndex) { paramSection = columns[sectionColumnIndex].trim(); } return new StudentAttributes(paramSection, paramTeam, paramName, paramEmail, paramComment, courseId); }

Target:
public StudentAttributes makeStudent(String enrollLine, String courseId) throws EnrollException { if (enrollLine.isEmpty()) { throw new EnrollException(ERROR_ENROLL_LINE_EMPTY); } String[] columns = splitLineIntoColumns(enrollLine); boolean hasMissingFields = columns.length <= teamColumnIndex || columns.length <= nameColumnIndex || columns.length <= emailColumnIndex; if (hasMissingFields) { throw new EnrollException(ERROR_ENROLL_LINE_TOOFEWPARTS); } String paramTeam = columns[teamColumnIndex].trim(); String paramName = columns[nameColumnIndex].trim(); String paramEmail = columns[emailColumnIndex].trim(); String paramComment = ""; if (hasComment && columns.length > commentColumnIndex) { paramComment = columns[commentColumnIndex].trim(); } String paramSection; if (hasSection && columns.length > sectionColumnIndex) { paramSection = columns[sectionColumnIndex].trim(); } else { paramSection = Const.DEFAULT_SECTION; } return new StudentAttributes(paramSection, paramTeam, paramName, paramEmail, paramComment, courseId); }
Source:
private void load(String filename) throws IOException{ InputStream conceptStream = Database.class.getResourceAsStream(filename); try { for (CSVRecord conceptRow : CSVFormat.RFC4180.withHeader().parse(new InputStreamReader(conceptStream))) { String tableName = conceptRow.get("omop_cdm_table"); String fieldName = conceptRow.get("omop_cdm_field"); Concept concept = new Concept(); concept.setConceptId(conceptRow.get("concept_id")); concept.setConceptName(conceptRow.get("concept_name")); concept.setStandardConcept(conceptRow.get("standard_concept")); this.put(tableName, fieldName, concept); } } catch (IOException e) { throw new IOException("Could not load concept_id hints: " + e.getMessage()); } }

Target:
private void load(String filename) throws IOException{ try (InputStream conceptStream = Database.class.getResourceAsStream(filename)) { for (CSVRecord conceptRow : CSVFormat.RFC4180.withHeader().parse(new InputStreamReader(conceptStream))) { String tableName = conceptRow.get("omop_cdm_table"); String fieldName = conceptRow.get("omop_cdm_field"); Concept concept = new Concept(); concept.setConceptId(conceptRow.get("concept_id")); concept.setConceptName(conceptRow.get("concept_name")); concept.setStandardConcept(conceptRow.get("standard_concept")); this.put(tableName, fieldName, concept); } } catch (IOException e) { throw new IOException("Could not load concept_id hints: " + e.getMessage()); } }
Source:
public static String amountToDollars(int n){ String s = "$ " + (n / 100) + "."; if (((n % 100) / 10) == 0) { s += "0"; } s += (n % 100); return s; }

Target:
public static String amountToDollars(int n){ String s = "$ " + (n / 100) + "."; if ((n % 100) < 10) { s += "0"; } s += (n % 100); return s; }
Source:
public static String encodeURLData(final Map<String, String> data) throws Exception { StringBuffer buf = new StringBuffer(); Iterator<String> iter = data.keySet().iterator(); while (iter.hasNext()) { String key = iter.next(); buf.append(URLEncoder.encode(key, StandardCharsets.UTF_8)).append("=") .append(URLEncoder.encode(data.get(key), StandardCharsets.UTF_8)); if (iter.hasNext()) { buf.append("&"); } } return buf.toString(); }

Target:
public static String encodeURLData(final Map<String, String> data) throws Exception { StringBuffer buf = new StringBuffer(); Iterator<String> iter = data.keySet().iterator(); while (iter.hasNext()) { String key = iter.next(); buf.append(URLEncoder.encode(key, StandardCharsets.UTF_8.toString())) .append("=") .append(URLEncoder.encode(data.get(key), StandardCharsets.UTF_8.toString())); if (iter.hasNext()) { buf.append("&"); } } return buf.toString(); }
Source:
public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); Matcher matcher; try { response = urlopen.open("<LINK_0>"); matcher = reAccounts.matcher(response); while (matcher.find()) { String balanceString ; balanceString = matcher.group(4) + ".00"; Account account = new Account(Html.fromHtml(matcher.group(2)).toString(), Helpers.parseBalance(balanceString), matcher.group(1).trim()); account.setCurrency("ISK"); balance = balance.add(Helpers.parseBalance(matcher.group(4))); accounts.add(account); } if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } } finally { super.updateComplete(); } }

Target:
public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); response = urlopen.open("<LINK_0>"); Matcher matcher = reAccounts.matcher(response); while (matcher.find()) { String balanceString ; balanceString = matcher.group(4) + ".00"; Account account = new Account(Html.fromHtml(matcher.group(2)).toString(), Helpers.parseBalance(balanceString), matcher.group(1).trim()); account.setCurrency("ISK"); balance = balance.add(Helpers.parseBalance(matcher.group(4))); accounts.add(account); } if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } super.updateComplete(); }
Source:
public IntegrationFlow imapMailFlow() { return IntegrationFlows.from(Mail.imapInboundAdapter("imap://localhost:143") .javaMailProperties(p -> p.put("mail.debug", "true")), e -> e.autoStartup(false) .poller(Pollers.fixedDelay(1000))) .channel(pop3Channel()) .get(); }

Target:
public IntegrationFlow imapMailFlow() { return IntegrationFlows.from(Mail.imapInboundAdapter("imap://user:pw@localhost:" + imapPort + "/INBOX") .javaMailProperties(p -> p.put("mail.debug", "true")), e -> e.autoStartup(true) .poller(Pollers.fixedDelay(1000))) .channel(imapChannel()) .get(); }
Source:
private static boolean hasAtLeastOneSiblingWithSameTokenType(DetailAST ast) { DetailAST cur = getFirstSibling(ast); boolean result = false; while (cur != null) { if (cur != ast && cur.getType() == ast.getType()) { result = true; } cur = cur.getNextSibling(); } return result; }

Target:
private static boolean hasAtLeastOneSiblingWithSameTokenType(DetailAST ast) { boolean result = false; if (ast.getParent() == null) { DetailAST prev = ast.getPreviousSibling(); while (prev != null) { if (prev.getType() == ast.getType()) { result = true; break; } prev = prev.getPreviousSibling(); } if (!result) { DetailAST next = ast.getNextSibling(); while (next != null) { if (next.getType() == ast.getType()) { result = true; break; } next = next.getNextSibling(); } } } else { result = ast.getParent().getChildCount(ast.getType()) > 1; } return result; }
Source:
public void run() throws Exception { HadoopConfigurationInjector.prepareResourcesToInject(getJobProps(), getWorkingDirectory()); if (shouldProxy && obtainTokens) { userToProxy = getJobProps().getString("user.to.proxy"); getLog().info("Need to proxy. Getting tokens."); Props props = new Props(); props.putAll(getJobProps()); props.putAll(getSysProps()); tokenFile = HadoopJobUtils .getHadoopTokens(hadoopSecurityManager, props, getLog()); getJobProps().put("env." + HADOOP_TOKEN_FILE_LOCATION, tokenFile.getAbsolutePath()); hadoopSecurityManager.updateJobProps(getJobProps(), getSysProps(), getLog()); } try { super.run(); } catch (Exception e) { e.printStackTrace(); throw new Exception(e); } finally { if (tokenFile != null) { try { HadoopJobUtils.cancelHadoopTokens(hadoopSecurityManager, userToProxy, tokenFile, getLog()); } catch (Throwable t) { t.printStackTrace(); getLog().error("Failed to cancel tokens."); } if (tokenFile.exists()) { tokenFile.delete(); } } } }

Target:
public void run() throws Exception { HadoopConfigurationInjector.prepareResourcesToInject(getJobProps(), getWorkingDirectory()); if (shouldProxy && obtainTokens) { userToProxy = getJobProps().getString("user.to.proxy"); getLog().info("Need to proxy. Getting tokens."); Props props = new Props(); props.putAll(getJobProps()); props.putAll(getSysProps()); tokenFile = HadoopJobUtils .getHadoopTokens(hadoopSecurityManager, props, getLog()); getJobProps().put("env." + HADOOP_TOKEN_FILE_LOCATION, tokenFile.getAbsolutePath()); } try { super.run(); } catch (Exception e) { e.printStackTrace(); throw new Exception(e); } finally { if (tokenFile != null) { try { HadoopJobUtils.cancelHadoopTokens(hadoopSecurityManager, userToProxy, tokenFile, getLog()); } catch (Throwable t) { t.printStackTrace(); getLog().error("Failed to cancel tokens."); } if (tokenFile.exists()) { tokenFile.delete(); } } } }
Source:
public void addAdditionalListeners() { super.addAdditionalListeners(); ActivityPartition activityPartition = getUMLElement(); if (activityPartition == null) { return; } getDiagramEventBroker().addNotificationListener(activityPartition, this); if (!(activityPartition.getRepresents() instanceof ConnectableElement)) { return; } Element el = (Element) activityPartition.getRepresents(); if (el != null) { getDiagramEventBroker().addNotificationListener(el, this); } }

Target:
public void addAdditionalListeners() { super.addAdditionalListeners(); ActivityPartition activityPartition = getUMLElement(); if (activityPartition == null) { return; } getDiagramEventBroker().addNotificationListener(activityPartition, this); Element el = activityPartition.getRepresents(); if (el != null) { getDiagramEventBroker().addNotificationListener(el, this); } }
Source:
public synchronized void shutdown() { try { if (shutdownHook != null) { synchronized (shutdownHookMonitor) { if (shutdownHook != null) { Runtime.getRuntime().removeShutdownHook(shutdownHook); frameworkProcess = null; shutdownHook.start(); shutdownHook = null; } } } } catch (IllegalStateException ignore) { } }

Target:
public synchronized void shutdown() { try { if (shutdownHook != null) { synchronized (shutdownHookMonitor) { if (shutdownHook != null) { Runtime.getRuntime().removeShutdownHook(shutdownHook); frameworkProcess = null; shutdownHook.start(); shutdownHook = null; } } } } catch (IllegalStateException ignore) { logger.error("Already started the process.", ignore); } }
Source:
public SwapTrade trade(LocalDate valuationDate, MarketData marketData) { double marketQuote = marketData.getValue(spreadKey) + additionalSpread; FxRate fxRate = marketData.getValue(fxKey); double rate = fxRate.fxRate(fxKey.getPair()); return template.toTrade(valuationDate, BuySell.BUY, 1, rate, marketQuote); }

Target:
public SwapTrade trade(LocalDate valuationDate, MarketData marketData) { double marketQuote = marketData.getValue(spreadKey) + additionalSpread; FxRate fxRate = marketData.getValue(fxKey); double rate = fxRate.fxRate(template.getCurrencyPair()); return template.toTrade(valuationDate, BuySell.BUY, 1, rate, marketQuote); }
Source:
private static String getSqlFromLdapFilter(Filter filter) { StringBuilder sql = new StringBuilder(); Filter[] filters = filter.getComponents(); Filter notFilter = filter.getNOTComponent(); switch (filter.getFilterType()) { case Filter.FILTER_TYPE_AND: for (int x=0 ; x < filters.length; x++) { if (x == 0) { sql.append(OPEN_PARENS); } if (x > 0) { sql.append(AND); } sql.append(getSqlFromLdapFilter(filters[x])); if (x == filters.length - 1) { sql.append(CLOSED_PARENS); } } break; case Filter.FILTER_TYPE_OR: for (int x=0 ; x < filters.length; x++) { if (x == 0) { sql.append(OPEN_PARENS); } if (x > 0) { sql.append(OR); } sql.append(getSqlFromLdapFilter(filters[x])); if (x == filters.length - 1) { sql.append(CLOSED_PARENS); } } break; case Filter.FILTER_TYPE_NOT: sql.append(NOT); sql.append(getSqlFromLdapFilter(notFilter)); break; case Filter.FILTER_TYPE_EQUALITY: if (!filter.getAttributeName().equals(CATEGORY)) { throw new IllegalArgumentException("Invalid Search Parameter"); } sql.append(String.format(CATEGORY_STRING, filter.getAssertionValue().toLowerCase())); break; } return sql.toString(); }

Target:
private static String getSqlFromLdapFilter(Filter filter) { StringBuilder sql = new StringBuilder(); Filter[] filters = filter.getComponents(); Filter notFilter = filter.getNOTComponent(); switch (filter.getFilterType()) { case Filter.FILTER_TYPE_AND: for (int x=0 ; x < filters.length; x++) { if (x == 0) { sql.append(OPEN_PARENS); } if (x > 0) { sql.append(AND); } sql.append(getSqlFromLdapFilter(filters[x])); if (x == filters.length - 1) { sql.append(CLOSED_PARENS); } } break; case Filter.FILTER_TYPE_OR: for (int x=0 ; x < filters.length; x++) { if (x == 0) { sql.append(OPEN_PARENS); } if (x > 0) { sql.append(OR); } sql.append(getSqlFromLdapFilter(filters[x])); if (x == filters.length - 1) { sql.append(CLOSED_PARENS); } } break; case Filter.FILTER_TYPE_NOT: sql.append(NOT); sql.append(getSqlFromLdapFilter(notFilter)); break; case Filter.FILTER_TYPE_EQUALITY: if (!filter.getAttributeName().equals(CATEGORY)) { throw new IllegalArgumentException("Invalid Search Parameter: LDAP attribute name must be 'cat'"); } sql.append(CATEGORY_STRING); break; } return sql.toString(); }
Source:
public void handleConnectionWithValidCredentialDefaultEntry() throws Exception { final String user = "johny"; final String password = "password2"; final Opt<Identity> identity = new PsBasic( "RealmAA", new PsBasic.Default( "mike my%20password1 urn:basic:michael", String.format("%s %s urn:basic:%s", user, password, user) ) ).enter( new RqWithHeaders( new RqFake( RqMethod.GET, String.format( PsBasicTest.VALID_CODE, RandomStringUtils.randomAlphanumeric(10) ) ), this.generateAuthenticateHead(user, password) ) ); MatcherAssert.assertThat(identity.has(), Matchers.is(true)); MatcherAssert.assertThat( identity.get().urn(), CoreMatchers.equalTo(this.generateIdentityUrn(user)) ); }

Target:
public void handleConnectionWithValidCredentialDefaultEntry() throws Exception { final String user = "johny"; final String password = "password2"; final Opt<Identity> identity = new PsBasic( "RealmAA", new PsBasic.Default( "mike my%20password1 urn:basic:michael", String.format("%s %s urn:basic:%s", user, password, user) ) ).enter( new RqWithHeaders( new RqFake( RqMethod.GET, String.format( PsBasicTest.VALID_CODE, RandomStringUtils.randomAlphanumeric(Tv.TEN) ) ), PsBasicTest.header(user, password) ) ); MatcherAssert.assertThat(identity.has(), Matchers.is(true)); MatcherAssert.assertThat( identity.get().urn(), CoreMatchers.equalTo(PsBasicTest.urn(user)) ); }
Source:
protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsWritable(OUTPUT); final ReferenceSequenceFile ref = ReferenceSequenceFileFactory.getReferenceSequenceFile(INPUT); final ReferenceSequenceMask referenceSequenceMask; if (INTERVALS != null) { IOUtil.assertFileIsReadable(INTERVALS); final IntervalList intervalList = IntervalList.fromFile(INTERVALS); referenceSequenceMask = new IntervalListReferenceSequenceMask(intervalList); } else { final SAMFileHeader header = new SAMFileHeader(); header.setSequenceDictionary(ref.getSequenceDictionary()); referenceSequenceMask = new WholeGenomeReferenceSequenceMask(header); } long nonNbases = 0L; for (final SAMSequenceRecord rec : ref.getSequenceDictionary().getSequences()) { final ReferenceSequence sequence = ref.getSequence(rec.getSequenceName()); final byte[] bases = sequence.getBases(); StringUtil.toUpperCase(bases); for (int i = 0; i < bases.length; i++) { if (referenceSequenceMask.get(sequence.getContigIndex(), i+1)) { nonNbases += bases[i] == 'N' ? 0 : 1; } } } try { final BufferedWriter out = IOUtil.openFileForBufferedWriting(OUTPUT); out.write(nonNbases + "\n"); out.close(); } catch (IOException ioe) { throw new PicardException("Error writing to file " + OUTPUT.getAbsolutePath(), ioe); } return 0; }

Target:
protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsWritable(OUTPUT); final ReferenceSequenceFile ref = ReferenceSequenceFileFactory.getReferenceSequenceFile(INPUT); final ReferenceSequenceMask referenceSequenceMask; if (INTERVALS != null) { IOUtil.assertFileIsReadable(INTERVALS); final IntervalList intervalList = IntervalList.fromFile(INTERVALS); referenceSequenceMask = new IntervalListReferenceSequenceMask(intervalList); } else { final SAMFileHeader header = new SAMFileHeader(); header.setSequenceDictionary(ref.getSequenceDictionary()); referenceSequenceMask = new WholeGenomeReferenceSequenceMask(header); } long nonNbases = 0L; for (final SAMSequenceRecord rec : ref.getSequenceDictionary().getSequences()) { final ReferenceSequence sequence = ref.getSequence(rec.getSequenceName()); final byte[] bases = sequence.getBases(); StringUtil.toUpperCase(bases); for (int i = 0; i < bases.length; i++) { if (referenceSequenceMask.get(sequence.getContigIndex(), i+1)) { nonNbases += bases[i] == SequenceUtil.N ? 0 : 1; } } } try { final BufferedWriter out = IOUtil.openFileForBufferedWriting(OUTPUT); out.write(nonNbases + "\n"); out.close(); } catch (IOException ioe) { throw new PicardException("Error writing to file " + OUTPUT.getAbsolutePath(), ioe); } return 0; }
Source:
public IAttributeType getAgileTeamPointsAttributeType(IAgileTeam team) { IAttributeType type = AtsAttributeTypes.Points; String attrTypeName = atsServer.getAttributeResolver().getSoleAttributeValue(team, AtsAttributeTypes.PointsAttributeType, null); if (Strings.isValid(attrTypeName)) { boolean found = false; for (IAttributeType attrType : atsServer.getOrcsApi().getOrcsTypes().getAttributeTypes().getAll()) { if (attrType.getName().equals(attrTypeName)) { type = attrType; found = true; break; } } if (!found) { throw new OseeCoreException("Invalid attribute type name provided: %s", attrTypeName); } } return null; }

Target:
public IAttributeType getAgileTeamPointsAttributeType(IAgileTeam team) { IAttributeType type = AtsAttributeTypes.Points; String attrTypeName = atsServer.getAttributeResolver().getSoleAttributeValue(team, AtsAttributeTypes.PointsAttributeType, null); if (Strings.isValid(attrTypeName)) { type = getTypeFromName(attrTypeName); } return type; }
Source:
public void setPresenter(ProviderDashboardContract.Presenter presenter) { }

Target:
public void setPresenter(ProviderDashboardContract.Presenter presenter) { mPresenter = (ProviderDashboardPresenter) presenter; }
Source:
public OnmsNode act(final OnmsNode node, Map<String, Object> attributes) { try { final CompiledScript compiledScript = compileScript(getScript()); if (compiledScript == null) { LOG.warn("No compiled script available for execution."); } else { if (attributes.size() > 0 && attributes.get(RUN_IN_TRANSACTION) != null && attributes.get(RUN_IN_TRANSACTION).equals(true)) { return (OnmsNode) m_sessionUtils.withTransaction(() -> { try { if (node.getId() != null && node.getId() > 0) { OnmsNode onmsNode = m_nodeDao.get(node.getId()); return runScript(compiledScript, onmsNode, attributes); } else { LOG.warn("Unexpected node which is not persisted yet", node); } } catch (ScriptException e) { LOG.warn("Error applying ScriptPolicy.", e); } return node; }); } else { runScript(compiledScript, node, attributes); } } } catch (ScriptException e) { LOG.warn("Error while compiling script.", e); } catch (IOException e) { LOG.warn("Error while opening script file {}.", m_script, e); } catch (Exception e) { LOG.warn("Unkown Error while applying script.", e); } return node; }

Target:
public OnmsNode act(final OnmsNode node, Map<String, Object> attributes) { try { final CompiledScript compiledScript = compileScript(getScript()); if (compiledScript == null) { LOG.warn("No compiled script available for execution."); } else { if (attributes.size() > 0 && attributes.get(RUN_IN_TRANSACTION) != null && attributes.get(RUN_IN_TRANSACTION).equals(true)) { return (OnmsNode) m_sessionUtils.withTransaction(() -> { try { if (node.getId() != null && node.getId() > 0) { OnmsNode onmsNode = m_nodeDao.get(node.getId()); return runScript(compiledScript, onmsNode, attributes); } else { LOG.warn("Unexpected node which is not persisted yet", node); } } catch (ScriptException e) { LOG.warn("Error applying ScriptPolicy.", e); } return node; }); } else { runScript(compiledScript, node, attributes); } } } catch (ScriptException e) { LOG.warn("Error while compiling script.", e); } catch (IOException e) { LOG.warn("Error while opening script file {}.", m_script, e); } catch (Exception e) { LOG.warn("Unkown error while applying script.", e); } return node; }
Source:
public RequestBuilder fit() { getOptions(); deferred = true; return this; }

Target:
public RequestBuilder fit() { PicassoBitmapOptions options = getOptions(); if (options.targetWidth != 0 || options.targetHeight != 0) { throw new IllegalStateException("Fit cannot be used with resize."); } deferred = true; return this; }
Source:
public FiltersEndpoint filtersEndpoint() { return new FiltersEndpoint(); }

Target:
public FiltersEndpoint filtersEndpoint() { FilterRegistry filterRegistry = FilterRegistry.instance(); return new FiltersEndpoint(filterRegistry); }
Source:
private String readPasswordFile(String passwordFile) throws FileNotFoundException, IOException { try (BufferedReader bufferedReader = new BufferedReader(new FileReader(passwordFile))) { String readLine = bufferedReader.readLine(); return readLine; } }

Target:
private String readPasswordFile(String passwordFile) throws FileNotFoundException, IOException { try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(passwordFile), "UTF-8"))) { String readLine = bufferedReader.readLine(); return readLine; } }
Source:
private void parseReportsXML() { try { constructServiceRequestBuilder(ReportXmlService).sendRequest(null, new RequestCallback() { @Override public void onError(Request request, Throwable exception) { scheduleCheckStatus(); setXmlInitialized(); } @Override public void onResponseReceived(Request request, Response response) { switch (response.getStatusCode()) { case Response.SC_INTERNAL_SERVER_ERROR: scheduleCheckStatus(); setXmlInitialized(); break; case Response.SC_OK: try { if (ReportParser.getInstance().parseReport(response.getText())) { resourceMap = ReportParser.getInstance().getResourceMap(); dashboardMap = ReportParser.getInstance().getDashboardMap(); isCommunityEdition = ReportParser.getInstance().isCommunityEdition(); } } catch (DOMParseException e) { } finally { setXmlInitialized(); } break; } } }); } catch (RequestException e) { setXmlInitialized(); } }

Target:
private void parseReportsXML() { try { constructServiceRequestBuilder(ReportXmlService).sendRequest(null, new RequestCallback() { @Override public void onError(Request request, Throwable exception) { scheduleCheckStatus(); setXmlInitialized(); } @Override public void onResponseReceived(Request request, Response response) { if (response.getStatusCode() == Response.SC_OK) { try { if (ReportParser.getInstance().parseReport(response.getText())) { resourceMap = ReportParser.getInstance().getResourceMap(); dashboardMap = ReportParser.getInstance().getDashboardMap(); isCommunityEdition = ReportParser.getInstance().isCommunityEdition(); } } catch (DOMParseException e) { } finally { setXmlInitialized(); } } else { scheduleCheckStatus(); setXmlInitialized(); } } }); } catch (RequestException e) { setXmlInitialized(); } }
Source:
public static File writeToTempFile(InputStream is, File tempDir, String prefix, String suffix) { if (is == null) throw new NullPointerException("Input stream required to create temp file for "+prefix+"*"+suffix); mkdirs(tempDir); File tempFile; try { tempFile = File.createTempFile(prefix, suffix, tempDir); } catch (IOException e) { throw Throwables.propagate(e); } tempFile.deleteOnExit(); OutputStream out = null; try { out = new FileOutputStream(tempFile); ByteStreams.copy(is, out); } catch (IOException e) { throw Throwables.propagate(e); } finally { Streams.closeQuietly(is); Streams.closeQuietly(out); } return tempFile; }

Target:
public static File writeToTempFile(InputStream is, File tempDir, String prefix, String suffix) { Preconditions.checkNotNull(is, "Input stream required to create temp file for %s*%s", prefix, suffix); mkdirs(tempDir); File tempFile; try { tempFile = File.createTempFile(prefix, suffix, tempDir); } catch (IOException e) { throw Throwables.propagate(e); } tempFile.deleteOnExit(); OutputStream out = null; try { out = new FileOutputStream(tempFile); ByteStreams.copy(is, out); } catch (IOException e) { throw Throwables.propagate(e); } finally { Streams.closeQuietly(is); Streams.closeQuietly(out); } return tempFile; }
Source:
public void callback(final HttpServletRequest request, final HttpServletResponse response) { assertNotNull("callbackLogic", callbackLogic); assertNotNull("config", config); final JEEContext context = new JEEContext(request, response, config.getSessionStore()); callbackLogic.perform(context, config, (action, theContext) -> null, this.defaultUrl, this.saveInSession, this.multiProfile, this.renewSession, this.defaultClient); }

Target:
public void callback(final HttpServletRequest request, final HttpServletResponse response) { assertNotNull("callbackLogic", callbackLogic); assertNotNull("config", config); final JEEContext context = new JEEContext(request, response, config.getSessionStore()); callbackLogic.perform(context, config, JEEHttpActionAdapter.INSTANCE, this.defaultUrl, this.saveInSession, this.multiProfile, this.renewSession, this.defaultClient); }
Source:
private ThriftSchemaConvertVisitor(FieldProjectionFilter fieldProjectionFilter, boolean doProjection, boolean keepOneOfEachUnion) { this(fieldProjectionFilter, doProjection, keepOneOfEachUnion, null); }

Target:
private ThriftSchemaConvertVisitor(FieldProjectionFilter fieldProjectionFilter, boolean doProjection, boolean keepOneOfEachUnion) { this(fieldProjectionFilter, doProjection, keepOneOfEachUnion, new Configuration()); }
Source:
public boolean buildCollectorFile(ConcurStandardAccountingExtractFile saeFileContents) { ConcurStandardAccountingExtractCollectorBatchBuilder builder = new ConcurStandardAccountingExtractCollectorBatchBuilder( universityDateService::getFiscalYear, dateTimeService::toString, concurSAEValidationService::validateConcurStandardAccountingExtractDetailLine, this::getConcurParameterValueAsString); CollectorBatch collectorBatch = builder.buildCollectorBatchFromStandardAccountingExtract(0, saeFileContents); if (collectorBatch == null) { LOG.error("There was a problem preparing the data for the Collector file; will not create a file."); return false; } return true; }

Target:
public boolean buildCollectorFile(ConcurStandardAccountingExtractFile saeFileContents) { ConcurStandardAccountingExtractCollectorBatchBuilder builder = new ConcurStandardAccountingExtractCollectorBatchBuilder( universityDateService, dateTimeService, concurSAEValidationService, this::getConcurParameterValueAsString); CollectorBatch collectorBatch = builder.buildCollectorBatchFromStandardAccountingExtract(0, saeFileContents); if (collectorBatch == null) { LOG.error("There was a problem preparing the data for the Collector file; will not create a file."); return false; } return true; }
Source:
public void destroy(int code) { if (routeBuilder == null) { return; } for (RouteDefinition routeDef : routeBuilder.getRouteCollection().getRoutes()) { try { String routeId = routeDef.getId(); LOGGER.trace("Stopping route with ID = and path {}", routeId, monitoredDirectory); camelContext.stopRoute(routeId); boolean status = camelContext.removeRoute(routeId); LOGGER.trace("Status of removing route is {}", routeId, status); camelContext.removeRouteDefinition(routeDef); } catch (Exception e) { LOGGER.debug("Unable to stop Camel route with route ID = {}", routeDef.getId(), e); } } }

Target:
public void destroy(int code) { CompletableFuture.runAsync(this::removeRoutes, configurationExecutor); }
Source:
public void run(ToolingApiOperation runnable, CancellationTokenSource tokenSource, IProgressMonitor monitor) throws CoreException { IProgressMonitor efficientMonitor = new RateLimitingProgressMonitor(monitor, 500, TimeUnit.MILLISECONDS); new WorkspaceRunnableAdapter(runnable, tokenSource).run(efficientMonitor); }

Target:
public void run(ToolingApiOperation runnable, CancellationTokenSource tokenSource, IProgressMonitor monitor) throws CoreException { IProgressMonitor efficientMonitor = new RateLimitingProgressMonitor(monitor, 500, TimeUnit.MILLISECONDS); ResourcesPlugin.getWorkspace().run(new WorkspaceRunnableAdapter(runnable, tokenSource), runnable.getRule(), IWorkspace.AVOID_UPDATE, efficientMonitor); }
Source:
public void testRequestBulkCancel() { TestingPhysicalSlotRequestBulkChecker bulkChecker = new TestingPhysicalSlotRequestBulkChecker(); AllocationContext context = createBulkCheckerContextWithEv12GroupAndEv3Group(bulkChecker); List<SlotExecutionVertexAssignment> assignments1 = context.allocateSlotsFor(EV1, EV3); fulfilOneOfTwoSlotRequestsAndGetPendingProfile(context, new AllocationID()); PhysicalSlotRequestBulk bulk1 = bulkChecker.getBulk(); List<SlotExecutionVertexAssignment> assignments2 = context.allocateSlotsFor(EV2); bulk1.cancel(new Throwable()); context.allocateSlotsFor(EV1, EV3); boolean ev1failed = assignments1.get(0).getLogicalSlotFuture().isCompletedExceptionally(); boolean ev2failed = assignments1.get(0).getLogicalSlotFuture().isCompletedExceptionally(); assertThat(context.getSlotProvider().getRequests().values(), hasSize(3)); assertThat(ev1failed != ev2failed, is(false)); assertThat(assignments2.get(0).getLogicalSlotFuture().isCompletedExceptionally(), is(false)); }

Target:
public void testRequestBulkCancel() { TestingPhysicalSlotRequestBulkChecker bulkChecker = new TestingPhysicalSlotRequestBulkChecker(); AllocationContext context = createBulkCheckerContextWithEv12GroupAndEv3Group(bulkChecker); List<SlotExecutionVertexAssignment> assignments1 = context.allocateSlotsFor(EV1, EV3); fulfilOneOfTwoSlotRequestsAndGetPendingProfile(context, new AllocationID()); PhysicalSlotRequestBulk bulk1 = bulkChecker.getBulk(); List<SlotExecutionVertexAssignment> assignments2 = context.allocateSlotsFor(EV2); bulk1.cancel(new Throwable()); CompletableFuture<LogicalSlot> ev1slot = assignments1.get(0).getLogicalSlotFuture(); boolean ev1failed = ev1slot.isCompletedExceptionally(); CompletableFuture<LogicalSlot> ev3slot = assignments1.get(1).getLogicalSlotFuture(); boolean ev3failed = ev3slot.isCompletedExceptionally(); LogicalSlot slot = ev1failed ? ev3slot.join() : ev1slot.join(); releaseLogicalSlot(slot); context.allocateSlotsFor(EV1, EV3); assertThat(context.getSlotProvider().getRequests().values(), hasSize(3)); assertThat(ev1failed != ev3failed, is(true)); assertThat(assignments2.get(0).getLogicalSlotFuture().isCompletedExceptionally(), is(false)); }
Source:
public CqlQuery<R> build() { Preconditions.checkNotNull(queryString, "Empty query string"); PreparedStatement statement = CqlClientImpl.this.prepareStatement(queryString); Object[] argsArray = new Object[args.size()]; for (int i = 0; i < args.size(); i++) { Preconditions.checkState(this.args.keySet().contains(statement.getVariables().getName(i)), "Set argument is not expected"); argsArray[i] = args.get(statement.getVariables().getName(i)); } BoundStatement boundStatement = statement.bind(argsArray); Preconditions.checkNotNull(rowStreamAccumulator, "RowStreamAccumulator is not set"); return new CqlQueryImpl<>(boundStatement, rowStreamAccumulator); }

Target:
public CqlQuery<R> build() { Preconditions.checkNotNull(queryString, "Empty query string"); PreparedStatement statement = CqlClientImpl.this.prepareStatement(queryString); Object[] argsArray = new Object[args.size()]; for (int i = 0; i < args.size(); i++) { Preconditions.checkState(this.args.containsKey(statement.getVariables().getName(i)), "Expected argument is not set", SafeArg.of("name", statement.getVariables().getName(i))); argsArray[i] = args.get(statement.getVariables().getName(i)); } BoundStatement boundStatement = statement.bind(argsArray); Preconditions.checkNotNull(rowStreamAccumulator, "RowStreamAccumulator is not set"); return new CqlQueryImpl<>(boundStatement, rowStreamAccumulator); }
Source:
public void setUp() { fetcher = new WorldcatFetcher("API_KEY"); }

Target:
public void setUp() { fetcher = new WorldcatFetcher("aMHOf2rfzUt3fuKkb7DXX8pkBv1AmcBWwwoSfwpt8CMhdUdxXscB4ESOmBPs4NlmYJmFtcSZ3Q5kMxzb"); }
Source:
public void uploadFlowFile(final int projectId, final int projectVersion, final int flowVersion, final File flowFile) throws ProjectManagerException { logger.info(String .format( "Uploading flow file %s, version %d for project %d, version %d, file length is [%d bytes]", flowFile.getName(), flowVersion, projectId, projectVersion, flowFile.length())); if (flowFile.length() > MAX_FLOW_FILE_SIZE) { throw new ProjectManagerException("Flow file length exceeds 10 MB limit."); } final byte[] buffer = new byte[MAX_FLOW_FILE_SIZE]; final String INSERT_FLOW_FILES = "INSERT INTO project_flow_files (project_id, project_version, flow_name, flow_version, " + "modified_time, " + "flow_file) values (?,?,?,?,?,?)"; try (final FileInputStream input = new FileInputStream(flowFile); final BufferedInputStream bufferedStream = new BufferedInputStream(input)) { final int size = bufferedStream.read(buffer); logger.info("Read bytes for " + flowFile.getName() + ", size:" + size); final byte[] buf = Arrays.copyOfRange(buffer, 0, size); try { this.dbOperator .update(INSERT_FLOW_FILES, projectId, projectVersion, flowFile.getName(), flowVersion, System.currentTimeMillis(), buf); } catch (final SQLException e) { throw new ProjectManagerException( "Error uploading flow file " + flowFile.getName() + ", version " + flowVersion + ".", e); } } catch (final IOException e) { throw new ProjectManagerException( String.format( "Error reading flow file %s, version: %d, length: [%d bytes].", flowFile.getName(), flowVersion, flowFile.length())); } }

Target:
public void uploadFlowFile(final int projectId, final int projectVersion, final int flowVersion, final File flowFile) throws ProjectManagerException { logger.info(String .format( "Uploading flow file %s, version %d for project %d, version %d, file length is [%d bytes]", flowFile.getName(), flowVersion, projectId, projectVersion, flowFile.length())); if (flowFile.length() > MAX_FLOW_FILE_SIZE_IN_BYTES) { throw new ProjectManagerException("Flow file length exceeds 10 MB limit."); } final byte[] buffer = new byte[MAX_FLOW_FILE_SIZE_IN_BYTES]; final String INSERT_FLOW_FILES = "INSERT INTO project_flow_files (project_id, project_version, flow_name, flow_version, " + "modified_time, " + "flow_file) values (?,?,?,?,?,?)"; try (final FileInputStream input = new FileInputStream(flowFile); final BufferedInputStream bufferedStream = new BufferedInputStream(input)) { final int size = bufferedStream.read(buffer); logger.info("Read bytes for " + flowFile.getName() + ", size:" + size); final byte[] buf = Arrays.copyOfRange(buffer, 0, size); try { this.dbOperator .update(INSERT_FLOW_FILES, projectId, projectVersion, flowFile.getName(), flowVersion, System.currentTimeMillis(), buf); } catch (final SQLException e) { throw new ProjectManagerException( "Error uploading flow file " + flowFile.getName() + ", version " + flowVersion + ".", e); } } catch (final IOException e) { throw new ProjectManagerException( String.format( "Error reading flow file %s, version: %d, length: [%d bytes].", flowFile.getName(), flowVersion, flowFile.length())); } }
Source:
public void testSortCompleted() { task1.setCompletionDate(new Date()); assertEquals(1, sorter.compare(new EmptyViewer(), task1, task2)); assertEquals(-1, sorter.compare(new EmptyViewer(), task2, task1)); task2.setCompletionDate(new Date()); assertEquals(0, sorter.compare(new EmptyViewer(), task1, task2)); assertEquals(0, sorter.compare(new EmptyViewer(), task2, task1)); }

Target:
public void testSortCompleted() { Date now = new Date(); task1.setCompletionDate(now); assertEquals(1, sorter.compare(new EmptyViewer(), task1, task2)); assertEquals(-1, sorter.compare(new EmptyViewer(), task2, task1)); task2.setCompletionDate(now); assertEquals(0, sorter.compare(new EmptyViewer(), task1, task2)); assertEquals(0, sorter.compare(new EmptyViewer(), task2, task1)); }
Source:
public SettingsDto(String host, String port, String user, String password, InputStream additionalProperties, String logAddress, String logSubject, String logBody, String logPurgeEnable, String logPurgeTime, String logPurgeTimeMultiplier) { this(host, port, user, password, new HashMap<String, String>(), logAddress, logSubject, logBody, logPurgeEnable, logPurgeTime, logPurgeTimeMultiplier); String data; try { data = IOUtils.toString(additionalProperties); data = data.replaceAll("\\{", ""); data = data.replaceAll("}", ""); if (!"".equals(data)) { for (String property : data.split(",")) { String[] p = property.replaceAll(" ", "").split("="); if (p.length == 2) { this.additionalProperties.put(p[0], p[1]); } else { throw new MotechException("Error loading raw file config to properties"); } } } } catch (IOException e) { throw new MotechException("Error loading raw file config to properties", e); } }

Target:
public SettingsDto(String host, String port, String user, String password, InputStream additionalProperties, String logAddress, String logSubject, String logBody, String logPurgeEnable, String logPurgeTime, String logPurgeTimeMultiplier) { this(host, port, user, password, new HashMap<String, String>(), logAddress, logSubject, logBody, logPurgeEnable, logPurgeTime, logPurgeTimeMultiplier); try { Properties props = new Properties(); props.load(additionalProperties); if (props != null) { for (Entry<Object, Object> entry : props.entrySet()) { this.additionalProperties.put((String) entry.getKey(), (String) entry.getValue()); } } } catch (IOException e) { throw new MotechException("Error loading raw file config to properties", e); } }
Source:
final void forceClose() { if ( referenceCount > 0 ) { if ( TRACK_STATEMENTS ) { throw new StatementNotClosedException( "Statements was not correctly closed. See attached open/close stack traces for details.", statementOpenCloseCalls ); } referenceCount = 0; cleanupResources(); } pageCursorTracer.reportEvents(); }

Target:
final void forceClose() { if ( referenceCount > 0 ) { int leakedStatements = referenceCount; referenceCount = 0; cleanupResources(); if ( TRACK_STATEMENTS && transaction.isSuccess() ) { throw new StatementNotClosedException( format("Statements were not correctly closed. Number of leaked statements: %d. " + "See attached open/close stack traces for details.", leakedStatements), statementOpenCloseCalls ); } } pageCursorTracer.reportEvents(); }
Source:
public void testInvalidAnalyzePartitionedTable() { String tableName = "test_invalid_analyze_partitioned_table"; assertQueryFails("ANALYZE " + tableName, ".*Table.*does not exist.*"); createPartitionedTableForAnalyzeTest(tableName); assertQueryFails(format("ANALYZE %s WITH (error = 1)", tableName), ".*does not support analyze property 'error'.*"); assertQueryFails(format("ANALYZE %s WITH (partitions = 1)", tableName), ".*Cannot convert.*to array\\(array\\(varchar\\)\\).*"); assertQueryFails(format("ANALYZE %s WITH (partitions = NULL)", tableName), ".*Invalid null value for analyze property.*"); assertQueryFails(format("ANALYZE %s WITH (partitions = ARRAY[NULL])", tableName), ".*Invalid null value in analyze partitions property.*"); assertQueryFails(format("ANALYZE %s WITH (partitions = ARRAY[ARRAY['p4']])", tableName), ".*Partition no longer exists: p_varchar=p4.*"); assertQueryFails(format("ANALYZE %s WITH (partitions = ARRAY[ARRAY['p4', 'error']])", tableName), ".*Partition value count does not match the partition column count.*"); assertUpdate(format("DROP TABLE %s", tableName)); }

Target:
public void testInvalidAnalyzePartitionedTable() { String tableName = "test_invalid_analyze_partitioned_table"; assertQueryFails("ANALYZE " + tableName, format(".*Table 'hive.tpch.%s' does not exist.*", tableName)); createPartitionedTableForAnalyzeTest(tableName); assertQueryFails(format("ANALYZE %s WITH (error = 1)", tableName), ".*'hive' does not support analyze property 'error'.*"); assertQueryFails(format("ANALYZE %s WITH (partitions = 1)", tableName), ".*Cannot convert '1' to \\Qarray(array(varchar))\\E.*"); assertQueryFails(format("ANALYZE %s WITH (partitions = NULL)", tableName), ".*Invalid null value for analyze property.*"); assertQueryFails(format("ANALYZE %s WITH (partitions = ARRAY[NULL])", tableName), ".*Invalid null value in analyze partitions property.*"); assertQueryFails(format("ANALYZE %s WITH (partitions = ARRAY[ARRAY['p4', '10']])", tableName), ".*Partition no longer exists.*"); assertQueryFails(format("ANALYZE %s WITH (partitions = ARRAY[ARRAY['p4']])", tableName), ".*Partition value count does not match the partition column count.*"); assertQueryFails(format("ANALYZE %s WITH (partitions = ARRAY[ARRAY['p4', '10', 'error']])", tableName), ".*Partition value count does not match the partition column count.*"); assertUpdate(format("DROP TABLE %s", tableName)); }
Source:
public void leaveNode(Tree tree) { if (!hasSemantic()) { return; } if (tree.is(METHOD) || tree.is(CONSTRUCTOR)) { synchronizedStack.pop(); } }

Target:
public void leaveNode(Tree tree) { if (!hasSemantic()) { return; } if (tree.is(METHOD, CONSTRUCTOR)) { synchronizedStack.pop(); } }
Source:
protected void cleanPersistenceDir() throws Exception { assertTrue("Grids are not stopped", F.isEmpty(G.allGrids())); U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), "cp", false)); U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), DFLT_STORE_DIR, false)); U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), "marshaller", false)); U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), "binary_meta", false)); U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), DFLT_LOCAL_SNAPSHOT_DIRECTORY, false)); }

Target:
protected void cleanPersistenceDir() throws Exception { assertTrue("Grids are not stopped", F.isEmpty(G.allGrids())); U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), "cp", false)); U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), DFLT_STORE_DIR, false)); U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), "marshaller", false)); U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), "binary_meta", false)); }
Source:
public static IRemoteConnection createConnection(URI hostUri, String hostName) throws RemoteConnectionException { IRemoteConnection connection = null; IRemoteConnectionType connectionType = getConnectionType(hostUri); IConnectionFactory connectionFactory = CONNECTION_FACTORIES.get(connectionType.getId()); if (connectionFactory != null) { connection = connectionFactory.createConnection(hostUri, hostName); } else { connection = DEFAULT_CONNECTION_FACTORY.createConnection(hostUri, hostName); } return connection; }

Target:
public static IRemoteConnection createConnection(URI hostUri, String hostName) throws RemoteConnectionException { IRemoteConnectionType connectionType = getConnectionType(hostUri); IConnectionFactory connectionFactory = CONNECTION_FACTORIES.get(connectionType.getId()); if (connectionFactory == null) { connectionFactory = DEFAULT_CONNECTION_FACTORY; } return connectionFactory.createConnection(hostUri, hostName); }