auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private ResponseBody callUrl(String url) throws IOException { try { Request request = new Request.Builder() .url(url) .addHeader("User-Agent", userAgent) .get() .build(); Response response = httpClient.newCall(request).execute(); if (!response.isSuccessful()) { throw new IllegalStateException(format("Status returned by url [%s] is not valid: [%s]", response.request().url(), response.code())); } return response.body(); } catch (Exception e) { logger.error(format("%s server [%s] can not be reached", url.toLowerCase(Locale.getDefault()).contains("sonarcloud") ? "SonarCloud" : "SonarQube", baseUrlWithoutTrailingSlash)); throw e; } }

Target:
private ResponseBody callUrl(String url) throws IOException { try { Request request = new Request.Builder() .url(url) .addHeader("User-Agent", userAgent) .get() .build(); Response response = httpClient.newCall(request).execute(); if (!response.isSuccessful()) { throw new IllegalStateException(format("Status returned by url [%s] is not valid: [%s]", response.request().url(), response.code())); } return response.body(); } catch (Exception e) { logger.error(format("%s server [%s] can not be reached", url.toLowerCase(Locale.ENGLISH).contains("sonarcloud") ? "SonarCloud" : "SonarQube", baseUrlWithoutTrailingSlash)); throw e; } }
Source:
public void setup() { final OptionalLimit groupLimit = OptionalLimit.empty(); final OptionalLimit seriesLimit = OptionalLimit.empty(); final OptionalLimit aggregationLimit = OptionalLimit.empty(); final OptionalLimit dataLimit = OptionalLimit.empty(); final int fetchParallelism = 20; final boolean failOnLimits = true; final Groups groups = Groups.of("foo"); doReturn(groups).when(metricBackend).groups(); final GroupSet<MetricBackend> groupSet = GroupSet.build(Collections.singletonList(metricBackend), Optional.empty()); QueryLogger queryLogger = mock(QueryLogger.class); QueryLoggerFactory queryLoggerFactory = mock(QueryLoggerFactory.class); when(queryLoggerFactory.create(any())).thenReturn(queryLogger); manager = new LocalMetricManager(groupLimit, seriesLimit, aggregationLimit, dataLimit, fetchParallelism, failOnLimits, async, groupSet, metadata, reporter, queryLoggerFactory); }

Target:
public void setup() { final OptionalLimit groupLimit = OptionalLimit.empty(); final OptionalLimit seriesLimit = OptionalLimit.empty(); final OptionalLimit aggregationLimit = OptionalLimit.empty(); final OptionalLimit dataLimit = OptionalLimit.empty(); final int fetchParallelism = 20; final boolean failOnLimits = true; final Groups groups = Groups.of("foo"); doReturn(groups).when(metricBackend).groups(); final GroupSet<MetricBackend> groupSet = GroupSet.build(Collections.singletonList(metricBackend), Optional.empty()); final QueryLogger queryLogger = mock(QueryLogger.class); final QueryLoggerFactory queryLoggerFactory = mock(QueryLoggerFactory.class); when(queryLoggerFactory.create(any())).thenReturn(queryLogger); manager = new LocalMetricManager(groupLimit, seriesLimit, aggregationLimit, dataLimit, fetchParallelism, failOnLimits, async, groupSet, metadata, reporter, queryLoggerFactory); }
Source:
private TableScanNode tableScan(String id, String... symbols) { List<Symbol> symbolsList = Arrays.stream(symbols).map(Symbol::new).collect(toImmutableList()); ImmutableMap.Builder<Symbol, ColumnHandle> assignments = ImmutableMap.builder(); for (Symbol symbol : symbolsList) { assignments.put(symbol, new TpchColumnHandle("orderkey", BIGINT)); } TpchTableHandle tableHandle = new TpchTableHandle("orders", 1.0); return new TableScanNode( new PlanNodeId(id), new TableHandle( new ConnectorId("tpch"), new TpchTableHandle("orders", 1.0), TestingTransactionHandle.create(), Optional.of(TestingHandle.INSTANCE)), symbolsList, assignments.build(), Optional.of(new TableLayoutHandle(new ConnectorId("tpch"), INSTANCE, new TpchTableLayoutHandle(tableHandle, TupleDomain.all()))), TupleDomain.all(), TupleDomain.all()); }

Target:
private TableScanNode tableScan(String id, String... symbols) { List<Symbol> symbolsList = Arrays.stream(symbols).map(Symbol::new).collect(toImmutableList()); ImmutableMap.Builder<Symbol, ColumnHandle> assignments = ImmutableMap.builder(); for (Symbol symbol : symbolsList) { assignments.put(symbol, new TpchColumnHandle("orderkey", BIGINT)); } TpchTableHandle tableHandle = new TpchTableHandle("orders", 1.0); return new TableScanNode( new PlanNodeId(id), new TableHandle( new ConnectorId("tpch"), tableHandle, TpchTransactionHandle.INSTANCE, Optional.of(new TpchTableLayoutHandle(tableHandle, TupleDomain.all()))), symbolsList, assignments.build(), TupleDomain.all(), TupleDomain.all()); }
Source:
String[] toColumns(String tableAlias, String path, boolean inSelect, boolean forceAlias) { checkInitialized(); PropertyMapping propertyMapping = getPropertyMapping( path ); if ( !inSelect && queryableCollection != null && CollectionProperties.isCollectionProperty( path ) ) { if ( persister != propertyMapping ) { return getCollectionPropertyReference( path ).toColumns( tableAlias ); } } if ( forceAlias ) { return propertyMapping.toColumns( tableAlias, path ); } if ( fromElement.getWalker().getStatementType() == HqlSqlTokenTypes.SELECT ) { return propertyMapping.toColumns( tableAlias, path ); } if ( fromElement.getWalker().isSubQuery() ) { if ( isCorrelation() ) { if (isMultiTable() && (!isUpdateQuery() || fromElement.getWalker().getCurrentTopLevelClauseType() == HqlSqlTokenTypes.WHERE)) { return propertyMapping.toColumns(tableAlias, path); } else if (isInsertQuery()) { return propertyMapping.toColumns( tableAlias, path ); } return propertyMapping.toColumns( extractTableName(), path ); } return propertyMapping.toColumns( tableAlias, path ); } if ( fromElement.getWalker().getCurrentTopLevelClauseType() == HqlSqlTokenTypes.SELECT ) { return propertyMapping.toColumns( tableAlias, path ); } if ( isManipulationQuery() && isMultiTable() && inWhereClause() ) { return propertyMapping.toColumns( tableAlias, path ); } String[] columns = propertyMapping.toColumns( path ); LOG.tracev( "Using non-qualified column reference [{0} -> ({1})]", path, ArrayHelper.toString( columns ) ); return columns; }

