auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public LSPServer() throws IOException { serverSocket = new ServerSocket(Configuration.PORT); new Thread(new Runnable() { @Override public void run() { try { clientSocket = serverSocket.accept(); InputStream in = clientSocket.getInputStream(); OutputStream out = clientSocket.getOutputStream(); lspserver = new LanguageServerImpl(); Launcher<LanguageClient> launcher = LSPLauncher.createServerLauncher(lspserver, in, out); lspserver.connect(launcher.getRemoteProxy()); launcher.startListening(); } catch (Exception e) { e.printStackTrace(); } } }).start(); }

Target:
public LSPServer() throws IOException { fServerSocket = new ServerSocket(Configuration.PORT); new Thread(new ServerLoop()).start(); }
Source:
private void createStreamClient() throws IOException { if (streamClient == null) { RestStreamClient.Builder builder = RestStreamClient.builder(host, port); builder.ssl(sslEnabled); builder.writerPoolSize(writerPoolSize); builder.version(version); AuthenticationClient authClient = null; InputStream inStream = null; try { authClient = (AuthenticationClient) Class.forName(authClientClassPath).getConstructor().newInstance(); authClient.setConnectionInfo(host, port, sslEnabled); Properties properties = new Properties(); inStream = new FileInputStream(authClientPropertiesPath); properties.load(inStream); authClient.configure(properties); builder.authClient(authClient); } catch (ReflectiveOperationException e) { LOG.error("Can not resolve class {}: {}", new Object[]{authClientClassPath, host, port, e.getMessage(), e}); } catch (IOException e) { LOG.error("Cannot load properties", e); } finally { try { if (inStream != null) { inStream.close(); } } catch (IOException e) { LOG.warn("Error during closing input stream. {}", e.getMessage(), e); } } streamClient = builder.build(); } try { if (writer == null) { writer = streamClient.createWriter(streamName); } } catch (Throwable t) { closeWriterQuietly(); throw new IOException("Can not create stream writer by name: " + streamName, t); } }

Target:
private void createStreamClient() throws IOException { if (streamClient == null) { RestStreamClient.Builder builder = RestStreamClient.builder(host, port); builder.ssl(sslEnabled); builder.writerPoolSize(writerPoolSize); builder.version(version); InputStream inStream = null; try { authClient = (AuthenticationClient) Class.forName(authClientClassName).newInstance(); Properties properties = new Properties(); inStream = new FileInputStream(authClientPropertiesPath); properties.load(inStream); authClient.configure(properties); authClient.setConnectionInfo(host, port, sslEnabled); builder.authClient(authClient); } catch (ReflectiveOperationException e) { LOG.error("Can not resolve class {}: {}", new Object[]{authClientClassName, host, port, e.getMessage(), e}); } catch (IOException e) { LOG.error("Cannot load properties", e); } finally { try { if (inStream != null) { inStream.close(); } } catch (IOException e) { LOG.warn("Error during closing input stream. {}", e.getMessage(), e); } } streamClient = builder.build(); } try { if (writer == null) { writer = streamClient.createWriter(streamName); } } catch (Throwable t) { closeWriterQuietly(); throw new IOException("Can not create stream writer by name: " + streamName, t); } }
Source:
private void setupFieldsForEdit(Button button, Collection<View> fieldViews, Activity activity) { button.setText("Add New"); for (View view : fieldViews) { fieldContainer.addView(view); } button.setOnClickListener(v -> { Intent udfCreator = new Intent(App.getAppInstance(), UDFCollectionCreateActivity.class); udfCreator.putParcelableArrayListExtra(UDFCollectionCreateActivity.UDF_DEFINITIONS, newArrayList(editableUdfDefinitions.values())); activity.startActivityForResult(udfCreator, TreeEditDisplay.FIELD_ACTIVITY_REQUEST_CODE); }); }

Target:
private void setupFieldsForEdit(Button button, Collection<View> fieldViews, Activity activity) { button.setText(R.string.udf_create_new); for (View view : fieldViews) { fieldContainer.addView(view); } button.setOnClickListener(v -> { Intent udfCreator = new Intent(App.getAppInstance(), UDFCollectionCreateActivity.class); udfCreator.putParcelableArrayListExtra(UDFCollectionCreateActivity.UDF_DEFINITIONS, newArrayList(editableUdfDefinitions.values())); activity.startActivityForResult(udfCreator, TreeEditDisplay.FIELD_ACTIVITY_REQUEST_CODE); }); }
Source:
public DataBag exec(Tuple input) throws IOException { DataBag output = bagFactory.newDefaultBag(); DataBag samples = (DataBag) input.get(0); if (samples == null || samples.size() == 0) { return output; } int numSamples = (int) samples.size(); if (numSamples == 1) return samples; Tuple[] tuples = new Tuple[numSamples]; int tupleIndex = 0; for (Tuple tuple : samples) { tuples[tupleIndex] = tuple; tupleIndex++; } double[] scores = new double[numSamples]; if (input.size() <= 1) { for (int i = 0; i < scores.length; i++) { scores[i] = scores.length + 1 - i; } } else { tupleIndex = 0; int scoreIndex = ((Number)input.get(1)).intValue(); for (Tuple tuple : samples) { double score = ((Number)tuple.get(scoreIndex)).doubleValue(); score = Math.max(score, Double.MIN_NORMAL); scores[tupleIndex] = score; tupleIndex++; } } int limitSamples = numSamples; if (input.size() == 3) { limitSamples = Math.min(((Number)input.get(2)).intValue(), numSamples); } Random rng = new Random(); if (System.getProperties().containsKey("pigunit.randseed")) { long randSeed = Long.parseLong(System.getProperties().getProperty("pigunit.randseed")); rng = new Random(randSeed); } for (int k = 0; k < limitSamples; k++) { double val = rng.nextDouble(); int idx = find_cumsum_interval(scores, val, k, numSamples); if (idx == numSamples) idx = rng.nextInt(numSamples - k) + k; output.add(tuples[idx]); scores[idx] = scores[k]; tuples[idx] = tuples[k]; } return output; }

