auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Status read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { LookupRequest.Builder lookupRequest = LookupRequest.newBuilder(); lookupRequest.addKey(buildPrimaryKey(table, key)); lookupRequest.getReadOptionsBuilder().setReadConsistency( this.readConsistency); logger.debug("Built lookup request as:\n" + lookupRequest.toString()); LookupResponse response = null; try { response = datastore.lookup(lookupRequest.build()); } catch (DatastoreException exception) { logger.error( String.format("Datastore Exception when reading (%s): %s %s", exception.getMessage(), exception.getMethodName(), exception.getCode())); return new Status("ERROR-" + exception.getCode(), exception.getMessage()); } if (response.getFoundCount() == 0) { return new Status("ERROR-404", "Not Found, key is: " + key); } Entity entity = response.getFound(0).getEntity(); logger.debug("Read entity: " + entity.toString()); Map<String, Value> properties = DatastoreHelper.getPropertyMap(entity); Set<String> propertiesToReturn = (fields == null ? properties.keySet() : fields); for (String name : propertiesToReturn) { if (properties.containsKey(name)) { result.put(name, new StringByteIterator(properties.get(name) .getStringValue())); } } return Status.OK; }

Target:
public Status read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { LookupRequest.Builder lookupRequest = LookupRequest.newBuilder(); lookupRequest.addKey(buildPrimaryKey(table, key)); lookupRequest.getReadOptionsBuilder().setReadConsistency( this.readConsistency); logger.debug("Built lookup request as: " + lookupRequest.toString()); LookupResponse response = null; try { response = datastore.lookup(lookupRequest.build()); } catch (DatastoreException exception) { logger.error( String.format("Datastore Exception when reading (%s): %s %s", exception.getMessage(), exception.getMethodName(), exception.getCode())); return new Status("ERROR-" + exception.getCode(), exception.getMessage()); } if (response.getFoundCount() == 0) { return new Status("ERROR-404", "Not Found, key is: " + key); } else if (response.getFoundCount() > 1) { return Status.UNEXPECTED_STATE; } Entity entity = response.getFound(0).getEntity(); logger.debug("Read entity: " + entity.toString()); Map<String, Value> properties = DatastoreHelper.getPropertyMap(entity); Set<String> propertiesToReturn = (fields == null ? properties.keySet() : fields); for (String name : propertiesToReturn) { if (properties.containsKey(name)) { result.put(name, new StringByteIterator(properties.get(name) .getStringValue())); } } return Status.OK; }
Source:
protected void performRuntime(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException { final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)); final String connectorName = address.getLastElement().getValue(); validateDuplicatedResources(context, address, connectorName, resource); final ModelNode fullModel = Resource.Tools.readModel(resource); launchServices(context, connectorName, fullModel); }

Target:
protected void performRuntime(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException { final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)); final String connectorName = address.getLastElement().getValue(); final ModelNode fullModel = Resource.Tools.readModel(resource); launchServices(context, connectorName, fullModel); }
Source:
public HttpDirectDownloadCommand(String url, Long templateId, PrimaryDataStoreTO destPool, String checksum, Map<String, String> headers, int connectTimeout, int soTimeout) { super(url, templateId, destPool, checksum, headers); setConnectTimeout(connectTimeout); setSoTimeout(soTimeout); }

Target:
public HttpDirectDownloadCommand(String url, Long templateId, PrimaryDataStoreTO destPool, String checksum, Map<String, String> headers, int connectTimeout, int soTimeout) { super(url, templateId, destPool, checksum, headers, connectTimeout, soTimeout, null); }
Source:
public int getEventSize() { return event.toString().getBytes(StandardCharsets.UTF_8).length; }

Target:
public int getEventSize() { return eventSize; }
Source:
public static Debug getDebug(String name) { if (!name.startsWith("/")) name = "/" + name; DebugTrace trace = null; Activator activator = Activator.getDefault(); Bundle bundle; BundleContext ctx; if (activator != null && (bundle = activator.getBundle()) != null && (ctx = bundle.getBundleContext()) != null) { ServiceReference<DebugOptions> ref = ctx.getServiceReference(DebugOptions.class); if (ref != null) { DebugOptions options = ctx.getService(ref); if (options.isDebugEnabled() && options.getBooleanOption(Activator.PLUGIN_ID + name, false)) { trace = options.newDebugTrace(Activator.PLUGIN_ID); } ctx.ungetService(ref); } } return new Debug(trace, name); }

Target:
public static Debug getDebug(String name) { if (!name.startsWith("/")) name = "/" + name; DebugTrace trace = null; Bundle bundle = FrameworkUtil.getBundle(Activator.class); BundleContext ctx; if (bundle != null && (ctx = bundle.getBundleContext()) != null) { ServiceReference<DebugOptions> ref = ctx.getServiceReference(DebugOptions.class); if (ref != null) { DebugOptions options = ctx.getService(ref); if (options.isDebugEnabled() && options.getBooleanOption(Activator.PLUGIN_ID + name, false)) { trace = options.newDebugTrace(Activator.PLUGIN_ID); } ctx.ungetService(ref); } } return new Debug(trace, name); }
Source:
public Void visit(GenContext state, Invocation ast) { return null; }

Target:
public Void visit(GenContext state, Invocation ast) { if (ast.getArgument() != null) { ast.getArgument().acceptVisitor(this, state); } if (ast.getArgument() != null) { ast.getReceiver().acceptVisitor(this, state); } return null; }
Source:
public void theUserClicksOnButtonInTheHeader(String button) throws Throwable { switch (button) { case "epam-logo": driverProvider.getDriver().findElement(By.cssSelector("img.img-rounded")).click(); break; case "Beállítások-icon": driverProvider.getDriver().findElement(By.id("settings_link")).click(); break; case "Beállítások-text": driverProvider.getDriver().findElement(By.linkText("Beállítások")).click(); break; case "Kilépés-icon": driverProvider.getDriver().findElement(By.id("logout_link")).click(); break; case "Kilépés-text": driverProvider.getDriver().findElement(By.linkText("Kilépés")).click(); break; } }

Target:
public void theUserClicksOnButtonInTheHeader(String button) throws Throwable { switch (button) { case "epam-logo": getDriver().findElement(By.cssSelector("img.img-rounded")).click(); break; case "Beállítások-icon": getDriver().findElement(By.id("settings_link")).click(); break; case "Beállítások-text": getDriver().findElement(By.linkText("Beállítások")).click(); break; case "Kilépés-icon": getDriver().findElement(By.id("logout_link")).click(); break; case "Kilépés-text": getDriver().findElement(By.linkText("Kilépés")).click(); break; } }
Source:
public BlockLoc getBlock() { return (BlockLoc) getPos(); }

