auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testTxTimeoutOnResumed() throws Exception { executeTestForAllCaches(new CI2Exc<Ignite, IgniteCache<Integer, Integer>>() { @Override public void applyx(Ignite ignite, final IgniteCache<Integer, Integer> cache) throws Exception { for (TransactionIsolation isolation : TransactionIsolation.values()) { final Transaction tx = ignite.transactions().txStart(transactionConcurrency(), isolation, TX_TIMEOUT, 0); cache.put(1, 1); tx.suspend(); GridTestUtils.runAsync(() -> { tx.resume(); cache.put(1, 1); cache.put(2, 2); tx.suspend(); }).get(FUT_TIMEOUT); tx.resume(); cache.put(1, 1); cache.put(2, 2); cache.put(3, 3); tx.suspend(); U.sleep(TX_TIMEOUT + 100L); GridTestUtils.assertThrowsWithCause(new Callable<Object>() { @Override public Object call() throws Exception { tx.resume(); return null; } }, TransactionTimeoutException.class); assertTrue(GridTestUtils.waitForCondition(new PA() { @Override public boolean apply() { return tx.state() == ROLLED_BACK; } }, getTestTimeout())); assertEquals(ROLLED_BACK, tx.state()); assertFalse(cache.containsKey(1)); tx.close(); assertFalse(cache.containsKey(1)); assertFalse(cache.containsKey(2)); assertFalse(cache.containsKey(3)); } } }); }

Target:
public void testTxTimeoutOnResumed() throws Exception { executeTestForAllCaches(new CI2Exc<Ignite, IgniteCache<Integer, Integer>>() { @Override public void applyx(Ignite ignite, final IgniteCache<Integer, Integer> cache) throws Exception { for (TransactionIsolation isolation : TransactionIsolation.values()) { final Transaction tx = initTxWithTimeout(ignite, cache, isolation, true); while (tx.startTime() + TX_TIMEOUT >= U.currentTimeMillis()) U.sleep(100L); GridTestUtils.assertThrowsWithCause(tx::resume, TransactionTimeoutException.class); assertTrue(GridTestUtils.waitForCondition(() -> tx.state() == ROLLED_BACK, getTestTimeout())); assertEquals(ROLLED_BACK, tx.state()); assertFalse(cache.containsKey(1)); tx.close(); assertFalse(cache.containsKey(1)); assertFalse(cache.containsKey(2)); assertFalse(cache.containsKey(3)); } } }); }
Source:
public void addAllReviewers(ChangeAttribute a, Change change) throws OrmException { Collection<Account.Id> reviewers = approvalsUtil.getReviewers(db.get(), change.getId()).values(); if (!reviewers.isEmpty()) { a.allReviewers = Lists.newArrayList(); for (Account.Id id : reviewers) { a.allReviewers.add(asAccountAttribute(id)); } } }

Target:
public void addAllReviewers(ChangeAttribute a, Change change) throws OrmException { Collection<Account.Id> reviewers = approvalsUtil.getReviewers(db.get(), change.getId()).values(); if (!reviewers.isEmpty()) { a.allReviewers = Lists.newArrayListWithCapacity(reviewers.size()); for (Account.Id id : reviewers) { a.allReviewers.add(asAccountAttribute(id)); } } }
Source:
public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { logger.info("Setting host to {}", host); Mono<HttpResponse> result; final UrlBuilder urlBuilder = UrlBuilder.parse(context.getHttpRequest().getUrl()); try { context.getHttpRequest().setUrl(urlBuilder.setHost(host).toURL()); result = next.process(); } catch (MalformedURLException e) { result = Mono.error(new RuntimeException("Please check the host URL: " + urlBuilder.setHost(host), e)); } return result; }

Target:
public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { logger.info("Setting host to {}", host); Mono<HttpResponse> result; final UrlBuilder urlBuilder = UrlBuilder.parse(context.getHttpRequest().getUrl()); try { context.getHttpRequest().setUrl(urlBuilder.setHost(host).toURL()); result = next.process(); } catch (MalformedURLException e) { result = Mono.error(new RuntimeException(String.format("Host URL '%s' is invalid.", host), e)); } return result; }
Source:
private void updateUIForOrientation(){ if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { setActionBarVisible(false); findViewById(R.id.course_unit_nav_bar).setVisibility(View.GONE); pager.setPagingEnabled(false); environment.getSegment().trackCourseComponentViewed(selectedUnit.getId(), courseData.getCourse().getId()); } else { setActionBarVisible(true); findViewById(R.id.course_unit_nav_bar).setVisibility(View.VISIBLE); pager.setPagingEnabled(true); environment.getSegment().trackCourseComponentViewed(selectedUnit.getId(), courseData.getCourse().getId()); } }

Target:
private void updateUIForOrientation(){ if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { setActionBarVisible(false); findViewById(R.id.course_unit_nav_bar).setVisibility(View.GONE); pager.setPagingEnabled(false); } else { setActionBarVisible(true); findViewById(R.id.course_unit_nav_bar).setVisibility(View.VISIBLE); pager.setPagingEnabled(true); } }
Source:
private SSESpecification getSseSpecFromConfig() { final SSESpecification sseSpecification = new SSESpecification(); sseSpecification.setEnabled(conf.getBoolean(S3GUARD_DDB_TABLE_SSE_ENABLED, false)); String cmk = conf.get(S3GUARD_DDB_TABLE_SSE_CMK); if (cmk != null) { if (cmk.equals("alias/aws/dynamodb")) { LOG.warn("Ignoring default DynamoDB table KMS Master Key alias/aws/dynamodb in configuration"); } else { sseSpecification.setSSEType("KMS"); sseSpecification.setKMSMasterKeyId(cmk); } } return sseSpecification; }

Target:
private SSESpecification getSseSpecFromConfig() { final SSESpecification sseSpecification = new SSESpecification(); boolean enabled = conf.getBoolean(S3GUARD_DDB_TABLE_SSE_ENABLED, false); if (!enabled) { return sseSpecification; } sseSpecification.setEnabled(Boolean.TRUE); String cmk = null; try { cmk = lookupPassword("", conf, S3GUARD_DDB_TABLE_SSE_CMK); } catch (IOException e) { LOG.error("Cannot retrieve " + S3GUARD_DDB_TABLE_SSE_CMK, e); } if (isEmpty(cmk)) { return sseSpecification; } if (SSE_DEFAULT_MASTER_KEY.equals(cmk)) { LOG.warn("Ignoring default DynamoDB table KMS Master Key {}", SSE_DEFAULT_MASTER_KEY); } else { sseSpecification.setSSEType("KMS"); sseSpecification.setKMSMasterKeyId(cmk); } return sseSpecification; }
Source:
ConsoleLogger() { _domains.addAll(EnumSet.allOf(LogDomain.class)); }

