auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static RelDataType getMaxPrecisionScaleDecimal(RelDataTypeFactory factory) { int maxPrecision = factory.getTypeSystem().getMaxNumericPrecision(); int maxScale = factory.getTypeSystem().getMaxNumericScale(); while (maxScale >= maxPrecision) { maxScale = maxScale / 2; } return factory.createSqlType(SqlTypeName.DECIMAL, maxPrecision, maxScale); }

Target:
public static RelDataType getMaxPrecisionScaleDecimal(RelDataTypeFactory factory) { int maxPrecision = factory.getTypeSystem().getMaxNumericPrecision(); int scale = maxPrecision / 2; return factory.createSqlType(SqlTypeName.DECIMAL, maxPrecision, scale); }
Source:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { boolean doFilter = false; try { HttpSession httpSession = ((HttpServletRequest) request).getSession(false); if (httpSession != null) { String engineSession = (String) httpSession.getAttribute(FiltersHelper.Constants.HTTP_SESSION_ENGINE_SESSION_ID_KEY); InitialContext ctx = null; if (engineSession != null) { ctx = new InitialContext(); try { VdcQueryReturnValue returnValue = FiltersHelper.getBackend(ctx) .runPublicQuery(VdcQueryType.ValidateSession, new VdcQueryParametersBase(engineSession)); if (!returnValue.getSucceeded()) { httpSession.invalidate(); } } finally { ctx.close(); } } } doFilter = true; } catch (Exception ex) { doFilter = false; String msg = String.format("An error has occurred while session validation. Message is %1$s", ex.getMessage()); log.error(msg); if (log.isDebugEnabled()) { log.debug("", ex); } ((HttpServletResponse) response).sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } if (doFilter) { chain.doFilter(request, response); } }

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { boolean doFilter = false; try { HttpSession httpSession = ((HttpServletRequest) request).getSession(false); if (httpSession != null) { String engineSession = (String) httpSession.getAttribute(FiltersHelper.Constants.HTTP_SESSION_ENGINE_SESSION_ID_KEY); InitialContext ctx = null; if (engineSession != null) { ctx = new InitialContext(); try { VdcQueryReturnValue returnValue = FiltersHelper.getBackend(ctx) .runPublicQuery(VdcQueryType.ValidateSession, new VdcQueryParametersBase(engineSession)); if (!returnValue.getSucceeded()) { httpSession.invalidate(); } } finally { ctx.close(); } } } doFilter = true; } catch (Exception ex) { log.error(String.format("An error has occurred while session validation. Message is %1$s", ex.getMessage())); if (log.isDebugEnabled()) { log.debug("", ex); } ((HttpServletResponse) response).sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } if (doFilter) { chain.doFilter(request, response); } }
Source:
public boolean releaseLease(String leaseId) { try { leaseBlob.releaseLease(AccessCondition.generateLeaseCondition(leaseId)); return true; } catch (StorageException e) { LOG.error("Wasn't able to release lease.", new SamzaException(e)); return false; } }

Target:
public boolean releaseLease(String leaseId) { try { leaseBlob.releaseLease(AccessCondition.generateLeaseCondition(leaseId)); return true; } catch (StorageException storageException) { LOG.error("Wasn't able to release lease with lease id: " + leaseId, storageException); return false; } }
Source:
public void getTokenFromBrowserIDAssertion(final String assertion, final boolean conditionsAccepted, final TokenServerClientDelegate delegate) { final BaseResource r = new BaseResource(uri); r.delegate = new BaseResourceDelegate(r) { @Override public void handleHttpResponse(HttpResponse response) { SkewHandler skewHandler = SkewHandler.getSkewHandlerForResource(r); if (skewHandler != null) { skewHandler.updateSkew(response, System.currentTimeMillis()); } try { TokenServerToken token = processResponse(response); invokeHandleSuccess(delegate, token); } catch (TokenServerException e) { invokeHandleFailure(delegate, e); } } @Override public void handleTransportException(GeneralSecurityException e) { invokeHandleError(delegate, e); } @Override public void handleHttpProtocolException(ClientProtocolException e) { invokeHandleError(delegate, e); } @Override public void handleHttpIOException(IOException e) { invokeHandleError(delegate, e); } @Override public AuthHeaderProvider getAuthHeaderProvider() { return new BrowserIDAuthHeaderProvider(assertion); } @Override public void addHeaders(HttpRequestBase request, DefaultHttpClient client) { String host = request.getURI().getHost(); request.setHeader(new BasicHeader("Host", host)); if (conditionsAccepted) { request.addHeader("X-Conditions-Accepted", "1"); } } }; r.get(); }

Target:
public void getTokenFromBrowserIDAssertion(final String assertion, final boolean conditionsAccepted, final TokenServerClientDelegate delegate) { final BaseResource r = new BaseResource(uri); r.delegate = new BaseResourceDelegate(r) { @Override public void handleHttpResponse(HttpResponse response) { SkewHandler skewHandler = SkewHandler.getSkewHandlerForResource(r); skewHandler.updateSkew(response, System.currentTimeMillis()); try { TokenServerToken token = processResponse(response); invokeHandleSuccess(delegate, token); } catch (TokenServerException e) { invokeHandleFailure(delegate, e); } } @Override public void handleTransportException(GeneralSecurityException e) { invokeHandleError(delegate, e); } @Override public void handleHttpProtocolException(ClientProtocolException e) { invokeHandleError(delegate, e); } @Override public void handleHttpIOException(IOException e) { invokeHandleError(delegate, e); } @Override public AuthHeaderProvider getAuthHeaderProvider() { return new BrowserIDAuthHeaderProvider(assertion); } @Override public void addHeaders(HttpRequestBase request, DefaultHttpClient client) { String host = request.getURI().getHost(); request.setHeader(new BasicHeader("Host", host)); if (conditionsAccepted) { request.addHeader("X-Conditions-Accepted", "1"); } } }; r.get(); }
Source:
private JobPrefixFile(final Path file, final FileChannel channel, final FileLock lock) throws IOException, IllegalStateException { Preconditions.checkNotNull(file); Preconditions.checkNotNull(channel); Preconditions.checkNotNull(lock); this.file = file; this.prefix = file.getFileName().toString(); this.channel = channel; this.lock = lock; }

