auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public RetryConfig build() { if (intervalFunction != null && intervalBiFunction != null) { throw new IllegalStateException("The intervalFunction was configured twice which could result in an" + " undesired state. Please use either intervalFunction or intervalBiFunction."); } RetryConfig config = new RetryConfig(); config.intervalFunction = Optional.ofNullable(intervalFunction).orElse(IntervalFunction.ofDefaults()); config.maxAttempts = maxAttempts; config.retryOnExceptionPredicate = retryOnExceptionPredicate; config.retryOnResultPredicate = retryOnResultPredicate; config.retryExceptions = retryExceptions; config.ignoreExceptions = ignoreExceptions; config.exceptionPredicate = createExceptionPredicate(); config.intervalBiFunction = intervalBiFunction; return config; }

Target:
public RetryConfig build() { if (intervalFunction != null && intervalBiFunction != null) { throw new IllegalStateException("The intervalFunction was configured twice which could result in an" + " undesired state. Please use either intervalFunction or intervalBiFunction."); } RetryConfig config = new RetryConfig(); config.maxAttempts = maxAttempts; config.retryOnExceptionPredicate = retryOnExceptionPredicate; config.retryOnResultPredicate = retryOnResultPredicate; config.retryExceptions = retryExceptions; config.ignoreExceptions = ignoreExceptions; config.exceptionPredicate = createExceptionPredicate(); config.intervalFunction = createIntervalFunction(); config.intervalBiFunction = Optional.ofNullable(intervalBiFunction) .orElse(IntervalBiFunction.ofIntervalFunction(config.intervalFunction)); return config; }
Source:
public ValidationResult validatePublicKey(String publicKey) { ValidationResult.ValidationResultBuilder validationResultBuilder = ValidationResult.builder(); if (StringUtils.isNotEmpty(publicKey)) { if (!SSH_PUBLIC_KEY_PATTERN.matcher(publicKey.trim()).matches()) { validationResultBuilder.error(String.format( "The uploaded SSH Public Key is invalid. Correct format is <algorithm> <key> <comment> where <algorithm> can be one of" + " %n'%s' and the <comment> is optional.", ALGORITHM_TEXT_LIST)); } } return validationResultBuilder.build(); }

Target:
public ValidationResult validatePublicKey(String publicKey) { ValidationResult.ValidationResultBuilder validationResultBuilder = ValidationResult.builder(); if (StringUtils.isNotEmpty(publicKey)) { Matcher matcher = SSH_PUBLIC_KEY_PATTERN.matcher(publicKey.trim()); if (!matcher.matches()) { validationResultBuilder.error(String.format( "The uploaded SSH Public Key is invalid. Correct format is <algorithm> <key> <comment> where <algorithm> can be one of" + " %n'%s' and the <comment> is optional.", ALGORITHM_TEXT_LIST)); } } return validationResultBuilder.build(); }
Source:
public String getStorageAccountKey(String accountName, Configuration rawConfig) throws KeyProviderException { String key = null; try { AbfsConfiguration abfsConfig = new AbfsConfiguration(rawConfig, accountName); key = abfsConfig.getPasswordString(ConfigurationKeys.FS_AZURE_ACCOUNT_KEY_PROPERTY_NAME); } catch(IllegalAccessException | InvalidConfigurationValueException e) { throw new KeyProviderException("Failure to initialize configuration", e); } catch(IOException ioe) { LOG.warn("Unable to get key from credential providers. {}", ioe); } try { validateStorageAccountKey(key); } catch (InvalidConfigurationValueException e) { e.printStackTrace(); } return key; }

Target:
public String getStorageAccountKey(String accountName, Configuration rawConfig) throws KeyProviderException { String key = null; try { AbfsConfiguration abfsConfig = new AbfsConfiguration(rawConfig, accountName); key = abfsConfig.getPasswordString(ConfigurationKeys.FS_AZURE_ACCOUNT_KEY_PROPERTY_NAME); validateStorageAccountKey(key); } catch (IllegalAccessException | InvalidConfigurationValueException e) { throw new KeyProviderException("Failure to initialize configuration", e); } catch(IOException ioe) { LOG.warn("Unable to get key from credential providers. {}", ioe); } return key; }
Source:
public static ArrayList<RiakKvPB.TsCell> convertCellsToPb(Collection<Cell> cells) { final ArrayList<RiakKvPB.TsCell> pbCells = new ArrayList<RiakKvPB.TsCell>(cells.size()); for (Cell cell : cells) { pbCells.add(convertCellToPb(cell)); } return pbCells; }

Target:
public static List<RiakKvPB.TsCell> convertCellsToPb(Collection<Cell> cells) { final ArrayList<RiakKvPB.TsCell> pbCells = new ArrayList<RiakKvPB.TsCell>(cells.size()); for (Cell cell : cells) { pbCells.add(convertCellToPb(cell)); } return pbCells; }
Source:
public boolean visit(IResourceDelta delta) throws CoreException { final IResource resource = delta.getResource(); if (resource.getType() == IResource.ROOT) { return true; } if (resource.getType() == IResource.PROJECT) { final RepositoryMapping mapping = RepositoryMapping .getMapping((IProject) resource); if (mapping == null || mapping.getRepository() != repository) { return false; } return true; } if (resource.isLinked()) { return false; } if (resource instanceof IFolder) { if (delta.getKind() == IResourceDelta.ADDED) { String repoRelativePath = getRepoRelativePath(resource); if (repoRelativePath == null) { return false; } String path = repoRelativePath + "/"; if (isIgnoredInOldIndex(path)) { return true; } filesToUpdate.add(path); resourcesToUpdate.add(resource); } return true; } if (delta.getKind() == IResourceDelta.CHANGED && (delta.getFlags() & INTERESTING_CHANGES) == 0) { return false; } if (resource.getName().equals(GITIGNORE_NAME)) { gitIgnoreChanged = true; return false; } String repoRelativePath = getRepoRelativePath(resource); if (repoRelativePath == null) { resourcesToUpdate.add(resource); return true; } if (isIgnoredInOldIndex(repoRelativePath)) { return false; } filesToUpdate.add(repoRelativePath); resourcesToUpdate.add(resource); return true; }