Target:
ConsoleLogger() { }
Source:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.mark_all_as_read: new AlertDialog.Builder(getActivity()) .setMessage(R.string.mark_all_as_read_question) .setPositiveButton(R.string.mark_all_as_read, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { new MarkReadTask(null, null).schedule(); } }) .setNegativeButton(R.string.cancel, null) .show(); return true; case R.id.notification_filter_unread: mAll = false; mParticipating = false; item.setChecked(true); reloadNotification(); return true; case R.id.notification_filter_all: mAll = true; mParticipating = false; item.setChecked(true); reloadNotification(); return true; case R.id.notification_filter_participating: mAll = false; mParticipating = true; item.setChecked(true); reloadNotification(); return true; } return super.onOptionsItemSelected(item); }

Target:
public boolean onOptionsItemSelected(MenuItem item) { int itemId = item.getItemId(); switch (itemId) { case R.id.mark_all_as_read: new AlertDialog.Builder(getActivity()) .setMessage(R.string.mark_all_as_read_question) .setPositiveButton(R.string.mark_all_as_read, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { new MarkReadTask(null, null).schedule(); } }) .setNegativeButton(R.string.cancel, null) .show(); return true; case R.id.notification_filter_unread: case R.id.notification_filter_all: case R.id.notification_filter_participating: mAll = itemId == R.id.notification_filter_all; mParticipating = itemId == R.id.notification_filter_participating; item.setChecked(true); reloadNotification(); return true; } return super.onOptionsItemSelected(item); }
Source:
private static void deleteRosFiles() throws IOException { File rosFiles = new File(InstrumentationRegistry.getContext().getFilesDir(),"realm-object-server"); if (rosFiles.isDirectory()) { deleteFile(rosFiles); } }

Target:
private static void deleteRosFiles() throws IOException { File rosFiles = new File(InstrumentationRegistry.getContext().getFilesDir(),"realm-object-server"); deleteFile(rosFiles); }
Source:
public void testSuccessfulResponseWithInputVariable() { UserVariable inputVariable = new UserVariable(TEST_INPUTVARIABLE, TEST_URL); FormulaElement formulaElement = new FormulaElement( FormulaElement.ElementType.USER_VARIABLE, inputVariable.getName(), null); final String responseString = "Response"; Formula formula = Mockito.spy(new Formula(formulaElement)); testSprite.addUserVariable(userVariable); testSprite.addUserVariable(inputVariable); WebRequestAction action = (WebRequestAction) testSprite.getActionFactory().createWebRequestAction( testSprite, formula, userVariable ); action.setWebConnectionFactory(webConnectionFactory); when(StageActivity.stageListener.webConnectionHolder.addConnection(any())).thenReturn(true); try { doAnswer(invocation -> { Sprite sprite = invocation.getArgument(0); return String.valueOf(sprite.getUserVariable(TEST_INPUTVARIABLE).getValue()); }).when(formula).interpretString(any(Sprite.class)); } catch (InterpretationException e) { fail("Formula could not be interpreted"); return; } doAnswer(invocation -> { String url = invocation.getArgument(0); assertEquals(url, TEST_URL); return webConnection; }).when(webConnectionFactory).createWebConnection(anyString(), any()); doAnswer(invocation -> { action.onRequestFinished(responseString); return null; }).when(webConnection).sendWebRequest(); assertTrue(action.act(0f)); assertEquals(responseString, userVariable.getValue()); }

Target:
public void testSuccessfulResponseWithInputVariable() throws InterpretationException { WebRequestAction action = setupTestSuccessfulResponseWithInputVariable(); assertTrue(action.act(0f)); }
Source:
public Collection<Resource> getMandatoryResources() { if (currentlyResolvingMandatory) { return new ArrayList<Resource>(currentlyResolving); } return Collections.emptyList(); }

Target:
public Collection<Resource> getMandatoryResources() { if (currentlyResolvingMandatory) { return Collections.unmodifiableList(currentlyResolving); } return Collections.emptyList(); }
Source:
public Predicate<ChangeData> label(String name) throws QueryParseException, OrmException { Set<Account.Id> accounts = null; String splitReviewer[] = name.split("~"); name = splitReviewer[0]; if (splitReviewer.length > 2) { throw new QueryParseException("more than one user specified"); } else if (splitReviewer.length == 2) { accounts = parseAccount(splitReviewer[1]); } return new LabelPredicate(args.changeControlGenericFactory, args.userFactory, args.dbProvider, args.approvalTypes, name, accounts); }

Target:
public Predicate<ChangeData> label(String name) throws QueryParseException, OrmException { Set<Account.Id> accounts = null; AccountGroup.UUID group = null; String splitReviewer[] = name.split(",", 2); name = splitReviewer[0]; if (splitReviewer.length == 2) { PredicateArgs lblArgs = new PredicateArgs(splitReviewer[1]); for (Map.Entry<String, String> pair : lblArgs.keyValue.entrySet()) { log.debug("pair.key={} pair.value={}", pair.getKey(), pair.getValue()); if (pair.getKey().equalsIgnoreCase(ARG_ID_USER)) { accounts = parseAccount(pair.getValue()); } else if (pair.getKey().equalsIgnoreCase(ARG_ID_GROUP)) { group = parseGroup(pair.getValue()).getUUID(); } else { log.error("Invalid argument identifier '{}'", pair.getKey()); throw new QueryParseException( "Invalid argument identifier '" + pair.getKey() + "'"); } } for (String value : lblArgs.positional) { log.debug("positional value = {}", value); if (accounts != null || group != null) { log.error("more than one user/group specified ({})", value); throw new QueryParseException("more than one user/group specified (" + value + ")"); } try { accounts = parseAccount(value); } catch (Exception e) { group = parseGroup(value).getUUID(); } } } return new LabelPredicate(args.projectCache, args.changeControlGenericFactory, args.userFactory, args.dbProvider, name, accounts, group); }
Source:
public IamTokenManager(IamOptions options) { this.apiKey = options.getApiKey(); this.url = (options.getUrl() != null) ? options.getUrl() : "<LINK_0>"; this.userManagedAccessToken = options.getAccessToken(); tokenData = new IamToken(); }