Target:
private JobPrefixFile(final Path file, final FileChannel channel, final FileLock lock) throws IOException, IllegalStateException { this.file = Preconditions.checkNotNull(file, "file"); this.channel = Preconditions.checkNotNull(channel, "channel"); this.lock = Preconditions.checkNotNull(lock, "lock"); this.prefix = file.getFileName().toString(); }
Source:
public void testDelayTaskCompleted() { final Task<Integer> task = Task.callable(() -> 1234); final Task<Integer> taskWithDelay = task.withDelay(200, TimeUnit.MILLISECONDS); assertEquals(1234, runAndWait(taskWithDelay).intValue()); assertTrue(task.isDone()); assertTrue(taskWithDelay.isDone()); assertFalse(task.isFailed()); assertFalse(taskWithDelay.isFailed()); long taskWithDelayStartTimeMillis = TimeUnit.MILLISECONDS.convert(taskWithDelay.getShallowTrace().getStartNanos(), TimeUnit.NANOSECONDS); long taskStartTimeMillis = TimeUnit.MILLISECONDS.convert(task.getShallowTrace().getStartNanos(), TimeUnit.NANOSECONDS); assertTrue(taskStartTimeMillis - taskWithDelayStartTimeMillis >= 200); }

Target:
public void testDelayTaskCompleted() throws InterruptedException { final Task<Integer> task = Task.callable(() -> 1234); final Task<Integer> taskWithDelay = task.withDelay(1, TimeUnit.SECONDS); getEngine().run(taskWithDelay); taskWithDelay.await(200, TimeUnit.MILLISECONDS); assertFalse(taskWithDelay.isDone()); assertFalse(task.isDone()); taskWithDelay.await(3, TimeUnit.SECONDS); assertTrue(taskWithDelay.isDone()); assertTrue(task.isDone()); assertFalse(task.isFailed()); assertFalse(taskWithDelay.isFailed()); assertEquals(1234, taskWithDelay.get().intValue()); }
Source:
public static Locale parseLocale(final String localeString) { if ((localeString != null) && (localeString.length() != 0)) { final int index = localeString.indexOf("_"); final int index2 = localeString.indexOf("_", index + 1); Locale l; if (index == -1) { l = new Locale(localeString); } else if (index2 == -1) { l = new Locale(localeString.substring(0, index), localeString.substring(index + 1)); } else { l = new Locale(localeString.substring(0, index), localeString.substring(index + 1, index2), localeString.substring(index2 + 1)); } return l; } return null; }

Target:
public static Locale parseLocale(final String localeString) { if ((localeString != null) && (localeString.length() != 0)) { final int index = localeString.indexOf("_"); final int index2 = localeString.indexOf("_", index + 1); Locale resultLocale; if (index == -1) { resultLocale = new Locale(localeString); } else if (index2 == -1) { resultLocale = new Locale(localeString.substring(0, index), localeString.substring(index + 1)); } else { resultLocale = new Locale( localeString.substring(0, index), localeString.substring(index + 1, index2), localeString.substring(index2 + 1)); } return resultLocale; } return null; }
Source:
public List<Property> properties() { List<Property> properties = new ArrayList<>(); if (binaryAnnotations != null) { Set<String> services = new HashSet<>(); for (BinaryAnnotation binaryAnnotation : binaryAnnotations) { Property property = new Property(binaryAnnotation.getKey(), binaryAnnotation.getValue()); Endpoint endpoint = binaryAnnotation.getEndpoint(); if (endpoint != null && !services.contains(endpoint.getServiceName())) { properties.add(new Property("service", endpoint.getServiceName(), PropertyType.Text)); services.add(endpoint.getServiceName()); } properties.add(property); } } return properties; }

Target:
public List<Property> properties() { if (binaryAnnotations == null || binaryAnnotations.isEmpty()) { return Collections.emptyList(); } List<Property> properties = new ArrayList<>(); Set<Endpoint> endpoints = new HashSet<>(); for (BinaryAnnotation binaryAnnotation : binaryAnnotations) { properties.add(new Property(binaryAnnotation.getKey(), binaryAnnotation.getValue(), AnnotationTypeUtil.toPropertyType(binaryAnnotation.getType()))); if (binaryAnnotation.getEndpoint() != null) { Endpoint endpoint = binaryAnnotation.getEndpoint(); if (endpoints.isEmpty()) { properties.add(new Property("service", endpoint.getServiceName())); properties.add(new Property("ipv4", endpoint.getIpv4())); } else if (!endpoints.contains(endpoint)){ log.severe("Multiple Endpoints within one Span: " + endpoint); } endpoints.add(endpoint); } } return properties; }
Source:
private void validateForRequireDrug(Errors errors, DrugOrder order) { boolean requireDrug = Context.getAdministrationService().getGlobalPropertyValue( OpenmrsConstants.GLOBAL_PROPERTY_DRUG_ORDER_REQUIRE_DRUG, false); OrderService orderService = Context.getOrderService(); if (order.isNonCodedDrug()) { if (OpenmrsUtil.nullSafeEquals(orderService.getNonCodedDrugConcept(), order.getConcept())) { ValidationUtils.rejectIfEmpty(errors, "drugNonCoded", "DrugOrder.error.drugNonCodedIsRequired"); } if (order.getDrug() != null) { errors.rejectValue("drug", "DrugOrder.error.onlyOneOfDrugOrNonCodedShouldBeSet"); } } else { if (requireDrug) { ValidationUtils.rejectIfEmpty(errors, "drug", "DrugOrder.error.drugIsRequired"); } if (OpenmrsUtil.nullSafeEquals(orderService.getNonCodedDrugConcept(), order.getConcept())) { errors.rejectValue("concept", "DrugOrder.error.cannotSetBothDrugAndNonCodedDrug"); } } }