Target:
public BlockLoc getBlock() { return new BlockWrapper(getWorld(), getPos().getX(), getPos().getY(), getPos().getZ()); }
Source:
private void insertJVMAargs() { String flowName = node.getParentFlow().getFlowId(); String jobId = node.getId(); String jobJVMArgs = String.format( "-Dazkaban.flowid=%s -Dazkaban.execid=%s -Dazkaban.jobid=%s", flowName, executionId, jobId); String previousJVMArgs = props.get(JavaProcessJob.JVM_PARAMS); if (previousJVMArgs == null) { previousJVMArgs = jobJVMArgs; } else { previousJVMArgs += " " + jobJVMArgs; } logger.info("job JVM args: " + previousJVMArgs); props.put(JavaProcessJob.JVM_PARAMS, previousJVMArgs); }

Target:
private void insertJVMAargs() { String flowName = node.getParentFlow().getFlowId(); String jobId = node.getId(); String jobJVMArgs = String.format( "-Dazkaban.flowid=%s -Dazkaban.execid=%s -Dazkaban.jobid=%s", flowName, executionId, jobId); String previousJVMArgs = props.get(JavaProcessJob.JVM_PARAMS); jobJVMArgs += (previousJVMArgs == null) ? "" : " " + previousJVMArgs; logger.info("job JVM args: " + jobJVMArgs); props.put(JavaProcessJob.JVM_PARAMS, jobJVMArgs); }
Source:
protected T doGetValue() { if (isListening) { return value; } return calculate(); }

Target:
protected final T doGetValue() { if (isListening) { return value; } return calculate(); }
Source:
public void onReceive(Context context, Intent intent) { if (!SyncthingService.alwaysRunInBackground(context)) return; Intent i = new Intent(context, SyncthingService.class); String action = intent.getAction(); if (action.equals("android.net.wifi.WIFI_AP_STATE_CHANGED")) { int state = intent.getIntExtra("wifi_state", 0); boolean apon = state == WIFI_AP_STATE_ENABLED; i.putExtra(DeviceStateHolder.EXTRA_AP_ON, apon); } else { ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo wifiInfo = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI); boolean isWifiConnected = (wifiInfo != null && wifiInfo.isConnected()); Log.v(TAG, "Received wifi " + (isWifiConnected ? "connected" : "disconnected") + " event"); i.putExtra(DeviceStateHolder.EXTRA_HAS_WIFI, isWifiConnected); } context.startService(i); }

Target:
public void onReceive(Context context, Intent intent) { if (!SyncthingService.alwaysRunInBackground(context)) return; Intent i = new Intent(context, SyncthingService.class); String action = intent.getAction(); if (action.equals("android.net.wifi.WIFI_AP_STATE_CHANGED")) { int state = intent.getIntExtra("wifi_state", 0); boolean apon = state == WIFI_AP_STATE_ENABLED; i.putExtra(DeviceStateHolder.EXTRA_AP_ENABLED, apon); } else { ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo wifiInfo = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI); boolean isWifiConnected = (wifiInfo != null && wifiInfo.isConnected()); Log.v(TAG, "Received wifi " + (isWifiConnected ? "connected" : "disconnected") + " event"); i.putExtra(DeviceStateHolder.EXTRA_HAS_WIFI, isWifiConnected); } context.startService(i); }
Source:
public boolean shouldThrottle(RestRequest restRequest) { return quotaMap.get(restRequest.getRestMethod()).shouldThrottle(1); }

Target:
public boolean shouldThrottle(RestRequest restRequest) { RejectThrottler throttler = quotaMap.get(restRequest.getRestMethod()); return throttler != null && throttler.shouldThrottle(1); }
Source:
protected boolean shouldSplit() { for (HStore store : region.getStores()) { if (!store.canSplit()) { return false; } } return isExceedSize(desiredMaxFileSize, ""); }

Target:
protected boolean shouldSplit() { if (!canSplit()) { return false; } return isExceedSize(desiredMaxFileSize); }
Source:
protected void fillDescription(final DiscountCodeViewModel viewModel, final DiscountCode discountCode) { final String displayDescription = Optional.of(discountCode.getDescription()) .flatMap(description -> description.find(userLanguage.locales())) .orElse(null); viewModel.setDescription(displayDescription); }

Target:
protected void fillDescription(final DiscountCodeViewModel viewModel, final DiscountCode discountCode) { viewModel.setDescription(discountCode.getDescription()); }
Source:
ManagedIdentityCredential(String clientId, IdentityClientOptions identityClientOptions) { IdentityClient identityClient = new IdentityClientBuilder() .clientId(clientId) .identityClientOptions(identityClientOptions) .build(); Configuration configuration = Configuration.getGlobalConfiguration().clone(); if (configuration.contains(Configuration.PROPERTY_IDENTITY_ENDPOINT)) { if (configuration.contains(Configuration.PROPERTY_IDENTITY_HEADER)) { managedIdentityServiceCredential = new AppServiceMsiCredential(clientId, identityClient); } else if (configuration.contains(PROPERTY_IMDS_ENDPOINT)) { managedIdentityServiceCredential = new ArcIdentityCredential(clientId, identityClient); } else { managedIdentityServiceCredential = null; } } else if (configuration.contains(Configuration.PROPERTY_MSI_ENDPOINT)) { managedIdentityServiceCredential = new AppServiceMsiCredential(clientId, identityClient); } else { managedIdentityServiceCredential = new VirtualMachineMsiCredential(clientId, identityClient); } LoggingUtil.logAvailableEnvironmentVariables(logger, configuration); }