Target:
public IamTokenManager(IamOptions options) { this.apiKey = options.getApiKey(); this.url = (options.getUrl() != null) ? options.getUrl() : DEFAULT_IAM_URL; this.userManagedAccessToken = options.getAccessToken(); tokenData = new IamToken(); }
Source:
public void channelRead0(ChannelHandlerContext ctx, HttpObject obj) throws RestServiceException { if (isOpen()) { logger.trace("Reading on channel {}", ctx.channel()); long currentTime = System.currentTimeMillis(); if (firstMessageReceived.compareAndSet(false, true)) { if (ctx.pipeline().get(SslHandler.class) != null) { nettyMetrics.sslChannelActiveToMessageReceiveTimeInMs.update(currentTime - channelActiveTimeMs); } else { nettyMetrics.channelActiveToMessageReceiveTimeInMs.update(currentTime - channelActiveTimeMs); } } boolean recognized = false; boolean success = true; if (obj instanceof HttpRequest) { recognized = true; success = handleRequest((HttpRequest) obj); } if (success && obj instanceof HttpContent) { recognized = true; success = handleContent((HttpContent) obj); } if (success && !recognized) { logger.warn("Received null/unrecognized HttpObject on channel {}", obj, ctx.channel()); nettyMetrics.unknownHttpObjectError.inc(); if (responseChannel == null || requestContentFullyReceived) { resetState(); } onRequestAborted(new RestServiceException("HttpObject received is null or not of a known type", RestServiceErrorCode.MalformedRequest)); } if (lastChannelReadTime != null) { nettyMetrics.channelReadIntervalInMs.update(currentTime - lastChannelReadTime); logger.trace("Delay between channel reads is ms for channel {}", (currentTime - lastChannelReadTime), ctx.channel()); } lastChannelReadTime = currentTime; } else { logger.debug("Read on channel ignored because it is inactive", ctx.channel()); } }

Target:
public void channelRead0(ChannelHandlerContext ctx, HttpObject obj) throws RestServiceException { if (isOpen()) { logger.trace("Reading on channel {}", ctx.channel()); long currentTime = System.currentTimeMillis(); if (firstMessageReceived.compareAndSet(false, true)) { if (ctx.pipeline().get(SslHandler.class) != null) { nettyMetrics.sslChannelActiveToFirstMessageReceiveTimeInMs.update(currentTime - channelActiveTimeMs); } else { nettyMetrics.channelActiveToFirstMessageReceiveTimeInMs.update(currentTime - channelActiveTimeMs); } } boolean recognized = false; boolean success = true; if (obj instanceof HttpRequest) { recognized = true; success = handleRequest((HttpRequest) obj); } if (success && obj instanceof HttpContent) { recognized = true; success = handleContent((HttpContent) obj); } if (success && !recognized) { logger.warn("Received null/unrecognized HttpObject on channel {}", obj, ctx.channel()); nettyMetrics.unknownHttpObjectError.inc(); if (responseChannel == null || requestContentFullyReceived) { resetState(); } onRequestAborted(new RestServiceException("HttpObject received is null or not of a known type", RestServiceErrorCode.MalformedRequest)); } if (lastChannelReadTime != null) { nettyMetrics.channelReadIntervalInMs.update(currentTime - lastChannelReadTime); logger.trace("Delay between channel reads is ms for channel {}", (currentTime - lastChannelReadTime), ctx.channel()); } lastChannelReadTime = currentTime; } else { logger.debug("Read on channel ignored because it is inactive", ctx.channel()); } }
Source:
private void lockOtherVmNodes() { for (VNodeModel nodeModel : getUnassignedNumaNodes()) { if (!nodeModel.getVm().getId().equals(vm.getId())) { nodeModel.setLocked(true); } } for (Set<VNodeModel> list : assignedNumaNodes.values()) { for (VNodeModel nodeModel : list) { if (!nodeModel.getVm().getId().equals(vm.getId())) { nodeModel.setLocked(true); } } } }

Target:
private void lockOtherVmNodes() { for (VNodeModel nodeModel : getUnassignedNumaNodes()) { if (!nodeModel.getVm().getId().equals(vm.getId())) { nodeModel.setLocked(true); } } for (Set<VNodeModel> nodeModelSet : assignedNumaNodes.values()) { for (VNodeModel nodeModel : nodeModelSet) { if (!nodeModel.getVm().getId().equals(vm.getId())) { nodeModel.setLocked(true); } } } }
Source:
public void test_var_in_parameter_in_lambda() throws JavaModelException { this.workingCopies = new ICompilationUnit[1]; this.workingCopies[0] = getWorkingCopy( "/Completion/src/test/X.java", "package test;\n" + "public class X {\n" + " public static void main(String[] args) { \n" + " I lambda = (va ) -> {}; \n" + " lambda.apply(10); \n" + " }\n" + " }\n" + "interface I {\n" + "void apply(Integer a); \n" + "}\n"); CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); requestor.allowAllRequiredProposals(); String str = this.workingCopies[0].getSource(); String completeBehind = "(va"; int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); System.out.println("requestor.getResults()=\n"+requestor.getResults()); assertResults( "var[KEYWORD]{var, null, null, var, null, 49}", requestor.getResults()); }

Target:
public void test_var_in_parameter_in_lambda() throws JavaModelException { this.workingCopies = new ICompilationUnit[1]; this.workingCopies[0] = getWorkingCopy( "/Completion/src/test/X.java", "package test;\n" + "public class X {\n" + " public static void main(String[] args) { \n" + " I lambda = (va ) -> {}; \n" + " lambda.apply(10); \n" + " }\n" + " }\n" + "interface I {\n" + "void apply(Integer a); \n" + "}\n"); CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); requestor.allowAllRequiredProposals(); String str = this.workingCopies[0].getSource(); String completeBehind = "(va"; int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); assertResults( "var[KEYWORD]{var, null, null, var, null, 49}", requestor.getResults()); }
Source:
protected static InputStream openResource(String path) { if (path.startsWith("splunk_search:")) { path = path.substring("splunk_search:".length()); String[] pathComponents = path.split("/"); String searchType = pathComponents[0]; String outputMode = pathComponents[1]; String search = pathComponents[2]; Args resultsArgs = new Args("output_mode", outputMode); if (searchType.equals("blocking")) { Job job = service.getJobs().create( search, new Args("exec_mode", "blocking")); return job.getResults(resultsArgs); } else if (searchType.equals("oneshot")) { return service.oneshotSearch(search, resultsArgs); } else { throw new IllegalArgumentException( "Unrecognized search type: " + searchType); } } InputStream input = PathPlaceHolder.class.getResourceAsStream(path); assertNotNull("Could not open " + path, input); return input; }