Target:
private void validateForRequireDrug(Errors errors, DrugOrder order) { boolean requireDrug = Context.getAdministrationService().getGlobalPropertyValue( OpenmrsConstants.GLOBAL_PROPERTY_DRUG_ORDER_REQUIRE_DRUG, false); OrderService orderService = Context.getOrderService(); if(requireDrug){ if(order.getConcept() != null && OpenmrsUtil.nullSafeEquals(orderService.getNonCodedDrugConcept(), order.getConcept())){ if(order.getDrug() == null && !order.isNonCodedDrug()){ errors.rejectValue("drugNonCoded", "DrugOrder.error.drugNonCodedIsRequired"); } else if(order.getDrug() != null){ errors.rejectValue("concept", "DrugOrder.error.onlyOneOfDrugOrNonCodedShouldBeSet"); } }else{ if(order.getDrug() == null && !order.isNonCodedDrug()){ errors.rejectValue("drug", "DrugOrder.error.drugIsRequired"); } else if(order.getDrug() != null && order.isNonCodedDrug()){ errors.rejectValue("concept", "DrugOrder.error.onlyOneOfDrugOrNonCodedShouldBeSet"); } } } }
Source:
private Task<? extends Serializable> createDbTask(Database dbObj) { CreateDatabaseDesc createDbDesc = new CreateDatabaseDesc(dbObj.getName(), dbObj.getDescription(), null, false, updateDbProps(dbObj, context.dumpDirectory, true)); DDLWork2 work = new DDLWork2(new HashSet<>(), new HashSet<>(), createDbDesc); return TaskFactory.get(work, context.hiveConf); }

Target:
private Task<? extends Serializable> createDbTask(Database dbObj) { CreateDatabaseDesc createDbDesc = new CreateDatabaseDesc(dbObj.getName(), dbObj.getDescription(), null, false, updateDbProps(dbObj, context.dumpDirectory)); DDLWork2 work = new DDLWork2(new HashSet<>(), new HashSet<>(), createDbDesc); return TaskFactory.get(work, context.hiveConf); }
Source:
public void templateClassification_createTemplateAndChangeItsType() { TemplatePage templatePage = new TemplatePage(); TemplateClassification templateClassification = templatePage .createTemplate(this.templateName) .open(this.templateName) .getTemplateClassification(); templateClassification .open() .resetTemplateType() .save(); Assertion.assertTrue(templateName.equals("Unknown"), "Template type was reset"); PageObjectLogging.logInfo("Template type was reset"); templateClassification .open() .changeTemplateType("Infobox") .save(); String templateType = templateClassification.getTemplateType(); Assertion.assertTrue(templateType.equals("Infobox"), "Template type set to Infobox"); PageObjectLogging.logInfo("Template type set to: '" + templateType + "'"); templateClassification .open() .changeTemplateType("Quote") .save(); String oldTemplateType = templateType; String currentTemplateType = templateClassification.getTemplateType(); Assertion.assertFalse(currentTemplateType.equals(oldTemplateType), "Template type did not change"); PageObjectLogging.logInfo( "Template type changed from: '" + oldTemplateType + "', to: '" + currentTemplateType + "'"); }

Target:
public void templateClassification_createTemplateAndChangeItsType() { TemplatePage templatePage = new TemplatePage() .createTemplate(DEFAULT_TEMPLATE_NAME) .open(DEFAULT_TEMPLATE_NAME); TemplateClassification templateClassification = templatePage.getTemplateClassification(); templateClassification .open() .resetTemplateType() .save(); String oldTemplateType = templateClassification.getTemplateType(); Assertion.assertEquals(templateClassification.getTemplateType(), TemplateTypes.UNKNOWN.getType()); templateClassification .open() .changeTemplateType(TemplateTypes.INFOBOX) .save(); Assertion.assertEquals(templateClassification.getTemplateType(), TemplateTypes.INFOBOX.getType()); templateClassification .open() .changeTemplateType(TemplateTypes.QUOTE) .save(); String currentTemplateType = templateClassification.getTemplateType(); Assertion.assertNotEquals(currentTemplateType, oldTemplateType); }
Source:
public boolean deleteAddress() { if (selectedAddress != null) { return loadTestDataService.deleteAddress(selectedAddress); } else { addPatientErrorMessages("Address have to be select to be deleted"); } return false; }

Target:
public boolean deleteAddress() { boolean result = false; if (selectedAddress != null) { result = loadTestDataService.deleteAddress(selectedAddress); } else { addPatientErrorMessages(msgForSelectDelete("address")); } return result; }
Source:
EJBRootContext(final NamingProvider namingProvider, final FastHashtable<String, Object> env) { super(env); this.namingProvider = namingProvider; URI clusterAffinity = getClusterAffinityURIFromEnvironment(); if (clusterAffinity != null) { affinity = Affinity.forUri(clusterAffinity); } else { final URI providerUri = namingProvider == null ? null : namingProvider.getProviderUri(); if (providerUri == null) { affinity = Affinity.NONE; } else { final String scheme = providerUri.getScheme(); if (scheme == null) { affinity = Affinity.NONE; } else { affinity = Affinity.forUri(providerUri); } } } }

Target:
EJBRootContext(final NamingProvider namingProvider, final FastHashtable<String, Object> env) { super(env); this.namingProvider = namingProvider; String clusterName = getClusterAffinityValueFromEnvironment(); if (clusterName != null) { affinity = new ClusterAffinity(clusterName); } else { final URI providerUri = namingProvider == null ? null : namingProvider.getProviderUri(); if (providerUri == null) { affinity = Affinity.NONE; } else { final String scheme = providerUri.getScheme(); if (scheme == null) { affinity = Affinity.NONE; } else { affinity = Affinity.forUri(providerUri); } } } }
Source:
public Plugin create(String id, Plugin plugin) { plugin.setLastModified(System.currentTimeMillis()); Assert.notNull(plugin.getName(), "Plugin name must NOT be null!"); Assert.notNull(plugin.getNamespace(), "Plugin namespace must NOT be null!"); Assert.notNull(plugin.getDescription(), "Plugin description must NOT be null!"); Assert.notNull(plugin.getAuthor(), "Plugin author must NOT be null!"); Assert.notNull(plugin.getVersion(), "Plugin version must NOT be null!"); Assert.notNull(plugin.getDependencies(), "Plugin dependencies must NOT be null!"); Assert.notNull(plugin.getRequiredVersions(), "Plugin requiredVersions must NOT be null!"); Assert.notNull(plugin.getCapabilities(), "Plugin capabilities must NOT be null!"); update(id, plugin); return findById(id); }

