auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void runMultipleActions(final VdcActionType actionType, final List<VdcActionParametersBase> parameters, final IFrontendActionAsyncCallback successCallback, final Object state, final boolean runCallbacksOnEmptyRun) { if (parameters == null || parameters.isEmpty()) { if (runCallbacksOnEmptyRun && successCallback != null) { VdcReturnValueBase emptyResult = new VdcReturnValueBase(); VdcActionParametersBase emptyParams = new VdcActionParametersBase(); successCallback.executed(new FrontendActionAsyncResult(actionType, emptyParams, emptyResult, state)); } return; } int n = parameters.size(); IFrontendActionAsyncCallback[] callbacks = new IFrontendActionAsyncCallback[n]; callbacks[n - 1] = successCallback; runMultipleActions(actionType, parameters, new LinkedList<IFrontendActionAsyncCallback>(Arrays.asList(callbacks)), state); }

Target:
public void runMultipleActions(final VdcActionType actionType, final List<VdcActionParametersBase> parameters, final IFrontendActionAsyncCallback successCallback, final Object state, final boolean runCallbacksOnEmptyRun) { if (parameters == null || parameters.isEmpty()) { if (runCallbacksOnEmptyRun && successCallback != null) { successCallback.executed(new FrontendActionAsyncResult(actionType, null, null, state)); } return; } int n = parameters.size(); IFrontendActionAsyncCallback[] callbacks = new IFrontendActionAsyncCallback[n]; callbacks[n - 1] = successCallback; runMultipleActions(actionType, parameters, new LinkedList<IFrontendActionAsyncCallback>(Arrays.asList(callbacks)), state); }
Source:
public Collection<Area> getAllAreas() { return areas; }

Target:
public Collection<FlexArea> getAllAreas() { return flexAreas; }
Source:
private List<Long> insertStackedContainer(final List<Long> left, final List<Long> right) { List<Long> stack = new ArrayList<Long>(); stack.add(left.get(0) + right.get(0)); stack.add(left.get(1) + right.get(1)); stack.add(left.get(2) + right.get(2)); stack.add(left.get(3) + right.get(3)); return stack; }

Target:
private List<Long> insertStackedContainer(final List<Long> left, final List<Long> right) { List<Long> stack = new ArrayList<>(left.size()); for (int index = 0; index < left.size(); index++) { stack.add(left.get(index) + right.get(index)); } return stack; }
Source:
private void initDockerFileFile(Logger log) { if (dockerFile != null && dockerFileDir != null) { dockerFileFile = new File(dockerFileDir, dockerFile); dockerFileMode = true; } else if (dockerFile != null) { dockerFileFile = new File(dockerFile); dockerFileMode = true; } else if (dockerFileDir != null) { dockerFileFile = new File(dockerFileDir, "Dockerfile"); dockerFileMode = true; } else { String deprecatedDockerFileDir = getAssemblyConfiguration() != null ? getAssemblyConfiguration().getDockerFileDir() : null; if (deprecatedDockerFileDir != null) { log.warn("<dockerFileDir> in the <assembly> section of a <build> configuration is deprecated"); log.warn("Please use <dockerFileDir> or <dockerFile> directly within the <build> configuration instead"); dockerFileFile = new File(deprecatedDockerFileDir,"Dockerfile"); dockerFileMode = true; } else { dockerFileMode = false; } } }

Target:
private void initDockerFileFile(Logger log) { if (dockerFile != null && dockerFileDir != null) { dockerFileFile = new File(dockerFile); if (dockerFileFile.isAbsolute()) { throw new IllegalArgumentException("<dockerFile> can not be absolute path if <dockerFileDir> also set."); } dockerFileFile = new File(dockerFileDir, dockerFile); dockerFileMode = true; } else if (dockerFile != null) { dockerFileFile = new File(dockerFile); dockerFileMode = true; } else if (dockerFileDir != null) { dockerFileFile = new File(dockerFileDir, "Dockerfile"); dockerFileMode = true; } else { String deprecatedDockerFileDir = getAssemblyConfiguration() != null ? getAssemblyConfiguration().getDockerFileDir() : null; if (deprecatedDockerFileDir != null) { log.warn("<dockerFileDir> in the <assembly> section of a <build> configuration is deprecated"); log.warn("Please use <dockerFileDir> or <dockerFile> directly within the <build> configuration instead"); dockerFileFile = new File(deprecatedDockerFileDir,"Dockerfile"); dockerFileMode = true; } else { dockerFileMode = false; } } }
Source:
public boolean entryExpiredInMemoryFromIteration(InternalCacheEntry<K, V> entry, long currentTime) { if (persistenceManager.isEnabled()) { blockingExecutor.submit(() -> entryExpiredInMemory(entry, currentTime, false)); } else { entryExpiredInMemory(entry, currentTime, false); } return true; }

Target:
public boolean entryExpiredInMemoryFromIteration(InternalCacheEntry<K, V> entry, long currentTime) { if (persistenceManager.hasWriter()) { blockingExecutor.submit(() -> entryExpiredInMemorySync(entry, currentTime)); } else { entryExpiredInMemory(entry, currentTime, false); } return true; }
Source:
public @Nonnull ItemStack getStackInSlot(int index) { final ItemStack itemStack = items.get(index); return itemStack.isEmpty() ? master.getStackInSlot(index) : itemStack; }

Target:
public @Nonnull ItemStack getStackInSlot(int index) { final ItemStack itemStack = items[index]; return itemStack.isEmpty() ? master.getStackInSlot(index) : itemStack; }
Source:
public Future<GetBlobResult> getBlob(String blobId, GetBlobOptions options, Callback<GetBlobResult> callback) { FutureResult<GetBlobResult> futureResult = new FutureResult<>(); handlePrechecks(futureResult, callback); ReadableStreamChannel blobDataChannel = null; BlobInfo blobInfo = null; Exception exception = null; if (blobId == null || blobId.length() != BLOB_ID_SIZE) { completeOperation(futureResult, callback, null, new RouterException("Cannot accept operation because blob ID is invalid", RouterErrorCode.InvalidBlobId)); } else { try { if (deletedBlobs.contains(blobId)) { throw new RouterException("Blob deleted", RouterErrorCode.BlobDeleted); } else if (!blobs.containsKey(blobId)) { throw new RouterException("Blob not found", RouterErrorCode.BlobDoesNotExist); } else { InMemoryBlob blob = blobs.get(blobId); switch (options.getOperationType()) { case Data: blobDataChannel = new ByteBufferRSC(blob.getBlob(options.getRange())); break; case BlobInfo: blobInfo = new BlobInfo(blob.getBlobProperties(), blob.getUserMetadata()); break; case All: blobDataChannel = new ByteBufferRSC(blob.getBlob(options.getRange())); blobInfo = new BlobInfo(blob.getBlobProperties(), blob.getUserMetadata()); break; } } } catch (RouterException e) { exception = e; } catch (Exception e) { exception = new RouterException(e, RouterErrorCode.UnexpectedInternalError); } finally { GetBlobResult operationResult = exception == null ? new GetBlobResult(blobInfo, blobDataChannel) : null; completeOperation(futureResult, callback, operationResult, exception); } } return futureResult; }