Target:
public boolean visit(IResourceDelta delta) throws CoreException { final IResource resource = delta.getResource(); if (resource.getType() == IResource.ROOT) { return true; } if (resource.getType() == IResource.PROJECT) { final RepositoryMapping mapping = RepositoryMapping .getMapping((IProject) resource); if (mapping == null || mapping.getRepository() != repository) { return false; } return true; } if (resource.isLinked()) { return false; } if (resource.getType() == IResource.FOLDER) { if (delta.getKind() == IResourceDelta.ADDED) { String repoRelativePath = getRepoRelativePath(resource); if (repoRelativePath == null) { return false; } String path = repoRelativePath + "/"; if (isIgnoredInOldIndex(path)) { return true; } filesToUpdate.add(path); resourcesToUpdate.add(resource); } return true; } if (delta.getKind() == IResourceDelta.CHANGED && (delta.getFlags() & INTERESTING_CHANGES) == 0) { return false; } if (resource.getName().equals(GITIGNORE_NAME)) { gitIgnoreChanged = true; return false; } String repoRelativePath = getRepoRelativePath(resource); if (repoRelativePath == null) { resourcesToUpdate.add(resource); return true; } if (isIgnoredInOldIndex(repoRelativePath)) { return false; } filesToUpdate.add(repoRelativePath); resourcesToUpdate.add(resource); return true; }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SyncVspCommand that = (SyncVspCommand) o; if (_nuageVspEntity != null ? !_nuageVspEntity.equals(that._nuageVspEntity) : that._nuageVspEntity != null) return false; return true; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SyncVspCommand)) return false; if (!super.equals(o)) return false; SyncVspCommand that = (SyncVspCommand) o; if (_nuageVspEntity != null ? !_nuageVspEntity.equals(that._nuageVspEntity) : that._nuageVspEntity != null) return false; return true; }
Source:
public static IBinding instantiateBinding(IBinding binding, ICPPTemplateParameterMap tpMap, int packOffset, ICPPClassSpecialization within, int maxdepth, IASTNode point) throws DOMException { if (binding instanceof ICPPClassTemplate) { binding = createDeferredInstance((ICPPClassTemplate) binding); } if (binding instanceof ICPPUnknownBinding) { return resolveUnknown((ICPPUnknownBinding) binding, tpMap, packOffset, within, point); } else if (binding instanceof IEnumerator || binding instanceof ICPPMethod || binding instanceof ICPPField || binding instanceof ICPPEnumeration || binding instanceof ICPPClassType) { IBinding owner = binding.getOwner(); if (!(owner instanceof ICPPSpecialization)) { owner = instantiateBinding(owner, tpMap, packOffset, within, maxdepth, point); } if (binding instanceof IEnumerator) { if (owner instanceof ICPPEnumerationSpecialization) { return ((ICPPEnumerationSpecialization) owner).specializeEnumerator((IEnumerator) binding); } } else { if (owner instanceof ICPPClassSpecialization) { return ((ICPPClassSpecialization) owner).specializeMember(binding, point); } } } return binding; }

Target:
public static IBinding instantiateBinding(IBinding binding, ICPPTemplateParameterMap tpMap, int packOffset, ICPPClassSpecialization within, int maxdepth, IASTNode point) throws DOMException { if (binding instanceof ICPPClassTemplate) { binding = createDeferredInstance((ICPPClassTemplate) binding); } if (binding instanceof ICPPUnknownBinding) { return resolveUnknown((ICPPUnknownBinding) binding, tpMap, packOffset, within, point); } if (binding instanceof IEnumerator || binding instanceof ICPPMethod || binding instanceof ICPPField || binding instanceof ICPPEnumeration || binding instanceof ICPPClassType) { IBinding owner = binding.getOwner(); if (!(owner instanceof ICPPSpecialization)) { owner = instantiateBinding(owner, tpMap, packOffset, within, maxdepth, point); } if (binding instanceof IEnumerator) { if (owner instanceof ICPPEnumerationSpecialization) { return ((ICPPEnumerationSpecialization) owner).specializeEnumerator((IEnumerator) binding); } } else { if (owner instanceof ICPPClassSpecialization) { return ((ICPPClassSpecialization) owner).specializeMember(binding, point); } } } return binding; }
Source:
public void handleServerSafe(NetHandlerPlayServer netHandler) { if(netHandler.player.getItemStackFromSlot(EntityEquipmentSlot.FEET).getItem() instanceof ItemSlimeBoots) netHandler.player.fallDistance = 0; }

Target:
public void handleServerSafe(NetHandlerPlayServer netHandler) { if(netHandler.player.getItemStackFromSlot(EntityEquipmentSlot.FEET).getItem() instanceof ItemSlimeBoots) { netHandler.player.fallDistance = 0; } }
Source:
public HttpResponse getTraces( @Param("serviceName") Optional<String> serviceName, @Param("spanName") Optional<String> spanName, @Param("annotationQuery") Optional<String> annotationQuery, @Param("minDuration") Optional<Long> minDuration, @Param("maxDuration") Optional<Long> maxDuration, @Param("endTs") Optional<Long> endTs, @Param("lookback") Optional<Long> lookback, @Default("10") @Param("limit") int limit) throws IOException { QueryRequest queryRequest = QueryRequest.newBuilder() .serviceName(serviceName.orElse(null)) .spanName(spanName.orElse(null)) .parseAnnotationQuery(annotationQuery.orElse(null)) .minDuration(minDuration.orElse(null)) .maxDuration(maxDuration.orElse(null)) .endTs(endTs.orElse(System.currentTimeMillis())) .lookback(lookback.orElse(defaultLookback)) .limit(limit) .build(); List<List<Span>> traces = storage.spanStore().getTraces(queryRequest).execute(); return jsonResponse(writeTraces(SpanBytesEncoder.JSON_V2, traces)); }