Target:
public Plugin create(String id, Plugin plugin) { plugin.setLastModified(System.currentTimeMillis()); try { Objects.requireNonNull(plugin.getName(), "Plugin name must NOT be null!"); Objects.requireNonNull(plugin.getNamespace(), "Plugin namespace must NOT be null!"); Objects.requireNonNull(plugin.getDescription(), "Plugin description must NOT be null!"); Objects.requireNonNull(plugin.getAuthor(), "Plugin author must NOT be null!"); Objects.requireNonNull(plugin.getVersion(), "Plugin version must NOT be null!"); Objects.requireNonNull(plugin.getDependencies(), "Plugin dependencies must NOT be null!"); Objects.requireNonNull( plugin.getRequiredVersions(), "Plugin requiredVersions must NOT be null!"); Objects.requireNonNull(plugin.getCapabilities(), "Plugin capabilities must NOT be null!"); } catch (NullPointerException e) { throw new IllegalArgumentException(e.getMessage(), e); } update(id, plugin); return findById(id); }
Source:
public void run() throws Exception { response = false; MultiMapContainer container = getOrCreateContainerWithoutAccess(); MultiMapValue multiMapValue = container.getMultiMapValueOrNull(dataKey); if (multiMapValue == null) { return; } Collection<MultiMapRecord> coll = multiMapValue.getCollection(false); MultiMapRecord record = new MultiMapRecord(isBinary() ? value : toObject(value)); response = coll.remove(record); }

Target:
public void run() throws Exception { response = false; MultiMapContainer container = getOrCreateContainerWithoutAccess(); MultiMapValue multiMapValue = container.getMultiMapValueOrNull(dataKey); if (multiMapValue == null) { return; } Collection<MultiMapRecord> coll = multiMapValue.getCollection(false); MultiMapRecord record = new MultiMapRecord(isBinary() ? value : toObject(value)); response = coll.remove(record); if (coll.isEmpty()) { container.delete(dataKey); } }
Source:
public void shouldRightProjectionOrElseRightProjection() { final RightProjection<Object, Integer> rightRight = Either.right(1).right(); final RightProjection<Object, Integer> leftRight = Either.<Object, Integer>left(1).right(); final RightProjection<Object, Integer> rightProjection = Either.right(2).right(); assertThat(rightRight.orElse(rightProjection).get()).isEqualTo(1); assertThat(leftRight.orElse(rightProjection).get()).isEqualTo(2); }

Target:
public void shouldRightProjectionOrElseRightProjection() { final RightProjection<Integer, Integer> elseProjection = API.<Integer, Integer>Right(2).right(); assertThat(Right(1).right().orElse(elseProjection).get()).isEqualTo(1); assertThat(Left(1).right().orElse(elseProjection).get()).isEqualTo(2); }
Source:
public BasicLocationDefinition(String id, String name, String spec, Map<String,? extends Object> config) { this.id = id != null ? id : LanguageUtils.newUid(); this.name = name; this.spec = Preconditions.checkNotNull(spec); this.config = config==null ? ImmutableMap.<String, Object>of() : ImmutableMap.<String, Object>copyOf(config); }

Target:
public BasicLocationDefinition(String id, String name, String spec, Map<String,? extends Object> config) { this.id = Preconditions.checkNotNull(id); this.name = name; this.spec = Preconditions.checkNotNull(spec); this.config = config==null ? ImmutableMap.<String, Object>of() : ImmutableMap.<String, Object>copyOf(config); }
Source:
protected static double getColumnWidth(String columnId) { switch (columnId) { case "Index": return 70; case "Description": return 230; default: return 150; } }