Target:
protected static InputStream openResource(String path) { if (path.startsWith("splunk_search:")) { path = path.substring("splunk_search:".length()); String[] pathComponents = path.split("/"); String searchType = pathComponents[0]; String outputMode = pathComponents[1]; String search = pathComponents[2]; Args resultsArgs = new Args("output_mode", outputMode); if (searchType.equals("blocking")) { Job job = service.getJobs().create( search, new Args("exec_mode", "blocking")); return job.getResults(resultsArgs); } else if (searchType.equals("oneshot")) { return service.oneshotSearch(search, resultsArgs); } else { throw new IllegalArgumentException( "Unrecognized search type: " + searchType); } } InputStream input = ResourceRoot.class.getResourceAsStream(path); assertNotNull("Could not open " + path, input); return input; }
Source:
protected Object singleWriteResponse(InvocationContext ctx, DataWriteCommand cmd, Object returnValue) { BiasManager.Revocation revocation; if (!cmd.isSuccessful() || (revocation = biasManager.startRevokingRemoteBias(cmd.getKey(), ctx.getOrigin())) == null) { return returnValue; } else if (revocation.shouldRevoke()) { Address[] waitFor = revocation.biased().toArray(new Address[revocation.biased().size()]); sendRevokeBias(revocation.biased(), Collections.singleton(cmd.getKey()), cmd.getTopologyId(), cmd.getCommandInvocationId()) .whenComplete(revocation); return new BiasRevocationResponse(returnValue, waitFor); } else { return asyncValue(revocation.handleCompose(() -> { Object response = singleWriteResponse(ctx, cmd, returnValue); if (response == null) { return null; } else if (response instanceof InvocationStage) { return ((InvocationStage) response).toCompletableFuture(); } else { return CompletableFuture.completedFuture(response); } })); } }

Target:
protected Object singleWriteResponse(InvocationContext ctx, DataWriteCommand cmd, Object returnValue) { BiasManager.Revocation revocation; if (!cmd.isSuccessful() || (revocation = biasManager.startRevokingRemoteBias(cmd.getKey(), ctx.getOrigin())) == null) { return returnValue; } else if (revocation.shouldRevoke()) { Address[] waitFor = revocation.biased().toArray(new Address[revocation.biased().size()]); sendRevokeBias(revocation.biased(), Collections.singleton(cmd.getKey()), cmd.getTopologyId(), cmd.getCommandInvocationId()) .whenComplete(revocation); return new BiasRevocationResponse(returnValue, waitFor); } else { return asyncValue(revocation.toCompletionStage()).andHandle(ctx, cmd, (rCtx, rCommand, rv, throwable) -> singleWriteResponse(rCtx, (DataWriteCommand) rCommand, returnValue)); } }
Source:
public DeltaBinaryPackingValuesWriter(int blockSizeInValues, int miniBlockNum, int slabSize, int pageSize, ByteBufferAllocator allocator) { this.config = new DeltaBinaryPackingConfig(blockSizeInValues, miniBlockNum); bitWidths = new int[config.miniBlockNumInABlock]; deltaBlockBuffer = new int[blockSizeInValues]; miniBlockByteBuffer = new byte[config.miniBlockSizeInValues * MAX_BITWIDTH]; this.allocator = allocator; baos = new CapacityByteArrayOutputStream(slabSize, pageSize, this.allocator); }

Target:
public DeltaBinaryPackingValuesWriter(int blockSizeInValues, int miniBlockNum, int slabSize, int pageSize, ByteBufferAllocator allocator) { this.config = new DeltaBinaryPackingConfig(blockSizeInValues, miniBlockNum); bitWidths = new int[config.miniBlockNumInABlock]; deltaBlockBuffer = new int[blockSizeInValues]; miniBlockByteBuffer = new byte[config.miniBlockSizeInValues * MAX_BITWIDTH]; baos = new CapacityByteArrayOutputStream(slabSize, pageSize, allocator); }
Source:
public ParseResult filter(Content content, ParseResult parseResult, HTMLMetaTags metaTags, DocumentFragment doc) { Parse parse = parseResult.get(content.getUrl()); String url = content.getBaseUrl(); ArrayList<Outlink> tempOutlinks = new ArrayList<Outlink>(); String title = parse.getData().getTitle(); ParseStatus status = parse.getData().getStatus(); String text = parse.getText(); if (!filterParse(text)) { LOG.info("ModelURLFilter: Page found irrelevent:: " + url); LOG.info("Checking outlinks"); Outlink[] out = null; for (int i = 0; i < parse.getData().getOutlinks().length; i++) { LOG.info("ModelURLFilter: Outlink to check:: " + parse.getData().getOutlinks()[i].getToUrl()); if (filterUrl(parse.getData().getOutlinks()[i].getToUrl())) { tempOutlinks.add(parse.getData().getOutlinks()[i]); LOG.info("ModelURLFilter: found relevent"); } else { LOG.info("ModelURLFilter: found irrelevent"); } } out = new Outlink[tempOutlinks.size()]; for (int i = 0; i < tempOutlinks.size(); i++) { out[i] = tempOutlinks.get(i); } ParseData parseData = new ParseData(status, title, out, parse.getData() .getContentMeta(), parse.getData().getParseMeta()); parseResult.put(content.getUrl(), new ParseText(text), parseData); } else { LOG.info("ModelURLFilter: Page found relevent:: " + url); } return parseResult; }

Target:
public ParseResult filter(Content content, ParseResult parseResult, HTMLMetaTags metaTags, DocumentFragment doc) { Parse parse = parseResult.get(content.getUrl()); String url = content.getBaseUrl(); ArrayList<Outlink> tempOutlinks = new ArrayList<Outlink>(); String text = parse.getText(); if (!filterParse(text)) { LOG.info("HtmlParseFilter: NaiveBayes: Page found irrelevent:: " + url); LOG.info("Checking outlinks"); Outlink[] out = null; for (int i = 0; i < parse.getData().getOutlinks().length; i++) { LOG.info("HtmlParseFilter: NaiveBayes: Outlink to check:: " + parse.getData().getOutlinks()[i].getToUrl()); if (filterUrl(parse.getData().getOutlinks()[i].getToUrl())) { tempOutlinks.add(parse.getData().getOutlinks()[i]); LOG.info("HtmlParseFilter: NaiveBayes: found relevent"); } else { LOG.info("HtmlParseFilter: NaiveBayes: found irrelevent"); } } out = new Outlink[tempOutlinks.size()]; for (int i = 0; i < tempOutlinks.size(); i++) { out[i] = tempOutlinks.get(i); } parse.getData().setOutlinks(out); } else { LOG.info("HtmlParseFilter: NaiveBayes: Page found relevent:: " + url); } return parseResult; }
Source:
private static MethodNode createMethod(final int access, final String name, final String descriptor) { final MethodNode m = new MethodNode(InstrSupport.ASM_API_VERSION, access, name, descriptor, null, null); m.visitVarInsn(Opcodes.ILOAD, 2); m.visitInsn(Opcodes.ICONST_1); m.visitInsn(Opcodes.IAND); final Label label = new Label(); m.visitJumpInsn(Opcodes.IFEQ, label); m.visitLdcInsn(42); m.visitVarInsn(Opcodes.ISTORE, 1); m.visitLabel(label); m.visitVarInsn(Opcodes.ALOAD, 0); m.visitVarInsn(Opcodes.ILOAD, 1); m.visitMethodInsn(Opcodes.INVOKESPECIAL, "Target", "origin", "(I)V", false); m.visitInsn(Opcodes.RETURN); return m; }