Target:
String[] toColumns(String tableAlias, String path, boolean inSelect, boolean forceAlias) { checkInitialized(); PropertyMapping propertyMapping = getPropertyMapping( path ); if ( !inSelect && queryableCollection != null && CollectionProperties.isCollectionProperty( path ) ) { if ( persister != propertyMapping ) { return getCollectionPropertyReference( path ).toColumns( tableAlias ); } } if ( forceAlias ) { return propertyMapping.toColumns( tableAlias, path ); } if ( fromElement.getWalker().getStatementType() == HqlSqlTokenTypes.SELECT ) { return propertyMapping.toColumns( tableAlias, path ); } if ( fromElement.getWalker().isSubQuery() ) { if ( isCorrelation() ) { if ( isMultiTable() && ( !isUpdateQuery() || inWhereClause() ) ) { return propertyMapping.toColumns( tableAlias, path ); } else if ( isInsertQuery() ) { return propertyMapping.toColumns( tableAlias, path ); } return propertyMapping.toColumns( extractTableName(), path ); } return propertyMapping.toColumns( tableAlias, path ); } if ( fromElement.getWalker().getCurrentTopLevelClauseType() == HqlSqlTokenTypes.SELECT ) { return propertyMapping.toColumns( tableAlias, path ); } if ( isManipulationQuery() && isMultiTable() && inWhereClause() ) { return propertyMapping.toColumns( tableAlias, path ); } String[] columns = propertyMapping.toColumns( path ); LOG.tracev( "Using non-qualified column reference [{0} -> ({1})]", path, ArrayHelper.toString( columns ) ); return columns; }
Source:
public void testClientConfigProviderSSLContextIgnoredIfDifferentIsSet() throws URISyntaxException, GeneralSecurityException { AuthenticationContextConfigurationClient AUTH_CONTEXT_CLIENT = AccessController.doPrivileged((PrivilegedAction<AuthenticationContextConfigurationClient>) AuthenticationContextConfigurationClient::new); AuthenticationContext context = doPrivileged((PrivilegedAction<AuthenticationContext>) () -> { try { URL config = getClass().getResource("wildfly-config-correct-truststore-missing.xml"); return ElytronXmlParser.parseAuthenticationClientConfiguration(config.toURI()).create(); } catch (Throwable t) { throw new InvalidAuthenticationConfigurationException(t); } }); AuthenticationContext contextWithTruststore = doPrivileged((PrivilegedAction<AuthenticationContext>) () -> { try { URL config = getClass().getResource("wildfly-config-correct-truststore.xml"); return ElytronXmlParser.parseAuthenticationClientConfiguration(config.toURI()).create(); } catch (Throwable t) { throw new InvalidAuthenticationConfigurationException(t); } }); SSLContext sslContext = AUTH_CONTEXT_CLIENT.getSSLContext(new URI(securedRootUrl.getHost()), contextWithTruststore); context.run(() -> { ResteasyClientBuilder resteasyClientBuilder = (ResteasyClientBuilder) ClientBuilder.newBuilder(); resteasyClientBuilder.sslContext(sslContext).hostnameVerifier((s, sslSession) -> true); ResteasyClient client = resteasyClientBuilder.build(); Response response = client.target(String.valueOf(securedRootUrl)).request().get(); Assert.assertEquals(200, response.getStatus()); }); }

Target:
public void testClientConfigProviderSSLContextIgnoredIfDifferentIsSet() throws URISyntaxException, GeneralSecurityException { AuthenticationContextConfigurationClient AUTH_CONTEXT_CLIENT = AccessController.doPrivileged((PrivilegedAction<AuthenticationContextConfigurationClient>) AuthenticationContextConfigurationClient::new); AuthenticationContext context = doPrivileged((PrivilegedAction<AuthenticationContext>) () -> { try { URL config = getClass().getResource("wildfly-config-correct-truststore-missing.xml"); return ElytronXmlParser.parseAuthenticationClientConfiguration(config.toURI()).create(); } catch (Throwable t) { throw new InvalidAuthenticationConfigurationException(t); } }); AuthenticationContext contextWithTruststore = doPrivileged((PrivilegedAction<AuthenticationContext>) () -> { try { URL config = getClass().getResource("wildfly-config-correct-truststore.xml"); return ElytronXmlParser.parseAuthenticationClientConfiguration(config.toURI()).create(); } catch (Throwable t) { throw new InvalidAuthenticationConfigurationException(t); } }); SSLContext sslContext = AUTH_CONTEXT_CLIENT.getSSLContext(securedRootUrl.toURI(), contextWithTruststore); context.run(() -> { ResteasyClientBuilder resteasyClientBuilder = (ResteasyClientBuilder) ClientBuilder.newBuilder(); resteasyClientBuilder.sslContext(sslContext).hostnameVerifier((s, sslSession) -> true); ResteasyClient client = resteasyClientBuilder.build(); Response response = client.target(String.valueOf(securedRootUrl)).request().get(); Assert.assertEquals(200, response.getStatus()); }); }
Source:
public boolean DoesEntryExist(final String x, final String y) { try { return threadRunner.submit(new Callable<Boolean>() { @Override public Boolean call() { YailList pair = YailList.makeList(Arrays.asList(x, y)); return chartDataModel.doesEntryExist(pair); } }).get(); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } return false; }

Target:
public boolean DoesEntryExist(final String x, final String y) { try { return threadRunner.submit(new Callable<Boolean>() { @Override public Boolean call() { YailList pair = YailList.makeList(Arrays.asList(x, y)); return chartDataModel.doesEntryExist(pair); } }).get(); } catch (InterruptedException e) { Log.e(this.getClass().getName(), e.getMessage()); } catch (ExecutionException e) { Log.e(this.getClass().getName(), e.getMessage()); } return false; }
Source:
private void clearCaches() { for (int i = 0; i < this.longs.length; ++i) { this.longs[i] = null; } for (int i = 0; i < this.doubles.length; ++i) { this.doubles[i] = null; } for (int i = 0; i < this.slices.length; ++i) { this.slices[i] = null; } for (int i = 0; i < this.nulls.length; ++i) { this.nulls[i] = null; } }