Target:
public AggregatedHttpMessage getTraces( @Param("serviceName") Optional<String> serviceName, @Param("spanName") Optional<String> spanName, @Param("annotationQuery") Optional<String> annotationQuery, @Param("minDuration") Optional<Long> minDuration, @Param("maxDuration") Optional<Long> maxDuration, @Param("endTs") Optional<Long> endTs, @Param("lookback") Optional<Long> lookback, @Default("10") @Param("limit") int limit) throws IOException { QueryRequest queryRequest = QueryRequest.newBuilder() .serviceName(serviceName.orElse(null)) .spanName(spanName.orElse(null)) .parseAnnotationQuery(annotationQuery.orElse(null)) .minDuration(minDuration.orElse(null)) .maxDuration(maxDuration.orElse(null)) .endTs(endTs.orElse(System.currentTimeMillis())) .lookback(lookback.orElse(defaultLookback)) .limit(limit) .build(); List<List<Span>> traces = storage.spanStore().getTraces(queryRequest).execute(); return jsonResponse(writeTraces(SpanBytesEncoder.JSON_V2, traces)); }
Source:
protected void recordCapabilitiesAndRequirements(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException { ModelNode model = resource.getModel(); if (model.hasDefined(DEFAULT_SLSB_INSTANCE_POOL)) { context.registerCapability(DEFAULT_SLSB_POOL_CONFIG_CAPABILITY); String resolvedDefaultSLSBPoolName = context.resolveExpressions(model.get(DEFAULT_SLSB_INSTANCE_POOL)).asString(); String defaultSLSBPoolRequirementName = RuntimeCapability.buildDynamicCapabilityName(STRICT_MAX_POOL_CONFIG_CAPABILITY_NAME, resolvedDefaultSLSBPoolName); context.registerAdditionalCapabilityRequirement(defaultSLSBPoolRequirementName, DEFAULT_SLSB_POOL_CONFIG_CAPABILITY_NAME, DEFAULT_SLSB_INSTANCE_POOL); } if (model.hasDefined(DEFAULT_MDB_INSTANCE_POOL)) { context.registerCapability(DEFAULT_MDB_POOL_CONFIG_CAPABILITY); String resolvedDefaultMDBPoolName = context.resolveExpressions(model.get(DEFAULT_MDB_INSTANCE_POOL)).asString(); String defaultMDBPoolRequirementName = RuntimeCapability.buildDynamicCapabilityName(STRICT_MAX_POOL_CONFIG_CAPABILITY_NAME, resolvedDefaultMDBPoolName); context.registerAdditionalCapabilityRequirement(defaultMDBPoolRequirementName, DEFAULT_MDB_POOL_CONFIG_CAPABILITY_NAME, DEFAULT_MDB_INSTANCE_POOL); } super.recordCapabilitiesAndRequirements(context, operation, resource); }

Target:
protected void recordCapabilitiesAndRequirements(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException { ModelNode model = resource.getModel(); if (model.hasDefined(DEFAULT_SLSB_INSTANCE_POOL)) { context.registerCapability(DEFAULT_SLSB_POOL_CONFIG_CAPABILITY); try { String resolvedDefaultSLSBPoolName = context.resolveExpressions(model.get(DEFAULT_SLSB_INSTANCE_POOL)).asString(); String defaultSLSBPoolRequirementName = RuntimeCapability.buildDynamicCapabilityName(STRICT_MAX_POOL_CONFIG_CAPABILITY_NAME, resolvedDefaultSLSBPoolName); context.registerAdditionalCapabilityRequirement(defaultSLSBPoolRequirementName, DEFAULT_SLSB_POOL_CONFIG_CAPABILITY_NAME, DEFAULT_SLSB_INSTANCE_POOL); } catch (OperationFailedException ofe) { EjbLogger.ROOT_LOGGER.defaultPoolExpressionCouldNotBeResolved(DEFAULT_SLSB_INSTANCE_POOL, model.get(DEFAULT_SLSB_INSTANCE_POOL).asString()); } } if (model.hasDefined(DEFAULT_MDB_INSTANCE_POOL)) { context.registerCapability(DEFAULT_MDB_POOL_CONFIG_CAPABILITY); try { String resolvedDefaultMDBPoolName = context.resolveExpressions(model.get(DEFAULT_MDB_INSTANCE_POOL)).asString(); String defaultMDBPoolRequirementName = RuntimeCapability.buildDynamicCapabilityName(STRICT_MAX_POOL_CONFIG_CAPABILITY_NAME, resolvedDefaultMDBPoolName); context.registerAdditionalCapabilityRequirement(defaultMDBPoolRequirementName, DEFAULT_MDB_POOL_CONFIG_CAPABILITY_NAME, DEFAULT_MDB_INSTANCE_POOL); } catch(OperationFailedException ofe) { EjbLogger.ROOT_LOGGER.defaultPoolExpressionCouldNotBeResolved(DEFAULT_MDB_INSTANCE_POOL, model.get(DEFAULT_MDB_INSTANCE_POOL).asString()); } } super.recordCapabilitiesAndRequirements(context, operation, resource); }
Source:
public int getNumActiveTasks() { return super.getActiveCount() - mNumPaused; }

Target:
public int getNumActiveTasks() { mPauseLock.lock(); try { return super.getActiveCount() - mNumPaused; } finally { mPauseLock.unlock(); } }
Source:
public boolean hasFlavors( ImmutableSet<Flavor> flavors, TargetConfiguration toolchainTargetConfiguration) { Set<Flavor> unmatchedFlavors = Sets.difference(flavors, SUPPORTED_FLAVORS); if (unmatchedFlavors.isEmpty()) { return true; } ImmutableSet<Flavor> delegateFlavors = ImmutableSet.copyOf(Sets.difference(flavors, NON_DELEGATE_FLAVORS)); ImmutableSet<Flavor> supportedDelegateFlavors = swiftDelegate .map(swift -> swift.getSupportedFlavors(delegateFlavors, toolchainTargetConfiguration)) .orElse(ImmutableSet.<Flavor>of()); unmatchedFlavors = Sets.difference(unmatchedFlavors, supportedDelegateFlavors); if (unmatchedFlavors.isEmpty()) { return true; } ImmutableList<ImmutableSortedSet<Flavor>> thinFlavorSets = generateThinDelegateFlavors(ImmutableSet.<Flavor>copyOf(unmatchedFlavors)); if (thinFlavorSets.size() > 0) { return Iterables.all( thinFlavorSets, inputFlavors -> cxxBinaryFlavored.hasFlavors(inputFlavors, toolchainTargetConfiguration)); } else { return cxxBinaryFlavored.hasFlavors(ImmutableSet.<Flavor>copyOf(unmatchedFlavors), toolchainTargetConfiguration); } }

Target:
public boolean hasFlavors( ImmutableSet<Flavor> flavors, TargetConfiguration toolchainTargetConfiguration) { Set<Flavor> unmatchedFlavors = Sets.difference(flavors, SUPPORTED_FLAVORS); if (unmatchedFlavors.isEmpty()) { return true; } ImmutableSet<Flavor> delegateFlavors = ImmutableSet.copyOf(Sets.difference(flavors, NON_DELEGATE_FLAVORS)); ImmutableSet<Flavor> supportedDelegateFlavors = swiftDelegate .map(swift -> swift.getSupportedFlavors(delegateFlavors, toolchainTargetConfiguration)) .orElse(ImmutableSet.<Flavor>of()); unmatchedFlavors = Sets.difference(unmatchedFlavors, supportedDelegateFlavors); if (unmatchedFlavors.isEmpty()) { return true; } ImmutableSet<Flavor> immutableUnmatchedFlavors = ImmutableSet.<Flavor>copyOf(unmatchedFlavors); ImmutableList<ImmutableSortedSet<Flavor>> thinFlavorSets = generateThinDelegateFlavors(immutableUnmatchedFlavors); if (thinFlavorSets.size() > 0) { return Iterables.all( thinFlavorSets, inputFlavors -> cxxBinaryFlavored.hasFlavors(inputFlavors, toolchainTargetConfiguration)); } else { return cxxBinaryFlavored.hasFlavors(immutableUnmatchedFlavors, toolchainTargetConfiguration); } }
Source:
public void updateSchema(KObject kObject) { String clustedId = toProtobufFormat(kObject.getClusterId()); Optional<Schema> storedSchema = this.infinispanContext.getSchema(clustedId); if (!storedSchema.isPresent()) { Schema newSchema = this.mappingProvider.getMapping(kObject); newSchema.getMessages().stream().forEach(message -> { message.setFields(this.reorderFields(new ArrayList<>(message.getFields()))); }); this.infinispanContext.addSchema(newSchema); this.infinispanContext.addProtobufSchema(kObject.getClusterId(), newSchema); } else { String type = toProtobufFormat(kObject.getClusterId() + "_" + kObject.getType().getName()); Optional<Message> storedMessage = this.getMessage(storedSchema.get(), type); Set<Message> messages = new HashSet<>(); if (storedMessage.isPresent()) { Message newMessages = this.merge(storedMessage.get(), this.getMessage(kObject)); messages.addAll(storedSchema.get().getMessages()); messages.remove(storedMessage.get()); messages.add(newMessages); } else { Set<Message> newMessages = this.mappingProvider.buildMessages(kObject); messages.addAll(newMessages); messages.addAll(storedSchema.get().getMessages()); } Schema newSchema = this.mappingProvider.buildSchema(kObject, messages); this.infinispanContext.addSchema(newSchema); this.infinispanContext.addProtobufSchema(kObject.getClusterId(), newSchema); } }

Target:
public void updateSchema(KObject kObject) { String clustedId = toProtobufFormat(kObject.getClusterId()); Optional<Schema> storedSchema = this.infinispanContext.getSchema(clustedId); if (!storedSchema.isPresent()) { Schema newSchema = this.mappingProvider.getMapping(kObject); newSchema.getMessages().forEach(message -> { message.setFields(this.reorderFields(new ArrayList<>(message.getFields()))); }); this.infinispanContext.addSchema(newSchema); this.infinispanContext.addProtobufSchema(kObject.getClusterId(), newSchema); } else { String type = toProtobufFormat(kObject.getClusterId() + "_" + kObject.getType().getName()); Optional<Message> storedMessage = this.getMessage(storedSchema.get(), type); Set<Message> messages = new HashSet<>(); if (storedMessage.isPresent()) { Message newMessages = this.merge(storedMessage.get(), this.getMessage(kObject)); messages.addAll(storedSchema.get().getMessages()); messages.remove(storedMessage.get()); messages.add(newMessages); } else { Set<Message> newMessages = this.mappingProvider.buildMessages(kObject); messages.addAll(newMessages); messages.addAll(storedSchema.get().getMessages()); } Schema newSchema = this.mappingProvider.buildSchema(kObject, messages); this.infinispanContext.addSchema(newSchema); this.infinispanContext.addProtobufSchema(kObject.getClusterId(), newSchema); } }
Source:
public static String getErrorMessage(final Context context, final MediaModel media, final MediaStore.MediaError error) { if (context == null || media == null || error == null) { return null; } switch (error.type) { case FS_READ_PERMISSION_DENIED: return context.getString(R.string.error_media_insufficient_fs_permissions); case NOT_FOUND: return context.getString(R.string.error_media_not_found); case AUTHORIZATION_REQUIRED: return context.getString(R.string.media_error_no_permission_upload); case REQUEST_TOO_LARGE: if (media.isVideo()) { return context.getString(R.string.media_error_http_too_large_video_upload); } else { return context.getString(R.string.media_error_http_too_large_photo_upload) + ". " + context.getString(R.string.media_error_suggest_optimize_image); } case SERVER_ERROR: return context.getString(R.string.media_error_internal_server_error); case TIMEOUT: return context.getString(R.string.media_error_timeout); case CONNECTION_ERROR: return context.getString(R.string.connection_error) + ". " + context.getString(R.string.media_error_generic_connection_error); case EXCEEDS_FILESIZE_LIMIT: return context.getString(R.string.media_error_exceeds_php_filesize); case EXCEEDS_MEMORY_LIMIT: return context.getString(R.string.media_error_exceeds_memory_limit); case PARSE_ERROR: return context.getString(R.string.error_media_parse_error); } return null; }

Target:
public static String getErrorMessage(final Context context, final MediaModel media, final MediaStore.MediaError error) { if (context == null || media == null || error == null) { return null; } switch (error.type) { case FS_READ_PERMISSION_DENIED: return context.getString(R.string.error_media_insufficient_fs_permissions); case NOT_FOUND: return context.getString(R.string.error_media_not_found); case AUTHORIZATION_REQUIRED: return context.getString(R.string.media_error_no_permission_upload); case REQUEST_TOO_LARGE: if (media.isVideo()) { return context.getString(R.string.media_error_http_too_large_video_upload); } else { return context.getString(R.string.media_error_http_too_large_photo_upload); } case SERVER_ERROR: return context.getString(R.string.media_error_internal_server_error); case TIMEOUT: return context.getString(R.string.media_error_timeout); case CONNECTION_ERROR: return context.getString(R.string.connection_error); case EXCEEDS_FILESIZE_LIMIT: return context.getString(R.string.media_error_exceeds_php_filesize); case EXCEEDS_MEMORY_LIMIT: return context.getString(R.string.media_error_exceeds_memory_limit); case PARSE_ERROR: return context.getString(R.string.error_media_parse_error); } return null; }
Source:
public PhoneHome(Node node) { hazelcastNode = node; logger = hazelcastNode.getLogger(com.hazelcast.internal.util.phonehome.PhoneHome.class); basePhoneHomeUrl = "<LINK_0>"; }

Target:
public PhoneHome(Node node) { this(node, DEFAULT_BASE_PHONE_HOME_URL); }
Source:
protected Statement classBlock(final RunNotifier notifier) { if (areAllChildrenIgnored()) { return withIgnores(null, notifier); } Statement statement = childrenInvoker(notifier); statement = withBeforeClasses(statement); statement = withIgnores(statement, notifier); statement = withAfterClasses(statement); statement = withClassRules(statement); return statement; }

Target:
protected Statement classBlock(final RunNotifier notifier) { if (areAllChildrenIgnored()) { return withNotificationOfIgnoredChildren(null, notifier); } Statement statement = childrenInvoker(notifier); statement = withBeforeClasses(statement); statement = withNotificationOfIgnoredChildren(statement, notifier); statement = withAfterClasses(statement); statement = withClassRules(statement); return statement; }
Source:
public static AbstractWebsocket getWebsocketImpl(Class<? extends AbstractWebsocket> websocketImpl, ModularXmppClientToServerConnectionInternal connectionInternal, DiscoveredWebsocketEndpoints discoveredWebsocketEndpoints) throws NoSuchMethodException, SecurityException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (connectionInternal == null) { throw new IllegalArgumentException("ConnectionInternal cannot be null"); } Constructor<? extends AbstractWebsocket> constructor = websocketImpl.getConstructor(ModularXmppClientToServerConnectionInternal.class, DiscoveredWebsocketEndpoints.class); return (AbstractWebsocket) constructor.newInstance(connectionInternal, discoveredWebsocketEndpoints); }

Target:
public static AbstractWebsocket getWebsocketImpl(Class<? extends AbstractWebsocket> websocketImpl, ModularXmppClientToServerConnectionInternal connectionInternal, DiscoveredWebsocketEndpoints discoveredWebsocketEndpoints) throws NoSuchMethodException, SecurityException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { Objects.requireNonNull(connectionInternal, "ConnectionInternal cannot be null"); Constructor<? extends AbstractWebsocket> constructor = websocketImpl.getConstructor(ModularXmppClientToServerConnectionInternal.class, DiscoveredWebsocketEndpoints.class); return (AbstractWebsocket) constructor.newInstance(connectionInternal, discoveredWebsocketEndpoints); }
Source:
<U> BitMappedTrie<U> map(Function<? super T, ? extends U> mapper) { Objects.requireNonNull(mapper, "mapper is null"); final Object[] elems = newInstance(length); final MutableInt index = new MutableInt(); this.<T> visit((leaf, start, end) -> { for (int i = start; i < end; i++) { elems[index.val++] = mapper.apply(leaf[i]); } }); return BitMappedTrie.ofAll(elems, length, 0); }

Target:
<U> BitMappedTrie<U> map(Function<? super T, ? extends U> mapper) { Objects.requireNonNull(mapper, "mapper is null"); final Object[] results = newInstance(length); this.<T> visit((index, leaf, start, end) -> { for (int i = start; i < end; i++) { results[index++] = mapper.apply(leaf[i]); } return index; }); return BitMappedTrie.ofAll(results); }
Source:
public CompletableFuture<YarnWorkerNode> requestResource(TaskExecutorProcessSpec taskExecutorProcessSpec) { checkInitialized(); final CompletableFuture<YarnWorkerNode> requestResourceFuture = new CompletableFuture<>(); final Optional<TaskExecutorProcessSpecContainerResourcePriorityAdapter.PriorityAndResource> priorityAndResourceOpt = taskExecutorProcessSpecContainerResourcePriorityAdapter.getPriorityAndResource(taskExecutorProcessSpec); if (!priorityAndResourceOpt.isPresent()) { requestResourceFuture.completeExceptionally( new ResourceManagerException(String.format("Could not compute the container Resource from the given TaskExecutorProcessSpec %s.", taskExecutorProcessSpec))); } else { final Priority priority = priorityAndResourceOpt.get().getPriority(); final Resource resource = priorityAndResourceOpt.get().getResource(); resourceManagerClient.addContainerRequest(getContainerRequest(resource, priority)); resourceManagerClient.setHeartbeatInterval(containerRequestHeartbeatIntervalMillis); requestResourceFutures.computeIfAbsent(taskExecutorProcessSpec, ignore -> new LinkedList<>()).add(requestResourceFuture); log.info("Requesting new TaskExecutor container with resource {}, priority {}.", taskExecutorProcessSpec, priority); } return requestResourceFuture; }

Target:
public CompletableFuture<YarnWorkerNode> requestResource(TaskExecutorProcessSpec taskExecutorProcessSpec) { checkInitialized(); final CompletableFuture<YarnWorkerNode> requestResourceFuture = new CompletableFuture<>(); final Optional<TaskExecutorProcessSpecContainerResourcePriorityAdapter.PriorityAndResource> priorityAndResourceOpt = taskExecutorProcessSpecContainerResourcePriorityAdapter.getPriorityAndResource(taskExecutorProcessSpec); if (!priorityAndResourceOpt.isPresent()) { requestResourceFuture.completeExceptionally( new ResourceManagerException( String.format("Could not compute the container Resource from the given TaskExecutorProcessSpec %s. " + "This usually indicates the requested resource is larger than Yarn's max container resource limit.", taskExecutorProcessSpec))); } else { final Priority priority = priorityAndResourceOpt.get().getPriority(); final Resource resource = priorityAndResourceOpt.get().getResource(); resourceManagerClient.addContainerRequest(getContainerRequest(resource, priority)); resourceManagerClient.setHeartbeatInterval(containerRequestHeartbeatIntervalMillis); requestResourceFutures.computeIfAbsent(taskExecutorProcessSpec, ignore -> new LinkedList<>()).add(requestResourceFuture); log.info("Requesting new TaskExecutor container with resource {}, priority {}.", taskExecutorProcessSpec, priority); } return requestResourceFuture; }
Source:
public void startLRA() throws WebApplicationException { URL lra = lraClient.startLRA(null, "SpecTest#startLRA", LRA_TIMEOUT_MILLIS, TimeUnit.SECONDS); lraClient.closeLRA(lra); }

Target:
public void startLRA() throws WebApplicationException { URL lra = lraClient.startLRA("SpecTest#startLRA", LRA_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); lraClient.closeLRA(lra); }
Source:
public void removeWaypoint(Waypoint waypoint) { if(waypoints.contains(waypoint)) waypoints.remove(waypoint); }

Target:
public void removeWaypoint(Waypoint waypoint) { if (waypoints.contains(waypoint)) { waypoints.remove(waypoint); } }
Source:
void onWindowFocusChange(boolean inFocus) { GridTimer modelTimer = getModelTimer(); if (modelTimer.isActive() && !modelTimer.isPaused()) { if (inFocus) { modelTimer.stop(); modelTimer.setRefreshRate(readRefreshRate()); } else { modelTimer.stop(); modelTimer.setRefreshRate(OUT_OF_FOCUS_REFRESH_RATE); } modelTimer.start(); } }

Target:
void onWindowFocusChange(boolean inFocus) { GridTimer modelTimer = getModelTimer(); if (modelTimer.isActive() && !modelTimer.isPaused()) { modelTimer.stop(); if (inFocus) { modelTimer.setRefreshRate(readRefreshRate()); } else { modelTimer.setRefreshRate(OUT_OF_FOCUS_REFRESH_RATE); } modelTimer.start(); } }
Source:
private RxDocumentServiceResponse completeResponse( StoreResponse storeResponse, RxDocumentServiceRequest request) throws InternalServerErrorException { if (storeResponse.getResponseHeaderNames().length != storeResponse.getResponseHeaderValues().length) { throw new InternalServerErrorException(RMResources.InvalidBackendResponse); } HttpHeaders httpHeaders = new HttpHeaders(); for (int idx = 0; idx < storeResponse.getResponseHeaderNames().length; idx++) { String name = storeResponse.getResponseHeaderNames()[idx]; String value = storeResponse.getResponseHeaderValues()[idx]; httpHeaders.put(name, value); } this.updateResponseHeader(request, httpHeaders); this.captureSessionToken(request, httpHeaders); BridgeInternal.recordRetryContext(request.requestContext.cosmosDiagnostics, request); storeResponse.setCosmosDiagnostics(request.requestContext.cosmosDiagnostics); return new RxDocumentServiceResponse(storeResponse); }

Target:
private RxDocumentServiceResponse completeResponse( StoreResponse storeResponse, RxDocumentServiceRequest request) throws InternalServerErrorException { HttpHeaders httpHeaders = storeResponse.getHeaders(); this.updateResponseHeader(request, httpHeaders); this.captureSessionToken(request, httpHeaders); BridgeInternal.recordRetryContext(request.requestContext.cosmosDiagnostics, request); storeResponse.setCosmosDiagnostics(request.requestContext.cosmosDiagnostics); return new RxDocumentServiceResponse(storeResponse); }
Source:
public void update() { fNodes = new HashMap<>(); fChildren = new HashMap<>(); fTree.removeAll(); Path path = Paths.get(fXmlFilesPath.toString()); try { Files.walkFileTree(path, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) { TreeItem itemParent = fNodes.get(dir.getParent().toString()); TreeItem item = null; if (itemParent == null) { item = new TreeItem(fTree, SWT.NONE); } else { item = new TreeItem(itemParent, SWT.NONE); } item.setText(dir.getFileName().toString()); fItemsPaths.put(item, dir); fNodes.put(dir.toString(), item); return FileVisitResult.CONTINUE; } @Override public FileVisitResult visitFile(Path dir, BasicFileAttributes attrs){ TreeItem itemParent = fNodes.get(dir.getParent().toString()); if (fChildren.get(itemParent) == null) { fChildren.put(itemParent, new ArrayList<Path>()); } fChildren.get(itemParent).add(dir); return FileVisitResult.CONTINUE; } }); } catch (IOException e) { Activator.logError("Cannot walk through the XML Files directory!", e); } for (TreeItem p : fChildren.keySet()) { for (Path c : fChildren.get(p)) { TreeItem item = new TreeItem(p, SWT.NONE); fItemsPaths.put(item, c); item.setText(c.getFileName().toString()); } } fTree.layout(); fNodes = null; fChildren = null; }

