auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void executeSyncOperation(final PlanOperation syncOp) { final String serverId = syncOp.getEvalId().get(); LOG.log(Level.FINE, "SYNC: server {0}", serverId); routingTableManager.waitUntilWorkersReadyForServerDelete(serverId); onOperationComplete(syncOp); }

Target:
private void executeSyncOperation(final PlanOperation syncOp) { final String serverId = syncOp.getEvalId().get(); LOG.log(Level.FINE, "SYNC: server {0}", serverId); routingTableManager.checkWorkersTobeReadyForServerDelete(serverId, new SyncHandler(syncOp)); }
Source:
public Optional<RelDataType> getReturnRelDataType() { if (returnType == null) { return Optional.empty(); } else { JavaTypeFactoryImpl typeFactory = new JavaTypeFactoryImpl(new HiveTypeSystemImpl()); Type type = returnType; if (type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if (parameterizedType.getRawType() == List.class) { final RelDataType componentRelType = typeFactory.createType(parameterizedType.getActualTypeArguments()[0]); return Optional .of(typeFactory.createArrayType(typeFactory.createTypeWithNullability(componentRelType, true), -1)); } } return Optional.of(typeFactory.createType(returnType)); } }

Target:
public Optional<RelDataType> getReturnRelDataType() { if (returnType == null) { return Optional.empty(); } else { JavaTypeFactoryImpl typeFactory = new JavaTypeFactoryImpl(new HiveTypeSystemImpl()); if (returnType instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) returnType; if (parameterizedType.getRawType() == List.class) { final RelDataType componentRelType = typeFactory.createType(parameterizedType.getActualTypeArguments()[0]); return Optional .of(typeFactory.createArrayType(typeFactory.createTypeWithNullability(componentRelType, true), -1)); } return Optional.empty(); } return Optional.of(typeFactory.createType(returnType)); } }
Source:
private RexNode simplifyNotEqual(RexNode e) { final Comparison comparison = Comparison.of(e); if (comparison == null || comparison.literal.getValue() == null) { return e; } for (RexNode node: predicates.pulledUpPredicates) { final Comparison predicate = Comparison.of(node); if (predicate == null || predicate.kind != SqlKind.EQUALS || predicate.literal.getValue() == null || !predicate.ref.equals(comparison.ref)) { continue; } final RelDataType type = comparison.ref.getType(); final boolean nullable = type.isNullable(); if (predicate.literal.equals(comparison.literal)) { return nullable ? rexBuilder.makeCall(SqlStdOperatorTable.AND, rexBuilder.makeNullLiteral(type), rexBuilder.makeCall(SqlStdOperatorTable.IS_NULL, comparison.ref)) : rexBuilder.makeLiteral(false); } else { return nullable ? rexBuilder.makeCall(SqlStdOperatorTable.OR, rexBuilder.makeNullLiteral(type), rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_NULL, comparison.ref)) : rexBuilder.makeLiteral(true); } } return e; }

Target:
private RexNode simplifyNotEqual(RexNode e) { final Comparison comparison = Comparison.of(e); if (comparison == null) { return e; } for (RexNode node: predicates.pulledUpPredicates) { final Comparison predicate = Comparison.of(node); if (predicate == null || predicate.kind != SqlKind.EQUALS || !predicate.ref.equals(comparison.ref)) { continue; } RexNode simplified; if (predicate.literal.equals(comparison.literal)) { simplified = rexBuilder.makeCall(SqlStdOperatorTable.AND, rexBuilder.makeNullLiteral(e.getType()), rexBuilder.makeCall(SqlStdOperatorTable.IS_NULL, comparison.ref)); } else { simplified = rexBuilder.makeCall(SqlStdOperatorTable.OR, rexBuilder.makeNullLiteral(e.getType()), rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_NULL, comparison.ref)); } return simplify(simplified); } return e; }
Source:
public void insertAfter(E request, E after) { this.requests.add(this.requests.indexOf(after) + 1, request); }

Target:
public AbstractBulkLightblueRequest<E> insertAfter(E request, E after) { this.requests.add(requests.indexOf(after) + 1, request); return this; }
Source:
private ObserveResponse createObserveResponse(Observation observation, LwM2mModel model, Response coapResponse) { if (coapResponse.getCode() != CoAP.ResponseCode.CHANGED && coapResponse.getCode() != CoAP.ResponseCode.CONTENT) { throw new InvalidResponseException(String.format("Unexpected response code [%s]", coapResponse.getCode())); } ContentFormat contentFormat = null; if (coapResponse.getOptions().hasContentFormat()) { contentFormat = ContentFormat.fromCode(coapResponse.getOptions().getContentFormat()); } else { throw new InvalidResponseException("Content Format is mandatory"); } try { List<TimestampedLwM2mNode> timestampedNodes = decoder.decodeTimestampedData(coapResponse.getPayload(), contentFormat, observation.getPath(), model); if (timestampedNodes.size() == 1 && !timestampedNodes.get(0).isTimestamped()) { return new ObserveResponse(ResponseCode.CONTENT, timestampedNodes.get(0).getNode(), null, observation, null, coapResponse); } else { return new ObserveResponse(ResponseCode.CONTENT, null, timestampedNodes, observation, null, coapResponse); } } catch (CodecException e) { byte[] payload = coapResponse.getPayload() == null ? new byte[0] : coapResponse.getPayload(); throw new InvalidResponseException( String.format("Unable to decode notification payload [%s] of observation [%s] ", Hex.encodeHexString(payload), observation), e); } }