Target:
private static MethodNode createMethod(final int access, final String name, final String descriptor) { final MethodNode m = new MethodNode(InstrSupport.ASM_API_VERSION, access, name, descriptor, null, null); m.visitVarInsn(Opcodes.ILOAD, 2); m.visitInsn(Opcodes.ICONST_1); m.visitInsn(Opcodes.IAND); final Label label = new Label(); m.visitJumpInsn(Opcodes.IFEQ, label); m.visitLdcInsn(Integer.valueOf(42)); m.visitVarInsn(Opcodes.ISTORE, 1); m.visitLabel(label); m.visitVarInsn(Opcodes.ALOAD, 0); m.visitVarInsn(Opcodes.ILOAD, 1); m.visitMethodInsn(Opcodes.INVOKESPECIAL, "Target", "origin", "(I)V", false); m.visitInsn(Opcodes.RETURN); return m; }
Source:
public void setClockConfiguration(final DeviceMessageMetadata deviceMessageMetadata, final SetClockConfigurationRequestData setClockConfigurationRequest) throws FunctionalException { LOGGER.info("setClockConfiguration for organisationIdentification: for deviceIdentification: {}", deviceMessageMetadata.getOrganisationIdentification(), deviceMessageMetadata.getDeviceIdentification()); final SmartMeter smartMeteringDevice = this.domainHelperService .findSmartMeter(deviceMessageMetadata.getDeviceIdentification()); final SetClockConfigurationRequestDto keySetDto = this.configurationMapper.map(setClockConfigurationRequest, SetClockConfigurationRequestDto.class); this.osgpCoreRequestMessageSender.send( new RequestMessage(deviceMessageMetadata.getCorrelationUid(), deviceMessageMetadata.getOrganisationIdentification(), deviceMessageMetadata.getDeviceIdentification(), smartMeteringDevice.getIpAddress(), keySetDto), deviceMessageMetadata.getMessageType(), deviceMessageMetadata.getMessagePriority(), deviceMessageMetadata.getScheduleTime()); }

Target:
public void setClockConfiguration(final DeviceMessageMetadata deviceMessageMetadata, final SetClockConfigurationRequestData setClockConfigurationRequest) throws FunctionalException { LOGGER.info("setClockConfiguration for organisationIdentification: for deviceIdentification: {}", deviceMessageMetadata.getOrganisationIdentification(), deviceMessageMetadata.getDeviceIdentification()); final SmartMeter smartMeteringDevice = this.domainHelperService .findSmartMeter(deviceMessageMetadata.getDeviceIdentification()); final SetClockConfigurationRequestDto setClockConfigurationRequestDto = this.configurationMapper.map(setClockConfigurationRequest, SetClockConfigurationRequestDto.class); this.osgpCoreRequestMessageSender.send( new RequestMessage(deviceMessageMetadata.getCorrelationUid(), deviceMessageMetadata.getOrganisationIdentification(), deviceMessageMetadata.getDeviceIdentification(), smartMeteringDevice.getIpAddress(), setClockConfigurationRequestDto), deviceMessageMetadata.getMessageType(), deviceMessageMetadata.getMessagePriority(), deviceMessageMetadata.getScheduleTime()); }
Source:
private BatchWriter createBatchWriter(String table) throws TableNotFoundException { BatchWriterConfig bwc = new BatchWriterConfig(); bwc.setMaxLatency( Long.parseLong(getProperties() .getProperty("accumulo.batchWriterMaxLatency", "30000")), TimeUnit.MILLISECONDS); bwc.setMaxMemory(Long.parseLong( getProperties().getProperty("accumulo.batchWriterSize", "100000"))); final String numThreadsValue = getProperties().getProperty("accumulo.batchWriterThreads"); int numThreads = Math.max(1, Runtime.getRuntime().availableProcessors() / 2); if (null != numThreadsValue) { numThreads = Integer.parseInt(numThreadsValue); } System.out.println("Using " + numThreads + " threads to write data"); bwc.setMaxWriteThreads(numThreads); return connector.createBatchWriter(table, bwc); }

Target:
private BatchWriter createBatchWriter(String table) throws TableNotFoundException { BatchWriterConfig bwc = new BatchWriterConfig(); bwc.setMaxLatency( Long.parseLong(getProperties() .getProperty("accumulo.batchWriterMaxLatency", "30000")), TimeUnit.MILLISECONDS); bwc.setMaxMemory(Long.parseLong( getProperties().getProperty("accumulo.batchWriterSize", "100000"))); final String numThreadsValue = getProperties().getProperty("accumulo.batchWriterThreads"); int numThreads = Math.max(1, Runtime.getRuntime().availableProcessors() / 2); if (null != numThreadsValue) { numThreads = Integer.parseInt(numThreadsValue); } System.err.println("Using " + numThreads + " threads to write data"); bwc.setMaxWriteThreads(numThreads); return connector.createBatchWriter(table, bwc); }
Source:
public void processRow(ResultSet rs) { try { Long municipalityId = rs.getLong(MUNICIPALITY_ID_COLUMN_NAMER); HashableEntity<Court> courtId = new HashableEntity<Court>(Court.class,rs.getLong(CourtDAO.COURT_ID_COLUMN_NAME)); if(municipalityMap.containsKey(municipalityId)) { municipalityMap.get(municipalityId).courts.add(courtId); } else { Municipality municipality = new Municipality(); municipality.id = new HashableEntity<Municipality>(Municipality.class,municipalityId); municipality.name = rs.getString(MUNICIPALITY_NAME_COLUMN_NAMER); municipality.courts = Lists.newArrayList(courtId); municipality.isSupported = (rs.getString("citation_datasource_id") != null)?true:false; municipalityMap.put(municipalityId, municipality); } } catch (Exception e) { LogSystem.LogDBException(e); } }