Target:
protected static double getColumnWidth(String columnId) { ExpressionIdentifier.NAME expressionName = ExpressionIdentifier.NAME.Other; try { expressionName = ExpressionIdentifier.NAME.valueOf(columnId); } catch (IllegalArgumentException e) { } switch(expressionName) { case Index: return 70; case Description: return 230; default: return 150; } }
Source:
protected void generateAPIFiles(ApiImplementor imp) throws IOException { String className = imp.getPrefix().substring(0, 1).toUpperCase() + imp.getPrefix().substring(1); String pkgName = safeName(camelCaseToLowerCaseDash(className)); Path path = getDirectory().resolve(pkgName + "_generated.go"); { File file = new File(path.toAbsolutePath().toString()); File dir = file.getParentFile(); if (dir != null && !dir.exists()) { dir.mkdirs(); } if (!file.exists()) { file.createNewFile(); } } System.out.println("Generating " + path.toAbsolutePath()); try (BufferedWriter out = Files.newBufferedWriter(path, StandardCharsets.UTF_8)) { out.write(HEADER); out.write(" out.write(" out.write(" out.write("package zap\n\n"); out.write("_imports_"); out.write("type " + className + " struct {\n\tc *Client\n}" + "\n\n" ); for (ApiElement view : imp.getApiViews()) { this.generateGoElement(view, className, imp.getPrefix(), VIEW_ENDPOINT, out); } for (ApiElement action : imp.getApiActions()) { this.generateGoElement(action, className, imp.getPrefix(), ACTION_ENDPOINT, out); } for (ApiElement other : imp.getApiOthers()) { this.generateGoElement(other, className, imp.getPrefix(), OTHER_ENDPOINT, out); } } addImports(path, addImports); addImports = false; }

Target:
protected void generateAPIFiles(ApiImplementor imp) throws IOException { String className = imp.getPrefix().substring(0, 1).toUpperCase() + imp.getPrefix().substring(1); String pkgName = safeName(camelCaseToLowerCaseDash(className)); Path file = getDirectory().resolve(pkgName + "_generated.go"); createDirAndFile(file); System.out.println("Generating " + file.toAbsolutePath()); try (BufferedWriter out = Files.newBufferedWriter(file, StandardCharsets.UTF_8)) { out.write(HEADER); out.write(" out.write(" out.write(" out.write("package zap\n\n"); out.write("_imports_"); out.write("type " + className + " struct {\n\tc *Client\n}" + "\n\n"); for (ApiElement view : imp.getApiViews()) { this.generateGoElement(view, className, imp.getPrefix(), VIEW_ENDPOINT, out); } for (ApiElement action : imp.getApiActions()) { this.generateGoElement(action, className, imp.getPrefix(), ACTION_ENDPOINT, out); } for (ApiElement other : imp.getApiOthers()) { this.generateGoElement(other, className, imp.getPrefix(), OTHER_ENDPOINT, out); } } addImports(file, addImports); addImports = false; }
Source:
private void buildDependenciesMap(@NotNull Module module, @NotNull Collection<VirtualFile> erlangModules, @NotNull List<String> globalParseTransforms) { for (VirtualFile erlangModule : erlangModules) { Set<String> dependencies = ContainerUtil.newHashSet(); ErlangFile erlangFile = getErlangFile(erlangModule); addDeclaredDependencies(module, erlangFile, dependencies); dependencies.addAll(resolvePathsFromNames(globalParseTransforms, module)); myPathsToDependenciesMap.put(erlangModule.getPath(), ContainerUtil.newArrayList(dependencies)); } }

Target:
private void buildDependenciesMap(@NotNull Module module, @NotNull Collection<VirtualFile> erlangModules, @NotNull List<String> globalParseTransforms) { for (VirtualFile erlangModule : erlangModules) { Set<String> dependencies = ContainerUtil.newHashSet(); ErlangFile erlangFile = getErlangFile(erlangModule); addDeclaredDependencies(module, erlangFile, dependencies); dependencies.addAll(globalParseTransforms); myPathsToDependenciesMap.put(erlangModule.getPath(), ContainerUtil.newArrayList(dependencies)); } }
Source:
public void testCreate() throws IOException, StripeException { final Customer customer = Customer.retrieve(CUSTOMER_ID); Map<String, Object> params = new HashMap<String, Object>(); params.put("source", "btok_123"); stubRequest( APIResource.RequestMethod.POST, String.format("/v1/customers/%s/sources", customer.getId()), params, Card.class, getResourceAsString("/api_fixtures/card.json") ); final Card card = (Card) customer.getSources().create(params); assertNotNull(card); verifyRequest( APIResource.RequestMethod.POST, String.format("/v1/customers/%s/sources", customer.getId()), params ); }

Target:
public void testCreate() throws IOException, StripeException { final Customer customer = Customer.retrieve(CUSTOMER_ID); final Map<String, Object> params = new HashMap<String, Object>(); params.put("source", "btok_123"); stubRequest( APIResource.RequestMethod.POST, String.format("/v1/customers/%s/sources", customer.getId()), params, Card.class, getResourceAsString("/api_fixtures/card.json") ); final Card card = (Card) customer.getSources().create(params); assertNotNull(card); verifyRequest( APIResource.RequestMethod.POST, String.format("/v1/customers/%s/sources", customer.getId()), params ); }
Source:
public boolean createUser() { boolean createdUser = false; if(this.getUserName() !=null && this.getPassword() !=null){ System.out.println("username from CreateuserBean---"+this.getUserName()); System.out.println("password from createuserBean---"+this.getPassword()); } Login user = new Login(userName, password); System.out.println("after the login object set up"); try{ System.out.println("Create user status before calling adduser method"+createdUser); createdUser = loginService.addUser(user); System.out.println("Create user status after calling adduser method"+createdUser); if(createdUser){ FacesContext facesContext = FacesContext.getCurrentInstance(); HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false); session.setAttribute(UserAuthorizationListener.USER_INFO_SESSION_ATTRIBUTE, user); } } catch (UserLoginException e) { e.printStackTrace(); } return createdUser; }

Target:
public boolean createUser() { boolean createdUser = false; if (this.getUserName() != null && this.getPassword() != null) { } Login user = new Login(userName, password); try { createdUser = loginService.addUser(user); if (createdUser) { FacesContext facesContext = FacesContext.getCurrentInstance(); HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false); session.setAttribute(UserAuthorizationListener.USER_INFO_SESSION_ATTRIBUTE, user); } } catch (UserLoginException e) { log.error("Error in create user" + e.getMessage()); } return createdUser; }
Source:
public void testOnContainerCompleted() throws Exception { new Context() {{ final List<CompletableFuture<Void>> addContainerRequestFutures = new ArrayList<>(); addContainerRequestFutures.add(new CompletableFuture<>()); addContainerRequestFutures.add(new CompletableFuture<>()); final AtomicInteger addContainerRequestFuturesNumCompleted = new AtomicInteger(0); final CompletableFuture<Void> removeContainerRequestFuture = new CompletableFuture<>(); final CompletableFuture<Void> startContainerAsyncFuture = new CompletableFuture<>(); testingYarnAMRMClientAsyncBuilder.setGetMatchingRequestsFunction(ignored -> Collections.singletonList(Collections.singletonList(YarnResourceManagerDriver.getContainerRequest(testingResource)))); testingYarnAMRMClientAsyncBuilder.setAddContainerRequestConsumer((ignored1, ignored2) -> addContainerRequestFutures.get(addContainerRequestFuturesNumCompleted.getAndIncrement()).complete(null)); testingYarnAMRMClientAsyncBuilder.setRemoveContainerRequestConsumer((ignored1, ignored2) -> removeContainerRequestFuture.complete(null)); testingYarnNMClientAsyncBuilder.setStartContainerAsyncConsumer((ignored1, ignored2, ignored3) -> startContainerAsyncFuture.complete(null)); resourceEventHandlerBuilder.setOnWorkerTerminatedConsumer((ignore1, ignore2) -> getDriver().requestResource(testingTaskExecutorProcessSpec)); runTest(() -> { getDriver().requestResource(testingTaskExecutorProcessSpec); ((YarnResourceManagerDriver) getDriver()).getYarnContainerEventHandler().onContainersAllocated(ImmutableList.of(testingContainer)); verifyFutureCompleted(addContainerRequestFutures.get(0)); verifyFutureCompleted(removeContainerRequestFuture); verifyFutureCompleted(startContainerAsyncFuture); ContainerStatus testingContainerStatus = createTestingContainerStatus(testingContainer.getId()); ((YarnResourceManagerDriver) getDriver()).getYarnContainerEventHandler().onContainersCompleted(ImmutableList.of(testingContainerStatus)); verifyFutureCompleted(addContainerRequestFutures.get(1)); }); }}; }

Target:
public void testOnContainerCompleted() throws Exception { new Context() {{ addContainerRequestFutures.add(new CompletableFuture<>()); addContainerRequestFutures.add(new CompletableFuture<>()); testingYarnAMRMClientAsyncBuilder.setAddContainerRequestConsumer((ignored1, ignored2) -> addContainerRequestFutures.get(addContainerRequestFuturesNumCompleted.getAndIncrement()).complete(null)); resourceEventHandlerBuilder.setOnWorkerTerminatedConsumer((ignore1, ignore2) -> getDriver().requestResource(testingTaskExecutorProcessSpec)); runTest(() -> { runInMainThread(() -> getDriver().requestResource(testingTaskExecutorProcessSpec)); resourceManagerClientCallbackHandler.onContainersAllocated(ImmutableList.of(testingContainer)); ContainerStatus testingContainerStatus = createTestingContainerCompletedStatus(testingContainer.getId()); resourceManagerClientCallbackHandler.onContainersCompleted(ImmutableList.of(testingContainerStatus)); verifyFutureCompleted(addContainerRequestFutures.get(1)); }); }}; }
Source:
public Object invoke(MethodInvocation methodInvocation) throws Throwable { Object result; try { result = methodInvocation.proceed(); } catch (ValidationException e) { List<ErrorMessage> messages = Lists.newArrayList(); for (Error error : e.errors) { messages.add(new ErrorMessage(error.message)); } return Reply.with(new Errors(messages)).status(SC_BAD_REQUEST).as(Json.class); } catch (ClassCastException e) { return Reply.with(new Errors(Lists.newArrayList(new ErrorMessage(defaultInternalServerError)))).status(SC_BAD_REQUEST).as(Json.class); } catch (NotFoundException e) { return Reply.with(new Errors(Lists.newArrayList(new ErrorMessage(e.getMessage())))).status(SC_NOT_FOUND).as(Json.class); } catch (OperatorException e) { return Reply.with(new Errors(Lists.<ErrorMessage>newArrayList(new ErrorMessage(e.getMessage())))).status(SC_CONFLICT); } catch (RuntimeException e) { logger.error("Exception stack trace", e); if(isNullOrEmpty(e.getMessage())) { return Reply.with(new Errors(Lists.newArrayList(new ErrorMessage(defaultInternalServerError)))).error().as(Json.class); } return Reply.with(new Errors(Lists.newArrayList(new ErrorMessage(e.getMessage())))).error().as(Json.class); } if (!(result instanceof Reply)) { throw new ProgrammerMistake("Wrong interceptor binding was performed. It seems that methods that are not returning" + " Reply objects are matched."); } return result; }

Target:
public Object invoke(MethodInvocation methodInvocation) throws Throwable { Object result; try { result = methodInvocation.proceed(); } catch (ValidationException e) { List<ErrorMessage> messages = Lists.newArrayList(); for (Error error : e.errors) { messages.add(new ErrorMessage(error.message)); } return Reply.with(new Errors(messages)).status(SC_BAD_REQUEST).as(Json.class); } catch (ClassCastException e) { return Reply.with(new Errors(Lists.newArrayList(new ErrorMessage(defaultInternalServerError)))).status(SC_BAD_REQUEST).as(Json.class); } catch (NotFoundException e) { return Reply.with(new Errors(Lists.newArrayList(new ErrorMessage(e.getMessage())))).status(SC_NOT_FOUND).as(Json.class); } catch (RuntimeException e) { logger.error("Exception stack trace", e); if(isNullOrEmpty(e.getMessage())) { return Reply.with(new Errors(Lists.newArrayList(new ErrorMessage(defaultInternalServerError)))).error().as(Json.class); } return Reply.with(new Errors(Lists.newArrayList(new ErrorMessage(e.getMessage())))).error().as(Json.class); } if (!(result instanceof Reply)) { throw new ProgrammerMistake("Wrong interceptor binding was performed. It seems that methods that are not returning" + " Reply objects are matched."); } return result; }
Source:
public JFXSearchPanel() { super(); init(); setPrefWidth(350d); setMinWidth(350d); setMaxWidth(500d); }

Target:
public JFXSearchPanel() { super(); init(); setPrefWidth(350d); setMinWidth(350d); setMaxWidth(350d); }
Source:
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { try { Object parameter = getItemsSource().get(position); if (onLongClick != null && onLongClick.canExecute(parameter)) { onLongClick.execute(parameter); return true; } } catch (Exception e) { } return false; }

Target:
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { try { Object parameter = getItemsSource().get(position); if (!mDelegate.isDisposed() && mDelegate.getLongClick().canExecute(parameter)) { mDelegate.getLongClick().execute(parameter); return true; } } catch (Exception e) { } return false; }
Source:
public InnerBuilder setCepSinkType(final CepSinkType cepSinkType) { if (this.cepSinkType != null) { throw new IllegalStateException("Sink type cannot be defined twice!"); } this.cepSinkType = cepSinkType; return this; }

Target:
private InnerBuilder setCepSinkType(final CepSinkType cepSinkType) { if (this.cepSinkType != null) { throw new IllegalStateException("Sink type cannot be defined twice!"); } this.cepSinkType = cepSinkType; return this; }
Source:
public void plotGraph(StaplerRequest req, StaplerResponse rsp) throws IOException { if (ChartUtil.awtProblemCause != null) { rsp.sendRedirect2(req.getContextPath() + "/images/headless.png"); return; } setWidth(req); setHeight(req); setNumBuilds(req); setRightBuildNum(req); setHasLegend(req); setTitle(req); setStyle(req); setUseDescr(req); setDescription(req); generatePlot(true); ChartUtil.generateGraph(req, rsp, plot, getWidth(), getHeight()); }

Target:
public void plotGraph(StaplerRequest req, StaplerResponse rsp) throws IOException { if (ChartUtil.awtProblemCause != null) { rsp.sendRedirect2(req.getContextPath() + "/images/headless.png"); return; } setWidth(req); setHeight(req); setNumBuilds(req); setRightBuildNum(req); setHasLegend(req); setTitle(req); setStyle(req); setUseDescr(req); generatePlot(true); ChartUtil.generateGraph(req, rsp, plot, getWidth(), getHeight()); }
Source:
public void stop(BundleContext context) throws Exception { channelTypeServiceBinder.close(); thingTypeServiceBinder.close(); Activator.context = null; }

Target:
public void stop(BundleContext context) throws Exception { channelTypeServiceBinder.close(); thingTypeServiceBinder.close(); channelTypeServiceBinder = null; thingTypeServiceBinder = null; Activator.context = null; }
Source:
public DateTime (Composite parent, int style) { super (parent, checkStyle (style)); if ((this.style & SWT.CALENDAR) == 0) { createText((this.style & SWT.DROP_DOWN) != 0); } initAccessible (); }

Target:
public DateTime (Composite parent, int style) { super (parent, checkStyle (style)); if (isDate() || isTime()) { createText(); } if (isDateWithDropDownButton()) { createDropDownButton(); createPopupShell(-1, -1, -1); addListener(SWT.Resize, new Listener() { public void handleEvent(Event event) { setDropDownButtonSize(); } }); } initAccessible (); if (isDateWithDropDownButton()) { Point size = computeSize(SWT.DEFAULT, SWT.DEFAULT); setBounds(0, 0, size.x, size.y); } }
Source:
public static IndicesAliases parse(Map<String, Object> resp) { final Map<String, Map<String, Alias> > indices = new HashMap<String, Map<String, Alias> > (); for (Map.Entry<String, Object> index : resp.entrySet()) { final Map<String, Object> metadata = (Map<String, Object>) index.getValue(); final Map<String, Object> aliases = (Map<String, Object>) metadata.get("aliases"); final Map<String, Alias> indexAliases = new HashMap<String, Alias> (); indices.put(index.getKey(), indexAliases); for (Map.Entry<String, Object> entry : aliases.entrySet()) { String name = entry.getKey(); String searchRouting = null; String indexRouting = null; Map<String, Object> filter = null; if (metadata.containsKey("search_routing")) { searchRouting = (String) metadata.get("search_routing"); } if (metadata.containsKey("index_routing")) { indexRouting = (String) metadata.get("index_routing"); } if (metadata.containsKey("filter")) { filter = (Map<String, Object>) metadata.get("filter"); } Alias alias = new Alias(name, searchRouting, indexRouting, filter); indexAliases.put(alias.name, alias); } } return new IndicesAliases(Collections.unmodifiableMap(indices)); }

Target:
public static IndicesAliases parse(Map<String, Object> resp) { final Map<String, Map<String, Alias> > indices = new HashMap<String, Map<String, Alias> > (); for (Map.Entry<String, Object> index : resp.entrySet()) { final Map<String, Object> metadata = (Map<String, Object>) index.getValue(); final Map<String, Map<String, Object> > aliases = (Map<String, Map<String, Object> >) metadata.get("aliases"); final Map<String, Alias> indexAliases = new HashMap<String, Alias> (); indices.put(index.getKey(), indexAliases); for (Map.Entry<String, Map<String, Object> > entry : aliases.entrySet()) { String name = entry.getKey(); Map<String, Object> aliasMetadata = entry.getValue(); String searchRouting = null; String indexRouting = null; Map<String, Object> filter = null; if (aliasMetadata.containsKey("search_routing")) { searchRouting = (String) aliasMetadata.get("search_routing"); } if (aliasMetadata.containsKey("index_routing")) { indexRouting = (String) aliasMetadata.get("index_routing"); } if (aliasMetadata.containsKey("filter")) { filter = (Map<String, Object>) aliasMetadata.get("filter"); } Alias alias = new Alias(name, searchRouting, indexRouting, filter); indexAliases.put(alias.name, alias); } } return new IndicesAliases(Collections.unmodifiableMap(indices)); }
Source:
static <T> java.util.List<T> asJava(IndexedSeq<T> seq) { return new SeqAsJavaList<T>(seq) { private static final long serialVersionUID = 1L; @Override public java.util.ListIterator<T> listIterator() { return JavaConverters.listIterator(((IndexedSeq<T>) delegate), 0); } @Override public java.util.ListIterator<T> listIterator(int index) { return JavaConverters.listIterator(((IndexedSeq<T>) delegate), index); } }; }

Target:
static <T> java.util.List<T> asJava(IndexedSeq<T> seq) { return new SeqAsJavaList<>(seq, IndexedSeqListIterator::new); }
Source:
public void getCampaigns() { if (view != null && mediaWikiApi != null) { if (this.campaign != null) { view.showCampaigns(campaign); return; } Single<CampaignResponseDTO> campaigns = mediaWikiApi.getCampaigns(); campaigns.observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribeWith(new SingleObserver<CampaignResponseDTO>() { @Override public void onSubscribe(Disposable d) { disposable = d; } @Override public void onSuccess(CampaignResponseDTO campaignResponseDTO) { List<Campaign> campaigns = campaignResponseDTO.getCampaigns(); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH); if (campaigns == null || campaigns.isEmpty()) { Log.e(TAG, "The campaigns list is empty"); view.showCampaigns(null); } Collections.sort(campaigns, (campaign, t1) -> { Date date1, date2; try { date1 = dateFormat.parse(campaign.getStartDate()); date2 = dateFormat.parse(t1.getStartDate()); } catch (ParseException e) { e.printStackTrace(); return -1; } return date1.compareTo(date2); }); Date campaignEndDate, campaignStartDate; Date currentDate = new Date(); try { for (Campaign aCampaign : campaigns) { campaignEndDate = dateFormat.parse(aCampaign.getEndDate()); campaignStartDate = dateFormat.parse(aCampaign.getStartDate()); if (campaignEndDate.compareTo(currentDate) >= 0 && campaignStartDate.compareTo(currentDate) <= 0) { campaign = aCampaign; break; } } } catch (ParseException e) { e.printStackTrace(); } view.showCampaigns(campaign); } @Override public void onError(Throwable e) { Log.e(TAG, "could not fetch campaigns: " + e.getMessage()); } }); } }

Target:
public void getCampaigns() { if (view != null && mediaWikiApi != null) { if (this.campaign != null) { view.showCampaigns(campaign); return; } Single<CampaignResponseDTO> campaigns = mediaWikiApi.getCampaigns(); campaigns.observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribeWith(new SingleObserver<CampaignResponseDTO>() { @Override public void onSubscribe(Disposable d) { disposable = d; } @Override public void onSuccess(CampaignResponseDTO campaignResponseDTO) { List<Campaign> campaigns = campaignResponseDTO.getCampaigns(); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); if (campaigns == null || campaigns.isEmpty()) { Log.e(TAG, "The campaigns list is empty"); view.showCampaigns(null); } Collections.sort(campaigns, (campaign, t1) -> { Date date1, date2; try { date1 = dateFormat.parse(campaign.getStartDate()); date2 = dateFormat.parse(t1.getStartDate()); } catch (ParseException e) { e.printStackTrace(); return -1; } return date1.compareTo(date2); }); Date campaignEndDate, campaignStartDate; Date currentDate = new Date(); try { for (Campaign aCampaign : campaigns) { campaignEndDate = dateFormat.parse(aCampaign.getEndDate()); campaignStartDate = dateFormat.parse(aCampaign.getStartDate()); if (campaignEndDate.compareTo(currentDate) >= 0 && campaignStartDate.compareTo(currentDate) <= 0) { campaign = aCampaign; break; } } } catch (ParseException e) { e.printStackTrace(); } view.showCampaigns(campaign); } @Override public void onError(Throwable e) { Log.e(TAG, "could not fetch campaigns: " + e.getMessage()); } }); } }
Source:
public static void main(String[] args) throws Exception { if(args.length < 2) { usage(); return; } try (FileInputStream argIS = new FileInputStream(args[0]); BufferedReader modelReader = new BufferedReader(new FileReader(args[1]))) { String chartTitle = modelReader.readLine(); List<String> listCategories = new ArrayList<String>(3); List<Double> listValues = new ArrayList<Double>(3); String ln; while((ln = modelReader.readLine()) != null){ String[] vals = ln.split("\\s+"); listCategories.add(vals[0]); listValues.add(Double.valueOf(vals[1])); } String[] categories = listCategories.toArray(new String[listCategories.size()]); Double[] values = listValues.toArray(new Double[listValues.size()]); try (XWPFDocument doc = new XWPFDocument(argIS)) { XWPFChart chart = findChart(doc); setBarData(chart, chartTitle, categories, values); setColumnData(chart, "Column variant"); try (OutputStream out = new FileOutputStream("bar-chart-demo-output.docx")) { doc.write(out); } } } System.out.println("Done"); }

Target:
public static void main(String[] args) throws Exception { if(args.length < 2) { usage(); return; } try (FileInputStream argIS = new FileInputStream(args[0]); BufferedReader modelReader = new BufferedReader(new FileReader(args[1]))) { String chartTitle = modelReader.readLine(); List<String> listCategories = new ArrayList<String>(3); List<Double> listValues = new ArrayList<Double>(3); String ln; while((ln = modelReader.readLine()) != null){ String[] vals = ln.split("\\s+"); listCategories.add(vals[0]); listValues.add(Double.valueOf(vals[1])); } String[] categories = listCategories.toArray(new String[listCategories.size()]); Double[] values = listValues.toArray(new Double[listValues.size()]); try (XWPFDocument doc = new XWPFDocument(argIS)) { XWPFChart chart = doc.getCharts().get(0); setBarData(chart, chartTitle, categories, values); chart = doc.getCharts().get(1); setColumnData(chart, "Column variant"); try (OutputStream out = new FileOutputStream("bar-chart-demo-output.docx")) { doc.write(out); } } } System.out.println("Done"); }
Source:
public @NonNull List<ITmfStateInterval> getStatusIntervalsForThread(int threadQuark, long start, long end, long resolution, IProgressMonitor monitor) { ITmfStateSystem ssq = getStateSystem(); if (ssq == null) { @SuppressWarnings("null") @NonNull List<ITmfStateInterval> empty = Collections.EMPTY_LIST; return empty; } try { int statusQuark = ssq.getQuarkRelative(threadQuark, Attributes.STATUS); List<ITmfStateInterval> statusIntervals = StateSystemUtils.queryHistoryRange(ssq, statusQuark, Math.max(start, ssq.getStartTime()), Math.min(end - 1, ssq.getCurrentEndTime()), resolution, monitor); return statusIntervals; } catch (AttributeNotFoundException | StateSystemDisposedException e) { } @SuppressWarnings("null") @NonNull List<ITmfStateInterval> empty = Collections.EMPTY_LIST; return empty; }

Target:
public @NonNull List<ITmfStateInterval> getStatusIntervalsForThread(int threadQuark, long start, long end, long resolution, IProgressMonitor monitor) { ITmfStateSystem ss = getStateSystem(); if (ss == null) { @SuppressWarnings("null") @NonNull List<ITmfStateInterval> empty = Collections.EMPTY_LIST; return empty; } try { int statusQuark = ss.getQuarkRelative(threadQuark, Attributes.STATUS); List<ITmfStateInterval> statusIntervals = StateSystemUtils.queryHistoryRange(ss, statusQuark, Math.max(start, ss.getStartTime()), Math.min(end - 1, ss.getCurrentEndTime()), resolution, monitor); return statusIntervals; } catch (AttributeNotFoundException | StateSystemDisposedException e) { } @SuppressWarnings("null") @NonNull List<ITmfStateInterval> empty = Collections.EMPTY_LIST; return empty; }
Source:
void populateCommits(SRunningBuild sRunningBuild) { List<SVcsModification> changes = sRunningBuild.getContainingChanges(); if (changes == null) { return; } for (SVcsModification change : changes) { Collection<SUser> committers = change.getCommitters(); String slackUserName = null; if (committers != null && !committers.isEmpty()) { SUser committer = committers.iterator().next(); slackUserName = committer.getPropertyValue(SlackNotificator.USERNAME_KEY); Loggers.ACTIVITIES.debug("Resolved committer " + change.getUserName() + " to Slack User " + slackUserName); } commits.add(new Commit(change.getVersion(), change.getDescription(), change.getUserName(), slackUserName)); } }

Target:
public void populateCommits(SRunningBuild sRunningBuild) { List<SVcsModification> changes = sRunningBuild.getContainingChanges(); if (changes == null) { return; } for (SVcsModification change : changes) { Collection<SUser> committers = change.getCommitters(); String slackUserName = null; if (committers != null && !committers.isEmpty()) { SUser committer = committers.iterator().next(); slackUserName = committer.getPropertyValue(SlackNotificator.USERNAME_KEY); Loggers.ACTIVITIES.debug("Resolved committer " + change.getUserName() + " to Slack User " + slackUserName); } commits.add(new Commit(change.getVersion(), change.getDescription(), change.getUserName(), slackUserName)); } }
Source:
protected void onInit() { Properties properties = new Properties(); properties.put("locators", "localhost[7777]"); properties.put("log-level", "warning"); this.cache = new CacheFactory(properties).create(); super.onInit(); }

Target:
protected void onInit() { Properties properties = new Properties(); properties.put("locators", "localhost[7777]"); properties.put("log-level", "warning"); properties.put("mcast-port", "0"); this.cache = new CacheFactory(properties).create(); super.onInit(); }