Target:
ManagedIdentityCredential(String clientId, IdentityClientOptions identityClientOptions) { IdentityClient identityClient = new IdentityClientBuilder() .clientId(clientId) .identityClientOptions(identityClientOptions) .build(); Configuration configuration = Configuration.getGlobalConfiguration().clone(); if (configuration.contains(Configuration.PROPERTY_IDENTITY_ENDPOINT)) { if (configuration.contains(Configuration.PROPERTY_IDENTITY_HEADER)) { if (configuration.contains(PROPERTY_IDENTITY_SERVER_THUMBPRINT)) { managedIdentityServiceCredential = new ServiceFabricMsiCredential(clientId, identityClient); } else { managedIdentityServiceCredential = new VirtualMachineMsiCredential(clientId, identityClient); } } else if (configuration.contains(PROPERTY_IMDS_ENDPOINT)) { managedIdentityServiceCredential = new ArcIdentityCredential(clientId, identityClient); } else { managedIdentityServiceCredential = new VirtualMachineMsiCredential(clientId, identityClient); } } else if (configuration.contains(Configuration.PROPERTY_MSI_ENDPOINT)) { managedIdentityServiceCredential = new AppServiceMsiCredential(clientId, identityClient); } else { managedIdentityServiceCredential = new VirtualMachineMsiCredential(clientId, identityClient); } LoggingUtil.logAvailableEnvironmentVariables(logger, configuration); }
Source:
public void enqueue(Callback callback) { doEnqueueAndHandleErrorsAndRetries(callback); }

Target:
public void enqueue(Callback callback) { super.enqueue(new Callback() { @Override public void onFailure(Call call, IOException exception) { if (!backoffStrategy.nextBackoff().isPresent()) { callback.onFailure(call, new IOException("Failed to complete the request due to an " + "IOException", exception)); return; } Optional<HttpUrl> redirectTo = urls.redirectToNext(request().url()); if (!redirectTo.isPresent()) { callback.onFailure(call, new IOException("Failed to determine valid failover URL" + "for '" + request().url() + "' and base URLs " + urls.getBaseUrls())); return; } Request redirectedRequest = request().newBuilder() .url(redirectTo.get()) .build(); RemotingOkHttpCall retryCall = client.newCallWithMutableState(redirectedRequest, backoffStrategy, maxNumRelocations - 1); retryCall.enqueue(callback); } @Override public void onResponse(Call call, Response response) throws IOException { if (response.code() / 100 <= 2) { callback.onResponse(call, response); return; } Optional<QosException> qosError = qosHandler.handle(response); if (qosError.isPresent()) { qosError.get().accept(createQosVisitor(callback, call)); return; } Optional<RemoteException> httpError = remoteExceptionHandler.handle(response); if (httpError.isPresent()) { callback.onFailure(call, new IoRemoteException(httpError.get())); return; } Optional<IOException> ioException = ioExceptionHandler.handle(response); if (ioException.isPresent()) { callback.onFailure(call, ioException.get()); return; } callback.onFailure(call, new IOException("Failed to handle request, this is an http-remoting bug.")); } }); }
Source:
public boolean isSameContentIgnoreOrder(List a, List b) { String expectedListAsString = Joiner.on("\t").join(a); String actualListAsString = Joiner.on("\t").join(b); List<String> expectedStringTypeList = new ArrayList<String>( Arrays.asList(expectedListAsString.split("\t"))); List<String> actualStringTypeList = new ArrayList<String>( Arrays.asList(actualListAsString.split("\t"))); Collections.sort(expectedStringTypeList); Collections.sort(actualStringTypeList); return expectedStringTypeList.equals(actualStringTypeList); }

Target:
public static boolean isSameContentIgnoreOrder(List a, List b) { String expectedListAsString = Joiner.on("\t").join(a); String actualListAsString = Joiner.on("\t").join(b); List<String> expectedStringTypeList = new ArrayList<String>( Arrays.asList(expectedListAsString.split("\t"))); List<String> actualStringTypeList = new ArrayList<String>( Arrays.asList(actualListAsString.split("\t"))); Collections.sort(expectedStringTypeList); Collections.sort(actualStringTypeList); return expectedStringTypeList.equals(actualStringTypeList); }
Source:
private void remove0(HeaderEntry<K, V> entry) { int i = index(entry.hash); HeaderEntry<K, V> e = entries[i]; if (e == entry) { entries[i] = entry.next; } entry.remove(); }

Target:
private void remove0(HeaderEntry<K, V> entry) { int i = index(entry.hash); HeaderEntry<K, V> e = entries[i]; if (e == entry) { entries[i] = entry.next; } entry.remove(); --size; }
Source:
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) { final PathAddress hostAddress = PathAddress.pathAddress(operation.get(OP_ADDR)).getParent(); final PathAddress serverAddress = hostAddress.getParent(); final String hostName = hostAddress.getLastElement().getValue(); final String serverName = serverAddress.getLastElement().getValue(); final ServiceName serviceName = UndertowService.accessLogServiceName(serverName, hostName); context.removeService(serviceName); }

Target:
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) { final PathAddress hostAddress = context.getCurrentAddress().getParent(); final PathAddress serverAddress = hostAddress.getParent(); final String hostName = hostAddress.getLastElement().getValue(); final String serverName = serverAddress.getLastElement().getValue(); final ServiceName serviceName = UndertowService.accessLogServiceName(serverName, hostName); context.removeService(serviceName); }
Source:
public boolean equals(Object object) { if (object == null || object.getClass() != getClass()) { return false; } if (object == this) { return true; } Result rhs = (Result) object; return new EqualsBuilder() .append(this.syntaxId, rhs.syntaxId) .append(this.test, rhs.test) .append(this.isSyntaxInputTest, rhs.isSyntaxInputTest) .isEquals(); }

Target:
public boolean equals(Object object) { if (!(object instanceof Result)) { return false; } if (object == this) { return true; } Result rhs = (Result) object; return new EqualsBuilder() .append(this.syntaxId, rhs.syntaxId) .append(this.test, rhs.test) .append(this.isSyntaxInputTest, rhs.isSyntaxInputTest) .isEquals(); }
Source:
public void testCachingExpiresUsingETag() throws Exception { String endpointAddress = "http://localhost:" + PORT + "/bookstore/books/response3/123"; CacheControlFeature cacheControlFeature = new CacheControlFeature(); cacheControlFeature.setCacheResponseInputStream(true); Client client = ClientBuilder.newBuilder() .register(cacheControlFeature) .build(); WebTarget target = client.target(endpointAddress); Response response = target.request().get(); assertEquals(200, response.getStatus()); Book book = response.readEntity(Book.class); assertEquals(123L, book.getId()); MultivaluedMap<String, Object> headers = response.getMetadata(); assertFalse(headers.isEmpty()); Object etag = headers.getFirst("ETag"); assertNotNull(etag); assertTrue(etag.toString().startsWith("\"")); assertTrue(etag.toString().endsWith("\"")); Object cacheControl = headers.getFirst("Cache-Control"); assertNotNull(cacheControl); assertTrue(cacheControl.toString().contains("private")); assertTrue(cacheControl.toString().contains("max-age=1")); Thread.sleep(1500L); response = target.request().get(); assertEquals(304, response.getStatus()); assertFalse(response.hasEntity()); cacheControlFeature.close(); }