Target:
public void processRow(ResultSet rs) { try { Long municipalityId = rs.getLong(MUNICIPALITY_ID_COLUMN_NAMER); HashableEntity<Court> courtId = new HashableEntity<Court>(Court.class,rs.getLong(CourtDAO.COURT_ID_COLUMN_NAME)); if(municipalityMap.containsKey(municipalityId)) { municipalityMap.get(municipalityId).courts.add(courtId); } else { Municipality municipality = new Municipality(); municipality.id = new HashableEntity<Municipality>(Municipality.class,municipalityId); municipality.name = rs.getString(MUNICIPALITY_NAME_COLUMN_NAMER); municipality.courts = Lists.newArrayList(courtId); municipality.isSupported = rs.getString("citation_datasource_id") != null; municipalityMap.put(municipalityId, municipality); } } catch (Exception e) { LogSystem.LogDBException(e); } }
Source:
public TextArgs add(Object arg) { if (positionedArgsBuilder == null) { throw new IllegalArgumentException("Positioned arguments were already accessed, to add" + "more arguments use TextArgs.copy()"); } positionedArgsBuilder.add(arg); return this; }

Target:
public TextArgs add(Object arg) { return new TextArgs( ImmutableList.builder().addAll(positionedArgs).add(arg).build(), namedArgs ); }
Source:
private void updateLastKnownSequence(long seq) { if (seq > lastKnownSequence) { lastKnownSequence = seq; } }

Target:
private void updateLastKnownSequence(long seq) { lastKnownSequence.accumulateAndGet(seq, Long::max); }
Source:
private XSiteReplicateCommand buildRemoveCommand(CleanupTask cleanupTask) { Object key = cleanupTask.key; IracMetadata metadata = iracVersionGenerator.getTombstone(key); if (metadata == null) { return null; } cleanupTask.tombstone = metadata; return commandsFactory.buildIracUpdateKeyCommand(key, null, null, metadata); }

Target:
private XSiteReplicateCommand buildRemoveCommand(CleanupTask cleanupTask) { Object key = cleanupTask.key; IracMetadata metadata = iracVersionGenerator.getTombstone(key); if (metadata == null) { return null; } cleanupTask.tombstone = metadata; return commandsFactory.buildIracRemoveKeyCommand(key, metadata); }
Source:
public DatasetDescriptor update(String namespace, String name, DatasetDescriptor descriptor) { Preconditions.checkArgument(DEFAULT_NAMESPACE.equals(namespace), "Non-default namespaces are not supported"); Preconditions.checkNotNull(name, "Dataset name cannot be null"); Preconditions.checkNotNull(descriptor, "Descriptor cannot be null"); Compatibility.checkAndWarn( namespace, HBaseMetadataProvider.getTableName(name), descriptor.getSchema()); Preconditions.checkArgument(descriptor.isColumnMapped(), "Cannot update dataset %s: missing column mapping", name); String tableName = getTableName(name); String entityName = getEntityName(name); schemaManager.refreshManagedSchemaCache(tableName, entityName); Schema newSchema = getEmbeddedSchema(descriptor); String schemaString = newSchema.toString(true); EntitySchema entitySchema = new AvroEntitySchema( newSchema, schemaString, descriptor.getColumnMapping()); if (!schemaManager.hasSchemaVersion(tableName, entityName, entitySchema)) { schemaManager.migrateSchema(tableName, entityName, schemaString); } else { LOG.info("Schema hasn't changed, not migrating: (" + name + ")"); } Map<String, String> properties = getProperties(descriptor); schemaManager.setProperties(tableName, entityName, properties); return getDatasetDescriptor(newSchema, descriptor.getLocation()); }

Target:
public DatasetDescriptor update(String namespace, String name, DatasetDescriptor descriptor) { Preconditions.checkArgument(DEFAULT_NAMESPACE.equals(namespace), "Non-default namespaces are not supported"); Preconditions.checkNotNull(name, "Dataset name cannot be null"); Preconditions.checkNotNull(descriptor, "Descriptor cannot be null"); Compatibility.checkAndWarn( namespace, HBaseMetadataProvider.getTableName(name), descriptor.getSchema()); Preconditions.checkArgument(descriptor.isColumnMapped(), "Cannot update dataset %s: missing column mapping", name); String tableName = getTableName(name); String entityName = getEntityName(name); schemaManager.refreshManagedSchemaCache(tableName, entityName); Schema newSchema = getEmbeddedSchema(descriptor); String schemaString = newSchema.toString(true); EntitySchema entitySchema = new AvroEntitySchema( newSchema, schemaString, descriptor.getColumnMapping()); if (!schemaManager.hasSchemaVersion(tableName, entityName, entitySchema)) { schemaManager.migrateSchema(tableName, entityName, schemaString); } else { LOG.info("Schema hasn't changed, not migrating: (" + name + ")"); } return getDatasetDescriptor(newSchema, descriptor.getLocation()); }
Source:
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String dir = null; while (dir == null) { String status = null; while (status == null) { System.out.print("Enter r/b/a for release/beta or alpha quality:\t"); String q = in.readLine(); if (q.equalsIgnoreCase("r")) { status = ""; } else if (q.equalsIgnoreCase("b")) { status = "_beta"; } else if (q.equalsIgnoreCase("a")) { status = "_alpha"; } } System.out.print("Enter add-on package name:\t"); dir = "../zap-extensions" + status + "/src/org/zaproxy/zap/extension/" + in.readLine(); if (! new File(dir).isDirectory()) { System.out.println("dir is not a directory :("); dir = null; } } System.out.print("Enter the add-n 'friendly' name:\t"); String name = in.readLine(); System.out.print("Enter icon name (eg example.png) or just return for no icon:\t"); String icon = in.readLine(); if (icon.length() == 0) { icon = null; } System.out.print("Enter a one line summary of the add-on:\t"); String intro = in.readLine(); generateHelp( new File(dir), name, icon, intro); }