Target:
private ObserveResponse createObserveResponse(Observation observation, LwM2mModel model, Response coapResponse) { if (coapResponse.getCode() != CoAP.ResponseCode.CHANGED && coapResponse.getCode() != CoAP.ResponseCode.CONTENT) { throw new InvalidResponseException(String.format("Unexpected response code [%s]", coapResponse.getCode())); } ContentFormat contentFormat = null; if (coapResponse.getOptions().hasContentFormat()) { contentFormat = ContentFormat.fromCode(coapResponse.getOptions().getContentFormat()); } try { List<TimestampedLwM2mNode> timestampedNodes = decoder.decodeTimestampedData(coapResponse.getPayload(), contentFormat, observation.getPath(), model); if (timestampedNodes.size() == 1 && !timestampedNodes.get(0).isTimestamped()) { return new ObserveResponse(ResponseCode.CONTENT, timestampedNodes.get(0).getNode(), null, observation, null, coapResponse); } else { return new ObserveResponse(ResponseCode.CONTENT, null, timestampedNodes, observation, null, coapResponse); } } catch (CodecException e) { if (LOG.isDebugEnabled()) { byte[] payload = coapResponse.getPayload() == null ? new byte[0] : coapResponse.getPayload(); LOG.debug(String.format("Unable to decode notification payload [%s] of observation [%s] ", Hex.encodeHexString(payload), observation), e); } throw new InvalidResponseException( String.format("Unable to decode notification payload of observation [%s] ", observation), e); } }
Source:
public void objectNames() { List<network> list = new ArrayList<network>(); network n1 = new network(); n1.setname("network1"); network n2 = new network(); n2.setname("network2"); list.add(n1); list.add(n2); Set<String> names = Entities.objectNames(list); Assert.assertTrue(names.size() == 2); Assert.assertTrue(names.contains("network1")); Assert.assertTrue(names.contains("network2")); Assert.assertTrue(!names.contains("network3")); Assert.assertTrue(Entities.objectNames(null).equals(Collections.emptySet())); Assert.assertTrue(Entities.objectNames(new ArrayList<network>()).equals(Collections.emptySet())); }

Target:
public void objectNames() { List<network> list = new ArrayList<network>(); network n1 = new network(); n1.setname("network1"); network n2 = new network(); n2.setname("network2"); list.add(n1); list.add(n2); Set<String> names = Entities.objectNames(list); Assert.assertTrue(names.size() == 2); Assert.assertTrue(names.contains("network1")); Assert.assertTrue(names.contains("network2")); Assert.assertFalse(names.contains("network3")); Assert.assertTrue(Entities.objectNames(null).equals(Collections.emptySet())); Assert.assertTrue(Entities.objectNames(new ArrayList<network>()).equals(Collections.emptySet())); }
Source:
protected void append(final ILoggingEvent event) { if (bugsnag != null) { Throwable throwable = extractThrowable(event); final Callback reportCallback; if (event.getMarker() != null && event.getMarker() instanceof BugsnagMarker) { reportCallback = ((BugsnagMarker) event.getMarker()).getCallback(); } else { reportCallback = null; } if (throwable != null && !detectLogFromBugsnag(throwable) && !isExcludedLogger(event.getLoggerName())) { bugsnag.notify( throwable, calculateSeverity(event), new Callback() { @Override public void beforeNotify(Report report) { report.addToTab("Log event data", "Message", event.getMessage()); report.addToTab("Log event data", "Timestamp", event.getTimeStamp()); if (reportCallback != null) { reportCallback.beforeNotify(report); } } }); } } }

Target:
protected void append(final ILoggingEvent event) { if (bugsnag != null) { Throwable throwable = extractThrowable(event); final Callback reportCallback; Marker marker = event.getMarker(); if (marker instanceof BugsnagMarker) { reportCallback = ((BugsnagMarker) marker).getCallback(); } else { reportCallback = null; } if (throwable != null && !detectLogFromBugsnag(throwable) && !isExcludedLogger(event.getLoggerName())) { bugsnag.notify( throwable, calculateSeverity(event), new Callback() { @Override public void beforeNotify(Report report) { report.addToTab("Log event data", "Message", event.getMessage()); report.addToTab("Log event data", "Timestamp", event.getTimeStamp()); populateContextData(report, event); if (reportCallback != null) { reportCallback.beforeNotify(report); } } }); } } }
Source:
private boolean isAnotherBuildWithSameParametersRunningOnNode(Node node, Queue.Item item) { ThrottleJobProperty tjp = getThrottleJobProperty(item.task); Computer computer = node.toComputer(); List<String> paramsToCompare = tjp.getParamsToCompare(); List<ParameterValue> itemParams = getParametersFromQueueItem(item); if (paramsToCompare.size() > 0) { itemParams = doFilterParams(paramsToCompare, itemParams); } if (computer != null) { for (Executor exec : computer.getExecutors()) { if (item != null && item.task != null) { if (exec.getCurrentExecutable() != null && exec.getCurrentExecutable().getParent() != null && exec.getCurrentExecutable().getParent().getOwnerTask() != null && exec.getCurrentExecutable().getParent().getOwnerTask().getName().equals(item.task.getDisplayName())) { List<ParameterValue> executingUnitParams = getParametersFromWorkUnit(exec.getCurrentWorkUnit()); executingUnitParams = doFilterParams(paramsToCompare, executingUnitParams); if (executingUnitParams.containsAll(itemParams)) { LOGGER.log(Level.FINE, "build (" + exec.getCurrentWorkUnit() + ") with identical parameters (" + executingUnitParams + ") is already running."); return true; } } } } } return false; }

Target:
private boolean isAnotherBuildWithSameParametersRunningOnNode(Node node, Queue.Item item) { ThrottleJobProperty tjp = getThrottleJobProperty(item.task); Computer computer = node.toComputer(); List<String> paramsToCompare = tjp.getParamsToCompare(); List<ParameterValue> itemParams = getParametersFromQueueItem(item); if (paramsToCompare.size() > 0) { itemParams = doFilterParams(paramsToCompare, itemParams); } if (computer != null) { for (Executor exec : computer.getExecutors()) { if (item != null && item.task != null) { if (exec.getCurrentExecutable() != null && exec.getCurrentExecutable().getParent() != null && exec.getCurrentExecutable().getParent().getOwnerTask() != null && exec.getCurrentExecutable().getParent().getOwnerTask().getName().equals(item.task.getName())) { List<ParameterValue> executingUnitParams = getParametersFromWorkUnit(exec.getCurrentWorkUnit()); executingUnitParams = doFilterParams(paramsToCompare, executingUnitParams); if (executingUnitParams.containsAll(itemParams)) { LOGGER.log(Level.FINE, "build (" + exec.getCurrentWorkUnit() + ") with identical parameters (" + executingUnitParams + ") is already running."); return true; } } } } } return false; }
Source:
private void compare() { gitService.diff(workspaceId, project, Collections.singletonList(selectedFile), NAME_STATUS, false, 0, selectedRevision.getId(), false, new AsyncRequestCallback<String>(new StringUnmarshaller()) { @Override protected void onSuccess(String result) { if (result.isEmpty()) { dialogFactory.createMessageDialog(locale.compareMessageIdenticalContentTitle(), locale.compareMessageIdenticalContentText(), new ConfirmCallback() { @Override public void accepted() { } }).show(); } else { comparePresenter.show(result.substring(2), result.substring(0, 1), selectedRevision.getId()); } } @Override protected void onFailure(Throwable exception) { notificationManager.notify(exception.getMessage(), FAIL, false); } }); }