Target:
public void update() { final Map<String, TreeItem> fNodes = new HashMap<>(); final Map<TreeItem, ArrayList<Path>> fChildren = new HashMap<>(); fTree.removeAll(); Path path = Paths.get(fXmlFilesPath.toString()); try { Files.walkFileTree(path, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) { TreeItem itemParent = fNodes.get(dir.getParent().toString()); TreeItem item = null; if (itemParent == null) { item = new TreeItem(fTree, SWT.NONE); } else { item = new TreeItem(itemParent, SWT.NONE); } item.setText(dir.getFileName().toString()); fItemsPaths.put(item, dir); fNodes.put(dir.toString(), item); return FileVisitResult.CONTINUE; } @Override public FileVisitResult visitFile(Path dir, BasicFileAttributes attrs) { TreeItem itemParent = fNodes.get(dir.getParent().toString()); if (fChildren.get(itemParent) == null) { fChildren.put(itemParent, new ArrayList<Path>()); } fChildren.get(itemParent).add(dir); return FileVisitResult.CONTINUE; } }); } catch (IOException e) { Activator.logError("Cannot walk through the XML Files directory!", e); } for (TreeItem p : fChildren.keySet()) { for (Path c : fChildren.get(p)) { TreeItem item = new TreeItem(p, SWT.NONE); fItemsPaths.put(item, c); item.setText(c.getFileName().toString()); } } fTree.layout(); }
Source:
public void readRanges() { long firstTileOffset = cogTileInfo.getFirstTileOffset(); byte[] headerBytes = CacheManagement.DEFAULT.getHeader(uri.toString()); if (firstTileOffset < headerBytes.length) { byte[] newHeaderBytes = Arrays.copyOf(headerBytes, (int) firstTileOffset); CacheManagement.DEFAULT.cacheHeader(uri.toString(), newHeaderBytes); rangeReader.setHeaderLength(newHeaderBytes.length); } RangeBuilder rangeBuilder = new RangeBuilder(0, cogTileInfo.getHeaderSize() - 1); cogTileInfo.getTileRanges().forEach((tileIndex, tileRange) -> { if (tileIndex == HEADER_TILE_INDEX) { return; } TileCacheEntryKey key = new TileCacheEntryKey(uri.toString(), tileIndex); if (!CacheManagement.DEFAULT.keyExists(key)) { rangeBuilder.addTileRange(tileRange.getStart(), tileRange.getEnd()); } }); Set<long[]> ranges = rangeBuilder.getRanges(); if (ranges.size() == 0) { return; } LOGGER.fine("Submitting " + ranges.size() + " range request(s)"); rangeReader.readAsync(ranges); cogTileInfo.getTileRanges().forEach((tileIndex, tileRange) -> { if (tileIndex == HEADER_TILE_INDEX) { return; } TileCacheEntryKey key = new TileCacheEntryKey(uri.toString(), tileIndex); try { byte[] b = rangeReader.getBytes(); byte[] tileBytes = Arrays.copyOfRange(b, (int) tileRange.getStart(), (int) (tileRange.getEnd() + 1)); CacheManagement.DEFAULT.cacheTile(key, tileBytes); } catch (Exception e) { e.printStackTrace(); } }); }