Target:
public Future<GetBlobResult> getBlob(String blobId, GetBlobOptions options, Callback<GetBlobResult> callback) { FutureResult<GetBlobResult> futureResult = new FutureResult<>(); handlePrechecks(futureResult, callback); ReadableStreamChannel blobDataChannel = null; BlobInfo blobInfo = null; Exception exception = null; if (blobId == null || blobId.length() != BLOB_ID_SIZE) { completeOperation(futureResult, callback, null, new RouterException("Cannot accept operation because blob ID is invalid", RouterErrorCode.InvalidBlobId)); } else { try { if (deletedBlobs.contains(blobId)) { exception = new RouterException("Blob deleted", RouterErrorCode.BlobDeleted); } else if (!blobs.containsKey(blobId)) { exception = new RouterException("Blob not found", RouterErrorCode.BlobDoesNotExist); } else { InMemoryBlob blob = blobs.get(blobId); switch (options.getOperationType()) { case Data: blobDataChannel = new ByteBufferRSC(blob.getBlob(options.getRange())); break; case BlobInfo: blobInfo = new BlobInfo(blob.getBlobProperties(), blob.getUserMetadata()); break; case All: blobDataChannel = new ByteBufferRSC(blob.getBlob(options.getRange())); blobInfo = new BlobInfo(blob.getBlobProperties(), blob.getUserMetadata()); break; } } } catch (RouterException e) { exception = e; } catch (Exception e) { exception = new RouterException(e, RouterErrorCode.UnexpectedInternalError); } finally { GetBlobResult operationResult = exception == null ? new GetBlobResult(blobInfo, blobDataChannel) : null; completeOperation(futureResult, callback, operationResult, exception); } } return futureResult; }
Source:
private <T> T timed(Supplier<? extends T> callable, String schemaTimer) { Timer.Context time = startLatencyTimer(schemaTimer); T value = callable.get(); time.stop(); return value; }

Target:
private <T> T timed(Supplier<? extends T> callable, String schemaTimer) { try (Timer.Context time = startLatencyTimer(schemaTimer)) { return callable.get(); } }
Source:
synchronized VungleBannerAdapter getBannerRequest(@NonNull String placementId, @Nullable String requestUniqueId, @NonNull AdConfig adConfig) { VungleBannerAdapter bannerRequest = mVungleBanners.get(placementId); if (bannerRequest != null) { String activeUniqueRequestId = bannerRequest.getUniquePubRequestId(); if (activeUniqueRequestId != null && activeUniqueRequestId.equals(requestUniqueId) || activeUniqueRequestId == null && requestUniqueId == null) { Log.d(TAG, "Seems like Refresh: activeUniqueId: " + activeUniqueRequestId + " ### RequestId: " + requestUniqueId); } else { Log.d(TAG, "Does NOT seems like Refresh: activeUniqueId: " + activeUniqueRequestId + " ### RequestId: " + requestUniqueId); return null; } } else { bannerRequest = new VungleBannerAdapter(placementId, requestUniqueId, adConfig); mVungleBanners.put(placementId, bannerRequest); } Log.d(TAG, "New banner request:" + bannerRequest + "; size=" + mVungleBanners.size()); return bannerRequest; }

Target:
synchronized VungleBannerAdapter getBannerRequest(@NonNull String placementId, @Nullable String requestUniqueId, @NonNull AdConfig adConfig) { VungleBannerAdapter bannerRequest = mVungleBanners.get(placementId); if (bannerRequest != null) { String activeUniqueRequestId = bannerRequest.getUniquePubRequestId(); Log.d(TAG, "activeUniqueId: " + activeUniqueRequestId + " ### RequestId: " + requestUniqueId); if (activeUniqueRequestId == null) { Log.w(TAG, "Ad already loaded for placement ID: " + placementId + ", and cannot determine if this " + "is a refresh. Set Vungle extras when making an ad request to support refresh on Vungle banner ads."); return null; } if (!activeUniqueRequestId.equals(requestUniqueId)) { Log.w(TAG, "Ad already loaded for placement ID: " + placementId); return null; } } else { bannerRequest = new VungleBannerAdapter(placementId, requestUniqueId, adConfig); mVungleBanners.put(placementId, bannerRequest); } Log.d(TAG, "New banner request:" + bannerRequest + "; size=" + mVungleBanners.size()); return bannerRequest; }
Source:
public static boolean isVirtIoScsiDiskInterfaceExists(VmBase vmBase) { if (vmBase.getImages().stream().anyMatch(i -> i.getDiskVmElementForVm(vmBase.getId()) .getDiskInterface() == DiskInterface.VirtIO_SCSI)) { return true; } return false; }

Target:
public static boolean isVirtIoScsiDiskInterfaceExists(VmBase vmBase) { return vmBase.getImages().stream().anyMatch(i -> i.getDiskVmElementForVm(vmBase.getId()) .getDiskInterface() == DiskInterface.VirtIO_SCSI); }
Source:
public String create(final String path, byte data[], List<ACL> acl, CreateMode createMode, Stat stat, long ttl) throws KeeperException, InterruptedException { final String clientPath = path; PathUtils.validatePath(clientPath, createMode.isSequential()); EphemeralType.validateTTL(createMode, ttl); final String serverPath = prependChroot(clientPath); RequestHeader h = new RequestHeader(); setCreateHeader(createMode, h); Create2Response response = new Create2Response(); if (acl == null || acl.isEmpty() || acl.contains(null)) { throw new KeeperException.InvalidACLException(); } Record record = makeCreateRecord(createMode, serverPath, data, acl, ttl); ReplyHeader r = cnxn.submitRequest(h, record, response, null); if (r.getErr() != 0) { throw KeeperException.create(KeeperException.Code.get(r.getErr()), clientPath); } if (stat != null) { DataTree.copyStat(response.getStat(), stat); } if (cnxn.chrootPath == null) { return response.getPath(); } else { return response.getPath().substring(cnxn.chrootPath.length()); } }