Target:
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String dir = null; do { String status = null; do { System.out.print("Enter r/b/a for release/beta or alpha quality:\t"); String q = in.readLine(); if (q.equalsIgnoreCase("r")) { status = ""; } else if (q.equalsIgnoreCase("b")) { status = "_beta"; } else if (q.equalsIgnoreCase("a")) { status = "_alpha"; } } while (status == null); System.out.print("Enter add-on package name:\t"); dir = "../zap-extensions" + status + "/src/org/zaproxy/zap/extension/" + in.readLine(); if (! new File(dir).isDirectory()) { System.out.println("dir is not a directory :( " + new File(dir).getAbsolutePath()); dir = null; } } while (dir == null); System.out.print("Enter the add-on 'friendly' name:\t"); String name = in.readLine(); System.out.print("Enter icon name (eg example.png) or just return for no icon:\t"); String icon = in.readLine(); if (icon.length() == 0) { icon = null; } System.out.print("Enter a one line summary of the add-on:\t"); String intro = in.readLine(); generateHelp( new File(dir), name, icon, intro); }
Source:
public void generatesPlainSnippet() { Step step = new Step(Collections.<Comment>emptyList(), "Given ", "I have 4 cukes in my \"big\" belly", 0, null, null); String snippet = new SnippetGenerator(new ClojureSnippet()).getSnippet(step); String expected = "" + "(Given #\"^I have (\\d+) cukes in my \"([^\"]*)\" belly$\" [arg1, arg2]\n" + <<<<<<< HEAD " (comment Express the Regexp above with the code you wish you had ))\n"; assertEquals(expected, snippet); }

Target:
public void generatesPlainSnippet() { Step step = new Step(Collections.<Comment>emptyList(), "Given ", "I have 4 cukes in my \"big\" belly", 0, null, null); String snippet = new SnippetGenerator(new ClojureSnippet()).getSnippet(step); String expected = "" + "(Given #\"^I have (\\d+) cukes in my \"([^\"]*)\" belly$\" [arg1, arg2]\n" + " (comment Express the Regexp above with the code you wish you had ))\n"; assertEquals(expected, snippet); }
Source:
public Optional getCarrier() { return Optional.empty(); }

Target:
public Optional<Carrier> getCarrier() { return Optional.ofNullable(this.carrier); }
Source:
public String getChartType() { return "png"; }

Target:
public ImageType getChartType() { return ImageType.png; }
Source:
protected void replay(long windowId) throws SQLException { isReplayed = true; MutablePair<String, String> recoveredData = new MutablePair<String, String>(); try { recoveredData = (MutablePair<String, String>)windowManager.load(operatorId, windowId); if (recoveredData != null) { if (recoveredData.left == null || recoveredData.right == null) { return; } if (recoveredData.right.equals(rangeQueryPair.getValue()) || recoveredData.right.equals(previousUpperBound)) { LOG.info("Matched so returning"); return; } JdbcPollInputOperator jdbcPoller = new JdbcPollInputOperator(); jdbcPoller.setStore(store); jdbcPoller.setKey(getKey()); jdbcPoller.setPartitionCount(getPartitionCount()); jdbcPoller.setPollInterval(50); jdbcPoller.setTableName(getTableName()); jdbcPoller.setBatchSize(getBatchSize()); isPollable = false; LOG.debug("[Window ID -" + windowId + "," + recoveredData.left + "," + recoveredData.right + "]"); jdbcPoller.setRangeQueryPair(new KeyValPair<String, String>(recoveredData.left, recoveredData.right)); jdbcPoller.ps = jdbcPoller.store.getConnection().prepareStatement( JdbcMetaDataUtility.buildRangeQuery(jdbcPoller.getTableName(), jdbcPoller.getKey(), jdbcPoller.getRangeQueryPair().getKey(), jdbcPoller.getRangeQueryPair().getValue()), java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY); LOG.info("Query formed for recovered data -" + jdbcPoller.ps.toString()); emitReplayedTuples(jdbcPoller.ps); } } catch (IOException e) { throw new RuntimeException("replay", e); } }

Target:
protected void replay(long windowId) throws SQLException { isReplayed = true; MutablePair<String, String> recoveredData = new MutablePair<String, String>(); try { recoveredData = (MutablePair<String, String>)windowManager.load(operatorId, windowId); if (recoveredData != null) { if (recoveredData.left == null || recoveredData.right == null) { return; } if (recoveredData.right.equals(rangeQueryPair.getValue()) || recoveredData.right.equals(previousUpperBound)) { LOG.info("Matched so returning"); return; } JdbcPollInputOperator jdbcPoller = new JdbcPollInputOperator(); jdbcPoller.setStore(store); jdbcPoller.setKey(getKey()); jdbcPoller.setPartitionCount(getPartitionCount()); jdbcPoller.setPollInterval(getPollInterval()); jdbcPoller.setTableName(getTableName()); jdbcPoller.setBatchSize(getBatchSize()); isPollable = false; LOG.debug("[Window ID -" + windowId + "," + recoveredData.left + "," + recoveredData.right + "]"); jdbcPoller.setRangeQueryPair(new KeyValPair<String, String>(recoveredData.left, recoveredData.right)); jdbcPoller.ps = jdbcPoller.store.getConnection().prepareStatement( JdbcMetaDataUtility.buildRangeQuery(jdbcPoller.getTableName(), jdbcPoller.getKey(), jdbcPoller.getRangeQueryPair().getKey(), jdbcPoller.getRangeQueryPair().getValue()), java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY); LOG.info("Query formed for recovered data - {}", jdbcPoller.ps.toString()); emitReplayedTuples(jdbcPoller.ps); } } catch (IOException e) { throw new RuntimeException("replay", e); } }
Source:
private void initTestForPool(StoragePool pool, List<Guid> vmGuids, List<Guid> templatesGuids, List<Guid> removedGuids) { Guid poolId = pool.getId(); doReturn(vmGuids).when(vmAndTemplatesGenerationsDao).getVmsIdsForOvfUpdate(poolId); doReturn(templatesGuids).when(vmAndTemplatesGenerationsDao).getVmTemplatesIdsForOvfUpdate(poolId); doReturn(removedGuids).when(vmAndTemplatesGenerationsDao).getIdsForOvfDeletion(poolId); pool.setStatus(StoragePoolStatus.Up); }