Target:
public DataBag exec(Tuple input) throws IOException { DataBag output = bagFactory.newDefaultBag(); DataBag samples = (DataBag) input.get(0); if (samples == null || samples.size() == 0) { return output; } int numSamples = (int) samples.size(); if (numSamples == 1) return samples; Tuple[] tuples = new Tuple[numSamples]; int tupleIndex = 0; for (Tuple tuple : samples) { tuples[tupleIndex] = tuple; tupleIndex++; } double[] scores = new double[numSamples]; int scoreIndex = ((Number)input.get(1)).intValue(); tupleIndex = 0; for (Tuple tuple : samples) { double score = ((Number)tuple.get(scoreIndex)).doubleValue(); score = Math.max(score, Double.MIN_NORMAL); scores[tupleIndex] = score; tupleIndex++; } int limitSamples = numSamples; if (input.size() == 3) { limitSamples = Math.min(((Number)input.get(2)).intValue(), numSamples); } Random rng = null; if (seed == null) { rng = new Random(); } else { rng = new Random(seed); } for (int k = 0; k < limitSamples; k++) { double val = rng.nextDouble(); int idx = find_cumsum_interval(scores, val, k, numSamples); if (idx == numSamples) idx = rng.nextInt(numSamples - k) + k; output.add(tuples[idx]); scores[idx] = scores[k]; tuples[idx] = tuples[k]; } return output; }
Source:
public Application getApplication() { if (application!=null) { if (application.getId().equals(getId())) { if (getProxy()!=null) return (Application)getProxy(); } return application; } if (getParent()==null) { if (getProxy()!=null) return (Application)getProxy(); return this; } return getParent().getApplication(); }

Target:
public Application getApplication() { if (application!=null) { if (application.getId().equals(getId())) return (Application) getProxyIfAvailable(); return application; } if (getParent()==null) return (Application)getProxyIfAvailable(); return getParent().getApplication(); }
Source:
public Map<?, ?> merge(Map<?, ?>... items) { if (ArrayUtils.isEmpty(items)) { return new HashMap<Object, Object>(); } Map<Object, Object> result = new HashMap<Object, Object>(); for (Map<?, ?> item : items) { if (item != null) { result.putAll(item); } } return result; }

Target:
public Map<?, ?> merge(Map<?, ?>... items) { if (ArrayUtils.isEmpty(items)) { return Collections.emptyMap(); } Map<Object, Object> result = new HashMap<Object, Object>(); for (Map<?, ?> item : items) { if (item != null) { result.putAll(item); } } return result; }
Source:
protected void modified(Map<String, Object> parameters) { minThreads = (Integer) parameters.get(CONFIG_MIN_THREADS); maxThreads = (Integer) parameters.get(CONFIG_MAX_THREADS); keepAliveTimeout = (Integer) parameters.get(CONFIG_KEEP_ALIVE); queueSize = (Integer) parameters.get(CONFIG_QUEUE_SIZE); threadPool.setCorePoolSize(minThreads); threadPool.setMaximumPoolSize(maxThreads); threadPool.setKeepAliveTime(keepAliveTimeout, TimeUnit.SECONDS); logger.debug("jetty thread pool changed to min threads {}, max threads {}", minThreads, maxThreads); }

Target:
protected void modified(Map<String, Object> parameters) { getConfigParameters(parameters); if (threadPool != null) { threadPool.setMinThreads(minThreadsShared); threadPool.setMaxThreads(maxThreadsShared); threadPool.setIdleTimeout(keepAliveTimeoutShared * 1000); } }
Source:
private void messageSpanTagger(Span span, Message<?> message) { span.remoteServiceName("amazon-sqs"); if (message.getHeaders().get(LOGICAL_RESOURCE_ID) != null) { span.tag("queue.url", message.getHeaders().get(LOGICAL_RESOURCE_ID).toString()); } }