Target:
public String create(final String path, byte data[], List<ACL> acl, CreateMode createMode, Stat stat, long ttl) throws KeeperException, InterruptedException { final String clientPath = path; PathUtils.validatePath(clientPath, createMode.isSequential()); EphemeralType.validateTTL(createMode, ttl); validateACL(acl); final String serverPath = prependChroot(clientPath); RequestHeader h = new RequestHeader(); setCreateHeader(createMode, h); Create2Response response = new Create2Response(); Record record = makeCreateRecord(createMode, serverPath, data, acl, ttl); ReplyHeader r = cnxn.submitRequest(h, record, response, null); if (r.getErr() != 0) { throw KeeperException.create(KeeperException.Code.get(r.getErr()), clientPath); } if (stat != null) { DataTree.copyStat(response.getStat(), stat); } if (cnxn.chrootPath == null) { return response.getPath(); } else { return response.getPath().substring(cnxn.chrootPath.length()); } }
Source:
private void connectSender(Queue queue, String targetName, Symbol... capabilities) { if (logger.isDebugEnabled()) { logger.debug("Connecting outbound for " + queue); } { Sender sender = senders.get(queue); if (sender != null) { logger.debug("Sender for queue " + queue + " already exists, just giving up"); return; } } if (session == null) { logger.debug("Session is null"); return; } Sender sender = session.sender(targetName + UUIDGenerator.getInstance().generateStringUUID()); Target target = new Target(); target.setAddress(targetName); if (capabilities != null) { target.setCapabilities(capabilities); } sender.setTarget(target); Source source = new Source(); source.setAddress(queue.getName().toString()); sender.setSource(source); AMQPOutgoingInitializer outgoingInitializer = new AMQPOutgoingInitializer(queue, sender, sessionContext.getSessionSPI()); ProtonServerSenderContext senderContext = new ProtonServerSenderContext(protonRemotingConnection.getAmqpConnection(), sender, sessionContext, sessionContext.getSessionSPI(), outgoingInitializer); senders.put(queue, sender); protonRemotingConnection.getAmqpConnection().runLater(() -> { try { sessionContext.addSender(sender, senderContext); } catch (Exception e) { error(e); } protonRemotingConnection.getAmqpConnection().flush(); }); }

Target:
private void connectSender(Queue queue, String targetName, Symbol... capabilities) { if (logger.isDebugEnabled()) { logger.debug("Connecting outbound for " + queue); } if (session == null) { logger.debug("Session is null"); return; } protonRemotingConnection.getAmqpConnection().runLater(() -> { try { if (senders.contains(queue)) { logger.debug("Sender for queue " + queue + " already exists, just giving up"); return; } senders.add(queue); Sender sender = session.sender(targetName + UUIDGenerator.getInstance().generateStringUUID()); sender.setSenderSettleMode(SenderSettleMode.UNSETTLED); sender.setReceiverSettleMode(ReceiverSettleMode.FIRST); Target target = new Target(); target.setAddress(queue.getAddress().toString()); if (capabilities != null) { target.setCapabilities(capabilities); } sender.setTarget(target); Source source = new Source(); source.setAddress(queue.getAddress().toString()); sender.setSource(source); AMQPOutgoingController outgoingInitializer = new AMQPOutgoingController(queue, sender, sessionContext.getSessionSPI()); ProtonServerSenderContext senderContext = new ProtonServerSenderContext(protonRemotingConnection.getAmqpConnection(), sender, sessionContext, sessionContext.getSessionSPI(), outgoingInitializer); sessionContext.addSender(sender, senderContext); } catch (Exception e) { error(e); } protonRemotingConnection.getAmqpConnection().flush(); }); }
Source:
public String getMessage() { return "Mapping defined in '" + source1.getSource() + "' and '" + source2.getSource() + "'"; }

Target:
public String getMessage() { String source1Description = source1 != null ? source1.getSource().toString() : DESCRIPTION_UNKNOWN_SOURCE; String source2Description = source2 != null ? source2.getSource().toString() : DESCRIPTION_UNKNOWN_SOURCE; return "Mapping defined in '" + source1Description + "' and '" + source2Description + "'"; }
Source:
public GridDhtPartitionsExchangeFuture( GridCacheSharedContext cctx, ReadWriteLock busyLock, GridDhtPartitionExchangeId exchId, ExchangeActions exchActions, CacheAffinityChangeMessage affChangeMsg ) { assert busyLock != null; assert exchId != null; assert exchId.topologyVersion() != null; assert exchActions == null || !exchActions.empty(); this.cctx = cctx; this.busyLock = busyLock; this.exchId = exchId; this.exchActions = exchActions; this.affChangeMsg = affChangeMsg; this.validator = new GridDhtPartitionsStateValidator(cctx); if (exchActions != null && exchActions.deactivate()) this.clusterIsActive = false; log = cctx.logger(getClass()); exchLog = cctx.logger(EXCHANGE_LOG); timeBag = new TimeBag(); initFut = new GridFutureAdapter<Boolean>() { @Override public IgniteLogger logger() { return log; } }; MetricRegistry sysreg = cctx.kernalContext().metric().registry(SYS_METRICS); startTimeMetric = sysreg.metric("StartPmeTime", null); startTimeMetric.value(System.nanoTime()); if (log.isDebugEnabled()) log.debug("Creating exchange future [localNode=" + cctx.localNodeId() + ", fut=" + this + ']'); }