Target:
private void clearCaches() { Arrays.fill(this.longs, null); Arrays.fill(this.doubles, null); Arrays.fill(this.slices, null); Arrays.fill(this.nulls, null); }
Source:
private void createFullHistory(ITmfStateProvider provider, File htFile) throws TmfTraceException { if (htFile.exists()) { final int version = provider.getVersion(); try { fHtBackend = new HistoryTreeBackend(htFile, version); fStateSystem = new StateSystem(fHtBackend, false); return; } catch (IOException e) { } } final int QUEUE_SIZE = 10000; try { fHtBackend = new ThreadedHistoryTreeBackend(htFile, provider.getStartTime(), provider.getVersion(), QUEUE_SIZE); fStateSystem = new StateSystem(fHtBackend); provider.assignTargetStateSystem(fStateSystem); build(provider); } catch (IOException e) { throw new TmfTraceException(e.toString(), e); } }

Target:
private void createFullHistory(ITmfStateProvider provider, File htFile) throws TmfTraceException { if (htFile.exists()) { final int version = provider.getVersion(); try { fHtBackend = new HistoryTreeBackend(htFile, version); fStateSystem = new StateSystem(fHtBackend, false); fInitialized.countDown(); return; } catch (IOException e) { } } final int QUEUE_SIZE = 10000; try { fHtBackend = new ThreadedHistoryTreeBackend(htFile, provider.getStartTime(), provider.getVersion(), QUEUE_SIZE); fStateSystem = new StateSystem(fHtBackend); provider.assignTargetStateSystem(fStateSystem); build(provider); } catch (IOException e) { throw new TmfTraceException(e.toString(), e); } }
Source:
public void visitNode(Tree tree) { StatementTree elseStmt = ((IfStatementTree) tree).elseStatement(); if (elseStmt != null && elseStmt.is(Tree.Kind.IF_STATEMENT) && ((IfStatementTree) elseStmt).elseStatement() == null) { reportIssue(elseStmt, "\"if ... else if\" constructs should end with \"else\" clauses."); } }

Target:
public void visitNode(Tree tree) { IfStatementTree treeIfStmt = (IfStatementTree) tree; StatementTree elseStmt = treeIfStmt.elseStatement(); if (elseStmt != null && elseStmt.is(Tree.Kind.IF_STATEMENT)) { IfStatementTree ifStmt = (IfStatementTree) elseStmt; if (ifStmt.elseStatement() == null) { reportIssue(treeIfStmt.elseKeyword(), ifStmt.ifKeyword(), "\"if ... else if\" constructs should end with \"else\" clauses."); } } }
Source:
private void setPosition() { optionalTotalMap.ifPresent(totalMap -> { List<List<Integer>> list = positionProperty.get().stream() .map(totalMap::get) .filter(Objects::nonNull) .collect(Collectors.toList()); int min = list.stream() .mapToInt(x -> x.get(0)) .min().getAsInt() - minRefPosition; int max = list.stream() .mapToInt(x -> x.get(1)) .max().getAsInt(); double scale = locator.getWidth() / maxRefPosition; locatorIndicator.setTranslateX(min * scale); locatorIndicator.setWidth((max - min) * scale); }); if (width != locator.getWidth()) { width = locator.getWidth(); graphController.showMutationsInLocator(); } }

Target:
private void setPosition() { optionalTotalMap.ifPresent(totalMap -> { List<List<Integer>> list = positionProperty.get().stream() .map(totalMap::get) .filter(Objects::nonNull) .collect(Collectors.toList()); int min = list.stream() .mapToInt(x -> x.get(0)) .min().getAsInt() - minRefPosition; int max = list.stream() .mapToInt(x -> x.get(1)) .max().getAsInt(); double scale = locator.getWidth() / maxRefPosition; locatorIndicator.setTranslateX(min * scale); locatorIndicator.setWidth((max - min) * scale); }); }
Source:
private List<NetworkCluster> createNetworkAttachments() { List<NetworkCluster> networkAttachments = new ArrayList<>(); getClustersToAttach().stream().forEach(networkClusterModel -> { NetworkCluster networkCluster = new NetworkCluster(); networkCluster.setClusterId(networkClusterModel.getEntity().getId()); networkCluster.setRequired(networkClusterModel.isRequired()); networkAttachments.add(networkCluster); }); return networkAttachments; }

Target:
private List<NetworkCluster> createNetworkAttachments() { List<NetworkCluster> networkAttachments = new ArrayList<>(); getClustersToAttach().forEach(networkClusterModel -> { NetworkCluster networkCluster = new NetworkCluster(); networkCluster.setClusterId(networkClusterModel.getEntity().getId()); networkCluster.setRequired(networkClusterModel.isRequired()); networkAttachments.add(networkCluster); }); return networkAttachments; }
Source:
public String getBestTitle(Activity activity) { String bestTitle = null; try { AndroidSessionWrapper asw = CommCareApplication._().getCurrentSessionWrapper(); CommCareSession session = asw.getSession(); String[] stepTitles = session.getHeaderTitles(); Vector<String[]> v = session.getFrame().getSteps(); for(int i = v.size() -1 ; i >= 0; i--){ if(bestTitle != null) { break;} String[] step = v.elementAt(i); if(!SessionFrame.STATE_DATUM_VAL.equals(step[0]) && bestTitle == null) { bestTitle = stepTitles[i]; } } } catch(SessionUnavailableException sue) { } if(bestTitle == null || bestTitle == "") { bestTitle = CommCareActivity.getTopLevelTitleName(activity); } if(bestTitle == null || bestTitle == "") { bestTitle = "CommCare"; } return bestTitle; }

Target:
public String getBestTitle(Activity activity) { String bestTitle = null; try { AndroidSessionWrapper asw = CommCareApplication._().getCurrentSessionWrapper(); CommCareSession session = asw.getSession(); String[] stepTitles = session.getHeaderTitles(); Vector<String[]> v = session.getFrame().getSteps(); for(int i = v.size() -1 ; i >= 0; i--){ if(bestTitle != null) { break;} String[] step = v.elementAt(i); if(!SessionFrame.STATE_DATUM_VAL.equals(step[0]) && bestTitle == null) { bestTitle = stepTitles[i]; } } } catch(SessionUnavailableException sue) { } if(bestTitle == null || "".equals(bestTitle)) { bestTitle = CommCareActivity.getTopLevelTitleName(activity); } if(bestTitle == null || "".equals(bestTitle)) { bestTitle = "CommCare"; } return bestTitle; }
Source:
public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); if (!isAdded()) { return; } if (getResources().getDisplayMetrics().widthPixels < originalWidth) { rootView.getLayoutParams().width = getDialogWidth(); } }