Target:
public void testCachingExpiresUsingETag() throws Exception { String endpointAddress = "http://localhost:" + PORT + "/bookstore/books/response3/123"; try (CacheControlFeature cacheControlFeature = new CacheControlFeature()) { cacheControlFeature.setCacheResponseInputStream(true); Client client = ClientBuilder.newBuilder() .register(cacheControlFeature) .build(); WebTarget target = client.target(endpointAddress); Response response = target.request().get(); assertEquals(200, response.getStatus()); response.bufferEntity(); Book book = response.readEntity(Book.class); assertEquals(123L, book.getId()); MultivaluedMap<String, Object> headers = response.getMetadata(); assertFalse(headers.isEmpty()); Object etag = headers.getFirst("ETag"); assertNotNull(etag); assertTrue(etag.toString().startsWith("\"")); assertTrue(etag.toString().endsWith("\"")); Object cacheControl = headers.getFirst("Cache-Control"); assertNotNull(cacheControl); assertTrue(cacheControl.toString().contains("private")); assertTrue(cacheControl.toString().contains("max-age=1")); Thread.sleep(1500L); Response response2 = target.request().get(); assertEquals(304, response2.getStatus()); assertFalse(response2.hasEntity()); Book book2 = response.readEntity(Book.class); assertEquals(123L, book2.getId()); } }
Source:
public void visit(DataChartNumericalDescriptor<?, ? extends Number> desc) { setType(EnumSet.of(DescriptorType.NUMERICAL)); }

Target:
public void visit(DataChartNumericalDescriptor<?, ? extends Number> desc) { fType.add(DescriptorType.NUMERICAL); }
Source:
public void testWriteReadExistsDeleteCas() throws Exception { SourceDocument doc = makeSourceDocument(1l, 1l); JCas cas = JCasFactory.createText("This is a test"); casStorageSession.add("cas", EXCLUSIVE_WRITE_ACCESS, cas.getCas()); String user = "test"; sut.writeCas(doc, cas.getCas(), user); assertThat(sut.getCasFile(doc, user)).exists(); assertThat(sut.existsCas(doc, user)).isTrue(); CAS cas2 = sut.readCas(doc, user); assertThat(cas2.getDocumentText()).isEqualTo(cas.getDocumentText()); sut.deleteCas(doc, user); assertThat(sut.getCasFile(doc, user)).doesNotExist(); assertThat(sut.existsCas(doc, user)).isFalse(); assertThat(casStorageSession.contains(cas.getCas())).isFalse(); }

Target:
public void testWriteReadExistsDeleteCas() throws Exception { SourceDocument doc = makeSourceDocument(1l, 1l); JCas templateCas = JCasFactory.createText("This is a test"); casStorageSession.add("cas", EXCLUSIVE_WRITE_ACCESS, templateCas.getCas()); String user = "test"; sut.writeCas(doc, templateCas.getCas(), user); assertThat(sut.getCasFile(doc, user)).exists(); assertThat(sut.existsCas(doc, user)).isTrue(); CAS cas = sut.readCas(doc, user); assertThat(cas.getDocumentText()).isEqualTo(templateCas.getDocumentText()); sut.deleteCas(doc, user); assertThat(sut.getCasFile(doc, user)).doesNotExist(); assertThat(sut.existsCas(doc, user)).isFalse(); assertThat(casStorageSession.contains(cas)).isFalse(); }
Source:
private Dataset<Row> fixupColumnNames(JoinOperation op, JoinType joinType, Dataset<Row> leftDF, Dataset<Row> rightDF, Dataset<Row> joinedDF) { if (!joinProjectsOnlyLeftTableColumns(joinType) && !op.wasRightOuterJoin && op.getLeftRow().nColumns() > leftDF.schema().length()) { int adjColNo = op.getLeftRow().nColumns(); int baseColNo = leftDF.schema().length(); StringBuilder expression = new StringBuilder(); String[] expressions = new String[op.getLeftRow().nColumns() + rightDF.schema().length()]; for (int i = 0; i < leftDF.schema().length(); i++) { String fieldName = ValueRow.getNamedColumn(i); expression.setLength(0); expression.append(fieldName); expressions[i] = expression.toString(); } for (int i = leftDF.schema().length(); i < op.getLeftRow().nColumns(); i++) { String fieldName = ValueRow.getNamedColumn(i); DataType dataType; try { dataType = op.getLeftRow().getColumn(i + 1).getStructField(fieldName).dataType(); } catch (StandardException e) { throw new RuntimeException(e); } expression.setLength(0); expression.append("CAST(null as "); expression.append(dataType.typeName()); expression.append(")"); expressions[i] = expression.toString(); } for (int i = 0; i < rightDF.schema().length(); i++) { String fieldName = ValueRow.getNamedColumn(i + baseColNo); expression.setLength(0); expression.append(fieldName); expression.append(" as "); expression.append(ValueRow.getNamedColumn(i + adjColNo)); expressions[i + adjColNo] = expression.toString(); } joinedDF = joinedDF.selectExpr(expressions); } return joinedDF; }

Target:
private Dataset<Row> fixupColumnNames(JoinOperation op, JoinType joinType, Dataset<Row> leftDF, Dataset<Row> rightDF, Dataset<Row> joinedDF) { boolean needsFixup = leftDFOfJoinProjectsFewerColumnsThanDefined(op, joinType, leftDF); if (!needsFixup) return joinedDF; int adjColNo = op.getLeftRow().nColumns(); int baseColNo = leftDF.schema().length(); StringBuilder expression = new StringBuilder(); String[] expressions = new String[op.getLeftRow().nColumns() + rightDF.schema().length()]; for (int i = 0; i < leftDF.schema().length(); i++) { String fieldName = ValueRow.getNamedColumn(i); expression.setLength(0); expression.append(fieldName); expressions[i] = expression.toString(); } for (int i = leftDF.schema().length(); i < op.getLeftRow().nColumns(); i++) { String fieldName = ValueRow.getNamedColumn(i); DataType dataType; try { dataType = op.getLeftRow().getColumn(i + 1).getStructField(fieldName).dataType(); } catch (StandardException e) { throw new RuntimeException(e); } expression.setLength(0); expression.append("CAST(null as "); expression.append(dataType.typeName()); expression.append(")"); expressions[i] = expression.toString(); } for (int i = 0; i < rightDF.schema().length(); i++) { String fieldName = ValueRow.getNamedColumn(i + baseColNo); expression.setLength(0); expression.append(fieldName); expression.append(" as "); expression.append(ValueRow.getNamedColumn(i + adjColNo)); expressions[i + adjColNo] = expression.toString(); } joinedDF = joinedDF.selectExpr(expressions); return joinedDF; }
Source:
default boolean containsAnyLiquids(AABB aabb) { }