Target:
private void compare() { gitService.diff(workspaceId, project, Collections.singletonList(selectedFile), NAME_STATUS, false, 0, selectedRevision.getId(), false, new AsyncRequestCallback<String>(new StringUnmarshaller()) { @Override protected void onSuccess(String result) { if (result.isEmpty()) { dialogFactory.createMessageDialog(locale.compareMessageIdenticalContentTitle(), locale.compareMessageIdenticalContentText(), new ConfirmCallback() { @Override public void accepted() { } }).show(); } else { comparePresenter.show(result.substring(2), result.substring(0, 1), selectedRevision.getId()); } } @Override protected void onFailure(Throwable exception) { notificationManager.notify(locale.diffFailed(), FAIL, false); } }); }
Source:
protected Type visitDereferenceExpression(DereferenceExpression node, StackableAstVisitorContext<Context> context) { QualifiedName qualifiedName = DereferenceExpression.getQualifiedName(node); if (qualifiedName != null) { Scope scope = context.getContext().getScope(); Optional<ResolvedField> resolvedField = scope.tryResolveField(node, qualifiedName); if (resolvedField.isPresent()) { if (!context.getContext().isInLambda() || !context.getContext().getFieldToLambdaArgumentDeclaration().containsKey(FieldId.from(resolvedField.get()))) { return handleResolvedField(node, resolvedField.get(), context); } } if (!scope.isColumnReference(qualifiedName)) { throw missingAttributeException(node, qualifiedName); } } Type baseType = process(node.getBase(), context); if (!(baseType instanceof RowType)) { throw new SemanticException(TYPE_MISMATCH, node.getBase(), "Expression %s is not of type ROW", node.getBase()); } RowType rowType = (RowType) baseType; Type rowFieldType = null; for (RowField rowField : rowType.getFields()) { if (node.getField().getValue().equalsIgnoreCase(rowField.getName().orElse(null))) { rowFieldType = rowField.getType(); break; } } if (rowFieldType == null) { throw missingAttributeException(node); } return setExpressionType(node, rowFieldType); }

Target:
protected Type visitDereferenceExpression(DereferenceExpression node, StackableAstVisitorContext<Context> context) { QualifiedName qualifiedName = DereferenceExpression.getQualifiedName(node); if (qualifiedName != null) { Scope scope = context.getContext().getScope(); Optional<ResolvedField> resolvedField = scope.tryResolveField(node, qualifiedName); if (resolvedField.isPresent()) { return handleResolvedField(node, resolvedField.get(), context); } if (!scope.isColumnReference(qualifiedName)) { throw missingAttributeException(node, qualifiedName); } } Type baseType = process(node.getBase(), context); if (!(baseType instanceof RowType)) { throw new SemanticException(TYPE_MISMATCH, node.getBase(), "Expression %s is not of type ROW", node.getBase()); } RowType rowType = (RowType) baseType; Type rowFieldType = null; for (RowField rowField : rowType.getFields()) { if (node.getField().getValue().equalsIgnoreCase(rowField.getName().orElse(null))) { rowFieldType = rowField.getType(); break; } } if (rowFieldType == null) { throw missingAttributeException(node); } return setExpressionType(node, rowFieldType); }
Source:
public static ClientContext create(final ClientConfiguration clientConfiguration) { Assert.requireNonNull(clientConfiguration, "clientConfiguration"); Logger openDolphinLogger = LoggerFactory.getLogger("org.opendolphin"); return new ClientContextImpl(clientConfiguration, new Function<ClientModelStore, AbstractClientConnector>() { @Override public AbstractClientConnector call(final ClientModelStore clientModelStore) { return new DolphinPlatformHttpClientConnector(clientConfiguration, clientModelStore, new OptimizedJsonCodec(), clientConfiguration.getRemotingExceptionHandler()); } }); }

Target:
public static ClientContext create(final ClientConfiguration clientConfiguration) { Assert.requireNonNull(clientConfiguration, "clientConfiguration"); return new ClientContextImpl(clientConfiguration, new Function<ClientModelStore, AbstractClientConnector>() { @Override public AbstractClientConnector call(final ClientModelStore clientModelStore) { return new DolphinPlatformHttpClientConnector(clientConfiguration, clientModelStore, new OptimizedJsonCodec(), clientConfiguration.getRemotingExceptionHandler()); } }); }
Source:
public static void main(String[] args) throws IOException { Schema schema = new Parser().parse(new File("./../user.avsc")); GenericRecord user1 = new GenericData.Record(schema); user1.put("name", "Alyssa"); user1.put("favorite_number", 256); GenericRecord user2 = new GenericData.Record(schema); user2.put("name", "Ben"); user2.put("favorite_number", 7); user2.put("favorite_color", "red"); File file = new File("users.avro"); DatumWriter<GenericRecord> datumWriter = new GenericDatumWriter<GenericRecord>(schema); DataFileWriter<GenericRecord> dataFileWriter = new DataFileWriter<GenericRecord>(datumWriter); dataFileWriter.create(schema, file); dataFileWriter.append(user1); dataFileWriter.append(user2); dataFileWriter.close(); DatumReader<GenericRecord> datumReader = new GenericDatumReader<GenericRecord>(schema); DataFileReader<GenericRecord> dataFileReader = new DataFileReader<GenericRecord>(file, datumReader); GenericRecord user = null; while (dataFileReader.hasNext()) { user = dataFileReader.next(user); System.out.println(user); } dataFileReader.close(); }