Target:
public GridDhtPartitionsExchangeFuture( GridCacheSharedContext cctx, ReadWriteLock busyLock, GridDhtPartitionExchangeId exchId, ExchangeActions exchActions, CacheAffinityChangeMessage affChangeMsg ) { assert busyLock != null; assert exchId != null; assert exchId.topologyVersion() != null; assert exchActions == null || !exchActions.empty(); this.cctx = cctx; this.busyLock = busyLock; this.exchId = exchId; this.exchActions = exchActions; this.affChangeMsg = affChangeMsg; this.validator = new GridDhtPartitionsStateValidator(cctx); if (exchActions != null && exchActions.deactivate()) this.clusterIsActive = false; log = cctx.logger(getClass()); exchLog = cctx.logger(EXCHANGE_LOG); timeBag = new TimeBag(); initFut = new GridFutureAdapter<Boolean>() { @Override public IgniteLogger logger() { return log; } }; if (log.isDebugEnabled()) log.debug("Creating exchange future [localNode=" + cctx.localNodeId() + ", fut=" + this + ']'); }
Source:
public TopologyDetails(String topologyId, Map<String, Object> topologyConf, StormTopology topology, int numWorkers, Map<ExecutorDetails, String> executorToComponents, int launchTime, String owner) { this.owner = owner; this.topologyId = topologyId; this.topologyConf = topologyConf; this.topology = topology; this.numWorkers = numWorkers; this.executorToComponent = new HashMap<>(0); if (executorToComponents != null) { this.executorToComponent.putAll(executorToComponents); } if (topology != null) { initResourceList(); } initConfigs(); this.launchTime = launchTime; this.topoName = (String) topologyConf.get(Config.TOPOLOGY_NAME); this.distributeSysCompEvenly = (boolean) topologyConf.getOrDefault(Config.TOPOLOGY_SYSTEM_COMPONENTS_EVEN_DISTRIBUTION, false); }

Target:
public TopologyDetails(String topologyId, Map<String, Object> topologyConf, StormTopology topology, int numWorkers, Map<ExecutorDetails, String> executorToComponents, int launchTime, String owner) { this.owner = owner; this.topologyId = topologyId; this.topologyConf = topologyConf; this.topology = topology; this.numWorkers = numWorkers; this.executorToComponent = new HashMap<>(0); if (executorToComponents != null) { this.executorToComponent.putAll(executorToComponents); } if (topology != null) { initResourceList(); } initConfigs(); this.launchTime = launchTime; this.topoName = (String) topologyConf.get(Config.TOPOLOGY_NAME); }
Source:
private void handleDesignViewActivatedEvent() throws Exception { if (sourceEditor != null) { String xmlSource = sourceEditor.getDocument().get(); if (xmlSource != null) { if (!xmlSource.trim().isEmpty()) { rebuildModelObject(xmlSource); } } } }

Target:
private void handleDesignViewActivatedEvent() { if(sourceEditor!=null){ String xmlSource = sourceEditor.getDocument().get(); if(xmlSource!=null && sourceDirty){ if(!xmlSource.trim().isEmpty()){ rebuildModelObject(xmlSource); } } } }
Source:
private boolean internalValidateAndSetQuota() { if (isInternalExecution()) { return true; } if (getStoragePool() == null) { log.error("Command: " + this.getClass().getName() + ". Storage pool is not available for quota calculation. "); } QuotaConsumptionParametersWrapper quotaConsumptionParametersWrapper = new QuotaConsumptionParametersWrapper(this, getReturnValue().getCanDoActionMessages()); quotaConsumptionParametersWrapper.setParameters(getQuotaConsumptionParameters()); return true; }

Target:
private boolean internalValidateAndSetQuota() { if (isInternalExecution()) { return true; } if (getStoragePool() == null && getActionType().getQuotaDependency() != VdcActionType.QuotaDependency.NONE) { log.error("Command: " + this.getClass().getName() + ". Storage pool is not available for quota calculation. "); return false; } QuotaConsumptionParametersWrapper quotaConsumptionParametersWrapper = new QuotaConsumptionParametersWrapper(this, getReturnValue().getCanDoActionMessages()); quotaConsumptionParametersWrapper.setParameters(getQuotaConsumptionParameters()); return true; }
Source:
public LocalStackDaoImpl(LocalStorageFactory localStorageFactory) throws IOException, ServerException { HashMap<Class<?>, Object> adapters = new HashMap<>(); adapters.put(StackComponent.class, new StackComponentSerializer()); adapters.put(WorkspaceConfig.class, new WorkspaceConfigSerializer()); adapters.put(ProjectConfig.class, new ProjectConfigSerializer()); adapters.put(EnvironmentState.class, new EnvironmentStateSerializer()); adapters.put(Command.class, new CommandSerializer()); adapters.put(Recipe.class, new RecipeSerializer()); adapters.put(Limits.class, new LimitsSerializer()); adapters.put(MachineSource.class, new MachineSourceSerializer()); adapters.put(MachineConfig.class, new MachineSourceSerializer()); adapters.put(StackSource.class, new StackSourceSerializer()); adapters.put(Permissions.class, new PermissionsSerializer()); adapters.put(Group.class, new GroupSerializer()); this.stackStorage = localStorageFactory.create(STORAGE_FILE, Collections.unmodifiableMap(adapters), Collections.singletonMap(byte[].class, new ByteArrayToBase64Serializer())); this.stacks = new HashMap<>(); this.lock = new ReentrantReadWriteLock(); }

Target:
public LocalStackDaoImpl(LocalStorageFactory localStorageFactory) throws IOException, ServerException { HashMap<Class<?>, Object> adapters = new HashMap<>(); adapters.put(StackComponent.class, new StackComponentSerializer()); adapters.put(WorkspaceConfig.class, new WorkspaceConfigSerializer()); adapters.put(ProjectConfig.class, new ProjectConfigSerializer()); adapters.put(EnvironmentState.class, new EnvironmentStateSerializer()); adapters.put(Command.class, new CommandSerializer()); adapters.put(Recipe.class, new RecipeSerializer()); adapters.put(Limits.class, new LimitsSerializer()); adapters.put(MachineSource.class, new MachineSourceSerializer()); adapters.put(MachineConfig.class, new MachineConfigSerializer()); adapters.put(StackSource.class, new StackSourceSerializer()); adapters.put(Permissions.class, new PermissionsSerializer()); adapters.put(Group.class, new GroupSerializer()); this.stackStorage = localStorageFactory.create(STORAGE_FILE, Collections.unmodifiableMap(adapters), Collections.singletonMap(byte[].class, new ByteArrayToBase64Serializer())); this.stacks = new HashMap<>(); this.lock = new ReentrantReadWriteLock(); }
Source:
public void testCalculateRocksDBDefaultArenaBlockSize() { long align = 4 * 1024; long writeBufferSize = 64 * 1024 * 1024; long expectArenaBlockSize = writeBufferSize / 8; long expectArenaBlockSize2 = expectArenaBlockSize + align; long expectArenaBlockSize3 = expectArenaBlockSize + 2 * align; assertThat(RocksDBMemoryControllerUtils.calculateRocksDBDefaultArenaBlockSize(writeBufferSize), is(expectArenaBlockSize)); assertThat(RocksDBMemoryControllerUtils.calculateRocksDBDefaultArenaBlockSize(writeBufferSize + 7), is(expectArenaBlockSize)); assertThat(RocksDBMemoryControllerUtils.calculateRocksDBDefaultArenaBlockSize(writeBufferSize + 8), is(expectArenaBlockSize2)); assertThat(RocksDBMemoryControllerUtils.calculateRocksDBDefaultArenaBlockSize(writeBufferSize + 8 * align + 7), is(expectArenaBlockSize2)); assertThat(RocksDBMemoryControllerUtils.calculateRocksDBDefaultArenaBlockSize(writeBufferSize + 8 * align + 8), is(expectArenaBlockSize3)); }