Target:
default boolean containsAnyLiquids(AABB aabb) { final Vector3d max = aabb.getMax(); final Vector3d min = aabb.getMin(); return this.shadow$containsAnyLiquid(new AxisAlignedBB(min.getX(), min.getY(), min.getZ(), max.getX(), max.getY(), max.getZ())); }
Source:
public synchronized Map<Guid, AsyncTaskStatus> pollTasks(Set<Guid> taskIds) { if (taskIds == null) { return Collections.emptyMap(); } return taskIds.stream().collect(Collectors.toMap(Function.identity(), this::getTaskStatus)); }

Target:
public Map<Guid, AsyncTaskStatus> pollTasks(Set<Guid> taskIds) { if (taskIds == null) { return Collections.emptyMap(); } return taskIds.stream().collect(Collectors.toMap(Function.identity(), this::getTaskStatus)); }
Source:
public void deleteLogsByDate() throws InterruptedException { Date testStartDate = new Date(); KieSession kieSession = createKSession(HELLO_WORLD_PROCESS); startProcess(kieSession, HELLO_WORLD_PROCESS_ID, 4); List<ProcessInstanceLog> resultList = auditService.processInstanceLogQuery() .startDateRangeStart(testStartDate) .build() .getResultList(); Assertions.assertThat(resultList) .hasSize(4) .extracting("processId") .containsExactly(HELLO_WORLD_PROCESS_ID, HELLO_WORLD_PROCESS_ID, HELLO_WORLD_PROCESS_ID, HELLO_WORLD_PROCESS_ID); Set<Date> startDates = new HashSet<>(); resultList.stream().skip(1).forEach(s -> startDates.add(s.getStart())); int resultCount = startDates.stream().map( s -> auditService.processInstanceLogDelete() .startDate(s) .build() .execute()) .collect(Collectors.summingInt(Integer::intValue)); Assertions.assertThat(resultCount).isEqualTo(3); resultCount = auditService.processInstanceLogDelete() .startDate(new Date()) .build() .execute(); Assertions.assertThat(resultCount).isEqualTo(0); List<ProcessInstanceLog> resultList2 = auditService.processInstanceLogQuery() .startDateRangeStart(testStartDate) .build() .getResultList(); Assertions.assertThat(resultList2).hasSize(1); Assertions.assertThat(resultList2.get(0)).isEqualTo(resultList.get(0)); }

Target:
public void deleteLogsByDate() throws InterruptedException { Date testStartDate = new Date(); KieSession kieSession = createKSession(HELLO_WORLD_PROCESS); startProcess(kieSession, HELLO_WORLD_PROCESS_ID, 4, 5); List<ProcessInstanceLog> resultList = auditService.processInstanceLogQuery() .startDateRangeStart(testStartDate) .build() .getResultList(); Assertions.assertThat(resultList) .hasSize(4) .extracting("processId") .containsExactly(HELLO_WORLD_PROCESS_ID, HELLO_WORLD_PROCESS_ID, HELLO_WORLD_PROCESS_ID, HELLO_WORLD_PROCESS_ID); Set<Date> startDates = new HashSet<>(); resultList.stream().skip(1).forEach(s -> startDates.add(s.getStart())); int resultCount = startDates.stream().map( s -> auditService.processInstanceLogDelete() .startDate(s) .build() .execute()) .collect(Collectors.summingInt(Integer::intValue)); Assertions.assertThat(resultCount).isEqualTo(3); resultCount = auditService.processInstanceLogDelete() .startDate(new Date()) .build() .execute(); Assertions.assertThat(resultCount).isEqualTo(0); List<ProcessInstanceLog> resultList2 = auditService.processInstanceLogQuery() .startDateRangeStart(testStartDate) .build() .getResultList(); Assertions.assertThat(resultList2).hasSize(1); Assertions.assertThat(resultList2.get(0)).isEqualTo(resultList.get(0)); }
Source:
private long download(T object, File outFile, int tryCount) throws IOException { try (final InputStream is = openObjectFunction.open(object); final OutputStream os = new FileOutputStream(outFile)) { return IOUtils.copyLarge(is, os); } catch (IOException e) { final int nextTry = tryCount + 1; if (!Thread.currentThread().isInterrupted() && nextTry < maxFetchRetry) { LOG.error(e, "Failed to download object[%s], retrying (%d of %d)", object, nextTry, maxFetchRetry); outFile.delete(); return download(object, outFile, nextTry); } else { LOG.error(e, "Failed to download object[%s], retries exhausted, aborting", object); throw e; } } }

Target:
private long download(T object, File outFile, int tryCount) throws IOException { try (final InputStream is = openObjectFunction.open(object); final OutputStream os = new FileOutputStream(outFile)) { return IOUtils.copyLarge(is, os, buffer); } catch (IOException e) { final int nextTry = tryCount + 1; if (!Thread.currentThread().isInterrupted() && nextTry < maxFetchRetry) { LOG.error(e, "Failed to download object[%s], retrying (%d of %d)", object, nextTry, maxFetchRetry); outFile.delete(); return download(object, outFile, nextTry); } else { LOG.error(e, "Failed to download object[%s], retries exhausted, aborting", object); throw e; } } }
Source:
private String getFixedCommitMsgWithChangeId(String errMsg, RevCommit c) { final String changeId = "Change-Id:"; StringBuilder sb = new StringBuilder(); sb.append("ERROR: ").append(errMsg); sb.append("\n"); sb.append("Suggestion for commit message:\n"); if (c.getFullMessage().indexOf(changeId)==-1) { sb.append(c.getFullMessage()); sb.append("\n"); sb.append(changeId).append(" I").append(c.name()); } else { String lines[] = c.getFullMessage().trim().split("\n"); String lastLine = lines.length > 0 ? lines[lines.length - 1] : ""; if (lastLine.indexOf(changeId)==0) { for (int i = 0; i < lines.length - 1; i++) { sb.append(lines[i]); sb.append("\n"); } sb.append("\n"); sb.append(lastLine); } else { sb.append(c.getFullMessage()); sb.append("\n"); sb.append(changeId).append(" I").append(c.name()); sb.append("\nHint: A potential Change-Id was found, but it was not in the footer of the commit message."); } } sb.append("\n"); sb.append("Hint: To automatically add a Change-Id to commit messages, install the commit-msg hook:\n"); sb.append(" $ scp -p -P 29418 review.example.com:hooks/commit-msg .git/hooks/"); return sb.toString(); }