Target:
public static void main(String[] args) throws IOException { Schema schema = new Parser().parse(new File("./../user.avsc")); GenericRecord user1 = new GenericData.Record(schema); user1.put("name", "Alyssa"); user1.put("favorite_number", 256); GenericRecord user2 = new GenericData.Record(schema); user2.put("name", "Ben"); user2.put("favorite_number", 7); user2.put("favorite_color", "red"); File file = new File("users.avro"); DatumWriter<GenericRecord> datumWriter = new GenericDatumWriter<GenericRecord>(schema); DataFileWriter<GenericRecord> dataFileWriter = new DataFileWriter<GenericRecord>(datumWriter); dataFileWriter.create(schema, file); dataFileWriter.append(user1); dataFileWriter.append(user2); dataFileWriter.close(); DatumReader<GenericRecord> datumReader = new GenericDatumReader<GenericRecord>(schema); GenericRecord user = null; try(DataFileReader<GenericRecord> dataFileReader = new DataFileReader<GenericRecord>(file, datumReader)){ while (dataFileReader.hasNext()) { user = dataFileReader.next(user); System.out.println(user); } } }
Source:
public HttpClient httpClient() { List<String> hosts = hostsSupplier().get(); if (hosts.isEmpty()) throw new IllegalArgumentException("no hosts configured"); final String clientUrl; if (hosts.size() == 1) { clientUrl = hosts.get(0); } else { List<URL> urls = hosts.stream() .map(host -> { try { return new URL(host); } catch (MalformedURLException e) { throw new IllegalArgumentException("Invalid host: " + host, e); } }) .collect(Collectors.toList()); List<Endpoint> endpoints = urls.stream() .map(url -> Endpoint.parse(url.getAuthority())) .collect(Collectors.toList()); EndpointGroup group = HttpHealthCheckedEndpointGroup.of( new StaticEndpointGroup(endpoints), "/_cluster/health"); EndpointGroupRegistry.register("elasticsearch", group, EndpointSelectionStrategy.ROUND_ROBIN); clientUrl = urls.get(0).getProtocol() + "://group:elasticsearch" + urls.get(0).getPath(); } HttpClientBuilder client = new HttpClientBuilder(clientUrl) .factory(clientFactory()) .decorator(HttpDecodingClient.newDecorator()); clientCustomizer().accept(client); return client.build(); }

Target:
public HttpClient httpClient() { List<String> hosts = hostsSupplier().get(); if (hosts.isEmpty()) throw new IllegalArgumentException("no hosts configured"); List<URL> urls = hosts.stream() .map(host -> { try { return new URL(host); } catch (MalformedURLException e) { throw new IllegalArgumentException("Invalid host: " + host, e); } }) .collect(Collectors.toList()); final EndpointGroup endpointGroup; if (urls.size() == 1) { URL url = urls.get(0); if (isIpAddress(url.getHost())) { endpointGroup = null; } else { DnsAddressEndpointGroupBuilder dnsEndpoint = new DnsAddressEndpointGroupBuilder(url.getHost()); if (url.getPort() != -1) { dnsEndpoint.port(url.getPort()); } endpointGroup = dnsEndpoint.build(); } } else { List<EndpointGroup> endpointGroups = new ArrayList<>(); List<Endpoint> staticEndpoints = new ArrayList<>(); for (URL url : urls) { if (isIpAddress(url.getHost())) { staticEndpoints.add(Endpoint.parse(url.getAuthority())); } else { endpointGroups.add(url.getPort() == -1 ? DnsAddressEndpointGroup.of(url.getHost()) : DnsAddressEndpointGroup.of(url.getHost(), url.getPort())); } } if (!staticEndpoints.isEmpty()) { endpointGroups.add(new StaticEndpointGroup(staticEndpoints)); } if (endpointGroups.size() == 1) { endpointGroup = endpointGroups.get(0); } else { endpointGroup = new CompositeEndpointGroup(endpointGroups); } } final String clientUrl; if (endpointGroup != null) { HttpHealthCheckedEndpointGroup healthChecked = new HttpHealthCheckedEndpointGroupBuilder( endpointGroup, "/_cluster/health") .clientFactory(clientFactory()) .build(); EndpointGroupRegistry.register( "elasticsearch", healthChecked, EndpointSelectionStrategy.ROUND_ROBIN); try { healthChecked.awaitInitialEndpoints(30, TimeUnit.SECONDS); } catch (InterruptedException | TimeoutException e) { } clientUrl = urls.get(0).getProtocol() + "://group:elasticsearch" + urls.get(0).getPath(); } else { clientUrl = hosts.get(0); } HttpClientBuilder client = new HttpClientBuilder(clientUrl) .factory(clientFactory()) .decorator(HttpDecodingClient.newDecorator()); clientCustomizer().accept(client); return client.build(); }
Source:
protected void ExecuteVmCommand() { VmDeviceUtils.updateVmDevices(getVm().getStaticData()); setActionReturnValue(VMStatus.Down); if (InitVm()) { if (getVm().getstatus() == VMStatus.Paused) { ResumeVm(); } else { if (getParameters().getRunAsStateless()) { for (Disk disk : getVm().getDiskMap().values()) { if (!disk.isAllowSnapshot()) { AuditLogDirector.log(this, AuditLogType.USER_RUN_VM_AS_STATELESS_WITH_DISKS_NOT_ALLOWING_SNAPSHOT); break; } } } if (!_isRerun && Boolean.TRUE.equals(getParameters().getRunAsStateless()) && !getVm().getDiskList().isEmpty() && getVm().getstatus() != VMStatus.Suspended) { StatelessVmTreatment(); } else if (!getParameters().getIsInternal() && !_isRerun && getVm().getstatus() != VMStatus.Suspended && statelessSnapshotExistsForVm()) { removeVmStatlessImages(); } else { RunVm(); } } } else { setActionReturnValue(getVm().getstatus()); } }

Target:
protected void ExecuteVmCommand() { VmDeviceUtils.updateVmDevices(getVm().getStaticData()); setActionReturnValue(VMStatus.Down); if (InitVm()) { if (getVm().getstatus() == VMStatus.Paused) { ResumeVm(); } else { if (!_isRerun && Boolean.TRUE.equals(getParameters().getRunAsStateless()) && !getVm().getDiskList().isEmpty() && getVm().getstatus() != VMStatus.Suspended) { StatelessVmTreatment(); } else if (!getParameters().getIsInternal() && !_isRerun && getVm().getstatus() != VMStatus.Suspended && statelessSnapshotExistsForVm()) { removeVmStatlessImages(); } else { RunVm(); } } } else { setActionReturnValue(getVm().getstatus()); } }
Source:
public PropertyPathNotification extract(MultiValueMap<String, String> headers, Map<String, Object> request) { if (HEADERS_VALUE.equals(headers.getFirst(HEADERS_KEY))) { if (request.get("commits") instanceof Collection) { Set<String> paths = new HashSet<>(); @SuppressWarnings("unchecked") Collection<Map<String, Object>> commits = (Collection<Map<String, Object>>) request .get("commits"); for (Map<String, Object> commit : commits) { addAllPaths(paths, commit, "added"); addAllPaths(paths, commit, "removed"); addAllPaths(paths, commit, "modified"); } if (!paths.isEmpty()) { return new PropertyPathNotification(paths.toArray(new String[0])); } } } return null; }