Target:
public void readRanges() { ContiguousRangeComposer contiguousRangeComposer = new ContiguousRangeComposer(0, cogTileInfo.getHeaderLength() - 1); cogTileInfo.getTileRanges().forEach((tileIndex, tileRange) -> { if (tileIndex == HEADER_TILE_INDEX) { return; } TileCacheEntryKey key = new TileCacheEntryKey(uri.toString(), tileIndex); if (!CacheManagement.DEFAULT.keyExists(key)) { contiguousRangeComposer.addTileRange(tileRange.getStart(), tileRange.getEnd()); } }); Set<long[]> ranges = contiguousRangeComposer.getRanges(); if (ranges.size() == 0) { return; } LOGGER.fine("Submitting " + ranges.size() + " range request(s)"); Map<Long, byte[]> data = rangeReader.read(ranges); cogTileInfo.getTileRanges().forEach((tileIndex, tileRange) -> { if (tileIndex == HEADER_TILE_INDEX) { return; } TileCacheEntryKey key = new TileCacheEntryKey(uri.toString(), tileIndex); for (Map.Entry<Long, byte[]> entry : data.entrySet()) { long contiguousRangeOffset = entry.getKey(); int contiguousRangeLength = (int) contiguousRangeOffset + entry.getValue().length; if (tileRange.getStart() >= contiguousRangeOffset && tileRange.getEnd() < contiguousRangeLength) { byte[] contiguousBytes = entry.getValue(); long relativeOffset = tileRange.getStart() - contiguousRangeOffset; byte[] tileBytes = Arrays .copyOfRange(contiguousBytes, (int) relativeOffset, (int) tileRange.getEnd()); CacheManagement.DEFAULT.cacheTile(key, tileBytes); } } }); }
Source:
protected boolean delete(XWikiContext context) throws XWikiException { return deleteToRecycleBin(context.getDoc().getDocumentReference().getLastSpaceReference(), context, true); }