Target:
private String getFixedCommitMsgWithChangeId(String errMsg, RevCommit c) { final String changeId = "Change-Id:"; StringBuilder sb = new StringBuilder(); sb.append("ERROR: ").append(errMsg); sb.append("\n"); sb.append("Suggestion for commit message:\n"); if (c.getFullMessage().indexOf(changeId)==-1) { sb.append(c.getFullMessage()); sb.append("\n"); sb.append(changeId).append(" I").append(c.name()); } else { String lines[] = c.getFullMessage().trim().split("\n"); String lastLine = lines.length > 0 ? lines[lines.length - 1] : ""; if (lastLine.indexOf(changeId)==0) { for (int i = 0; i < lines.length - 1; i++) { sb.append(lines[i]); sb.append("\n"); } sb.append("\n"); sb.append(lastLine); } else { sb.append(c.getFullMessage()); sb.append("\n"); sb.append(changeId).append(" I").append(c.name()); sb.append("\nHint: A potential Change-Id was found, but it was not in the footer of the commit message."); } } String host; if (canonicalWebUrl != null) { try { host = new URL(canonicalWebUrl).getHost(); } catch (MalformedURLException e) { host = SystemReader.getInstance().getHostname(); } } else { host = SystemReader.getInstance().getHostname(); } sb.append("\n"); sb.append("Hint: To automatically add a Change-Id to commit messages, install the commit-msg hook:\n"); sb.append(" $ scp -p -P 29418 " + currentUser.getUserName() + "@" + host + ":hooks/commit-msg .git/hooks/"); return sb.toString(); }
Source:
public static void deleteSilentlyRecursively(final Path path) { if (path != null) { try { deleteRecursively(path); } catch (IOException ioex) { DeploymentRepositoryLogger.ROOT_LOGGER.errorf(ioex, "Error deleting file %s", path); } } }

Target:
public static void deleteSilentlyRecursively(final Path path) { if (path != null) { try { deleteRecursively(path); } catch (IOException ioex) { DeploymentRepositoryLogger.ROOT_LOGGER.cannotDeleteFile(ioex, path); } } }
Source:
public void captureWithMinLatency_jpegQualityIs95() throws InterruptedException { final Semaphore semaphore = new Semaphore(0); AtomicBoolean hasJpegQuality = new AtomicBoolean(); ImageCapture imageCapture = createImageCapture(); mInstrumentation.runOnMainSync(() -> bind(imageCapture)); FakeCameraControl fakeCameraControl = ((FakeCameraControl) mFakeCamera.getCameraControlInternal()); fakeCameraControl.setOnNewCaptureRequestListener(captureConfigs -> { hasJpegQuality.set(hasJpegQuality(captureConfigs, (byte) 95)); semaphore.release(); }); mInstrumentation.runOnMainSync( () -> imageCapture.takePicture(CameraXExecutors.mainThreadExecutor(), mock(ImageCapture.OnImageCapturedCallback.class))); assertThat(semaphore.tryAcquire(1, TimeUnit.SECONDS)).isTrue(); assertThat(hasJpegQuality.get()).isTrue(); }

Target:
public void captureWithMinLatency_jpegQualityIs95() throws InterruptedException { ImageCapture imageCapture = createImageCapture(); mInstrumentation.runOnMainSync(() -> bind(imageCapture)); FakeCameraControl fakeCameraControl = ((FakeCameraControl) mFakeCamera.getCameraControlInternal()); FakeCameraControl.OnNewCaptureRequestListener mockCaptureRequestListener = mock(FakeCameraControl.OnNewCaptureRequestListener.class); fakeCameraControl.setOnNewCaptureRequestListener(mockCaptureRequestListener); mInstrumentation.runOnMainSync( () -> imageCapture.takePicture(CameraXExecutors.mainThreadExecutor(), mock(ImageCapture.OnImageCapturedCallback.class))); ArgumentCaptor<List<CaptureConfig>> argumentCaptor = ArgumentCaptor.forClass(List.class); verify(mockCaptureRequestListener, timeout(1000).times(1)).onNewCaptureRequests(argumentCaptor.capture()); assertThat(hasJpegQuality(argumentCaptor.getValue(), (byte) 95)).isTrue(); }
Source:
public boolean isModified(DirCacheEntry entry, boolean forceContentCheck) { switch (compareMetadata(entry)) { case DIFFER_BY_TIMESTAMP: if (forceContentCheck) return contentCheck(entry); else return true; case SMUDGED: return contentCheck(entry); case EQUAL: return false; case NOT_EQUAL: return true; default: return true; } }

Target:
public boolean isModified(DirCacheEntry entry, boolean forceContentCheck) { MetadataDiff diff = compareMetadata(entry); switch (diff) { case DIFFER_BY_TIMESTAMP: if (forceContentCheck) return contentCheck(entry); else return true; case SMUDGED: return contentCheck(entry); case EQUAL: return false; case DIFFER_BY_METADATA: return true; default: throw new IllegalStateException(MessageFormat.format( JGitText.get().unexpectedCompareResult, diff.name())); } }
Source:
public void variantsSetup(Set<String> enabledFields) throws Exception { String sectionName = "variants"; Set<String> present = this.enabledHeaderIdsBySection.get("genes"); if (present == null || present.isEmpty() || !enabledFields.remove(sectionName)) { return; } List<String> columns = Arrays.asList("gene", "cdna", "protein", "transcript", "dbsnp", "zygosity", "effect", "interpretation", "inheritance", "evidence", "segregation", "sanger", "chromosome", "start_position", "end_position", "reference_genome"); this.enabledHeaderIdsBySection.put(sectionName + "_variants", new LinkedHashSet<>(columns)); }