Target:
public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); setWindowLayout(); spaceView.getLayoutParams().height = dialogHeightPx(); listView.getLayoutParams().width = dialogWidthPx(); listView.post(new Runnable() { @Override public void run() { setContentPeekHeight(); } }); }
Source:
private String getDurationTime(IRepositoryElement element) { if (element instanceof IRepositoryQuery) { RepositoryQuery query = (RepositoryQuery) element; String duration_min_string = query.getAttribute("duration_min"); String duration_max_string = query.getAttribute("duration_max"); String duration_avg_string = query.getAttribute("duration_avg"); String duration_anz_string = query.getAttribute("duration_anz"); String erg = "Min: " + (duration_min_string == null ? "" : duration_min_string) + " Max: " + (duration_max_string == null ? "" : duration_max_string) + " Anz: " + (duration_anz_string == null ? "" : duration_anz_string) + " Avg: " + (duration_avg_string == null ? "" : duration_avg_string); return erg; } return null; }

Target:
private String getDurationTime(IRepositoryElement element) { if (element instanceof IRepositoryQuery) { RepositoryQuery query = (RepositoryQuery) element; long duration_max = parseLongFromString(query.getAttribute("duration_max")); if (duration_max > 2 * 60 * 1000) { long duration_min = parseLongFromString(query.getAttribute("duration_min")); long duration_avg = parseLongFromString(query.getAttribute("duration_avg")); long duration_anz = parseLongFromString(query.getAttribute("duration_anz")); String erg = "Min: " + (duration_min == 0 ? "" : "" + duration_min / 1000 + "s") + " Max: " + (duration_max == 0 ? "" : "" + duration_max / 1000 + "s") + " Anz: " + (duration_anz == 0 ? "" : "" + duration_anz) + " Avg: " + (duration_avg == 0 ? "" : "" + duration_avg / 1000 + "s"); return erg; } } return null; }
Source:
protected void checkStarted() throws StoreException { if (!started) { throw new StoreException("Store not started", StoreErrorCodes.Store_Not_Started); } }

Target:
private void checkStarted() throws StoreException { if (!started) { throw new StoreException("Store not started", StoreErrorCodes.Store_Not_Started); } }
Source:
public Take route(final Request req) throws IOException { final Href href = new RqHref(req).href(); final String key = "file"; final Iterator<String> param = href.param(key).iterator(); final String file = this.filename(req, key, param); final Doc doc = this.base.user( new RqAuth(req).identity().urn() ).docs().doc(file); return new TsFork( new FkRegex("/doc/read", new TkRead(doc)), new FkRegex("/doc/delete", new TkDelete(doc)), new FkRegex( "/doc/write", new Takes() { @Override public Take route(final Request request) { return new TkWrite(doc, req); } } ), new FkRegex( "/doc/add-friend", new Takes() { @Override public Take route(final Request rst) throws IOException { return new TkAddFriend( doc, new RqForm(rst).param("friend").iterator().next() ); } } ), new FkRegex( "/doc/eject-friend", new Takes() { @Override public Take route(final Request rst) { return new TkEjectFriend( doc, href.param("friend").iterator().next() ); } } ) ).route(req); }

Target:
public Take route(final Request req) throws IOException { final Href href = new RqHref(req).href(); final String key = "file"; final String file = this.filename( req, key, href.param(key).iterator() ); final Doc doc = this.base.user( new RqAuth(req).identity().urn() ).docs().doc(file); return new TsFork( new FkRegex("/doc/read", new TkRead(doc)), new FkRegex("/doc/delete", new TkDelete(doc)), new FkRegex( "/doc/write", new Takes() { @Override public Take route(final Request request) { return new TkWrite(doc, req); } } ), new FkRegex( "/doc/add-friend", new Takes() { @Override public Take route(final Request rst) throws IOException { return new TkAddFriend( doc, new RqForm(rst).param("friend").iterator().next() ); } } ), new FkRegex( "/doc/eject-friend", new Takes() { @Override public Take route(final Request rst) { return new TkEjectFriend( doc, href.param("friend").iterator().next() ); } } ) ).route(req); }
Source:
private void addPropertyMapping(ElasticsearchMappingBuilder mappingBuilder, DocumentFieldMetadata fieldMetadata) { if ( fieldMetadata.getAbsoluteName().isEmpty() || fieldMetadata.getAbsoluteName().endsWith( "." ) || fieldMetadata.isSpatial() ) { return; } String propertyPath = fieldMetadata.getAbsoluteName(); PropertyMapping propertyMapping = new PropertyMapping(); addTypeOptions( propertyMapping, fieldMetadata ); propertyMapping.setStore( fieldMetadata.getStore() == Store.NO ? false : true ); addIndexOptions( propertyMapping, mappingBuilder, fieldMetadata.getSourceProperty(), fieldMetadata.getAbsoluteName(), fieldMetadata.getIndex(), fieldMetadata.getAnalyzerReference() ); propertyMapping.setBoost( mappingBuilder.getBoost( fieldMetadata.getBoost() ) ); logDynamicBoostWarning( mappingBuilder, fieldMetadata.getSourceType().getDynamicBoost(), propertyPath ); PropertyMetadata sourceProperty = fieldMetadata.getSourceProperty(); if ( sourceProperty != null ) { logDynamicBoostWarning( mappingBuilder, sourceProperty.getDynamicBoostStrategy(), propertyPath ); } addNullValue( propertyMapping, fieldMetadata ); for ( FacetMetadata facetMetadata : fieldMetadata.getFacetMetadata() ) { try { addFieldMapping( propertyMapping, mappingBuilder, facetMetadata ); } catch (IncompleteDataException e) { LOG.debug( "Not adding a mapping for facet " + facetMetadata.getAbsoluteName() + " because of incomplete data", e ); } } mappingBuilder.setPropertyAbsolute( propertyPath, propertyMapping ); }