Target:
protected boolean delete(XWikiContext context) throws XWikiException { return deleteToRecycleBin(context.getDoc().getDocumentReference().getLastSpaceReference(), context, false); }
Source:
public boolean matches() { List<? extends VariableElement> candidateParameters = candidateMethod.getExecutable().getParameters(); if ( candidateParameters.size() == parameters.length ) { for ( int i = 0; i < parameters.length; i++ ) { TypeMatcher parameterMatcher = new TypeMatcher(); parameterMatcher.visit( candidateParameters.get( i ).asType(), parameters[i].getTypeMirror() ); if ( !typesMatch ) { break; } } } else { typesMatch = false; } if ( typesMatch ) { TypeMirror candidateReturnType = candidateMethod.getExecutable().getReturnType(); TypeMatcher returnTypeMatcher = new TypeMatcher(); returnTypeMatcher.visit( candidateReturnType, returnType.getTypeMirror() ); } if ( candidateMethod.getExecutable().getTypeParameters().size() != this.genericTypesMap.size() ) { typesMatch = false; } else { for (Map.Entry<TypeVariable, TypeMirror> entry : genericTypesMap.entrySet()) { if (!isWithinBounds( entry.getValue(), getTypeParamFromCandite( entry.getKey() ) ) ) { typesMatch = false; } } } return typesMatch; }