Target:
public void variantsSetup(Set<String> enabledFields) throws Exception { String sectionName = "variants"; Set<String> present = this.enabledHeaderIdsBySection.get("genes"); if (present == null || present.isEmpty() || !enabledFields.remove(sectionName)) { return; } List<String> columns = Arrays.asList("gene", "cdna", "protein", "transcript", "dbsnp", "zygosity", "effect", "interpretation", "inheritance", "evidence", "segregation", "sanger", "chromosome", "start_position", "end_position", "reference_genome"); this.enabledHeaderIdsBySection.put(sectionName, new LinkedHashSet<>(columns)); }
Source:
public void getWorkerUUIDs_must_be_retrieved_from_ceworkerfactory() { CeWorkerFactory ceWorkerFactory = mock(CeWorkerFactory.class); Set<String> workerUUIDs = new HashSet<>(); workerUUIDs.addAll(Arrays.asList("1", "2", "3")); when(ceWorkerFactory.getWorkerUUIDs()).thenReturn(workerUUIDs); StandaloneCeDistributedInformation ceCluster = new StandaloneCeDistributedInformation(ceWorkerFactory); ceCluster.broadcastWorkerUUIDs(); assertThat(ceCluster.getWorkerUUIDs()).isEqualTo(workerUUIDs); }

Target:
public void getWorkerUUIDs_must_be_retrieved_from_ceworkerfactory() { CeWorkerFactory ceWorkerFactory = mock(CeWorkerFactory.class); Set<String> workerUUIDs = ImmutableSet.of("1", "2", "3"); when(ceWorkerFactory.getWorkerUUIDs()).thenReturn(workerUUIDs); StandaloneCeDistributedInformation ceCluster = new StandaloneCeDistributedInformation(ceWorkerFactory); ceCluster.broadcastWorkerUUIDs(); assertThat(ceCluster.getWorkerUUIDs()).isEqualTo(workerUUIDs); }
Source:
private SetOptions parseOptionalParameters(List<byte[]> optionalParameterBytes) throws IllegalArgumentException { boolean keepTTL = false; SetOptions.Exists existsOption = SetOptions.Exists.NONE; long expiration = 0L; List<String> optionalParametersStrings = optionalParameterBytes.stream() .map(item -> Coder.bytesToString(item).toUpperCase()) .collect(Collectors.toList()); throwExceptionIfUnknownParameter(optionalParametersStrings); throwExceptionIfIncompatableParamaterOptions(optionalParametersStrings); if (optionalParametersStrings.contains("KEEPTL")) { keepTTL = true; } if (optionalParametersStrings.contains("PX")) { int index = optionalParametersStrings.indexOf("PX"); if (optionalParametersStrings.size() <= index + 1) { throw new IllegalArgumentException(ERROR_SYNTAX); } String expirationTime = optionalParametersStrings.get(index + 1); expiration = parseExpirationTime("PX", expirationTime); } else if (optionalParametersStrings.contains("EX")) { int index = optionalParametersStrings.indexOf("EX"); if (optionalParametersStrings.size() <= index + 1) { throw new IllegalArgumentException(ERROR_SYNTAX); } String expirationTime = optionalParametersStrings.get(index + 1); expiration = parseExpirationTime("EX", expirationTime); } if (optionalParametersStrings.contains("NX")) { existsOption = SetOptions.Exists.NX; } else if (optionalParametersStrings.contains("XX")) { existsOption = SetOptions.Exists.XX; } return new SetOptions(existsOption, expiration, keepTTL); }

Target:
private SetOptions parseOptionalParameters(List<byte[]> optionalParameterBytes) throws IllegalArgumentException { boolean keepTTL = false; SetOptions.Exists existsOption = SetOptions.Exists.NONE; long millisecondsUntilExpiration = 0L; List<String> optionalParametersStrings = optionalParameterBytes.stream() .map(item -> Coder.bytesToString(item).toUpperCase()) .collect(Collectors.toList()); throwExceptionIfIncompatableParameterOptions(optionalParametersStrings); throwErrorIfNumberInWrongPosition(optionalParametersStrings); throwExceptionIfUnknownParameter(optionalParametersStrings); if (optionalParametersStrings.contains("PX")) { millisecondsUntilExpiration = handleExpiration(optionalParametersStrings, "PX"); } else if (optionalParametersStrings.contains("EX")) { millisecondsUntilExpiration = handleExpiration(optionalParametersStrings, "EX"); } if (optionalParametersStrings.contains("NX")) { existsOption = SetOptions.Exists.NX; } else if (optionalParametersStrings.contains("XX")) { existsOption = SetOptions.Exists.XX; } return new SetOptions(existsOption, millisecondsUntilExpiration, keepTTL); }
Source:
public void testFindPrimaryReferenceSingleChildOfSpanContext() { Tracer tracer = new APMTracer(); Map<String, String> headers = new HashMap<>(); headers.put(Constants.HAWKULAR_APM_TRACEID, TEST_APM_TRACEID); headers.put(Constants.HAWKULAR_APM_ID, TEST_APM_ID1); headers.put(Constants.HAWKULAR_APM_TXN, TEST_TXN); SpanContext spanCtx = tracer.extract(Format.Builtin.TEXT_MAP, new TextMapExtractAdapter(headers)); Reference ref = new Reference(References.CHILD_OF, spanCtx); assertEquals(ref, APMSpan.findPrimaryReference(Arrays.asList(ref))); }

Target:
public void testFindPrimaryReferenceSingleChildOfSpanContext() { Tracer tracer = new APMTracer(); SpanContext spanCtx = extractSpanContext(tracer, TEST_APM_ID1); Reference ref = new Reference(References.CHILD_OF, spanCtx); assertEquals(ref, APMSpan.findPrimaryReference(Arrays.asList(ref))); }
Source:
List<IResource> getRelevantResources() { List<IResource> resourcesInScope = new ArrayList<IResource>(); ResourceTraversal[] traversals = getScope().getTraversals(); for (ResourceTraversal resourceTraversal : traversals) { resourcesInScope.addAll(Arrays.asList(resourceTraversal .getResources())); } return resourcesInScope; }

Target:
List<IResource> getRelevantResources() { List<IResource> resourcesInScope = new ArrayList<IResource>(); ResourceTraversal[] traversals = getScope().getTraversals(); for (ResourceTraversal resourceTraversal : traversals) resourcesInScope.addAll(Arrays.asList(resourceTraversal .getResources())); return resourcesInScope; }
Source:
private String getStorageId(final ZooKeeperHolder zooKeeperHolder, final Environment environment) { final CuratorFramework curator = zooKeeperHolder.get(); try { curator.create().creatingParentsIfNeeded() .forPath(StorageService.ZK_TIMELINES_DEFAULT_STORAGE, null); } catch (final Exception e) { LOGGER.debug("Node is already there", StorageService.ZK_TIMELINES_DEFAULT_STORAGE); } try { final byte[] storageIdBytes = curator.getData() .forPath(StorageService.ZK_TIMELINES_DEFAULT_STORAGE); if (storageIdBytes != null) { return new String(storageIdBytes); } } catch (final Exception e) { LOGGER.warn("Init of default storage from zk failed, will use default from env", e); } return environment.getProperty("nakadi.timelines.storage.default"); }