Target:
private void addPropertyMapping(ElasticsearchMappingBuilder mappingBuilder, DocumentFieldMetadata fieldMetadata) { if ( fieldMetadata.getAbsoluteName().isEmpty() || fieldMetadata.getAbsoluteName().endsWith( "." ) || fieldMetadata.isSpatial() ) { return; } String propertyPath = fieldMetadata.getAbsoluteName(); PropertyMapping propertyMapping = new PropertyMapping(); addTypeOptions( propertyMapping, fieldMetadata ); propertyMapping.setStore( fieldMetadata.getStore() == Store.NO ? false : true ); addIndexOptions( propertyMapping, mappingBuilder, fieldMetadata.getSourceProperty(), fieldMetadata.getAbsoluteName(), fieldMetadata.getIndex(), fieldMetadata.getAnalyzerReference() ); propertyMapping.setBoost( mappingBuilder.getBoost( fieldMetadata.getBoost() ) ); logDynamicBoostWarning( mappingBuilder, fieldMetadata.getSourceType().getDynamicBoost(), propertyPath ); PropertyMetadata sourceProperty = fieldMetadata.getSourceProperty(); if ( sourceProperty != null ) { logDynamicBoostWarning( mappingBuilder, sourceProperty.getDynamicBoostStrategy(), propertyPath ); } addNullValue( propertyMapping, fieldMetadata ); for ( FacetMetadata facetMetadata : fieldMetadata.getFacetMetadata() ) { try { addSubfieldMapping( propertyMapping, mappingBuilder, facetMetadata ); } catch (IncompleteDataException e) { LOG.debug( "Not adding a mapping for facet " + facetMetadata.getAbsoluteName() + " because of incomplete data", e ); } } mappingBuilder.setPropertyAbsolute( propertyPath, propertyMapping ); }
Source:
public boolean matches(String packageName) { if (packageName == null || packageName.isEmpty()) { return false; } boolean result = false; for (Pattern pattern : patterns) { result |= pattern.matcher(packageName).matches(); } return result; }

Target:
public boolean matches(String packageName) { if (StringUtils.isEmpty(packageName)) { return false; } for (Pattern pattern : patterns) { if (pattern.matcher(packageName).matches()) { return true; } } return false; }
Source:
private static Filter pushDownNot(Filter current) { if (current instanceof NotFilter) { Filter child = ((NotFilter) current).getBaseFilter(); if (child instanceof NotFilter) { return pushDownNot(((NotFilter) child).getBaseFilter()); } if (child instanceof AndFilter) { List<Filter> children = Lists.newArrayList(); for (Filter grandChild : ((AndFilter) child).getFilters()) { children.add(pushDownNot(new NotFilter(grandChild))); } return new OrFilter(children); } if (child instanceof OrFilter) { List<Filter> children = Lists.newArrayList(); for (Filter grandChild : ((OrFilter) child).getFilters()) { children.add(pushDownNot(new NotFilter(grandChild))); } return new AndFilter(children); } } if (current instanceof AndFilter) { List<Filter> children = Lists.newArrayList(); for (Filter child : ((AndFilter) current).getFilters()) { children.add(pushDownNot(child)); } return new AndFilter(children); } if (current instanceof OrFilter) { List<Filter> children = Lists.newArrayList(); for (Filter child : ((OrFilter) current).getFilters()) { children.add(pushDownNot(child)); } return new OrFilter(children); } return current; }

Target:
private static Filter pushDownNot(Filter current) { if (current instanceof NotFilter) { Filter child = ((NotFilter) current).getBaseFilter(); if (child instanceof NotFilter) { return pushDownNot(((NotFilter) child).getBaseFilter()); } if (child instanceof AndFilter) { List<Filter> children = Lists.newArrayList(); for (Filter grandChild : ((AndFilter) child).getChildren()) { children.add(pushDownNot(new NotFilter(grandChild))); } return new OrFilter(children); } if (child instanceof OrFilter) { List<Filter> children = Lists.newArrayList(); for (Filter grandChild : ((OrFilter) child).getChildren()) { children.add(pushDownNot(new NotFilter(grandChild))); } return new AndFilter(children); } } if (current instanceof AndFilter) { List<Filter> children = Lists.newArrayList(); for (Filter child : ((AndFilter) current).getChildren()) { children.add(pushDownNot(child)); } return new AndFilter(children); } if (current instanceof OrFilter) { List<Filter> children = Lists.newArrayList(); for (Filter child : ((OrFilter) current).getChildren()) { children.add(pushDownNot(child)); } return new OrFilter(children); } return current; }
Source:
private static File createTempStore(String storePath) { File f = null; try (InputStream trustStoreIs = CcmBridge.class.getResourceAsStream(storePath)) { f = File.createTempFile("server", ".store"); logger.debug("Created store file for {}.", f, storePath); try (OutputStream trustStoreOs = new FileOutputStream(f)) { byte[] buffer = new byte[1024]; int len; while ((len = trustStoreIs.read(buffer)) != -1) { trustStoreOs.write(buffer, 0, len); } } } catch (IOException e) { logger.warn("Failure to write keystore, SSL-enabled servers may fail to start.", e); } if (f != null) { f.deleteOnExit(); } return f; }

Target:
private static File createTempStore(String storePath) { File f = null; try (OutputStream os = new FileOutputStream(f = File.createTempFile("server", ".store"))) { f.deleteOnExit(); Resources.copy(CcmBridge.class.getResource(storePath), os); } catch (IOException e) { logger.warn("Failure to write keystore, SSL-enabled servers may fail to start.", e); } return f; }
Source:
void onFillComplete() { buf.flip(); prepareForSending(); chunkReadyAtMs = time.milliseconds(); routerMetrics.chunkFillTimeMs.update(chunkReadyAtMs - chunkFreeAtMs); }

Target:
void onFillComplete() { buf.flip(); prepareForSending(); chunkReadyAtMs = time.milliseconds(); }
Source:
public T getRowData() { System.out.println("Hello"); return null; }

Target:
public T getRowData() { return this.rowVo; }
Source:
public void setEnabled(boolean enabled) { if (isEnforcedDisabled()) { this.enabled = SupportPlugin.AUTO_BUNDLE_PERIOD_HOURS >= 1; } else { this.enabled = enabled; } }

Target:
public void setEnabled(boolean enabled) { this.enabled = !isEnforcedDisabled() && enabled; }
Source:
public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); discussionResponsesRecyclerView.setLayoutManager(linearLayoutManager); courseDiscussionResponsesAdapter.setPaginationHandler(this); courseDiscussionResponsesAdapter.setDiscussionThread(discussionThread); discussionResponsesRecyclerView.setAdapter(courseDiscussionResponsesAdapter); getCommentList(true); if (discussionThread.isClosed()) { addResponseTextView.setText(R.string.discussion_add_response_disabled_title); addResponseTextView.setCompoundDrawables( new IconDrawable(getActivity(), Iconify.IconValue.fa_lock) .sizeRes(R.dimen.icon_view_standard_width_height) .colorRes(R.color.edx_grayscale_neutral_white_t), null, null, null ); addResponseLayout.setEnabled(false); } else { addResponseTextView.setText(R.string.discussion_responses_add_response_button); addResponseTextView.setCompoundDrawables( new IconDrawable(getActivity(), Iconify.IconValue.fa_plus_circle) .sizeRes(R.dimen.icon_view_standard_width_height) .colorRes(R.color.edx_grayscale_neutral_white_t), null, null, null ); addResponseLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { router.showCourseDiscussionAddResponse(getActivity(), discussionThread); } }); } }