Target:
public boolean matches() { List<? extends VariableElement> candidateParameters = candidateMethod.getExecutable().getParameters(); if ( candidateParameters.size() == parameters.length ) { for ( int i = 0; i < parameters.length; i++ ) { TypeMatcher parameterMatcher = new TypeMatcher(); typesMatch = parameterMatcher.visit( candidateParameters.get( i ).asType(), parameters[i].getTypeMirror() ); if ( !typesMatch ) { break; } } } else { typesMatch = false; } if ( typesMatch ) { TypeMirror candidateReturnType = candidateMethod.getExecutable().getReturnType(); TypeMatcher returnTypeMatcher = new TypeMatcher(); typesMatch = returnTypeMatcher.visit( candidateReturnType, returnType.getTypeMirror() ); } if ( candidateMethod.getExecutable().getTypeParameters().size() != this.genericTypesMap.size() ) { typesMatch = false; } else { for (Map.Entry<TypeVariable, TypeMirror> entry : genericTypesMap.entrySet()) { if (!isWithinBounds( entry.getValue(), getTypeParamFromCandite( entry.getKey() ) ) ) { typesMatch = false; } } } return typesMatch; }
Source:
static void computeSha1s(InputStream fileInputStream, BoxUploadSession uploadSession, long fileSize) throws NoSuchAlgorithmException, IOException { int totalParts = uploadSession.getTotalParts(); List<String> partSha1s = new ArrayList<>(totalParts); byte[] partBuffer = new byte[SdkUtils.BUFFER_SIZE]; int bytesOfChunkToRead; MessageDigest mdFile = MessageDigest.getInstance("SHA-1"); MessageDigest mdPart = MessageDigest.getInstance("SHA-1"); for (int i = 0; i < totalParts; i++) { bytesOfChunkToRead = BoxUploadSession.getChunkSize(uploadSession, i, fileSize); while (bytesOfChunkToRead > 0) { int readTo = Math.min(bytesOfChunkToRead, partBuffer.length); int bytesRead = fileInputStream.read(partBuffer, 0, readTo); if (bytesRead != -1) { bytesOfChunkToRead -= bytesRead; mdPart.update(partBuffer, 0, readTo); mdFile.update(partBuffer, 0, readTo); } } partSha1s.add(Base64.encodeToString(mdPart.digest(), Base64.DEFAULT)); mdPart.reset(); } uploadSession.setPartsSha1(partSha1s); uploadSession.setSha1(Base64.encodeToString(mdFile.digest(), Base64.DEFAULT)); }

Target:
static void computeSha1s(InputStream fileInputStream, BoxUploadSession uploadSession, long fileSize) throws NoSuchAlgorithmException, IOException { int totalParts = uploadSession.getTotalParts(); List<String> partSha1s = new ArrayList<>(totalParts); byte[] partBuffer = new byte[SdkUtils.BUFFER_SIZE]; int bytesOfChunkToRead; MessageDigest mdFile = MessageDigest.getInstance("SHA-1"); MessageDigest mdPart = MessageDigest.getInstance("SHA-1"); for (int i = 0; i < totalParts; i++) { bytesOfChunkToRead = BoxUploadSession.getChunkSize(uploadSession, i, fileSize); while (bytesOfChunkToRead > 0) { int readTo = Math.min(bytesOfChunkToRead, partBuffer.length); int bytesRead = fileInputStream.read(partBuffer, 0, readTo); if (bytesRead != -1) { bytesOfChunkToRead -= bytesRead; mdPart.update(partBuffer, 0, readTo); mdFile.update(partBuffer, 0, readTo); } else if (bytesRead == -1){ break; } } partSha1s.add(Base64.encodeToString(mdPart.digest(), Base64.DEFAULT)); mdPart.reset(); } uploadSession.setPartsSha1(partSha1s); uploadSession.setSha1(Base64.encodeToString(mdFile.digest(), Base64.DEFAULT)); }
Source:
public void addEvents(Collection<IEventDeclaration> events) throws CTFReaderException { if (!fEvents.isEmpty()) { if (fEventUnsetId) { throw new CTFReaderException("Cannot add to a stream with an unidentified event"); } for (IEventDeclaration event : events) { if (event != null) { int index = event.getId().intValue(); ensureSize(index); if (fEvents.get(index) != null) { throw new CTFReaderException("Both lists have an event defined at position " + index); } fEvents.set(index, event); } } } else { fEvents.addAll(events); } }