Target:
private void initTestForPool(StoragePool pool, List<Guid> vmGuids, List<Guid> templatesGuids, List<Guid> removedGuids) { Guid poolId = pool.getId(); doReturn(vmGuids).when(vmAndTemplatesGenerationsDao).getVmsIdsForOvfUpdate(poolId); doReturn(templatesGuids).when(vmAndTemplatesGenerationsDao).getVmTemplatesIdsForOvfUpdate(poolId); doReturn(removedGuids).when(vmAndTemplatesGenerationsDao).getIdsForOvfDeletion(poolId); doReturn(Collections.EMPTY_LIST).when(affinityGroupDao).getAllAffinityGroupsByVmId(any()); pool.setStatus(StoragePoolStatus.Up); }
Source:
private <X> ExtendedQueryResult<T> changeOrder(EntityViewDefaultQueryResult.ChangeOrder changeOrder) { lastPaginatedQuery = null; if (!context.getRepositoryMethod().isQuery()) { for (CriteriaBuilderPostProcessor processor : context.getCriteriaBuilderPostProcessors()) { if (processor instanceof OrderByCriteriaBuilderPostProcessor) { OrderByCriteriaBuilderPostProcessor orderBy = (OrderByCriteriaBuilderPostProcessor) processor; if (changeOrder.matches(orderBy)) { orderBy.changeDirection(); return this; } } } } else { for (QueryStringPostProcessor processor : context.getQueryStringPostProcessors()) { if (processor instanceof OrderByQueryStringPostProcessor) { OrderByQueryStringPostProcessor orderBy = (OrderByQueryStringPostProcessor) processor; if (changeOrder.matches(orderBy)) { orderBy.changeDirection(); return this; } } } } changeOrder.addDefault(); return this; }

Target:
private <X> ExtendedQueryResult<T> changeOrder(EntityViewDefaultQueryResult.ChangeOrder changeOrder) { lastPaginatedQuery = null; if (context.getRepositoryMethod().isQuery()) { for (QueryStringPostProcessor processor : context.getQueryStringPostProcessors()) { if (processor instanceof OrderByQueryStringPostProcessor) { OrderByQueryStringPostProcessor orderBy = (OrderByQueryStringPostProcessor) processor; if (changeOrder.matches(orderBy)) { orderBy.changeDirection(); return this; } } } } else { for (CriteriaBuilderPostProcessor processor : context.getCriteriaBuilderPostProcessors()) { if (processor instanceof OrderByCriteriaBuilderPostProcessor) { OrderByCriteriaBuilderPostProcessor orderBy = (OrderByCriteriaBuilderPostProcessor) processor; if (changeOrder.matches(orderBy)) { orderBy.changeDirection(); return this; } } } } changeOrder.addDefault(); return this; }
Source:
AllureGenerateResult generate(Path sourceDir, Path targetDir) { try { forceMkdir(targetDir.toFile()); final LinkedList<String> args = new LinkedList<>(asList("generate", "-c", "-o", targetDir.toString(), sourceDir.toString())); String output; if (cmdLine.isUnix() && cmdLine.hasCommand(BASH_CMD)) { args.addFirst(cmdPath.toString()); output = cmdLine.runCommand("/bin/bash", args.toArray(new String[args.size()])); } else { output = cmdLine.runCommand(cmdPath.toString(), args.toArray(new String[args.size()])); } LOGGER.info(output); return cmdLine.parseGenerateOutput(output); } catch (IOException e) { throw new RuntimeException("Failed to generate allure report", e); } }

Target:
AllureGenerateResult generate(Path sourceDir, Path targetDir) { try { final LinkedList<String> args = new LinkedList<>(asList("generate", "-o", targetDir.toString(), sourceDir.toString())); String output; if (cmdLine.isUnix() && cmdLine.hasCommand(BASH_CMD)) { args.addFirst(cmdPath.toString()); output = cmdLine.runCommand("/bin/bash", args.toArray(new String[args.size()])); } else { output = cmdLine.runCommand(cmdPath.toString(), args.toArray(new String[args.size()])); } LOGGER.info(output); return cmdLine.parseGenerateOutput(output); } catch (Exception e) { throw new RuntimeException("Failed to generate allure report", e); } }
Source:
public void emptyStringToSynapseFriendlyName() { assertEquals("", BridgeUtils.toSynapseFriendlyName(" #")); }

Target:
public void emptyStringToSynapseFriendlyName() { BridgeUtils.toSynapseFriendlyName(" #"); }
Source:
public List<String> executeTests() throws MojoExecutionException { JMeterArgumentsArray thisTestArgs = baseTestArgs; List<String> tests = generateTestList(); List<String> results = new ArrayList<String>(); SimpleDateFormat sdf = new SimpleDateFormat(REPORT_DIR_DATE_FORMAT); for (String file : tests) { if(generateReports) { thisTestArgs.setReportsDirectory(reportDirectory+"/"+ FilenameUtils.getBaseName(file)+"_"+ sdf.format(new Date())); } if (remoteServerConfiguration != null) { if ((remoteServerConfiguration.isStartServersBeforeTests() && tests.get(0).equals(file)) || remoteServerConfiguration.isStartAndStopServersForEachTest()) { thisTestArgs.setRemoteStart(); thisTestArgs.setRemoteStartServerList(remoteServerConfiguration.getServerList()); } if ((remoteServerConfiguration.isStopServersAfterTests() && tests.get(tests.size() - 1).equals(file)) || remoteServerConfiguration.isStartAndStopServersForEachTest()) { thisTestArgs.setRemoteStop(); } } results.add(executeSingleTest(new File(testFilesDirectory, file), thisTestArgs)); try { TimeUnit.SECONDS.sleep(postTestPauseInSeconds); } catch (InterruptedException ignored) { } } return results; }

Target:
public List<String> executeTests() throws MojoExecutionException { JMeterArgumentsArray thisTestArgs = baseTestArgs; List<String> tests = generateTestList(); List<String> results = new ArrayList<String>(); DateTimeFormatter sdf = new DateTimeFormatterBuilder().appendPattern(REPORT_DIR_DATE_FORMAT).toFormatter(); for (String file : tests) { if(generateReports) { thisTestArgs.setReportsDirectory(reportDirectory+"/"+ FilenameUtils.getBaseName(file)+"_"+ sdf.print(new DateTime())); } if (remoteServerConfiguration != null) { if ((remoteServerConfiguration.isStartServersBeforeTests() && tests.get(0).equals(file)) || remoteServerConfiguration.isStartAndStopServersForEachTest()) { thisTestArgs.setRemoteStart(); thisTestArgs.setRemoteStartServerList(remoteServerConfiguration.getServerList()); } if ((remoteServerConfiguration.isStopServersAfterTests() && tests.get(tests.size() - 1).equals(file)) || remoteServerConfiguration.isStartAndStopServersForEachTest()) { thisTestArgs.setRemoteStop(); } } results.add(executeSingleTest(new File(testFilesDirectory, file), thisTestArgs)); try { TimeUnit.SECONDS.sleep(postTestPauseInSeconds); } catch (InterruptedException ignored) { } } return results; }