Target:
public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); discussionResponsesRecyclerView.setLayoutManager(linearLayoutManager); courseDiscussionResponsesAdapter = new CourseDiscussionResponsesAdapter( getActivity().getApplicationContext(), this, discussionThread); discussionResponsesRecyclerView.setAdapter(courseDiscussionResponsesAdapter); getCommentList(true); DiscussionUtils.setStateOnTopicClosed(discussionThread.isClosed(), addResponseTextView, R.string.discussion_responses_add_response_button, R.string.discussion_add_response_disabled_title, addResponseLayout, new View.OnClickListener() { @Override public void onClick(View v) { router.showCourseDiscussionAddResponse(getActivity(), discussionThread); } }); }
Source:
private void insertHorizontalLine() { addRow(new SafeHtml() { @Override public String asString() { return "<p><hr size=\"2\" width=\"100%\"></p>"; } }); }

Target:
private void insertHorizontalLine() { addRow(templates.horizontalLine()); }
Source:
public boolean useLoginShell() { String str = fRemoteConnection.getAttribute(USE_LOGIN_SHELL_ATTR); return str != null ? Boolean.parseBoolean(str) : DEFAULT_USE_LOGIN_SHELL; }

Target:
public boolean useLoginShell() { String str = fRemoteConnection.getAttribute(USE_LOGIN_SHELL_ATTR); return !str.isEmpty() ? Boolean.parseBoolean(str) : DEFAULT_USE_LOGIN_SHELL; }
Source:
private KieCompilationResponse handleNormalBuild(final CompilationRequest req, final CompilationResponse res) { final List<String> targetContent = getStringFromTargets(req.getInfo().getPrjPath()); if (res.isSuccessful()) { return new DefaultKieCompilationResponse(res.isSuccessful(), null, null, null, res.getMavenOutput(), targetContent, res.getDependencies(), req.getInfo().getPrjPath(), null); } else { return new DefaultKieCompilationResponse(res.isSuccessful(), new ArrayList<>(res.getMavenOutput()), req.getInfo().getPrjPath()); } }

Target:
private KieCompilationResponse handleNormalBuild(final CompilationRequest req, final CompilationResponse res) { final List<String> targetContent = getStringFromTargets(req.getInfo().getPrjPath()); if (res.isSuccessful()) { return new DefaultKieCompilationResponse(res.isSuccessful(), res.getMavenOutput(), targetContent, res.getDependencies(), req.getInfo().getPrjPath()); } else { return new DefaultKieCompilationResponse(res.isSuccessful(), res.getMavenOutput(), req.getInfo().getPrjPath()); } }
Source:
private static void checkMessages() { AuditLogType[] values = AuditLogType.values(); if (values.length != messages.size()) { for (AuditLogType value : values) { if (!messages.containsKey(value)) { log.info("AuditLogType: '{}' not exist in string table", value.toString()); } } } }

Target:
private static void checkMessages() { AuditLogType[] values = AuditLogType.values(); if (values.length != messages.size()) { for (AuditLogType value : values) { if (!messages.containsKey(value)) { log.info("AuditLogType: '{}' not exist in string table", value); } } } }
Source:
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { String type = "fireball"; double speed = 2; boolean ride = false; if (args.length > 0 && types.containsKey(args[0])) { type = args[0]; } if (args.length > 1) { try { speed = FloatUtil.parseDouble(args[1]); speed = Double.max(0, Double.min(speed, ess.getSettings().getMaxProjectileSpeed())); } catch (Exception ignored) { } } if (args.length > 2 && args[2].equalsIgnoreCase("ride") && user.isAuthorized("essentials.fireball.ride")) { ride = true; } if (!user.isAuthorized("essentials.fireball." + type)) { throw new Exception(tl("noPerm", "essentials.fireball." + type)); } final Vector direction = user.getBase().getEyeLocation().getDirection().multiply(speed); Projectile projectile = user.getWorld().spawn(user.getBase().getEyeLocation().add(direction.getX(), direction.getY(), direction.getZ()), types.get(type)); projectile.setShooter(user.getBase()); projectile.setVelocity(direction); projectile.setCustomName("Fireball Arrow"); projectile.setCustomNameVisible(false); if (ride) { projectile.addPassenger(user.getBase()); } }

Target:
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { String type = "fireball"; double speed = 2; boolean ride = false; if (args.length > 0 && types.containsKey(args[0])) { type = args[0]; } if (args.length > 1) { try { speed = FloatUtil.parseDouble(args[1]); speed = Double.max(0, Double.min(speed, ess.getSettings().getMaxProjectileSpeed())); } catch (Exception ignored) { } } if (args.length > 2 && args[2].equalsIgnoreCase("ride") && user.isAuthorized("essentials.fireball.ride")) { ride = true; } if (!user.isAuthorized("essentials.fireball." + type)) { throw new Exception(tl("noPerm", "essentials.fireball." + type)); } final Vector direction = user.getBase().getEyeLocation().getDirection().multiply(speed); Projectile projectile = user.getWorld().spawn(user.getBase().getEyeLocation().add(direction.getX(), direction.getY(), direction.getZ()), types.get(type)); projectile.setShooter(user.getBase()); projectile.setVelocity(direction); projectile.setMetadata("Ess_Fireball_Projectile", new FixedMetadataValue(ess, true)); if (ride) { projectile.addPassenger(user.getBase()); } }
Source:
public DocumentModel createEntry(Map<String, Object> fieldMap) throws DirectoryException { checkPermission(SecurityConstants.WRITE); DocumentModel docModel = createEntryWithoutReferences(fieldMap); String idFieldName = schemaFieldMap != null ? schemaFieldMap.get(getIdField()).getName().getPrefixedName() : getIdField(); String sourceId = docModel.getId(); for (Reference reference : getDirectory().getReferences()) { String referenceFieldName = schemaFieldMap.get(reference.getFieldName()).getName().getPrefixedName(); if (getDirectory().getReferences(reference.getFieldName()).size() > 1) { log.warn("Directory " + getDirectory().getName() + " cannot create field " + reference.getFieldName() + " for entry " + fieldMap.get(idFieldName) + ": this field is associated with more than one reference"); continue; } @SuppressWarnings("unchecked") List<String> targetIds = (List<String>) fieldMap.get(referenceFieldName); if (reference.getClass() == referenceClassName) { reference.addLinks(sourceId, targetIds, this); } else { reference.addLinks(sourceId, targetIds); } } getDirectory().invalidateCaches(); return docModel; }