Target:
public void testCalculateRocksDBDefaultArenaBlockSize() { final long align = 4 * 1024; final long writeBufferSize = 64 * 1024 * 1024; final long expectArenaBlockSize = writeBufferSize / 8; assertThat("Arena block size calculation error for normal case", RocksDBMemoryControllerUtils.calculateRocksDBDefaultArenaBlockSize(writeBufferSize), is(expectArenaBlockSize)); assertThat("Arena block size calculation error for alignment case", RocksDBMemoryControllerUtils.calculateRocksDBDefaultArenaBlockSize(writeBufferSize - 1), is(expectArenaBlockSize)); assertThat("Arena block size calculation error for alignment case2", RocksDBMemoryControllerUtils.calculateRocksDBDefaultArenaBlockSize(writeBufferSize + 8), is(expectArenaBlockSize + align)); }
Source:
public Response getCatalogXml(@QueryParam(QUERY_REQUESTED_DT) final String requestedDate, @javax.ws.rs.core.Context final HttpServletRequest request) throws Exception { final TenantContext tenantContext = context.createTenantContextNoAccountId(request); final DateTime catalogDateVersion = requestedDate != null ? DATE_TIME_FORMATTER.parseDateTime(requestedDate).toDateTime(DateTimeZone.UTC) : null; final VersionedCatalog catalog = (VersionedCatalog) catalogUserApi.getCatalog(catalogName, tenantContext); String result = null; if (catalogDateVersion != null) { for (final StandaloneCatalog v : catalog.getVersions()) { if (v.getEffectiveDate().compareTo(catalogDateVersion.toDate()) == 0) { result = XMLWriter.writeXML(v, StandaloneCatalog.class); break; } } } else { result = XMLWriter.writeXML(catalog, VersionedCatalog.class); } return Response.status(Status.OK).entity(result).build(); }

Target:
public Response getCatalogXml(@QueryParam(QUERY_REQUESTED_DT) final String requestedDate, @javax.ws.rs.core.Context final HttpServletRequest request) throws Exception { final TenantContext tenantContext = context.createTenantContextNoAccountId(request); final DateTime catalogDateVersion = requestedDate != null ? DATE_TIME_FORMATTER.parseDateTime(requestedDate).toDateTime(DateTimeZone.UTC) : null; final VersionedCatalog catalog = (VersionedCatalog) catalogUserApi.getCatalog(catalogName, tenantContext); final String result; if (catalogDateVersion != null) { final VersionedCatalog oneVersionCatalog = new VersionedCatalog(); for (final StandaloneCatalog v : catalog.getVersions()) { if (v.getEffectiveDate().compareTo(catalogDateVersion.toDate()) >= 0) { oneVersionCatalog.add(v); break; } } result = XMLWriter.writeXML(oneVersionCatalog, VersionedCatalog.class); } else { result = XMLWriter.writeXML(catalog, VersionedCatalog.class); } return Response.status(Status.OK).entity(result).build(); }
Source:
public void testGetAllTicketsForTransport_Admin() { ticketRepository.saveAndFlush(new Ticket(user, TicketType.REGULAR_FULL, true, false)); SessionData login = login("admin", adminCleartextPassword); given() .filter(sessionFilter) .header(login.getCsrfHeader()) .when() .get("/tickets/transport") .then() .statusCode(HttpStatus.SC_OK) .body("", hasSize(1)); }

Target:
public void testGetAllTicketsForTransport_Admin() { makeTicket(); ticketRepository.saveAndFlush(new Ticket(user, TicketType.REGULAR_FULL, true, false)); SessionData login = login(admin.getUsername(), adminCleartextPassword); given() .filter(sessionFilter) .header(login.getCsrfHeader()) .when() .get("/tickets/transport") .then() .statusCode(HttpStatus.SC_OK) .body("$", hasSize(1)) .body("pickupService", contains(true)); }
Source:
public ResponseEntity<Resources<Resource<Project>>> getProjectsForUser(@RequestParam(value = "name", required = false) String name, @RequestParam(value = "type", required = false) String projectType, OAuth2Authentication oAuth2Authentication) { User sw360User = restControllerHelper.getSw360UserFromAuthentication(oAuth2Authentication); List<Project> sw360Projects = new ArrayList<>(); if (name != null && !name.isEmpty()) { sw360Projects.addAll(projectService.searchProjectByName(name, sw360User)); } else { sw360Projects.addAll(projectService.getProjectsForUser(sw360User)); } List<Resource<Project>> projectResources = new ArrayList<>(); sw360Projects.stream() .filter(projectType == null ? p -> true : project -> projectType.equals(project.projectType.name())) .forEach(p -> { p.setDescription(null); p.setType(null); p.setCreatedOn(null); p.setReleaseIdToUsage(null); p.setExternalIds(null); p.setBusinessUnit(null); projectResources.add(new Resource<>(p)); }); Resources<Resource<Project>> resources = new Resources<>(projectResources); return new ResponseEntity<>(resources, HttpStatus.OK); }

Target:
public ResponseEntity<Resources<Resource<Project>>> getProjectsForUser(@RequestParam(value = "name", required = false) String name, @RequestParam(value = "type", required = false) String projectType, OAuth2Authentication oAuth2Authentication) { User sw360User = restControllerHelper.getSw360UserFromAuthentication(oAuth2Authentication); List<Project> sw360Projects = new ArrayList<>(); if (name != null && !name.isEmpty()) { sw360Projects.addAll(projectService.searchProjectByName(name, sw360User)); } else { sw360Projects.addAll(projectService.getProjectsForUser(sw360User)); } List<Resource<Project>> projectResources = new ArrayList<>(); sw360Projects.stream() .filter(project -> projectType == null || projectType.equals(project.projectType.name())) .forEach(p -> { p.setDescription(null); p.setType(null); p.setCreatedOn(null); p.setReleaseIdToUsage(null); p.setExternalIds(null); p.setBusinessUnit(null); projectResources.add(new Resource<>(p)); }); Resources<Resource<Project>> resources = new Resources<>(projectResources); return new ResponseEntity<>(resources, HttpStatus.OK); }
Source:
public void access(final Path path, final FsAction mode) throws AzureBlobFileSystemException { LOG.debug("access for filesystem: {}, path: {}, mode: {}", this.client.getFileSystem(), path, mode); if (!this.abfsConfiguration.isCheckAccessEnabled() || !getIsNamespaceEnabled()) { LOG.debug("Returning; either check access is not enabled or the account" + " used is not namespace enabled"); return; } String relativePath = AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path, true); this.client.checkAccess(relativePath, mode.SYMBOL); }