Target:
public PropertyPathNotification extract(MultiValueMap<String, String> headers, Map<String, Object> request) { if (HEADERS_VALUE.equals(headers.getFirst(HEADERS_KEY))) { if (request.get("commits") instanceof Collection) { Set<String> paths = new HashSet<>(); @SuppressWarnings("unchecked") Collection<Map<String, Object>> commits = (Collection<Map<String, Object>>) request .get("commits"); for (Map<String, Object> commit : commits) { addAllPaths(paths, commit, "added"); addAllPaths(paths, commit, "removed"); addAllPaths(paths, commit, "modified"); } if (!paths.isEmpty()) { return new PropertyPathNotification(paths.toArray(new String[paths.size()])); } } } return null; }
Source:
public boolean hasMappingTargetParameter() { for ( Parameter param : getParameterBindings() ) { if ( param.isMappingTarget() ) { return true; } } return false; }

Target:
public boolean hasMappingTargetParameter() { for ( ParameterBinding param : getParameterBindings() ) { if ( param.isMappingTarget() ) { return true; } } return false; }
Source:
public short sizeInBytes() { switch (version) { case BLOB_ID_V1: return (short) (VERSION_FIELD_LENGTH_IN_BYTES + partitionId.getBytes().length + UUID_SIZE_FIELD_LENGTH_IN_BYTES + uuid.length()); case BLOB_ID_V2: return (short) (VERSION_FIELD_LENGTH_IN_BYTES + FLAG_FIELD_LENGTH_IN_BYTES + DATACENTER_ID_FIELD_LENGTH_IN_BYTES + ACCOUNT_ID_FIELD_LENGTH_IN_BYTES + CONTAINER_ID_FIELD_LENGTH_IN_BYTES + partitionId.getBytes().length + UUID_SIZE_FIELD_LENGTH_IN_BYTES + uuid.length()); default: throw new IllegalArgumentException("blobId version=" + version + " not supported"); } }

Target:
public short sizeInBytes() { short sizeForBlobIdV1 = (short) (VERSION_FIELD_LENGTH_IN_BYTES + partitionId.getBytes().length + UUID_SIZE_FIELD_LENGTH_IN_BYTES + uuid.getBytes().length); switch (version) { case BLOB_ID_V1: return sizeForBlobIdV1; case BLOB_ID_V2: return (short) (FLAG_FIELD_LENGTH_IN_BYTES + DATACENTER_ID_FIELD_LENGTH_IN_BYTES + ACCOUNT_ID_FIELD_LENGTH_IN_BYTES + CONTAINER_ID_FIELD_LENGTH_IN_BYTES + sizeForBlobIdV1); default: throw new IllegalArgumentException("blobId version=" + version + " not supported"); } }
Source:
public void downloadPart(DataChannel channel, Part part, String objectId, File outputDir) throws IOException { retry.execute(new RetryCallback<Void, IOException>() { @Override public Void doWithRetry(RetryContext ctx) throws IOException { log.debug("Download Part URL: {}", part.getUrl()); final RequestCallback callback = new RequestCallback() { @Override public void doWithRequest(final ClientHttpRequest request) throws IOException { request.getHeaders().set(HttpHeaders.RANGE, Parts.getHttpRangeValue(part)); } }; final ResponseExtractor<HttpHeaders> headersExtractor = new ResponseExtractor<HttpHeaders>() { @Override public HttpHeaders extractData(ClientHttpResponse response) throws IOException { try (HashingInputStream his = new HashingInputStream(Hashing.md5(), response.getBody())) { channel.readFrom(his); response.getHeaders().set(HttpHeaders.ETAG, his.hash().toString()); return response.getHeaders(); } } }; try { HttpHeaders headers = dataTemplate.execute(new URI(part.getUrl()), HttpMethod.GET, callback, headersExtractor); part.setMd5(cleanUpETag(headers.getETag())); downloadStateStore.commit(outputDir, objectId, part); } catch (NotResumableException | NotRetryableException e) { log.error("Cannot proceed. Failed to receive part for part number: {}", part.getPartNumber(), e); throw e; } catch (Throwable e) { log.warn("Failed to receive part for part number: {}. Retrying.", part.getPartNumber(), e); channel.reset(); throw new RetryableException(e); } return null; } }); }

Target:
public void downloadPart(DataChannel channel, Part part, String objectId, File outputDir) throws IOException { retry.execute(new RetryCallback<Void, IOException>() { @Override public Void doWithRetry(RetryContext ctx) throws IOException { log.debug("Download Part URL: {}", part.getUrl()); final RequestCallback callback = new RequestCallback() { @Override public void doWithRequest(final ClientHttpRequest request) throws IOException { request.getHeaders().set(HttpHeaders.RANGE, Parts.getHttpRangeValue(part)); } }; final ResponseExtractor<HttpHeaders> headersExtractor = new ResponseExtractor<HttpHeaders>() { @Override public HttpHeaders extractData(ClientHttpResponse response) throws IOException { try (HashingInputStream his = new HashingInputStream(Hashing.md5(), response.getBody())) { channel.readFrom(his); response.getHeaders().set(HttpHeaders.ETAG, his.hash().toString()); return response.getHeaders(); } } }; try { log.debug("performing GET {}", part.getUrl()); HttpHeaders headers = dataTemplate.execute(new URI(part.getUrl()), HttpMethod.GET, callback, headersExtractor); part.setMd5(cleanUpETag(headers.getETag())); downloadStateStore.commit(outputDir, objectId, part); log.debug("committed part# to download state store", objectId, part.getPartNumber()); } catch (NotResumableException | NotRetryableException e) { log.error("Cannot proceed. Failed to receive part for part# : {}", part.getPartNumber(), e); throw e; } catch (Throwable e) { log.warn("Failed to receive part for part number: {}. Retrying. {}", part.getPartNumber(), e); channel.reset(); throw new RetryableException(e); } return null; } }); }
Source:
protected OAuth20Credentials getOAuthCredentials(final WebContext context) { if (configuration.isWithState()) { final Optional<String> stateParameter = context.getRequestParameter(OAuth20Configuration.STATE_REQUEST_PARAMETER); if (CommonHelper.isNotBlank(stateParameter.orElse(null))) { final String stateSessionAttributeName = this.configuration.getStateSessionAttributeName(client.getName()); final Optional<String> sessionState = context.getSessionStore().get(context, stateSessionAttributeName); context.getSessionStore().set(context, stateSessionAttributeName, null); logger.debug("sessionState: / stateParameter: {}", sessionState, stateParameter); if (!stateParameter.equals(sessionState)) { final String message = "State parameter mismatch: session expired or possible threat of cross-site request forgery"; throw new OAuthCredentialsException(message); } } else { final String message = "Missing state parameter: session expired or possible threat of cross-site request forgery"; throw new OAuthCredentialsException(message); } } final Optional<String> codeParameter = context.getRequestParameter(OAuth20Configuration.OAUTH_CODE); if (codeParameter.isPresent()) { final String code = OAuthEncoder.decode(codeParameter.get()); logger.debug("code: {}", code); return new OAuth20Credentials(code); } else { final String message = "No credential found"; throw new OAuthCredentialsException(message); } }