Target:
public DocumentModel createEntry(Map<String, Object> fieldMap) throws DirectoryException { checkPermission(SecurityConstants.WRITE); DocumentModel docModel = createEntryWithoutReferences(fieldMap); String idFieldName = schemaFieldMap != null ? schemaFieldMap.get(getIdField()).getName().getPrefixedName() : getIdField(); Object entry = fieldMap.get(idFieldName); String sourceId = docModel.getId(); for (Reference reference : getDirectory().getReferences()) { String referenceFieldName = schemaFieldMap.get(reference.getFieldName()).getName().getPrefixedName(); if (getDirectory().getReferences(reference.getFieldName()).size() > 1) { if (log.isWarnEnabled()) { log.warn("Directory " + directoryName + " cannot create field " + reference.getFieldName() + " for entry " + entry + ": this field is associated with more than one reference"); } continue; } @SuppressWarnings("unchecked") List<String> targetIds = (List<String>) fieldMap.get(referenceFieldName); if (reference.getClass() == referenceClass) { reference.addLinks(sourceId, targetIds, this); } else { reference.addLinks(sourceId, targetIds); } } getDirectory().invalidateCaches(); return docModel; }
Source:
public List<VariableMetadata> findByDataVarIdAndFileMetaId(Long datVarId, Long metaId) { TypedQuery<VariableMetadata> query = em.createQuery("SELECT object(o) FROM VariableMetadata as o where o.dataVariable.id =:value1 and o.fileMetadata.id =:value2", VariableMetadata.class); query.setParameter("value1", datVarId); query.setParameter("value2", metaId); return query.getResultList(); }

Target:
public List<VariableMetadata> findByDataVarIdAndFileMetaId(Long datVarId, Long metaId) { TypedQuery<VariableMetadata> query = em.createQuery("SELECT object(o) FROM VariableMetadata as o where o.dataVariable.id =:dvId and o.fileMetadata.id =:fmId", VariableMetadata.class); query.setParameter("dvId", datVarId); query.setParameter("fmId", metaId); return query.getResultList(); }
Source:
private Map<String, ResourceAssignment> getBaselineAssignment( AssignmentMetadataStore assignmentMetadataStore, CurrentStateOutput currentStateOutput, Set<String> resources) throws HelixRebalanceException { Map<String, ResourceAssignment> currentBaseline = Collections.emptyMap(); if (assignmentMetadataStore != null) { try { LatencyMetric stateReadLatency = _metricCollector.getMetric( WagedRebalancerMetricCollector.WagedRebalancerMetricNames.StateReadLatencyGauge.name(), LatencyMetric.class); stateReadLatency.startMeasuringLatency(); currentBaseline = assignmentMetadataStore.getBaseline(); stateReadLatency.endMeasuringLatency(); } catch (Exception ex) { throw new HelixRebalanceException( "Failed to get the current baseline assignment because of unexpected error.", HelixRebalanceException.Type.INVALID_REBALANCER_STATUS, ex); } } if (currentBaseline.isEmpty()) { LOG.warn("The current baseline assignment record is empty. Use the current states instead."); currentBaseline = currentStateOutput.getCurrentStateAssignment(resources); } currentBaseline.keySet().retainAll(resources); return currentBaseline; }

Target:
private Map<String, ResourceAssignment> getBaselineAssignment( AssignmentMetadataStore assignmentMetadataStore, CurrentStateOutput currentStateOutput, Set<String> resources) throws HelixRebalanceException { Map<String, ResourceAssignment> currentBaseline = Collections.emptyMap(); if (assignmentMetadataStore != null) { try { LatencyMetric stateReadLatency = _metricCollector.getMetric( WagedRebalancerMetricCollector.WagedRebalancerMetricNames.StateReadLatencyGauge.name(), LatencyMetric.class); stateReadLatency.startMeasuringLatency(); currentBaseline = assignmentMetadataStore.getBaseline(); stateReadLatency.endMeasuringLatency(); } catch (Exception ex) { throw new HelixRebalanceException( "Failed to get the current baseline assignment because of unexpected error.", HelixRebalanceException.Type.INVALID_REBALANCER_STATUS, ex); } } if (currentBaseline.isEmpty()) { LOG.warn("The current baseline assignment record is empty. Use the current states instead."); currentBaseline = currentStateOutput.getAssignment(resources); } currentBaseline.keySet().retainAll(resources); return currentBaseline; }
Source:
public void getConceptsCount_shouldGetCorrectConceptCount() { mDatabase.conceptRoomDAO().addConcept(expectedConceptEntity1); mDatabase.conceptRoomDAO().addConcept(expectedConceptEntity2); long count = mDatabase.conceptRoomDAO().getConceptsCount(); Assert.assertEquals(count, 2L); }

Target:
public void getConceptsCount_shouldGetCorrectConceptCount() { mDatabase.conceptRoomDAO().addConcept(expectedConceptEntity1); mDatabase.conceptRoomDAO().addConcept(expectedConceptEntity2); Assert.assertEquals(mDatabase.conceptRoomDAO().getConceptsCount(), 2L); }
Source:
public void testFindAllByOrderByCacheVersionDescVepVersionDescCacheVersionOrder() throws Exception { List<AnnotationMetadata> annotationMetadataList = repository.findAllByOrderByCacheVersionDescVepVersionDesc(); AnnotationMetadata prevAnnotationMetadata = annotationMetadataList.get(0); for (AnnotationMetadata curAnnotationMetadata : annotationMetadataList.subList(1, annotationMetadataList.size())) { assertTrue(Integer.parseInt(curAnnotationMetadata.getCacheVersion()) <= Integer.parseInt(prevAnnotationMetadata.getCacheVersion())); } }