Target:
private String getStorageId(final ZooKeeperHolder zooKeeperHolder, final Environment environment) { final CuratorFramework curator = zooKeeperHolder.get(); try { curator.create().creatingParentsIfNeeded() .forPath(StorageService.ZK_TIMELINES_DEFAULT_STORAGE, null); } catch (final KeeperException.NodeExistsException e) { LOGGER.trace("Node already is there", StorageService.ZK_TIMELINES_DEFAULT_STORAGE); } catch (final Exception e) { LOGGER.error("Zookeeper access error {}", e.getMessage(), e); } try { final byte[] storageIdBytes = curator.getData() .forPath(StorageService.ZK_TIMELINES_DEFAULT_STORAGE); if (storageIdBytes != null) { return new String(storageIdBytes, Charsets.UTF_8); } } catch (final Exception e) { LOGGER.warn("Init of default storage from zk failed, will use default from env", e); } return environment.getProperty("nakadi.timelines.storage.default"); }
Source:
public void runAll(AuthenticationInfo authenticationInfo, boolean blocking) { for (Paragraph p : getParagraphs()) { if (!p.isEnabled()) { continue; } if (authenticationInfo != null) { p.setAuthenticationInfo(authenticationInfo); } else if (p.getUser() != null){ p.setAuthenticationInfo(new AuthenticationInfo((p.getUser()))); } else { p.setAuthenticationInfo(AuthenticationInfo.ANONYMOUS); } if (!run(p.getId(), blocking)) { logger.warn("Skip running the remain notes because paragraph fails", p.getId()); break; } } }

Target:
public void runAll(AuthenticationInfo authenticationInfo, boolean blocking) { for (Paragraph p : getParagraphs()) { if (!p.isEnabled()) { continue; } p.setAuthenticationInfo(authenticationInfo); if (!run(p.getId(), blocking)) { logger.warn("Skip running the remain notes because paragraph fails", p.getId()); break; } } }
Source:
public CharSequence toXML() { XmlStringBuilder xml = new XmlStringBuilder(); xml.halfOpenElement(this); xml.attribute("node", node); xml.rightAngleBracket(); xml.halfOpenElement("affiliation"); xml.attribute("jid", userJid); xml.attribute("affiliation", "none"); xml.closeEmptyElement(); xml.closeElement(this); return xml; }

Target:
public CharSequence toXML() { XmlStringBuilder xml = new XmlStringBuilder(this); xml.attribute("node", node); xml.rightAngleBracket(); xml.halfOpenElement("affiliation"); xml.attribute("jid", userJid); xml.attribute("affiliation", "none"); xml.closeEmptyElement(); xml.closeElement(this); return xml; }
Source:
private boolean handleDefinedNestedTargetMapping(Set<String> handledTargets) { NestedTargetPropertyMappingHolder holder = new NestedTargetPropertyMappingHolder.Builder() .mappingContext( ctx ) .method( method ) .existingVariableNames( existingVariableNames ) .build(); unprocessedSourceParameters.removeAll( holder.getProcessedSourceParameters() ); propertyMappings.addAll( holder.getPropertyMappings() ); handledTargets.addAll( holder.getHandledTargets() ); for ( Entry<PropertyEntry, List<Mapping>> entry : holder.getUnprocessedDefinedTarget().entrySet() ) { if ( entry.getValue().isEmpty() ) { continue; } unprocessedDefinedTargets.put( entry.getKey().getName(), entry.getValue() ); } return holder.isErrorOccurred(); }

Target:
private boolean handleDefinedNestedTargetMapping(Set<String> handledTargets) { NestedTargetPropertyMappingHolder holder = new NestedTargetPropertyMappingHolder.Builder() .mappingContext( ctx ) .method( method ) .existingVariableNames( existingVariableNames ) .build(); unprocessedSourceParameters.removeAll( holder.getProcessedSourceParameters() ); propertyMappings.addAll( holder.getPropertyMappings() ); handledTargets.addAll( holder.getHandledTargets() ); for ( Entry<PropertyEntry, List<Mapping>> entry : holder.getUnprocessedDefinedTarget().entrySet() ) { if ( entry.getValue().isEmpty() ) { continue; } unprocessedDefinedTargets.put( entry.getKey().getName(), entry.getValue() ); } return holder.hasErrorOccurred(); }
Source:
public BaseResponseDto generateWithdrawRequest(@RequestBody WithdrawOperateRequestDto requestDto) { requestDto.getBaseParam().setUserId(getLoginName()); String loginName = getLoginName(); if (blacklistService.userIsInBlacklist(loginName)) { BaseResponseDto<BaseResponseDataDto> baseResponseDto = new BaseResponseDto<>(); baseResponseDto.setCode(ReturnMessage.WITHDRAW_IN_BLACKLIST.getCode()); baseResponseDto.setMessage("操作失败(错误代码:YM001), 请联系客服"); return baseResponseDto; } return mobileAppWithDrawService.generateWithdrawRequest(requestDto); }

Target:
public BaseResponseDto generateWithdrawRequest(@RequestBody WithdrawOperateRequestDto requestDto) { requestDto.getBaseParam().setUserId(getLoginName()); return mobileAppWithDrawService.generateWithdrawRequest(requestDto); }
Source:
ClusterTierManagerPassiveEntity(ClusterTierManagerConfiguration config, EhcacheStateService ehcacheStateService, Management management) throws ConfigurationException { if (config == null) { throw new ConfigurationException("ClusterTierManagerConfiguration cannot be null"); } this.ehcacheStateService = ehcacheStateService; if (ehcacheStateService == null) { throw new AssertionError("Server failed to retrieve EhcacheStateService."); } try { ehcacheStateService.configure(); this.management = management; } catch (ConfigurationException e) { ehcacheStateService.destroy(); throw e; } }

Target:
public ClusterTierManagerPassiveEntity(ClusterTierManagerConfiguration config, EhcacheStateService ehcacheStateService, Management management) throws ConfigurationException { if (config == null) { throw new ConfigurationException("ClusterTierManagerConfiguration cannot be null"); } this.ehcacheStateService = ehcacheStateService; if (ehcacheStateService == null) { throw new AssertionError("Server failed to retrieve EhcacheStateService."); } try { ehcacheStateService.configure(); this.management = management; } catch (ConfigurationException e) { ehcacheStateService.destroy(); throw e; } }