Target:
protected OAuth20Credentials getOAuthCredentials(final WebContext context) { if (configuration.isWithState()) { final Optional<String> stateParameter = context.getRequestParameter(OAuth20Configuration.STATE_REQUEST_PARAMETER); if (CommonHelper.isNotBlank(stateParameter.orElse(null))) { final String stateSessionAttributeName = this.configuration.getStateSessionAttributeName(client.getName()); final Optional<String> sessionState = context.getSessionStore().get(context, stateSessionAttributeName); context.getSessionStore().set(context, stateSessionAttributeName, null); logger.debug("sessionState: / stateParameter: {}", sessionState, stateParameter); if (!stateParameter.equals(sessionState)) { final String message = "State parameter mismatch: session expired or possible threat of cross-site request forgery"; throw new OAuthCredentialsException(message); } } else { final String message = "Missing state parameter: session expired or possible threat of cross-site request forgery"; throw new OAuthCredentialsException(message); } } return context.getRequestParameter(OAuth20Configuration.OAUTH_CODE) .map( codeParameter -> { final String code = OAuthEncoder.decode(codeParameter); logger.debug("code: {}", code); return new OAuth20Credentials(code); } ).orElseThrow( () -> new OAuthCredentialsException("No credential found") ); }
Source:
private void checkHomeAndWarnIfNeeded(TaskListener listener) { try { Computer computer = toComputer(); if (computer != null) { String home = computer.getEnvironment().get("HOME"); if ("/".equals(home)) { listener.getLogger().println(Messages.KubernetesSlave_HomeWarning()); } } } catch (IOException e) { e.printStackTrace(listener.error("[WARNING] Unable to retrieve HOME environment variable")); } catch (InterruptedException e) { e.printStackTrace(listener.error("[WARNING] Interrupted while retrieving HOME environment variable")); } }

Target:
private void checkHomeAndWarnIfNeeded(TaskListener listener) { try { Computer computer = toComputer(); if (computer != null) { String home = computer.getEnvironment().get("HOME"); if ("/".equals(home)) { listener.getLogger().println(Messages.KubernetesSlave_HomeWarning()); } } } catch (IOException|InterruptedException e) { e.printStackTrace(listener.error("[WARNING] Unable to retrieve HOME environment variable")); } }
Source:
ValidationResult validateBondMode(Bond modifiedOrNewBond) { if (modifiedOrNewBond.getNetworkName()!=null){ String invalidBondMode = getBondModeIfBondModeIsInvalid(modifiedOrNewBond); return ValidationResult.failWith(EngineMessage.INVALID_BONDMODE_FOR_BOND_WITH_ATTACHMENT, ReplacementUtils.createSetVariableString(VAR_BOND_NAME, modifiedOrNewBond.getName()), ReplacementUtils.createSetVariableString(VAR_BOND_MODE, invalidBondMode), ReplacementUtils.createSetVariableString(VAR_NETWORK_NAME, modifiedOrNewBond.getNetworkName())) .when(invalidBondMode != null); } return ValidationResult.VALID; }

Target:
ValidationResult validateBondMode(Bond modifiedOrNewBond) { if (modifiedOrNewBond.getNetworkName() == null){ return ValidationResult.VALID; } String bondMode = getBondMode(modifiedOrNewBond); return ValidationResult.failWith(EngineMessage.INVALID_BOND_MODE_FOR_BOND_WITH_ATTACHMENT, ReplacementUtils.createSetVariableString(VAR_BOND_NAME, modifiedOrNewBond.getName()), ReplacementUtils.createSetVariableString(VAR_BOND_MODE, bondMode), ReplacementUtils.createSetVariableString(VAR_NETWORK_NAME, modifiedOrNewBond.getNetworkName())) .unless(isBondModeValid(bondMode)); }
Source:
public DataPointProcessingParameters() { super(new Parameter[] {processing, spectraProcessing}); }

Target:
public DataPointProcessingParameters() { super(new Parameter[] {processingParameters, enableProcessing}); }
Source:
private static boolean copyFile(File src, File target) { boolean ret = true; InputStream in = null; OutputStream out = null; try { in = new FileInputStream(src); out = new FileOutputStream(target); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0) { out.write(buf, 0, len); } } catch (IOException ex) { ret = false; } finally { if (in != null) try { in.close(); } catch (IOException e) { e.printStackTrace(System.err); } if (out != null) try { out.close(); } catch (IOException e) { e.printStackTrace(System.err); } } return ret; }

Target:
private boolean copyFile(File src, File target) { boolean ret = true; InputStream in = null; OutputStream out = null; try { in = new FileInputStream(src); out = new FileOutputStream(target); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0) { out.write(buf, 0, len); } } catch (IOException ex) { ret = false; } finally { if (in != null) try { in.close(); } catch (IOException e) { e.printStackTrace(System.err); } if (out != null) try { out.close(); } catch (IOException e) { e.printStackTrace(System.err); } } return ret; }
Source:
public void testVCFModeIsConcordantWithGATK3_5ResultsAlleleSpecificAnnotations() throws Exception { Utils.resetRandomGenerator(); final File output = createTempFile("testVCFModeIsConcordantWithGATK3_5ResultsAlleleSpecificAnnotations", ".vcf"); final File gatk3Output = new File(TEST_FILES_DIR + "expected.testVCFMode.gatk3.5.alleleSpecific.vcf"); final String[] args = new String[] { "-I", NA12878_20_21_WGS_bam, "-R", b37_reference_20_21, "-L", "20:10000000-10100000", "-O", output.getAbsolutePath(), "-G", "StandardAnnotation", "-G", "AS_StandardAnnotation", "-pairHMM", "AVX_LOGLESS_CACHING" }; runCommandLine(args); final double concordance = calculateConcordance(output, gatk3Output); Assert.assertTrue(concordance >= 0.99, "Concordance with GATK 3.5 in VCF mode is < 99%"); }