Target:
public void testFindAllByOrderByCacheVersionDescVepVersionDescCacheVersionOrder() throws Exception { List<AnnotationMetadata> annotationMetadataList = repository.findAllByOrderByCacheVersionDescVepVersionDesc(); AnnotationMetadata prevAnnotationMetadata = annotationMetadataList.get(0); for (AnnotationMetadata curAnnotationMetadata : annotationMetadataList.subList(1, annotationMetadataList.size())) { assertTrue(curAnnotationMetadata.getCacheVersion().compareTo(prevAnnotationMetadata.getCacheVersion()) <= 0); } }
Source:
protected boolean executeAnalysis(@Nullable IProgressMonitor monitor) { ITmfTrace trace = getTrace(); if (monitor == null || trace == null) { return false; } for (IAnalysisModule module : getDependentAnalyses()) { if (!(module instanceof AbstractCallStackAnalysis)) { return false; } AbstractCallStackAnalysis callstackModule = (AbstractCallStackAnalysis) module; callstackModule.waitForCompletion(); ITmfStateSystem ss = callstackModule.getStateSystem(); if (ss == null) { return false; } List<Integer> processQuarks = ss.getQuarks(callstackModule.getProcessesPattern()); String @NonNull callStackPath = callstackModule.getCallStackPath(); for (int processQuark : processQuarks) { for (int threadQuark : ss.getQuarks(processQuark, callstackModule.getThreadsPattern())) { if (!iterateOverQuark(ss, threadQuark, callStackPath, monitor)) { return false; } } } sendUpdate(fStore); } monitor.worked(1); monitor.done(); return true; }

Target:
protected boolean executeAnalysis(@Nullable IProgressMonitor monitor) { ITmfTrace trace = getTrace(); if (monitor == null || trace == null) { return false; } for (IAnalysisModule module : getDependentAnalyses()) { if (!(module instanceof AbstractCallStackAnalysis)) { return false; } AbstractCallStackAnalysis callstackModule = (AbstractCallStackAnalysis) module; callstackModule.schedule(); callstackModule.waitForCompletion(); ITmfStateSystem ss = callstackModule.getStateSystem(); if (ss == null) { return false; } List<Integer> processQuarks = ss.getQuarks(callstackModule.getProcessesPattern()); String @NonNull callStackPath = callstackModule.getCallStackPath(); for (int processQuark : processQuarks) { for (int threadQuark : ss.getQuarks(processQuark, callstackModule.getThreadsPattern())) { if (!iterateOverQuark(ss, threadQuark, callStackPath, monitor)) { return false; } } } sendUpdate(fStore); } monitor.worked(1); monitor.done(); return true; }
Source:
public int hashCode() { int result = 17; result += 37 * Long.hashCode(duration); result += 37 * Arrays.hashCode(channels); return result; }

Target:
public int hashCode() { int result = 17; result += 37 * 37 * Long.hashCode(duration); result += 37 * Arrays.hashCode(channels); return result; }
Source:
ServiceBusReceiverException(Throwable throwable, ServiceBusErrorSource errorSource) { super(throwable.getMessage(), throwable.getCause()); this.errorSource = errorSource; }

Target:
ServiceBusReceiverException(Throwable throwable, ServiceBusErrorSource errorSource) { super(throwable.getMessage(), throwable); this.errorSource = errorSource; }
Source:
public Iterator<T> iterator() { if (isClosed()) { throw new IllegalStateException("A Cursor is already closed."); } if (iteratorRetrieved) { throw new IllegalStateException("Cannot open more than one iterator on a Cursor"); } iteratorRetrieved = true; return cursorIterator; }

Target:
public Iterator<T> iterator() { if (iteratorRetrieved) { throw new IllegalStateException("Cannot open more than one iterator on a Cursor"); } if (isClosed()) { throw new IllegalStateException("A Cursor is already closed."); } iteratorRetrieved = true; return cursorIterator; }
Source:
public void placeNewOrder(Market m, String symbol, int volume, double price, OrderType orderType) throws StockMarketException { double costOfPurchase = price * volume; switch (orderType){ case BUY: StockMarketAssert.AssertOrderDoesNotExist(symbol, this.name, ordersPlaced); StockMarketAssert.AssertCashIsAvailable(symbol, this.name, costOfPurchase, cashInHand); BuyOrder newBuyOrder = new BuyOrder(symbol, volume, price, this); ordersPlaced.add(newBuyOrder); m.addBuyOrder(newBuyOrder); break; case SELL: StockMarketAssert.AssertOrderDoesNotExist(symbol, this.name, ordersPlaced); StockMarketAssert.AssertTraderOwnsEnoughStock(symbol, this.name, this.position, volume); SellOrder newSellOrder = new SellOrder(symbol, volume, price, this); ordersPlaced.add(newSellOrder); m.addSellOrder(newSellOrder); break; } }

Target:
public void placeNewOrder(Market m, String symbol, int volume, double price, OrderType orderType) throws StockMarketException { double costOfPurchase = price * volume; switch (orderType){ case BUY: placeNewBuyOrder(m, symbol, volume, price); break; case SELL: placeNewSellOrder(m, symbol, volume, price); break; } }
Source:
public void setTrace(ITmfTrace trace) throws TmfAnalysisException { if (trace == null) { throw new TmfAnalysisException(Messages.TmfAbstractAnalysisModule_NullTrace); } ITmfTrace prevTrace = getTrace(); if (prevTrace != null) { throw new TmfAnalysisException(NLS.bind(Messages.TmfAbstractAnalysisModule_TraceSetMoreThanOnce, getName())); } if (!canExecute(trace)) { throw new TmfAnalysisException(NLS.bind(Messages.TmfAbstractAnalysisModule_AnalysisCannotExecute, getName())); } synchronized (syncObj) { fTrace = trace; } fParameterProviders = TmfAnalysisManager.getParameterProviders(this, trace); for (IAnalysisParameterProvider provider : fParameterProviders) { provider.registerModule(this); } resetAnalysis(); fStarted = false; }

Target:
public void setTrace(ITmfTrace trace) throws TmfAnalysisException { if (trace == null) { throw new TmfAnalysisException(Messages.TmfAbstractAnalysisModule_NullTrace); } if (fTrace != null) { throw new TmfAnalysisException(NLS.bind(Messages.TmfAbstractAnalysisModule_TraceSetMoreThanOnce, getName())); } if (!canExecute(trace)) { throw new TmfAnalysisException(NLS.bind(Messages.TmfAbstractAnalysisModule_AnalysisCannotExecute, getName())); } fTrace = trace; fParameterProviders = TmfAnalysisManager.getParameterProviders(this, trace); for (IAnalysisParameterProvider provider : fParameterProviders) { provider.registerModule(this); } resetAnalysis(); fStarted = false; }