Target:
public void access(final Path path, final FsAction mode) throws AzureBlobFileSystemException { LOG.debug("access for filesystem: {}, path: {}, mode: {}", this.client.getFileSystem(), path, mode); if (!this.abfsConfiguration.isCheckAccessEnabled() || !getIsNamespaceEnabled()) { LOG.debug("Returning; either check access is not enabled or the account" + " used is not namespace enabled"); return; } try (AbfsPerfInfo perfInfo = startTracking("access", "checkAccess")) { String relativePath = AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path, true); final AbfsRestOperation op = this.client .checkAccess(relativePath, mode.SYMBOL); perfInfo.registerResult(op.getResult()).registerSuccess(true); } }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_nearby, container, false); rootView.setPadding(0, getContentTopOffsetPx(getActivity()), 0, 0); mapView = (MapView) rootView.findViewById(R.id.mapview); mapView.setAccessToken(getString(R.string.mapbox_public_token)); markerIconPassive = mapView.getSpriteFactory().fromResource(R.drawable.ic_map_marker); mapView.onCreate(savedInstanceState); rootView.findViewById(R.id.user_location_button).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { checkLocationPermissionsToGoToUserLocation(); } }); return rootView; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_nearby, container, false); rootView.setPadding(0, getContentTopOffsetPx(getActivity()), 0, 0); mapView = (MapView) rootView.findViewById(R.id.mapview); mapView.setAccessToken(getString(R.string.mapbox_public_token)); markerIconPassive = mapView.getSpriteFactory().fromResource(R.drawable.ic_map_marker); mapView.onCreate(null); rootView.findViewById(R.id.user_location_button).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { checkLocationPermissionsToGoToUserLocation(); } }); return rootView; }
Source:
public void ensureChannelCount(int capacity) throws IOException { if (this.shutdown) { throw new IOException("The channel is closed."); } if (channels.get().size() < capacity) { synchronized (this) { if (channels.get().size() < capacity) { Counter counter = getActiveChannelCounter(); List<ChannelAndMetrics> newChannelList = new ArrayList<>(channels.get()); while(newChannelList.size() < capacity) { newChannelList.add(createChannelAndMetrics()); counter.inc(); } setChannels(newChannelList); } } } }

Target:
public void ensureChannelCount(int capacity) throws IOException { if (this.shutdown) { throw new IOException("The channel is closed."); } if (channels.get().size() < capacity) { synchronized (this) { if (channels.get().size() < capacity) { List<InstrumentedChannel> newChannelList = new ArrayList<>(channels.get()); while(newChannelList.size() < capacity) { newChannelList.add(new InstrumentedChannel(factory.create())); } setChannels(newChannelList); } } } }
Source:
protected Optional<AccessToken> tryJwt(String token, String type) { try { if (isJwt(token)) { final byte[] decoded = getDecoder().decode(splitToken(token)[1]); final JsonNode node = om.readTree(decoded); long expiration = node.get("exp").asLong(-1L); long initialValidSeconds = expiration - MILLISECONDS.toSeconds(currentTimeMillis()); return ofNullable(new AccessToken(token,type, initialValidSeconds, from(ofEpochSecond(expiration)))); } return empty(); } catch (Exception e) { return empty(); } }

Target:
protected Optional<AccessToken> tryJwt(String token, String type) { try { if (isJwt(token)) { final byte[] decoded = getDecoder().decode(splitToken(token)[1]); final JsonNode node = om.readTree(decoded); long expiration = node.get("exp").asLong(-1L); long initialValidSeconds = expiration - MILLISECONDS.toSeconds(currentTimeMillis()); return ofNullable(new AccessToken(token,type, initialValidSeconds, from(ofEpochSecond(expiration)))); } return empty(); } catch (Exception e) { logger.warn(e.getMessage()); return empty(); } }
Source:
public void update(final GuidedDecisionTable52 model, final List<Coordinate> coordinates) { PortablePreconditions.checkNotNull("model", model); PortablePreconditions.checkNotNull("coordinates", coordinates); final Set<Integer> canBeUpdated = new HashSet<>(); for (final Coordinate coordinate : coordinates) { if (coordinate.getCol() != GuidedDecisionTable52.RULE_NUMBER_INDEX && coordinate.getCol() != GuidedDecisionTable52.RULE_NAME_COLUMN_INDEX && coordinate.getCol() != GuidedDecisionTable52.RULE_DESCRIPTION_INDEX) { if (getCellUpdateManager(coordinate, model).update()) { canBeUpdated.add(coordinate.getRow()); } } } boolean hadUpdates = !canBeUpdated.isEmpty(); if (hadUpdates) { analyzer.update(canBeUpdated); analyzer.analyze(); } }

Target:
public void update(final GuidedDecisionTable52 model, final List<Coordinate> coordinates) { PortablePreconditions.checkNotNull("model", model); PortablePreconditions.checkNotNull("coordinates", coordinates); final Set<Integer> canBeUpdated = new HashSet<>(); for (final Coordinate coordinate : coordinates) { if (coordinate.getCol() > GuidedDecisionTable52.RULE_DESCRIPTION_INDEX) { if (getCellUpdateManager(coordinate, model).update()) { canBeUpdated.add(coordinate.getRow()); } } } boolean hadUpdates = !canBeUpdated.isEmpty(); if (hadUpdates) { analyzer.update(canBeUpdated); analyzer.analyze(); } }
Source:
public int getTiedJobCount() { SecurityContext context = ACL.impersonate(ACL.SYSTEM); try { int result = 0; for (TopLevelItem topLevelItem : Jenkins.getInstance().getItemMap().values()) { if (topLevelItem instanceof AbstractProject) { final AbstractProject project = (AbstractProject) topLevelItem; if (this.name.equals(project.getAssignedLabelString())) { result++; } } if (topLevelItem instanceof ItemGroup) { Stack<ItemGroup> q = new Stack<ItemGroup>(); q.push((ItemGroup) topLevelItem); while (!q.isEmpty()) { ItemGroup<?> parent = q.pop(); for (Item i : parent.getItems()) { if (i instanceof AbstractProject) { final AbstractProject project = (AbstractProject) i; if (this.name.equals(project.getAssignedLabelString())) { result++; } } if (i instanceof ItemGroup) { q.push((ItemGroup) i); } } } } } return result; } finally { SecurityContextHolder.setContext(context); } }