Target:
public void testVCFModeIsConcordantWithGATK3_5ResultsAlleleSpecificAnnotations() throws Exception { Utils.resetRandomGenerator(); final File output = createTempFile("testVCFModeIsConcordantWithGATK3_5ResultsAlleleSpecificAnnotations", ".vcf"); final File gatk3Output = new File(TEST_FILES_DIR + "expected.testVCFMode.gatk3.5.alleleSpecific.vcf"); final String[] args = { "-I", NA12878_20_21_WGS_bam, "-R", b37_reference_20_21, "-L", "20:10000000-10100000", "-O", output.getAbsolutePath(), "-G", "StandardAnnotation", "-G", "AS_StandardAnnotation", "-pairHMM", "AVX_LOGLESS_CACHING" }; runCommandLine(args); final double concordance = calculateConcordance(output, gatk3Output); Assert.assertTrue(concordance >= 0.99, "Concordance with GATK 3.5 in AS VCF mode is < 99%"); }
Source:
public static ClassStub parseClass(URL url) throws IOException { SoftReference<ClassStub> ref = StubCache.map.get(url); ClassStub stub = ref == null ? null : ref.get(); if (stub == null) { DecompilingVisitor visitor = new DecompilingVisitor(); new ClassReader(new BufferedInputStream(url.openStream())).accept(visitor, ClassReader.SKIP_FRAMES); stub = visitor.result; StubCache.map.put(url, new SoftReference<ClassStub>(stub)); } return stub; }

Target:
public static ClassStub parseClass(URL url) throws IOException { SoftReference<ClassStub> ref = StubCache.map.get(url); ClassStub stub = ref == null ? null : ref.get(); if (stub == null) { DecompilingVisitor visitor = new DecompilingVisitor(); InputStream stream = url.openStream(); try { new ClassReader(new BufferedInputStream(stream)).accept(visitor, ClassReader.SKIP_FRAMES); } finally { stream.close(); } stub = visitor.result; StubCache.map.put(url, new SoftReference<ClassStub>(stub)); } return stub; }
Source:
private void cacheOrWriteItem(ModelWithPayload<Content> content, OwlTelescopeReporter telescope) { ModelWithPayload<Item> item = content.asModelType(Item.class); ParentRef parent = item.getModel().getContainer(); if (parent != null && !seenContainer.containsKey(parent.getUri())) { cached.put(parent.getUri(), item); } else { writer.createOrUpdate(content.asModelType(Item.class).getModel()); if(content.getModel().getId() != null){ telescope.reportSuccessfulEvent( content.getModel().getId(), content.getModel().getAliases(), EntityType.CONTENT, content.getPayload() ); } else { telescope.reportFailedEvent( "Atlas did not return an id after attempting to create or update this Content", EntityType.CONTENT, content.getPayload() ); } } }

Target:
private void cacheOrWriteItem(ModelWithPayload<Content> content, OwlTelescopeReporter telescope) { ModelWithPayload<Item> item = content.asModelType(Item.class); ParentRef parent = item.getModel().getContainer(); if (parent != null && !seenContainer.containsKey(parent.getUri())) { cached.put(parent.getUri(), item); } else { writer.createOrUpdate(content.asModelType(Item.class).getModel()); if(content.getModel().getId() != null){ telescope.reportSuccessfulEvent( content.getModel().getId(), content.getModel().getAliases(), content.getModel(), content.getPayload() ); } else { telescope.reportFailedEvent( "Atlas did not return an id after attempting to create or update this Content", EntityType.CONTENT, content.getPayload() ); } } }
Source:
KafkaConsumer contentBootstrapWorker() { ContentBootstrapWorker worker = ContentBootstrapWorker.create( persistence.legacyContentResolver(), persistence.contentStore(), metricsModule.metrics().timer("ContentBootstrapWorker"), metricsModule.metrics().meter("ContentBootstrapWorker.notWritten"), metricsModule.metrics().meter("ContentBootstrapWorker.errorRate"), ColumbusTelescopeReporter.create(getTelescopeClient(), reportingEnvironment) ); return bootstrapQueueFactory() .createConsumer( worker, new EntityUpdatedLegacyMessageSerializer(), contentChanges, "ContentBootstrap" ) .withConsumerSystem(consumerSystem) .withDefaultConsumers(contentChangesNumOfConsumers) .withMaxConsumers(contentChangesNumOfConsumers) .withPersistentRetryPolicy(persistence.databasedWriteMongo()) .build(); }

Target:
KafkaConsumer contentBootstrapWorker() { MetricRegistry metricRegistry = metricsModule.metrics(); ContentBootstrapWorker worker = ContentBootstrapWorker.create( persistence.legacyContentResolver(), persistence.contentStore(), metricRegistry.timer("ContentBootstrapWorker"), metricRegistry.meter("ContentBootstrapWorker.notWritten"), metricRegistry.meter("ContentBootstrapWorker.errorRate"), ColumbusTelescopeReporter.create( getTelescopeClient(), reportingEnvironment, getObjectMapper() ) ); return bootstrapQueueFactory() .createConsumer( worker, new EntityUpdatedLegacyMessageSerializer(), contentChanges, "ContentBootstrap" ) .withConsumerSystem(consumerSystem) .withDefaultConsumers(contentChangesNumOfConsumers) .withMaxConsumers(contentChangesNumOfConsumers) .withPersistentRetryPolicy(persistence.databasedWriteMongo()) .build(); }
Source:
public InvokableBuilder<Command> add_nodes(String labelOrId, int node_count) { RequestDetails entity = new RequestDetails(new AddNode(node_count), RequestDetails.Method.POST); System.out.println(entity.getEntity()); return new GenericInvokableBuilderImpl<Command>(client, entity, Command.class, "clusters", labelOrId, "nodes"); }

Target:
public InvokableBuilder<Command> add_nodes(String labelOrId, int node_count) { RequestDetails entity = new RequestDetails(new AddNode(node_count), RequestDetails.Method.POST); return new GenericInvokableBuilderImpl<Command>(client, entity, Command.class, "clusters", labelOrId, "nodes"); }
Source:
protected CartUpdateCommand buildRequest(final Cart cart, final AddDiscountCodeFormData addDiscountCodeFormData) { final AddDiscountCode addDiscountCode = AddDiscountCode.of(addDiscountCodeFormData.code()); return CartUpdateCommand.of(cart, Arrays.asList(addDiscountCode)); }