Target:
private void messageSpanTagger(Span span, Message<?> message) { span.remoteServiceName("sqs"); if (message.getHeaders().get(LOGICAL_RESOURCE_ID) != null) { span.tag("sqs.queue_url", message.getHeaders().get(LOGICAL_RESOURCE_ID).toString()); } }
Source:
public static Contact setContactMe(){ Contact me = null; try{ Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc:mysql://mysql.cs.iastate.edu/db30901", "adm309", "EXbDqudt4"); ResultSet rs = con.createStatement().executeQuery("select * from testTable where phoneNumber='" + Global.username + "'"); if(rs.next());{ me = new Contact(rs.getString("firstName"),rs.getString("lastName"), rs.getString("phoneNumber"),null); } rs.close(); con.close(); System.out.println("ContactED WORKED"); } catch(Exception e){ System.out.println("Login fail" + e.getMessage()); } return me; }

Target:
public static Contact setContactMe(){ Contact me = null; try{ Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc:mysql://mysql.cs.iastate.edu/db30901", "adm309", "EXbDqudt4"); ResultSet rs = con.createStatement().executeQuery("select * from testTable where phoneNumber='" + Global.username + "'"); if(rs.next());{ me = new Contact(rs.getString("firstName"),rs.getString("lastName"), rs.getString("phoneNumber"),null); } rs.close(); con.close(); } catch(Exception e){ System.out.println("Login fail" + e.getMessage()); } return me; }
Source:
public void processEvent(final CloudTrailEvent event) { List<String> keyNames = containsKeyNames(event.getEventData().getRequestParameters()); if (!CollectionUtils.isEmpty(keyNames)) { LOG.info("KeyPair must be blank, but was {}", keyNames); } }

Target:
public void processEvent(final CloudTrailEvent event) { List<String> keyNames = CloudtrailEventSupport.containsKeyNames(event.getEventData().getRequestParameters()); if (!CollectionUtils.isEmpty(keyNames)) { violationStore.save(String.format("KeyPair must be blank, but was {}", keyNames)); } }
Source:
private BlackboardArtifact createDownloadArtifact(AbstractFile zoneFile, ZoneIdentifierInfo zoneInfo) { Collection<BlackboardAttribute> bbattributes = createDownloadAttributes( null, null, zoneInfo.getURL(), null, (zoneInfo.getURL() != null ? NetworkUtils.extractDomain(zoneInfo.getURL()) : ""), null); return addArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD, zoneFile, bbattributes); }

Target:
private BlackboardArtifact createDownloadArtifact(AbstractFile zoneFile, ZoneIdentifierInfo zoneInfo) { Collection<BlackboardAttribute> bbattributes = createDownloadAttributes( null, null, zoneInfo.getURL(), null, (zoneInfo.getURL() != null ? NetworkUtils.extractDomain(zoneInfo.getURL()) : ""), null); return addArtifact(TSK_WEB_DOWNLOAD, zoneFile, bbattributes); }
Source:
public void modifyAST(IIndex index, IMarker marker) { String supressionComment = getSupressionComment(getProblem(marker)); if (supressionComment == null) { return; } try { int line = marker.getAttribute(IMarker.LINE_NUMBER, 0); int offset = getDocument().getLineOffset(line) - 1; String commentString = String.format(COMMENT_TEMPLATE, supressionComment); InsertEdit edit = new InsertEdit(offset, commentString); edit.apply(getDocument()); } catch (BadLocationException e) { CheckersUiActivator.log(e); } }

Target:
public void modifyAST(IIndex index, IMarker marker) { String supressionComment = getSupressionComment(getProblem(marker)); if (supressionComment == null) { return; } try { int line = marker.getAttribute(IMarker.LINE_NUMBER, 0); IRegion lineInformation = getDocument().getLineInformation(line - 1); int offset = lineInformation.getOffset() + lineInformation.getLength(); String commentString = String.format(COMMENT_TEMPLATE, supressionComment); InsertEdit edit = new InsertEdit(offset, commentString); edit.apply(getDocument()); } catch (BadLocationException e) { CheckersUiActivator.log(e); } }
Source:
protected RestResponse handleRequest(RestRequest req) throws Exception { RestResponse res = new RestResponse(); res.setCode(String.valueOf(HttpServletResponse.SC_OK)); String surveyId = ((WebFormRequest)req).getSurveyId(); String url = String.format("<LINK_0>", SystemProperty.applicationId.get(), surveyId); res.setMessage(url); return res; }

Target:
protected RestResponse handleRequest(RestRequest req) throws Exception { RestResponse res = new RestResponse(); res.setCode(String.valueOf(HttpServletResponse.SC_OK)); String surveyId = ((WebFormRequest)req).getSurveyId(); String url = String.format("%s/%s/%s", PropertyUtil.getProperty(EnvServlet.WEBFORM_REDIRECTION_URL), PropertyUtil.getProperty("appId"), surveyId); res.setMessage(url); return res; }
Source:
private String getSearchResults(String searchId) throws Exception { String results = null; ArtifactReadable action = null; if (GUID.isValid(searchId)) { action = AtsServerImpl.get().getArtifactByGuid(searchId); } if (action != null) { IAtsWorkItem workItem = AtsServerImpl.get().getWorkItemFactory().getWorkItem(action); if (workItem != null) { results = ActionUtility.displayAction(registry, action, "Action - " + searchId, ActionLoadLevel.HEADER); } else { results = AHTML.simplePage(String.format("Undisplayable %s", action)); } } for (IAttributeType attrType : Arrays.asList(AtsAttributeTypes.AtsId, AtsAttributeTypes.LegacyPcrId)) { ResultSet<ArtifactReadable> results2 = orcsApi.getQueryFactory(null).fromBranch(AtsUtilRest.getAtsBranch()).and(attrType, org.eclipse.osee.framework.core.enums.Operator.EQUAL, searchId).getResults(); if (results2.size() == 1) { results = ActionUtility.displayAction(registry, results2.getExactlyOne(), "Action - " + searchId, ActionLoadLevel.HEADER); break; } else if (results2.size() > 1) { results = getGuidListHtml(results2); break; } } if (results == null) { results = AHTML.simplePage(String.format("Unknown Id [%s]", searchId)); } return results; }

Target:
private String getSearchResults(String searchId) throws Exception { String results = null; ArtifactReadable action = null; if (GUID.isValid(searchId)) { action = AtsServerImpl.get().getArtifactByGuid(searchId); } if (action != null) { IAtsWorkItem workItem = AtsServerImpl.get().getWorkItemFactory().getWorkItem(action); if (workItem != null) { results = ActionUtility.displayAction(registry, action, "Action - " + searchId, ActionLoadLevel.HEADER); } else { results = AHTML.simplePage(String.format("Undisplayable %s", action)); } } if (!Strings.isValid(results)) { for (IAttributeType attrType : Arrays.asList(AtsAttributeTypes.AtsId, AtsAttributeTypes.LegacyPcrId)) { ResultSet<ArtifactReadable> legacyQueryResults = orcsApi.getQueryFactory(null).fromBranch(AtsUtilRest.getAtsBranch()).and(attrType, org.eclipse.osee.framework.core.enums.Operator.EQUAL, searchId).getResults(); if (legacyQueryResults.size() == 1) { results = ActionUtility.displayAction(registry, legacyQueryResults.getExactlyOne(), "Action - " + searchId, ActionLoadLevel.HEADER); break; } else if (legacyQueryResults.size() > 1) { results = getGuidListHtml(legacyQueryResults); break; } } } if (!Strings.isValid(results)) { results = AHTML.simplePage(String.format("Unknown Id [%s]", searchId)); } return results; }
Source:
private static boolean isSerialVersionUID(Tree tree) { Tree parent = tree.parent(); while (parent != null && !parent.is(Tree.Kind.VARIABLE)) { parent = parent.parent(); } return parent != null && "serialVersionUID".equals(((VariableTree) parent).symbol().name()); }

Target:
private static boolean isSerialVersionUID(Tree tree) { Tree parent = tree.parent(); while (parent != null && !parent.is(Tree.Kind.VARIABLE)) { parent = parent.parent(); } return parent != null && "serialVersionUID".equals(((VariableTree) parent).simpleName().name()); }
Source:
public void addReviewers(ReviewDb db, Change change, PatchSet ps, PatchSetInfo info, Set<Id> wantReviewers, Set<Account.Id> existingReviewers) throws OrmException { List<ApprovalType> allTypes = approvalTypes.getApprovalTypes(); if (allTypes.isEmpty()) { return; } Set<Account.Id> need = Sets.newHashSet(wantReviewers); Account.Id authorId = info.getAuthor() != null ? info.getAuthor().getAccount() : null; if (authorId != null && !ps.isDraft()) { need.add(authorId); } Account.Id committerId = info.getCommitter() != null ? info.getCommitter().getAccount() : null; if (committerId != null && !ps.isDraft()) { need.add(committerId); } need.remove(change.getOwner()); need.removeAll(existingReviewers); List<PatchSetApproval> cells = Lists.newArrayListWithCapacity(need.size()); ApprovalCategory.Id catId = new ApprovalCategory.Id( allTypes.get(allTypes.size() - 1).getId()); for (Account.Id account : need) { PatchSetApproval psa = new PatchSetApproval( new PatchSetApproval.Key(ps.getId(), account, catId), (short) 0); psa.cache(change); cells.add(psa); } db.patchSetApprovals().insert(cells); }

Target:
public void addReviewers(ReviewDb db, Change change, PatchSet ps, PatchSetInfo info, Set<Id> wantReviewers, Set<Account.Id> existingReviewers) throws OrmException { List<ApprovalType> allTypes = approvalTypes.getApprovalTypes(); if (allTypes.isEmpty()) { return; } Set<Account.Id> need = Sets.newHashSet(wantReviewers); Account.Id authorId = info.getAuthor() != null ? info.getAuthor().getAccount() : null; if (authorId != null && !ps.isDraft()) { need.add(authorId); } Account.Id committerId = info.getCommitter() != null ? info.getCommitter().getAccount() : null; if (committerId != null && !ps.isDraft()) { need.add(committerId); } need.remove(change.getOwner()); need.removeAll(existingReviewers); List<PatchSetApproval> cells = Lists.newArrayListWithCapacity(need.size()); ApprovalCategory.Id catId = Iterables.getLast(allTypes).getApprovalCategoryId(); for (Account.Id account : need) { PatchSetApproval psa = new PatchSetApproval( new PatchSetApproval.Key(ps.getId(), account, catId), (short) 0); psa.cache(change); cells.add(psa); } db.patchSetApprovals().insert(cells); }
Source:
public Gson getGson() { return gsonBuilder.create(); }

Target:
public Gson getGson() { return gson; }
Source:
public String getToken(HttpServletRequest req) { if (req.getHeader(HttpHeaders.AUTHORIZATION) == null) { return null; } if (req.getHeader(HttpHeaders.AUTHORIZATION).toLowerCase().startsWith("bearer")) { String[] parts = req.getHeader(HttpHeaders.AUTHORIZATION).split("\\s+"); if (parts.length != 2) { throw new BadRequestException("Invalid authorization header format."); } return parts[1]; } else { return req.getHeader(HttpHeaders.AUTHORIZATION); } }

Target:
public String getToken(HttpServletRequest req) { if (req.getHeader(HttpHeaders.AUTHORIZATION) == null) { return null; } if (req.getHeader(HttpHeaders.AUTHORIZATION).toLowerCase().startsWith("bearer")) { String[] parts = req.getHeader(HttpHeaders.AUTHORIZATION).split(" "); if (parts.length != 2) { throw new BadRequestException("Invalid authorization header format."); } return parts[1]; } else { return req.getHeader(HttpHeaders.AUTHORIZATION); } }
Source:
private void populateDirectoryList() { setContentView(R.layout.uploader_layout); mRadioBtnMoveFiles = (RadioButton) findViewById(R.id.uploader_radio_move); mRadioBtnCopyFiles = (RadioButton) findViewById(R.id.uploader_radio_copy); mRadioBtnCopyFiles.setChecked(true); ListView mListView = (ListView) findViewById(android.R.id.list); String current_dir = mParents.peek(); if(current_dir.equals("")){ getSupportActionBar().setTitle(getString(R.string.default_display_name_for_root_folder)); } else{ getSupportActionBar().setTitle(current_dir); } boolean notRoot = (mParents.size() > 1); ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(notRoot); actionBar.setHomeButtonEnabled(notRoot); String full_path = generatePath(mParents); Log_OC.d(TAG, "Populating view with content of : " + full_path); mFile = getStorageManager().getFileByPath(full_path); if (mFile != null) { Vector<OCFile> files = getStorageManager().getFolderContent(mFile ); List<HashMap<String, OCFile>> data = new LinkedList<HashMap<String,OCFile>>(); for (OCFile f : files) { HashMap<String, OCFile> h = new HashMap<String, OCFile>(); h.put("dirname", f); data.add(h); } UploaderAdapter sa = new UploaderAdapter(this, data, R.layout.uploader_list_item_layout, new String[] {"dirname"}, new int[] {R.id.filename}, getStorageManager(), getAccount()); mListView.setAdapter(sa); Button btnChooseFolder = (Button) findViewById(R.id.uploader_choose_folder); btnChooseFolder.setOnClickListener(this); Button btnNewFolder = (Button) findViewById(R.id.uploader_cancel); btnNewFolder.setOnClickListener(this); mListView.setOnItemClickListener(this); } }

Target:
private void populateDirectoryList() { ListView mListView = (ListView) findViewById(android.R.id.list); String current_dir = mParents.peek(); if(current_dir.equals("")){ getSupportActionBar().setTitle(getString(R.string.default_display_name_for_root_folder)); } else{ getSupportActionBar().setTitle(current_dir); } boolean notRoot = (mParents.size() > 1); ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(notRoot); actionBar.setHomeButtonEnabled(notRoot); String full_path = generatePath(mParents); Log_OC.d(TAG, "Populating view with content of : " + full_path); mFile = getStorageManager().getFileByPath(full_path); if (mFile != null) { Vector<OCFile> files = getStorageManager().getFolderContent(mFile ); List<HashMap<String, OCFile>> data = new LinkedList<HashMap<String,OCFile>>(); for (OCFile f : files) { HashMap<String, OCFile> h = new HashMap<String, OCFile>(); h.put("dirname", f); data.add(h); } UploaderAdapter sa = new UploaderAdapter(this, data, R.layout.uploader_list_item_layout, new String[] {"dirname"}, new int[] {R.id.filename}, getStorageManager(), getAccount()); mListView.setAdapter(sa); Button btnChooseFolder = (Button) findViewById(R.id.uploader_choose_folder); btnChooseFolder.setOnClickListener(this); Button btnNewFolder = (Button) findViewById(R.id.uploader_cancel); btnNewFolder.setOnClickListener(this); mListView.setOnItemClickListener(this); } }
Source:
public long getRetainedSizeInBytes() { return INSTANCE_SIZE + sizeOf(keyIndices) + sizeOf(nestedReadOffsets) + sizeOf(offsets) + sizeOf(nulls) + sizeOf(outputPositions) + sizeOf(nestedLengths) + (nestedPositions != null ? Arrays.stream(nestedPositions).mapToLong(SizeOf::sizeOf).sum() : 0) + sizeOf(nestedPositionCounts) + (nestedOutputPositions != null ? Arrays.stream(nestedOutputPositions).mapToLong(SizeOf::sizeOf).sum() : 0) + (inMap != null ? Arrays.stream(inMap).mapToLong(SizeOf::sizeOf).sum() : 0); }

Target:
public long getRetainedSizeInBytes() { return INSTANCE_SIZE + sizeOf(keyIndices) + sizeOf(nestedReadOffsets) + sizeOf(offsets) + sizeOf(nulls) + sizeOf(outputPositions) + sizeOf(nestedLengths) + (nestedPositions != null ? Arrays.stream(nestedPositions).mapToLong(SizeOf::sizeOf).sum() : 0) + sizeOf(nestedPositionCounts) + (nestedOutputPositions != null ? Arrays.stream(nestedOutputPositions).mapToLong(SizeOf::sizeOf).sum() : 0) + (inMap != null ? Arrays.stream(inMap).mapToLong(SizeOf::sizeOf).sum() : 0) + (valueStreamReaders != null ? valueStreamReaders.stream().mapToLong(StreamReader::getRetainedSizeInBytes).sum() : 0); }
Source:
public byte[] getCacheKey() { return new CacheKeyBuilder(PostAggregatorIds.HLL_SKETCH_TO_ESTIMATE_CACHE_TYPE_ID) .appendString(name) .appendCacheable(field) .build(); }

Target:
public byte[] getCacheKey() { return new CacheKeyBuilder(PostAggregatorIds.HLL_SKETCH_TO_ESTIMATE_CACHE_TYPE_ID) .appendCacheable(field) .build(); }
Source:
public void stop(BundleContext context) throws Exception { IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry(); matchEngineConfiguratorRegistry = null; matchEngineConfiguratorRegistryListener = null; extensionRegistry.removeListener(differenceGroupExtenderRegistryListener); differenceGroupExtenderRegistryListener = null; differenceGroupExtenderRegistry = null; extensionRegistry.removeListener(accessorFactoryRegistryListener); accessorFactoryRegistryListener = null; accessorFactoryRegistry = null; extensionRegistry.removeListener(filterRegistryListener); filterRegistryListener = null; filterRegistry = null; extensionRegistry.removeListener(groupProviderRegistryListener); groupProviderRegistryListener = null; groupProviderRegistry = null; plugin = null; disposeCachedImages(); super.stop(context); }

Target:
public void stop(BundleContext context) throws Exception { IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry(); extensionRegistry.removeListener(matchEngineConfiguratorRegistryListener); matchEngineConfiguratorRegistry = null; matchEngineConfiguratorRegistryListener = null; extensionRegistry.removeListener(differenceGroupExtenderRegistryListener); differenceGroupExtenderRegistryListener = null; differenceGroupExtenderRegistry = null; extensionRegistry.removeListener(accessorFactoryRegistryListener); accessorFactoryRegistryListener = null; accessorFactoryRegistry = null; extensionRegistry.removeListener(filterRegistryListener); filterRegistryListener = null; filterRegistry = null; extensionRegistry.removeListener(groupProviderRegistryListener); groupProviderRegistryListener = null; groupProviderRegistry = null; plugin = null; disposeCachedImages(); super.stop(context); }
Source:
private boolean hasNewOrMissingSubstitutions() { for (NLSSubstitution curr : fSubstitutions) { if (curr.getInitialState() == NLSSubstitution.INTERNALIZED) { return true; } if (curr.getInitialState() == NLSSubstitution.EXTERNALIZED && curr.getInitialValue() == null) { return true; } } return false; }

Target:
private boolean hasNewOrMissingSubstitutions() { for (NLSSubstitution substitution : fSubstitutions) { if (substitution.getInitialState() == NLSSubstitution.INTERNALIZED) { return true; } if (substitution.getInitialState() == NLSSubstitution.EXTERNALIZED && substitution.getInitialValue() == null) { return true; } } return false; }
Source:
public String toString() { return "[TmfTraceSynchronizedSignal (" + fAlgoSync.toString() + ")]"; }

Target:
public String toString() { return "[" + getClass().getSimpleName() + " (" + fAlgoSync.toString() + ")]"; }
Source:
private PaymentTransaction findCreatedTransaction(final Payment payment, final TransactionType transactionType, @Nullable final String transactionExternalKey) { final List<PaymentTransaction> reversedTransactions = Lists.reverse(payment.getTransactions()); final Iterable<PaymentTransaction> matchingTransactions = Iterables.filter(reversedTransactions, new Predicate<PaymentTransaction>() { @Override public boolean apply(final PaymentTransaction input) { return input.getTransactionType() == transactionType; } }); if (transactionExternalKey != null) { for (final PaymentTransaction transaction : matchingTransactions) { if (Objects.equal(transaction.getExternalKey(), transactionExternalKey)) { return transaction; } } } return Iterables.getFirst(matchingTransactions, null); }

Target:
private PaymentTransaction findCreatedTransaction(final Payment payment, final TransactionType transactionType, @Nullable final String transactionExternalKey) { final List<PaymentTransaction> reversedTransactions = Lists.reverse(payment.getTransactions()); final Iterable<PaymentTransaction> matchingTransactions = Iterables.filter(reversedTransactions, new Predicate<PaymentTransaction>() { @Override public boolean apply(final PaymentTransaction input) { return input.getTransactionType() == transactionType; } }); if (transactionExternalKey != null) { for (final PaymentTransaction transaction : matchingTransactions) { if (transactionExternalKey.equals(transaction.getExternalKey())) { return transaction; } } } return Iterables.getFirst(matchingTransactions, null); }
Source:
public Linkifier(GitilesUrls urls, Config config) { this.urls = checkNotNull(urls, "urls"); List<CommentLinkInfo> list = new ArrayList<>(); list.add(new CommentLinkInfo(HTTP_URL_PATTERN, "$0")); Set<String> subsections = config.getSubsections(COMMENTLINK); List<String> patterns = new ArrayList<>(); patterns.add(HTTP_URL_PATTERN.pattern()); patterns.add(CHANGE_ID_PATTERN.pattern()); for (String subsection : subsections) { String match = config.getString("commentlink", subsection, "match"); String link = config.getString("commentlink", subsection, "link"); String html = config.getString("commentlink", subsection, "html"); if (html != null) { log.warn("Beware: html in commentlinks is unsupported in gitiles; " + "Did you copy it from a gerrit config?"); } if (Strings.isNullOrEmpty(match)) { log.warn("invalid commentlink.%s.match", subsection); continue; } if (Strings.isNullOrEmpty(link)) { log.warn("invalid commentlink.%s.link", subsection); continue; } Pattern pattern = Pattern.compile(match); if (link != null) { list.add(new CommentLinkInfo(pattern, link)); } patterns.add(match); } this.commentLinks = Collections.unmodifiableList(list); allPattern = Pattern.compile(Joiner.on('|').join(patterns)); }

Target:
public Linkifier(GitilesUrls urls, Config config) { this.urls = checkNotNull(urls, "urls"); List<CommentLinkInfo> list = new ArrayList<>(); list.add(new CommentLinkInfo(HTTP_URL_PATTERN, "$0")); Set<String> subsections = config.getSubsections(COMMENTLINK); List<String> patterns = new ArrayList<>(); patterns.add(HTTP_URL_PATTERN.pattern()); patterns.add(CHANGE_ID_PATTERN.pattern()); for (String subsection : subsections) { String match = config.getString("commentlink", subsection, "match"); String link = config.getString("commentlink", subsection, "link"); String html = config.getString("commentlink", subsection, "html"); if (html != null) { log.warn("Beware: html in commentlinks is unsupported in gitiles; " + "Did you copy it from a gerrit config?"); } if (Strings.isNullOrEmpty(match)) { log.warn("invalid commentlink.%s.match", subsection); continue; } if (Strings.isNullOrEmpty(link)) { log.warn("invalid commentlink.%s.link", subsection); continue; } Pattern pattern = Pattern.compile(match); list.add(new CommentLinkInfo(pattern, link)); patterns.add(match); } this.commentLinks = Collections.unmodifiableList(list); allPattern = Pattern.compile(Joiner.on('|').join(patterns)); }
Source:
private ScoreData[] getScoreDataForNode(BeatmapSetNode node, boolean setTimeSince) { if (scoreMap == null || scoreMap.isEmpty() || node.beatmapIndex == -1) return null; Beatmap beatmap = node.getSelectedBeatmap(); ScoreData[] scores = scoreMap.get(beatmap.version); if (scores == null || scores.length < 1) return null; ScoreData s = scores[0]; if (beatmap.beatmapID == s.MID && beatmap.beatmapSetID == s.MSID && beatmap.title.equals(s.title) && beatmap.artist.equals(s.artist) && beatmap.creator.equals(s.creator)) { for (int i = 0; i < scores.length; i++) { if (setTimeSince) scores[i].getTimeSince(); scores[i].loadGlyphs(); } return scores; } return null; }

Target:
private ScoreData[] getScoreDataForNode(BeatmapSetNode node, boolean setTimeSince) { if (scoreMap == null || scoreMap.isEmpty() || node.beatmapIndex == -1) return null; Beatmap beatmap = node.getSelectedBeatmap(); ScoreData[] scores = scoreMap.get(beatmap.version); if (scores == null || scores.length < 1) return null; ScoreData s = scores[0]; if (beatmap.beatmapID == s.MID && beatmap.beatmapSetID == s.MSID && beatmap.title.equals(s.title) && beatmap.artist.equals(s.artist) && beatmap.creator.equals(s.creator)) { for (int i = 0; i < scores.length; i++) { if (setTimeSince) scores[i].getTimeSince(); scores[i].loadGlyphs(); } return scores; } else return null; }
Source:
public synchronized double getTotalDataFetchRate() { double fetchRate = 0; for (HdfsCopyStats copyStats : copyStatsMap.values()) { fetchRate += copyStats.getBytesTransferredPerSecond(); } return fetchRate; }

Target:
public synchronized double getTotalDataFetchRate() { return HdfsFetcher.getDataFetchRate(); }
Source:
public void testKilledSession() throws Exception { client.create().forPath("/test"); cache = newTreeCacheWithListeners(client, "/test"); cache.start(); assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test"); assertEvent(TreeCacheEvent.Type.INITIALIZED); client.create().forPath("/test/foo", "foo".getBytes()); assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test/foo"); client.create().withMode(CreateMode.EPHEMERAL).forPath("/test/me", "data".getBytes()); assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test/me"); KillSession2.kill(client.getZookeeperClient().getZooKeeper()); if ( client.isZk34CompatibilityMode() ) { assertEvent(TreeCacheEvent.Type.CONNECTION_LOST); assertEvent(TreeCacheEvent.Type.NODE_REMOVED, "/test/me", "data".getBytes()); assertEvent(TreeCacheEvent.Type.CONNECTION_RECONNECTED); assertEvent(TreeCacheEvent.Type.INITIALIZED); } else { assertEvent(TreeCacheEvent.Type.CONNECTION_LOST); assertEvent(TreeCacheEvent.Type.CONNECTION_RECONNECTED); assertEvent(TreeCacheEvent.Type.INITIALIZED); assertEvent(TreeCacheEvent.Type.NODE_REMOVED, "/test/me", "data".getBytes()); } assertNoMoreEvents(); }

Target:
public void testKilledSession() throws Exception { client.create().forPath("/test"); cache = newTreeCacheWithListeners(client, "/test"); cache.start(); assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test"); assertEvent(TreeCacheEvent.Type.INITIALIZED); client.create().forPath("/test/foo", "foo".getBytes()); assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test/foo"); client.create().withMode(CreateMode.EPHEMERAL).forPath("/test/me", "data".getBytes()); assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test/me"); Compatibility.injectSessionExpiration(client.getZookeeperClient().getZooKeeper()); assertEvent(TreeCacheEvent.Type.NODE_REMOVED, "/test/me", "data".getBytes(), true); assertEvent(TreeCacheEvent.Type.INITIALIZED, null, null, true); assertNoMoreEvents(); }
Source:
public static OzoneObjInfo fromProtobuf(OzoneManagerProtocolProtos.OzoneObj proto) { Builder builder = new Builder() .setResType(ResourceType.valueOf(proto.getResType().name())) .setStoreType(StoreType.valueOf(proto.getStoreType().name())); String path = proto.getPath(); if(path == null) { throw new IllegalArgumentException("Unexpected null path"); } Path p = Paths.get(path); switch (proto.getResType()) { case VOLUME: builder.setVolumeName(p.getName(0).toString()); break; case BUCKET: if (p.getNameCount() < 2) { throw new IllegalArgumentException("Unexpected argument for " + "Ozone bucket. Path:" + proto.getPath()); } builder.setVolumeName(p.getName(0).toString()); builder.setBucketName(p.getName(1).toString()); break; case KEY: if (p.getNameCount() < 3) { throw new IllegalArgumentException("Unexpected argument for " + "Ozone key. Path:" + proto.getPath()); } builder.setVolumeName(p.getName(0).toString()); builder.setBucketName(p.getName(1).toString()); String keyName = p.subpath(2, p.getNameCount()).toString(); builder.setKeyName(path.endsWith(OZONE_URI_DELIMITER) ? keyName + OZONE_URI_DELIMITER : keyName); break; case PREFIX: if (p.getNameCount() < 3) { throw new IllegalArgumentException("Unexpected argument for " + "Ozone prefix. Path:" + proto.getPath()); } builder.setVolumeName(p.getName(0).toString()); builder.setBucketName(p.getName(1).toString()); builder.setPrefixName(p.subpath(2, p.getNameCount()).toString() + OZONE_URI_DELIMITER); break; default: throw new IllegalArgumentException("Unexpected type for " + "Ozone key. Type:" + proto.getResType()); } return builder.build(); }

Target:
public static OzoneObjInfo fromProtobuf(OzoneManagerProtocolProtos.OzoneObj proto) { Builder builder = new Builder() .setResType(ResourceType.valueOf(proto.getResType().name())) .setStoreType(StoreType.valueOf(proto.getStoreType().name())); String[] tokens = StringUtils.split(proto.getPath(), OZONE_URI_DELIMITER, 3); if(tokens == null) { throw new IllegalArgumentException("Unexpected path:" + proto.getPath()); } switch (proto.getResType()) { case VOLUME: builder.setVolumeName(tokens[0]); break; case BUCKET: if (tokens.length < 2) { throw new IllegalArgumentException("Unexpected argument for " + "Ozone bucket. Path:" + proto.getPath()); } builder.setVolumeName(tokens[0]); builder.setBucketName(tokens[1]); break; case KEY: if (tokens.length < 3) { throw new IllegalArgumentException("Unexpected argument for " + "Ozone key. Path:" + proto.getPath()); } builder.setVolumeName(tokens[0]); builder.setBucketName(tokens[1]); builder.setKeyName(tokens[2]); break; case PREFIX: if (tokens.length < 3) { throw new IllegalArgumentException("Unexpected argument for " + "Ozone Prefix. Path:" + proto.getPath()); } builder.setVolumeName(tokens[0]); builder.setBucketName(tokens[1]); builder.setPrefixName(tokens[2]); break; default: throw new IllegalArgumentException("Unexpected type for " + "Ozone key. Type:" + proto.getResType()); } return builder.build(); }
Source:
public void handle(Request request, Response response) throws Exception { verifySystemAdministrator(); List<RuleKey> disabledTemplateAndCustomRuleKeys = null; try (DbSession dbSession = dbClient.openSession(false)) { if (isSupportDisabled(dbSession)) { flagCurrentUserAsRoot(dbSession); createDefaultMembersGroup(dbSession); disabledTemplateAndCustomRuleKeys = disableTemplateRulesAndCustomRules(dbSession); enableFeature(dbSession); dbSession.commit(); } } if (disabledTemplateAndCustomRuleKeys != null) { ruleIndexer.indexRuleDefinitions(disabledTemplateAndCustomRuleKeys); } response.noContent(); }

Target:
public void handle(Request request, Response response) throws Exception { verifySystemAdministrator(); try (DbSession dbSession = dbClient.openSession(false)) { if (isSupportDisabled(dbSession)) { flagCurrentUserAsRoot(dbSession); createDefaultMembersGroup(dbSession); List<RuleKey> disabledTemplateAndCustomRuleKeys = disableTemplateRulesAndCustomRules(dbSession); enableFeature(dbSession); dbSession.commit(); ruleIndexer.indexRuleDefinitions(disabledTemplateAndCustomRuleKeys); } } response.noContent(); }
Source:
public void reinstatePatchUnauthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context) .withName("Parent Community") .build(); Community child1 = CommunityBuilder.createSubCommunity(context, parentCommunity) .withName("Sub Community") .build(); Collection col1 = CollectionBuilder.createCollection(context, child1) .withName("Collection 1").build(); context.setCurrentUser(admin); Item item = ItemBuilder.createItem(context, col1) .withTitle("Public item 1") .withIssueDate("2017-10-17") .withAuthor("Smith, Donald").withAuthor("Doe, John") .withSubject("ExtraEntry") .withdrawn() .build(); String tokenAdmin = getAuthToken(admin.getEmail(), password); List<Operation> ops = new ArrayList<Operation>(); ReplaceOperation replaceOperation = new ReplaceOperation("/withdrawn", "false"); ops.add(replaceOperation); String patchBody = getPatchContent(ops); getClient().perform(patch("/api/core/items/" + item.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isUnauthorized()); getClient(tokenAdmin).perform(get("/api/core/items/" + item.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$.uuid", Matchers.is(item.getID().toString()))) .andExpect(jsonPath("$.withdrawn", Matchers.is(true))) .andExpect(jsonPath("$.inArchive", Matchers.is(false))); }

Target:
public void reinstatePatchUnauthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context) .withName("Parent Community") .build(); Community child1 = CommunityBuilder.createSubCommunity(context, parentCommunity) .withName("Sub Community") .build(); Collection col1 = CollectionBuilder.createCollection(context, child1) .withName("Collection 1").build(); context.setCurrentUser(admin); Item item = ItemBuilder.createItem(context, col1) .withTitle("Public item 1") .withIssueDate("2017-10-17") .withAuthor("Smith, Donald").withAuthor("Doe, John") .withSubject("ExtraEntry") .withdrawn() .build(); String tokenAdmin = getAuthToken(admin.getEmail(), password); List<Operation> ops = new ArrayList<Operation>(); ReplaceOperation replaceOperation = new ReplaceOperation("/withdrawn", false); ops.add(replaceOperation); String patchBody = getPatchContent(ops); getClient().perform(patch("/api/core/items/" + item.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isUnauthorized()); getClient(tokenAdmin).perform(get("/api/core/items/" + item.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$.uuid", Matchers.is(item.getID().toString()))) .andExpect(jsonPath("$.withdrawn", Matchers.is(true))) .andExpect(jsonPath("$.inArchive", Matchers.is(false))); }
Source:
public List<QuotaEmailTemplatesVO> listAllQuotaEmailTemplates(final String templateName) { return Transaction.execute(TransactionLegacy.USAGE_DB, new TransactionCallback<List<QuotaEmailTemplatesVO>>() { @Override public List<QuotaEmailTemplatesVO> doInTransaction(final TransactionStatus status) { SearchCriteria<QuotaEmailTemplatesVO> sc = QuotaEmailTemplateSearch.create(); if (templateName != null) { sc.setParameters("template_name", templateName); } return listBy(sc); } }); }

Target:
public List<QuotaEmailTemplatesVO> listAllQuotaEmailTemplates(final String templateName) { return Transaction.execute(TransactionLegacy.USAGE_DB, new TransactionCallback<List<QuotaEmailTemplatesVO>>() { @Override public List<QuotaEmailTemplatesVO> doInTransaction(final TransactionStatus status) { SearchCriteria<QuotaEmailTemplatesVO> sc = QuotaEmailTemplateSearch.create(); if (!Strings.isNullOrEmpty(templateName)) { sc.setParameters("template_name", templateName); } return listBy(sc); } }); }
Source:
public void internalStart(String trigger) { StartNode startNode = getRuleFlowProcess().getStart(trigger); if (startNode != null) { ((NodeInstance) getNodeInstance(startNode)).trigger(null, null); } else if (!getRuleFlowProcess().isDynamic() && this.getRuleFlowProcess().getTimerStart().isEmpty()) { throw new IllegalArgumentException("There is no start node that matches the trigger " + trigger == null ? "none" : trigger); } List<Node> autoStartNodes = getRuleFlowProcess().getAutoStartNodes(); autoStartNodes .forEach(austoStartNode -> signalEvent(austoStartNode.getName(), null)); }

Target:
public void internalStart(String trigger) { StartNode startNode = getRuleFlowProcess().getStart(trigger); if (startNode != null) { ((NodeInstance) getNodeInstance(startNode)).trigger(null, null); } else if (!getRuleFlowProcess().isDynamic()) { throw new IllegalArgumentException("There is no start node that matches the trigger " + (trigger == null ? "none" : trigger)); } List<Node> autoStartNodes = getRuleFlowProcess().getAutoStartNodes(); autoStartNodes .forEach(austoStartNode -> signalEvent(austoStartNode.getName(), null)); }
Source:
private static List<FoundFailureCause> findCauses(final Collection<FailureCause> causes, final Run build, final PrintStream buildLog) { final List<FoundFailureCause> foundFailureCauseList = new ArrayList<FoundFailureCause>(); long start = System.currentTimeMillis(); THREAD_POOL_EXECUTOR.setCorePoolSize(PluginImpl.getInstance().getNrOfScanThreads()); THREAD_POOL_EXECUTOR.setMaximumPoolSize(PluginImpl.getInstance().getNrOfScanThreads()); buildLog.println("[BFA] Scanning build for known causes..."); Runnable runnable = new Runnable() { @Override public void run() { Thread.currentThread().setName("BFA-scanner-" + build.getFullDisplayName()); foundFailureCauseList.addAll(findIndications(causes, build, buildLog)); } }; try { THREAD_POOL_EXECUTOR.submit(runnable).get(); } catch (InterruptedException e) { buildLog.print("[BFA] was interrupted: " + e); } catch (ExecutionException e) { buildLog.print("[BFA] was interrupted: " + e); } long time = System.currentTimeMillis() - start; if (logger.isLoggable(Level.FINER)) { logger.log(Level.FINER, "[BFA] [{0}] {1}ms", new Object[] {build.getFullDisplayName(), String.valueOf(time), }); } if (!foundFailureCauseList.isEmpty()) { buildLog.println("[BFA] Found failure cause(s):"); for (FoundFailureCause foundCause : foundFailureCauseList) { if (foundCause.getCategories() == null) { buildLog.println("[BFA] " + foundCause.getName()); } else { buildLog.println("[BFA] " + foundCause.getName() + " from category " + foundCause.getCategories().get(0)); } } } else { buildLog.println("[BFA] No failure causes found"); } buildLog.println("[BFA] Done. " + TimeUnit.MILLISECONDS.toSeconds(time) + "s"); return foundFailureCauseList; }

Target:
private static List<FoundFailureCause> findCauses(final Collection<FailureCause> causes, final Run build, final PrintStream buildLog) { THREAD_POOL_EXECUTOR.setCorePoolSize(PluginImpl.getInstance().getNrOfScanThreads()); THREAD_POOL_EXECUTOR.setMaximumPoolSize(PluginImpl.getInstance().getNrOfScanThreads()); buildLog.println("[BFA] Scanning build for known causes..."); long start = System.currentTimeMillis(); final List<FoundFailureCause> foundFailureCauseList = findIndications(causes, build, buildLog); long time = System.currentTimeMillis() - start; if (logger.isLoggable(Level.FINER)) { logger.log(Level.FINER, "[BFA] [{0}] {1}ms", new Object[] {build.getFullDisplayName(), String.valueOf(time), }); } if (!foundFailureCauseList.isEmpty()) { buildLog.println("[BFA] Found failure cause(s):"); for (FoundFailureCause foundCause : foundFailureCauseList) { if (foundCause.getCategories() == null) { buildLog.println("[BFA] " + foundCause.getName()); } else { buildLog.println("[BFA] " + foundCause.getName() + " from category " + foundCause.getCategories().get(0)); } } } else { buildLog.println("[BFA] No failure causes found"); } buildLog.println("[BFA] Done. " + TimeUnit.MILLISECONDS.toSeconds(time) + "s"); return foundFailureCauseList; }