Target:
public int getTiedJobCount() { SecurityContext context = ACL.impersonate(ACL.SYSTEM); try { int result = 0; for (TopLevelItem topLevelItem : Jenkins.getInstance().getItemMap().values()) { if (topLevelItem instanceof AbstractProject) { final AbstractProject project = (AbstractProject) topLevelItem; if (matches(project.getAssignedLabelString())) { result++; } } if (topLevelItem instanceof ItemGroup) { Stack<ItemGroup> q = new Stack<ItemGroup>(); q.push((ItemGroup) topLevelItem); while (!q.isEmpty()) { ItemGroup<?> parent = q.pop(); for (Item i : parent.getItems()) { if (i instanceof AbstractProject) { final AbstractProject project = (AbstractProject) i; if (matches(project.getAssignedLabelString())) { result++; } } if (i instanceof ItemGroup) { q.push((ItemGroup) i); } } } } } return result; } finally { SecurityContextHolder.setContext(context); } }
Source:
public Status mergeWith(Status that) { return this.compareTo(that) > 0 ? this : that; }

Target:
public Status mergeWith(Status that) { return this.precedence >= that.precedence ? this : that; }
Source:
public void shouldIterate() { for (byte depth = 1; depth <= 6; depth++) { for (int i = 0; i < getMaxSizeForDepth(depth); i++) { final Seq<Integer> expected = Array.range(0, i); final Vector<Integer> actual = Vector.ofAll(expected); assertAreEqual(actual, null, constant(actual), expected); } System.out.println("Depth " + depth + " ok!"); } }

Target:
public void shouldIterate() { for (byte depth = 0; depth <= 4; depth++) { for (int i = 0; i < getMaxSizeForDepth(depth); i++) { final Seq<Integer> expected = Array.range(0, i); final Vector<Integer> actual = Vector.ofAll(expected); assertAreEqual(actual, expected); } } }
Source:
public Iterable<Class<?>> allTypes() { final List<ClassLoader> classloaders = new LinkedList<ClassLoader>(); classloaders.add(ClasspathHelper.contextClassLoader()); classloaders.add(ClasspathHelper.staticClassLoader()); final Set<Class<?>> all = new Reflections( new ConfigurationBuilder() .setScanners(new SubTypesScanner(false), new ResourcesScanner()) .setUrls( ClasspathHelper.forClassLoader( classloaders.toArray( new ClassLoader[classloaders.size()] ) ) ).filterInputsBy( new FilterBuilder().include( FilterBuilder.prefix("com.jcabi.github") ) ) ).getSubTypesOf(Object.class); return Iterables.filter( all, new Predicate<Class<?>>() { @Override public boolean apply(final Class<?> input) { final String name = input.getName(); if (name.endsWith("Test") || name.endsWith("ITCase") || name.endsWith("ClasspathRule") || (input.getEnclosingClass() != null && !name.endsWith("Smart"))) { return false; } return true; } }); }

Target:
public Iterable<Class<?>> allTypes() { return Iterables.filter( new Reflections( new ConfigurationBuilder() .setScanners( new SubTypesScanner(false), new ResourcesScanner() ) .setUrls( ClasspathHelper.forClassLoader( ClasspathHelper.contextClassLoader(), ClasspathHelper.staticClassLoader() ) ).filterInputsBy( new FilterBuilder().include( FilterBuilder.prefix("com.jcabi.github") ) ) ).getSubTypesOf(Object.class), new Predicate<Class<?>>() { @Override public boolean apply(final Class<?> input) { final String name = input.getName(); return !name.endsWith("Test") && !name.endsWith("ITCase") && !name.endsWith("ClasspathRule") && (input.getEnclosingClass() == null || name.endsWith("Smart")); } } ); }
Source:
public VdsInstaller(VDS vds, String rootPassword, boolean overrideFirewall, boolean rebootAfterInstallation) { super(); _vds = vds; this.overrideFirewall = overrideFirewall; _messages = new InstallerMessages(vds.getId()); _fileGuid = Guid.NewGuid(); _certFileNameLocal = "cert.pem"; _certRequestFileName = String.format("cert_%1$s.req", _fileGuid); _certFileName = String.format("cert_%1$s.pem", _fileGuid); _caFileName = String.format("CA_%1$s.pem", _fileGuid); String[] parts = _bootstrapRunningScript.split("[.]", -1); if (parts.length > 1) { _bootstrapRunningScript = String.format("%1$s_%2$s.%3$s", parts[0], _fileGuid, parts[1]); } else { throw new RuntimeException(); } _remoteBootstrapRunningScriptPath = _remoteDirectory + "/" + _bootstrapRunningScript; remoteFwRulesFilePath = String.format("%s/%s.%s", _remoteDirectory,FIREWALL_CONFIG_FILENAME_PREFIX,_fileGuid); _bootStrapInitialCommand = InitInitialCommand(vds, _bootStrapInitialCommand); _bootStrapInitialCommand = _bootStrapInitialCommand.replace("-g", ""); _finishCommand = _bootStrapInitialCommand; _bootStrapInitialCommand = _bootStrapInitialCommand.replace("{RunFlag}", "False"); _finishCommand = _finishCommand.replace("{RunFlag}", "True"); if (!rebootAfterInstallation) { _finishCommand = _finishCommand.replace(" -b ", " "); } _serverName = vds.gethost_name(); _rootPassword = rootPassword; _wrapper.InitCallback(this); _certFileNameLocal = _serverName + _certFileNameLocal; }