Target:
protected CartUpdateCommand buildRequest(final Cart cart, final AddDiscountCodeFormData addDiscountCodeFormData) { final AddDiscountCode addDiscountCode = AddDiscountCode.of(addDiscountCodeFormData.code()); return CartUpdateCommand.of(cart, addDiscountCode); }
Source:
private void checkLine(boolean flush) { String buffer = currentLine.toString(); int i = 0; while ((i = buffer.indexOf('\n')) != -1) { String line = buffer.substring(0, i); if (line.endsWith("\r")) line=line.substring(0,line.length()-1); processLine(line); previousLine = line; buffer = buffer.substring(i + 1); } currentLine.setLength(0); if (flush) { if (buffer.length() > 0) { processLine(buffer); previousLine = buffer; } } else { currentLine.append(buffer); } }

Target:
private void checkLine(boolean flush) { String buffer = currentLine.toString(); int i = 0; while ((i = buffer.indexOf('\n')) != -1) { String line = buffer.substring(0, i); if (line.endsWith("\r")) { line=line.substring(0,line.length()-1); } processLine(line); previousLine = line; buffer = buffer.substring(i + 1); } currentLine.setLength(0); if (flush) { if (buffer.length() > 0) { processLine(buffer); previousLine = buffer; } } else { currentLine.append(buffer); } }
Source:
private static StateItem createState(LinuxStyle style) { int rgbInt = (int) style.toMap().getOrDefault(ITimeEventStyle.FILL_COLOR(), 0); RGB color = new RGB(rgbInt >> 24 & 0xff, rgbInt >> 16 & 0xff, rgbInt >> 8 & 0xff); return new StateItem(color, style.getLabel()) { @Override public Map<String, Object> getStyleMap() { return style.toMap(); } }; }

Target:
private static StateItem createState(LinuxStyle style) { int rgbInt = (int) style.toMap().getOrDefault(ITimeEventStyleStrings.fillColor(), 0); RGB color = new RGB(rgbInt >> 24 & 0xff, rgbInt >> 16 & 0xff, rgbInt >> 8 & 0xff); return new StateItem(color, style.getLabel()) { @Override public Map<String, Object> getStyleMap() { return style.toMap(); } }; }
Source:
public void openTestShells() { Display.syncExec(() -> { for (int i = 1; i <= TEST_SHELLS_COUNT; i++) { String shellTitle = "shell" + i; ShellTestUtils.createShell(shellTitle); shells.add(new DefaultShell(shellTitle)); } }); }

Target:
public void openTestShells() { for (int i = 1; i <= TEST_SHELLS_COUNT; i++) { String shellTitle = "shell" + i; Display.syncExec(() -> { ShellTestUtils.createShell(shellTitle); }); shells.add(new DefaultShell(shellTitle)); } }
Source:
public VariantContextBuilder filters(final Set<String> filters) { makeFiltersModifiable(); if (filters == null) { unfiltered(); } else { this.filters.clear(); this.filters.addAll(filters); toValidate.add(VariantContext.Validation.FILTERS); } return this; }

Target:
public VariantContextBuilder filters(final Set<String> filters) { if (filters == null) { unfiltered(); } else { this.filtersCanBeModified = true; filtersAsIs(new HashSet<>(filters)); } return this; }
Source:
void setPartitionState(String partition, PartitionState partitionState) { for (IdealState entry : resourcesToIdealStates.values()) { for (String partitionStr : entry.getPartitionSet()) { if (partitionStr.equals(partition) && partitionStates.containsKey(partition)) { partitionStates.put(partition, partitionState); } } } }

Target:
void setPartitionState(String partition, PartitionState partitionState) { for (IdealState entry : resourcesToIdealStates.values()) { for (String partitionInIdealState : entry.getPartitionSet()) { if (partitionInIdealState.equals(partition)) { partitionToPartitionStates.put(partition, partitionState); } } } }
Source:
private RetryingMutateRowsOperation createOperation(MutateRowsRequest request) { return new RetryingMutateRowsOperation(RETRY_OPTIONS, request, mutateRows, CallOptions.DEFAULT, executorService, new Metadata()) { @Override protected ApiClock getApiClock() { return clock; } }; }

Target:
private RetryingMutateRowsOperation createOperation(MutateRowsRequest request) { return new RetryingMutateRowsOperation(RETRY_OPTIONS, request, mutateRows, CallOptions.DEFAULT, executorService, new Metadata(), clock); }
Source:
private boolean isPostgreSQLIntegrityConstraintViolation(SQLException sqlException) { return sqlException instanceof PSQLException && sqlException.getSQLState().matches("23\\d{3}"); }

Target:
private boolean isPostgreSQLIntegrityConstraintViolation(SQLException sqlException) { return sqlException instanceof PSQLException && sqlException.getSQLState().length() == 5 && sqlException.getSQLState().startsWith("23"); }
Source:
public static WebArchive createWebApplication() { return ShrinkWrap.create(WebArchive.class, "spring-test.war") .addClasses(Employee.class, EmployeeService.class, DefaultEmployeeService.class, EmployeeRepository.class, DefaultEmployeeRepository.class, NullEmployeeRepository.class, EmployeeController.class, ClassPathResourceLocationsProcessor.class) .addAsLibraries(springDependencies()) .addAsLibraries(mockitoDependencies()); }

Target:
public static WebArchive createWebApplication() { return ShrinkWrap.create(WebArchive.class, "spring-test.war") .addClasses(Employee.class, EmployeeService.class, DefaultEmployeeService.class, EmployeeRepository.class, DefaultEmployeeRepository.class, NullEmployeeRepository.class, EmployeeController.class) .addAsLibraries(springDependencies()) .addAsLibraries(mockitoDependencies()); }
Source:
public Deserializer getDeserializer(String type) throws HessianProtocolException { if (type == null || type.equals("") || typeNotFoundDeserializer.contains(type)) { return null; } Deserializer deserializer = super.getDeserializer(type); if (deserializer == null) { typeNotFoundDeserializer.add(type); logger.warn("unable to find deserializer for string type:" + type); } return deserializer; }

Target:
public Deserializer getDeserializer(String type) throws HessianProtocolException { if (StringUtils.isEmpty(type) || typeNotFoundDeserializer.contains(type)) { return null; } Deserializer deserializer = super.getDeserializer(type); if (deserializer == null) { typeNotFoundDeserializer.add(type); logger.warn("unable to find deserializer for string type:" + type); } return deserializer; }