Target:
public void addEvents(Collection<IEventDeclaration> events) throws CTFReaderException { boolean isUnset = isUnsetList(events); if (fEvents.isEmpty()) { fEvents.addAll(events); if( isUnset) { fEventUnsetId = isUnset; } return; } if (fEventUnsetId) { throw new CTFReaderException("Cannot add to a stream with an unidentified event"); } for (IEventDeclaration event : events) { if (event != null) { int index = event.getId().intValue(); ensureSize(index); if (fEvents.get(index) != null) { throw new CTFReaderException("Both lists have an event defined at position " + index); } fEvents.set(index, event); } } }
Source:
@Override public void setUp(BenchmarkConfiguration cfg) throws Exception { super.setUp(cfg); txs = ignite().transactions(); ex = Executors.newFixedThreadPool(cfg.threads()); keysNumbPerThread = (args.range() > cfg.threads() ? args.range() / cfg.threads() : args.range()); }

Target:
@Override public void setUp(BenchmarkConfiguration cfg) throws Exception { super.setUp(cfg); txs = ignite().transactions(); ex = Executors.newFixedThreadPool(cfg.threads()); keysNumbPerThread = (args.range() > cfg.threads() ? args.range() / cfg.threads() : args.range()); firstKey = new ThreadLocal<Integer>() { final private AtomicInteger keyCntr = new AtomicInteger(0); @Override protected Integer initialValue() { return keyCntr.getAndAdd(keysNumbPerThread); } }; }
Source:
public void genericTestStore( String scheduleType, HashMap<String, Object> scheduleProperties ) throws ParseException { ScheduledTask<Integer> task = null; try { task = createScheduledTask( createSchedule( scheduleType, scheduleProperties ) ); defaultManager.addTask( task ); assertEquals( 1, getTaskConfiguration().size() ); assertEquals( TaskState.SUBMITTED, TaskState.valueOf( ( (CScheduledTask) getTaskConfiguration().get( 0 ) ).getStatus() ) ); assertEquals( TASK_NAME, ( (CScheduledTask) getTaskConfiguration().get( 0 ) ).getName() ); defaultManager.removeTask( task ); } finally { if ( task != null ) { task.cancel(); defaultManager.removeTask( task ); } } }

Target:
public void genericTestStore( String scheduleType, HashMap<String, Object> scheduleProperties ) throws ParseException { ScheduledTask<Integer> task = null; try { task = createScheduledTask( createSchedule( scheduleType, scheduleProperties ) ); defaultManager.addTask( task ); assertThat( getTaskConfiguration().size(), equalTo( 1 ) ); assertThat( TaskState.valueOf( ( (CScheduledTask) getTaskConfiguration().get( 0 ) ).getStatus() ), equalTo( TaskState.SUBMITTED ) ); assertThat( ( (CScheduledTask) getTaskConfiguration().get( 0 ) ).getName(), equalTo( TASK_NAME ) ); defaultManager.removeTask( task ); } finally { if ( task != null ) { task.cancel(); defaultManager.removeTask( task ); } } }
Source:
public String getCloseTagPattern() { return String.format("<[ ]*/[ ]*%s[ ]*>", this.xmlName); }

Target:
public String getCloseTagPattern() { return String.format(CLOSE_TAG_PATTERN, this.xmlName); }
Source:
public void checkPermission(AuthorizationConfiguration configuration, AuthorizationPermission perm, String role) { checkPermission(configuration, perm, Collections.singletonList(role)); }

Target:
public void checkPermission(AuthorizationConfiguration configuration, AuthorizationPermission perm, String role) { if (globalConfiguration.authorization().enabled()) { if (Security.isPrivileged()) { Security.checkPermission(perm.getSecurityPermission()); } else { Subject subject = Security.getSubject(); try { if (subject != null) { if (checkSubjectPermissionAndRole(subject, configuration, perm, role)) { audit.audit(subject, context, name, perm, AuditResponse.ALLOW); } else { checkSecurityManagerPermission(perm); } } else { checkSecurityManagerPermission(perm); } } catch (SecurityException e) { audit.audit(subject, context, name, perm, AuditResponse.DENY); throw log.unauthorizedAccess(Util.prettyPrintSubject(subject), perm.toString()); } } } }
Source:
public synchronized Flux<ByteBuf> getContentAsByteBufFlux() { if (contentAsByteArray == null) { return Flux.empty(); } return Flux.just(Unpooled.wrappedBuffer(contentAsByteArray).retain()); }

Target:
public synchronized Flux<ByteBuf> getContentAsByteBufFlux() { if (contentAsByteArray == null) { return Flux.empty(); } return Flux.just(Unpooled.wrappedBuffer(contentAsByteArray)); }
Source:
public boolean hasNext() { if (!getScannerIterator().hasNext() || !more) { try { writer.close(); } catch (MutationsRejectedException e) { log.error(e.toString()); for (ConstraintViolationSummary cvs : e.getConstraintViolationSummaries()) { log.trace(cvs.toString()); } } return false; } return true; }

Target:
public boolean hasNext() { if (!getScannerIterator().hasNext() || !more) { try { writer.close(); } catch (MutationsRejectedException e) { log.error(e.toString()); if (Shell.log.isTraceEnabled()) { for (ConstraintViolationSummary cvs : e.getConstraintViolationSummaries()) { log.trace(cvs.toString()); } } } return false; } return true; }
Source:
protected void setUp() throws Exception { super.setUp(); removeLeftOverProjects(); cproject = createProject(isCpp()); tmpDir = cproject.getProject().getLocation().makeAbsolute().toFile(); final IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); IViewPart view= activePage.findView("org.eclipse.cdt.ui.tests.DOMAST.DOMAST"); if (view != null) { activePage.hideView(view); } }

Target:
protected void setUp() throws Exception { super.setUp(); final IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); IViewPart view= activePage.findView("org.eclipse.cdt.ui.tests.DOMAST.DOMAST"); if (view != null) { activePage.hideView(view); } }