Target:
public VdsInstaller(VDS vds, String rootPassword, boolean overrideFirewall, boolean rebootAfterInstallation) { super(); _vds = vds; this.overrideFirewall = overrideFirewall; _messages = new InstallerMessages(vds.getId()); _fileGuid = Guid.NewGuid(); _certFileNameLocal = "cert.pem"; _certRequestFileName = String.format("cert_%1$s.req", _fileGuid); _certFileName = String.format("cert_%1$s.pem", _fileGuid); _caFileName = String.format("CA_%1$s.pem", _fileGuid); String[] parts = _bootstrapRunningScript.split("[.]", -1); if (parts.length > 1) { _bootstrapRunningScript = String.format("%1$s_%2$s.%3$s", parts[0], _fileGuid, parts[1]); } else { throw new RuntimeException(); } _remoteBootstrapRunningScriptPath = _remoteDirectory + "/" + _bootstrapRunningScript; remoteFwRulesFilePath = String.format("%s/%s.%s", _remoteDirectory,FIREWALL_CONFIG_FILENAME_PREFIX,_fileGuid); _bootStrapInitialCommand = InitInitialCommand(vds, _bootStrapInitialCommand); _bootStrapInitialCommand = _bootStrapInitialCommand.replace("-g {gluster-dummy}", ""); _bootStrapInitialCommand = _bootStrapInitialCommand.replace("-v {virt-dummy}", "-v"); _finishCommand = _bootStrapInitialCommand; _bootStrapInitialCommand = _bootStrapInitialCommand.replace("{RunFlag}", "False"); _finishCommand = _finishCommand.replace("{RunFlag}", "True"); if (!rebootAfterInstallation) { _finishCommand = _finishCommand.replace(" -b ", " "); } _serverName = vds.gethost_name(); _rootPassword = rootPassword; _wrapper.InitCallback(this); _certFileNameLocal = _serverName + _certFileNameLocal; }
Source:
public static <T> T decodeValue(String str, Class<T> clazz, boolean failOnUnknownProperties) throws DecodeException { ObjectReader reader = mapper.readerFor(clazz); if (failOnUnknownProperties) { reader = reader.with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); } else { reader = reader.without(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); } T ret; try { ret = reader.readValue(str); } catch (Exception e) { throw new DecodeException("Failed to decode:" + e.getMessage()); } return ret; }

Target:
public static <T> T decodeValue(String str, Class<T> clazz, boolean failOnUnknownProperties) throws DecodeException { try { if (failOnUnknownProperties) { return mapper.readValue(str, clazz); } else { return mapper.readerFor(clazz) .without(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .readValue(str); } } catch (Exception e) { throw new DecodeException("Failed to decode:" + e.getMessage()); } }
Source:
@Override public void unparse(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec) { assert call.operandCount() == 1; final SqlWriter.Frame frame = writer.startFunCall(getName()); call.operand(0).unparse(writer, 0, 0); writer.endFunCall(frame); }

Target:
@Override public void unparse(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec) { super.unparse(writer, call, 0, 0); }
Source:
protected AbstractHttpOverXmpp.Data parseData(XmlPullParser parser) throws XmlPullParserException, IOException { NamedElement child = null; boolean done = false; AbstractHttpOverXmpp.Data data = null; if (parser.getEventType() == XmlPullParser.START_TAG) { while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { if (parser.getName().equals(ELEMENT_TEXT)) { child = parseText(parser); } else if (parser.getName().equals(ELEMENT_BASE_64)) { child = parseBase64(parser); } else if (parser.getName().equals(ELEMENT_CHUNKED_BASE_64)) { child = parseChunkedBase64(parser); } else if (parser.getName().equals(ELEMENT_XML)) { child = parseXml(parser); } else if (parser.getName().equals(ELEMENT_IBB)) { child = parseIbb(parser); } else if (parser.getName().equals(ELEMENT_SIPUB)) { throw new UnsupportedOperationException("sipub is not supported yet"); } else if (parser.getName().equals(ELEMENT_JINGLE)) { throw new UnsupportedOperationException("jingle is not supported yet"); } else { throw new IllegalArgumentException("unsupported child tag: " + parser.getName()); } } else if (eventType == XmlPullParser.END_TAG) { if (parser.getName().equals(ELEMENT_DATA)) { done = true; } } } data = new AbstractHttpOverXmpp.Data(child); } return data; }

Target:
protected AbstractHttpOverXmpp.Data parseData(XmlPullParser parser) throws XmlPullParserException, IOException { NamedElement child = null; boolean done = false; AbstractHttpOverXmpp.Data data = null; if (parser.getEventType() == XmlPullParser.START_TAG) { while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { switch (parser.getName()) { case ELEMENT_TEXT: child = parseText(parser); break; case ELEMENT_BASE_64: child = parseBase64(parser); break; case ELEMENT_CHUNKED_BASE_64: child = parseChunkedBase64(parser); break; case ELEMENT_XML: child = parseXml(parser); break; case ELEMENT_IBB: child = parseIbb(parser); break; case ELEMENT_SIPUB: throw new UnsupportedOperationException("sipub is not supported yet"); case ELEMENT_JINGLE: throw new UnsupportedOperationException("jingle is not supported yet"); default: throw new IllegalArgumentException("unsupported child tag: " + parser.getName()); } } else if (eventType == XmlPullParser.END_TAG) { if (parser.getName().equals(ELEMENT_DATA)) { done = true; } } } data = new AbstractHttpOverXmpp.Data(child); } return data; }
Source:
public static boolean getScalabilityCapabilitiesOfModule(Map<String, Object> modules, String elementName) { try{ Map<String,Object> moduleInfo = (Map<String,Object>) modules.get(elementName); Map<String,Object> moduleProperties= (Map<String,Object>) moduleInfo.get(TOSCAkeywords.MODULE_PROPERTIES_TAG); boolean moduleCanScale = (boolean) moduleProperties.get(TOSCAkeywords.MODULE_AUTOSCALE_PROPERTY); return moduleCanScale; }catch(Exception e){ } return true; }

Target:
public static boolean getScalabilityCapabilitiesOfModule(Map<String, Object> modules, String elementName) { try { Map<String, Object> moduleInfo = (Map<String, Object>) modules.get(elementName); Map<String, Object> moduleProperties = (Map<String, Object>) moduleInfo .get(TOSCAkeywords.MODULE_PROPERTIES_TAG); boolean moduleCanScale = (boolean) moduleProperties.get(TOSCAkeywords.MODULE_AUTOSCALE_PROPERTY); return moduleCanScale; } catch (Exception e) { if (log.isDebugEnabled()) { log.debug("For module " + elementName + " it was not found information in the AAM regarding its possibility to scale"); } } return true; }
Source:
public TableDefinition(String id) { super(id); }

Target:
protected TableDefinition(String id) { super(id); }