auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void init() throws Exception { super.init(); serverManager = new ServerConfigurationManager(asServer); webAppAdminClient = new WebAppAdminClient(backendURL, sessionCookie); TENANT_IDLE_TIME = Long.parseLong(asServer.getConfigurationNode(TENANT_IDLE_XPATH).getNodeValue()) * 60 * 1000; WEB_APP_IDLE_TIME = Long.parseLong(asServer.getConfigurationNode(WEB_APP_IDLE_XPATH).getNodeValue()) * 60 * 1000; File sourceFile = new File(CARBON_ARTIFACT_LOCATION); File targetFile = new File(CARBON_REPOSITORY_LOCATION); SUPER_TENANT_DOMAIN = new AutomationContext(PRODUCT_GROUP_NAME, INSTANCE_NAME, SUPER_TENANT_DOMAIN_KEY, USER_KEY).getSuperTenant().getDomain(); TENANT_DOMAIN_1 = new AutomationContext(PRODUCT_GROUP_NAME, INSTANCE_NAME, TENANT_DOMAIN_1_kEY, USER_KEY). getContextTenant().getDomain(); TENANT_DOMAIN_2 = new AutomationContext(PRODUCT_GROUP_NAME, INSTANCE_NAME, TENANT_DOMAIN_2_KEY, USER_KEY). getContextTenant().getDomain(); serverManager.applyConfigurationWithoutRestart(sourceFile, targetFile, true); log.info("carbon.xml replaced with :" + CARBON_ARTIFACT_LOCATION); webAppAdminClient.warFileUplaoder(TENANT_INFO_SERVICE_ARTIFACT_LOCATION); serverManager.restartGracefully(); log.info("Server Restarted after applying carbon.xml and tenant information utility web application"); }

Target:
public void init() throws Exception { super.init(); supperTenantWebAppURL = webAppURL; hostURL = asServer.getInstance().getHosts().get(DEFAULT); serverManager = new ServerConfigurationManager(asServer); webAppAdminClient = new WebAppAdminClient(backendURL, sessionCookie); appAdminClient = new ApplicationAdminClient(backendURL, sessionCookie); tenantIdleTime = Long.parseLong(asServer.getConfigurationNode(TENANT_IDLE_XPATH).getNodeValue()) * 60 * 1000; webAppIdleTime = Long.parseLong(asServer.getConfigurationNode(WEB_APP_IDLE_XPATH).getNodeValue()) * 60 * 1000; artifactsLocation = TestConfigurationProvider.getResourceLocation() + File.separator + "artifacts" + File.separator + "AS" + File.separator + "ghost" + File.separator; String tenantInfoServiceArtifactLocation = artifactsLocation + TENANT_INFO_SERVICE_FILE_NAME; String carbonArtifactLocation = artifactsLocation + CARBON_XML; File sourceFile = new File(carbonArtifactLocation); File targetFile = new File(CARBON_REPOSITORY_LOCATION); superTenantDomain = new AutomationContext(PRODUCT_GROUP_NAME, INSTANCE_NAME, SUPER_TENANT_DOMAIN_KEY, ADMIN_USER_KEY). getSuperTenant().getDomain(); tenantDomain1 = new AutomationContext(PRODUCT_GROUP_NAME, INSTANCE_NAME, TENANT_DOMAIN_1_KEY, ADMIN_USER_KEY). getContextTenant().getDomain(); tenantDomain2 = new AutomationContext(PRODUCT_GROUP_NAME, INSTANCE_NAME, TENANT_DOMAIN_2_KEY, ADMIN_USER_KEY). getContextTenant().getDomain(); serverManager.applyConfigurationWithoutRestart(sourceFile, targetFile, true); log.info("carbon.xml replaced with :" + carbonArtifactLocation); webAppAdminClient.uploadWarFile(tenantInfoServiceArtifactLocation); serverManager.restartGracefully(); log.info("Server Restarted after applying carbon.xml and tenant information utility web application"); }
Source:
private static Symbol symbol(ExpressionTree tree) { return Optional.ofNullable(tree).filter(t -> t.is(Kind.IDENTIFIER)).map(t -> ((IdentifierTree) t).symbol()).orElse(null); }

Target:
private static Symbol symbol(ExpressionTree tree) { if (tree.is(Kind.IDENTIFIER)) { return ((IdentifierTree) tree).symbol(); } return null; }
Source:
public boolean startDeleteUserFlow(String userStoreDomain, String userName) throws WorkflowException { WorkflowService workflowService = IdentityWorkflowDataHolder.getInstance().getWorkflowService(); String tenant = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); String nameWithTenant = UserCoreUtil.addTenantDomainToEntry(userName, tenant); String fullyQualifiedName = UserCoreUtil.addDomainToName(nameWithTenant, userStoreDomain); Map<String, Object> wfParams = new HashMap<>(); Map<String, Object> nonWfParams = new HashMap<>(); wfParams.put(USERNAME, userName); wfParams.put(USER_STORE_DOMAIN, userStoreDomain); String uuid = UUID.randomUUID().toString(); boolean state = startWorkFlow(wfParams, nonWfParams, uuid); if (!Boolean.TRUE.equals(getWorkFlowCompleted()) && !state) { try { workflowService.addRequestEntityRelationships(uuid, new Entity[]{new Entity(fullyQualifiedName, "USER")}); } catch (InternalWorkflowException e) { log.info("No workflow associated with the operation."); } } return state; }

Target:
public boolean startDeleteUserFlow(String userStoreDomain, String userName) throws WorkflowException { WorkflowService workflowService = IdentityWorkflowDataHolder.getInstance().getWorkflowService(); String tenant = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); String fullyQualifiedName = UserCoreUtil.addDomainToName(userName, userStoreDomain); Entity userEntity = new Entity(fullyQualifiedName, UserStoreWFConstants.ENTITY_TYPE_USER, tenant); Map<String, Object> wfParams = new HashMap<>(); Map<String, Object> nonWfParams = new HashMap<>(); wfParams.put(USERNAME, userName); wfParams.put(USER_STORE_DOMAIN, userStoreDomain); String uuid = UUID.randomUUID().toString(); if (workflowService.eventEngagedWithWorkflows(UserStoreWFConstants.DELETE_USER_EVENT) && !Boolean.TRUE.equals (getWorkFlowCompleted()) && !isValidOperation(new Entity[]{userEntity})) { throw new WorkflowException("Operation is not valid"); } boolean state = startWorkFlow(wfParams, nonWfParams, uuid); if (!Boolean.TRUE.equals(getWorkFlowCompleted()) && !state) { try { workflowService.addRequestEntityRelationships(uuid, new Entity[]{userEntity}); } catch (InternalWorkflowException e) { if (log.isDebugEnabled()) { log.debug("No workflow associated with the operation.", e); } } } return state; }
Source:
public static ParserRuleContext shallowCopy(ParserRuleContext t) { try { Class<? extends ParserRuleContext> cl = t.getClass(); Class<?> sup = cl.getSuperclass(); Class<?> supSup = sup.getSuperclass(); if ( ctorCache==null ) { ctorCache = new ConcurrentHashMap<>(); } boolean isAltLabelNode = sup!=ParserRuleContext.class && supSup!=ParserRuleContext.class; if ( isAltLabelNode ) { Constructor<? extends ParserRuleContext> ctor = ctorCache.get(cl); if ( ctor==null ) { ctor = cl.getConstructor(sup); } return ctor.newInstance(t); } else { Constructor<? extends ParserRuleContext> ctor = ctorCache.get(cl); if ( ctor==null ) { ctor = cl.getConstructor(ParserRuleContext.class, int.class); ctorCache.put(cl, ctor); } ParserRuleContext copy = ctor.newInstance(t.getParent(), t.invokingState); copy.copyFrom(t); return copy; } } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public static ParserRuleContext shallowCopy(ParserRuleContext t) { try { Class<? extends ParserRuleContext> cl = t.getClass(); Class<?> sup = cl.getSuperclass(); Class<?> supSup = sup.getSuperclass(); boolean isAltLabelNode = sup!=ParserRuleContext.class && supSup!=ParserRuleContext.class; if ( isAltLabelNode ) { Constructor<? extends ParserRuleContext> ctor = ctorCache.get(cl); if ( ctor==null ) { ctor = cl.getConstructor(sup); } return ctor.newInstance(t); } else { Constructor<? extends ParserRuleContext> ctor = ctorCache.get(cl); if ( ctor==null ) { ctor = cl.getConstructor(ParserRuleContext.class, int.class); ctorCache.put(cl, ctor); } ParserRuleContext copy = ctor.newInstance(t.getParent(), t.invokingState); copy.copyFrom(t); return copy; } } catch (Exception e) { throw new RuntimeException(e); } }
Source:
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { CanaryTool.RegionStdOutSink sink = (CanaryTool.RegionStdOutSink) getServletContext().getAttribute( "sink"); assert sink != null : "No tool in context!"; resp.setContentType("text/html"); CanaryStatusTmpl tmpl = new CanaryStatusTmpl(); tmpl.render(resp.getWriter(), sink); }

Target:
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { CanaryTool.RegionStdOutSink sink = (CanaryTool.RegionStdOutSink) getServletContext().getAttribute( "sink"); if (sink == null) { throw new ServletException( "RegionStdOutSink is null! The CanaryTool's InfoServer is not initialized correctly"); } resp.setContentType("text/html"); CanaryStatusTmpl tmpl = new CanaryStatusTmpl(); tmpl.render(resp.getWriter(), sink); }
Source:
public void testGetBrickByServerIdAndDirectory() { GlusterBrickEntity brick = dao.getBrickByServerIdAndDirectory(BRICK_SERVER_ID, BRICK_DIRECTORY); assertNotNull(brick); }

Target:
public void testGetBrickByServerIdAndDirectory() { GlusterBrickEntity brick = dao.getBrickByServerIdAndDirectory(BRICK_SERVER_ID, BRICK_DIRECTORY); assertNotNull(brick); assertEquals(brick.getServerId(), BRICK_SERVER_ID); assertEquals(brick.getBrickDirectory(), BRICK_DIRECTORY); }
Source:
public List<IArrivingVehicle> getVehicles(@NonNull IStop stop){ List<JsonArrival> jsonArrivals = vasttrafikAdapter.getVehiclesHeadedToStop(stop); List<IArrivingVehicle> arrivingVehicles = new ArrayList<>(); for(JsonArrival a : jsonArrivals){ arrivingVehicles.add(VehicleFactory.getArrivingVehicle(a)); } return arrivingVehicles; }

Target:
public List<IArrivingVehicle> getVehicles(@NonNull IStop stop) { List<JsonArrival> jsonArrivals = vasttrafikAdapter.getVehiclesHeadedToStop(stop); List<IArrivingVehicle> arrivingVehicles = new ArrayList<>(); if (jsonArrivals != null) { for(JsonArrival a : jsonArrivals) { arrivingVehicles.add(VehicleFactory.getArrivingVehicle(a)); } } return arrivingVehicles; }
Source:
public CreateContainerCmd fillContainerConfig(CreateContainerCmd containerConfig) { final CreateContainerCmd result = dockerTemplateBase.fillContainerConfig(containerConfig); final String templateName = getName(); Map<String, String> labels = result.getLabels(); labels.put(DockerContainerLabelKeys.REMOVE_VOLUMES, Boolean.toString(this.isRemoveVolumes())); labels.put(DockerContainerLabelKeys.TEMPLATE_NAME, templateName); final String nodeName = calcUnusedNodeName(templateName); setNodeNameInContainerConfig(result, nodeName); return result; }

Target:
public CreateContainerCmd fillContainerConfig(CreateContainerCmd containerConfig) { final CreateContainerCmd result = dockerTemplateBase.fillContainerConfig(containerConfig); final String templateName = getName(); final Map<String, String> labels = result.getLabels(); labels.put(DockerContainerLabelKeys.REMOVE_VOLUMES, Boolean.toString(isRemoveVolumes())); labels.put(DockerContainerLabelKeys.TEMPLATE_NAME, templateName); final String nodeName = calcUnusedNodeName(templateName); setNodeNameInContainerConfig(result, nodeName); return result; }
Source:
private void verifyKeySizesMatch(ArrayList<IndexEntry> entries) { StoreKey firstKey = entries.get(0).getKey(); for (IndexEntry entry : entries) { if (entry.getKey().sizeInBytes() != firstKey.sizeInBytes()) { throw new IllegalArgumentException( "Key sizes in the entries list are not the same, key size: " + entry.getKey().sizeInBytes() + " key: " + entry.getKey() + " is different from size of first key: " + firstKey.sizeInBytes() + " key: " + firstKey); } } }

Target:
private void verifyKeySizesMatch(ArrayList<IndexEntry> entries) { StoreKey firstKey = entries.get(0).getKey(); for (IndexEntry entry : entries) { if (entry.getKey().sizeInBytes() != firstKey.sizeInBytes()) { metrics.keySizeMismatchCount.inc(1); throw new IllegalArgumentException( "Key sizes in the entries list are not the same, key size: " + entry.getKey().sizeInBytes() + " key: " + entry.getKey() + " is different from size of first key: " + firstKey.sizeInBytes() + " key: " + firstKey); } } }
Source:
public static Object[][] fliteTagBrokenOasis() { return new Object[][]{ {"adtest", "SyntheticTests/FliteTagBrokenWidth", "Invalid width of the flite unit was passed. Make sure you provide width parameter with numeric value.", "#mw-content-text .error"}, {"adtest", "SyntheticTests/FliteTagBrokenHeight", "Invalid height of the flite unit was passed. Make sure you provide height parameter with numeric value.", "#mw-content-text .error"}, {"adtest", "SyntheticTests/FliteTagBrokenTag", "Invalid guid parameter was passed. Provide valid guid or remove this tag from article's content.", "#mw-content-text .error"}}; }

Target:
public static Object[][] fliteTagBrokenOasis() { return new Object[][]{ { "SyntheticTests/FliteTagBrokenWidth", "Invalid width of the flite unit was passed. Make sure you provide width parameter with numeric value." }, { "SyntheticTests/FliteTagBrokenHeight", "Invalid height of the flite unit was passed. Make sure you provide height parameter with numeric value." }, { "SyntheticTests/FliteTagBrokenTag", "Invalid guid parameter was passed. Provide valid guid or remove this tag from article's content." } }; }
Source:
public VoiceMessageResponse sendVoiceMessage(final VoiceMessage voiceMessage) throws UnauthorizedException, GeneralException { if (voiceMessage.getMachineTimeout() == 0){ voiceMessage.setMachineTimeout(7000); } return messageBirdService.sendPayLoad(VOICEMESSAGESPATH, voiceMessage, VoiceMessageResponse.class); }

Target:
public VoiceMessageResponse sendVoiceMessage(final VoiceMessage voiceMessage) throws UnauthorizedException, GeneralException { addDefaultMachineTimeoutValueIfNotExists(voiceMessage); checkMachineTimeoutValueIsInRange(voiceMessage); return messageBirdService.sendPayLoad(VOICEMESSAGESPATH, voiceMessage, VoiceMessageResponse.class); }
Source:
public List<QueryHandle> getAllQueries(GrillSessionHandle sessionHandle, String state, String userName, String queryName) throws GrillException { try { acquire(sessionHandle); Status status = null; try { status = StringUtils.isBlank(state) ? null : Status.valueOf(state); } catch (IllegalArgumentException e) { throw new BadRequestException("Bad state argument passed, possible" + " values are " + Status.values(), e); } boolean filterByStatus = status != null; queryName = queryName.toLowerCase(); boolean filterByQueryName = StringUtils.isNotBlank(queryName); if (StringUtils.isBlank(userName)) { userName = getSession(sessionHandle).getUserName(); } List<QueryHandle> all = new ArrayList<QueryHandle>(allQueries.keySet()); Iterator<QueryHandle> itr = all.iterator(); while (itr.hasNext()) { QueryHandle q = itr.next(); QueryContext context = allQueries.get(q); GrillQuery query = context.toGrillQuery(); if ((filterByStatus && status != context.getStatus().getStatus()) || (filterByQueryName && !query.getQueryName().toLowerCase().contains(queryName)) || (!"all".equalsIgnoreCase(userName) && !userName.equalsIgnoreCase(context.getSubmittedUser())) ) { itr.remove(); } } return all; } finally { release(sessionHandle); } }

Target:
public List<QueryHandle> getAllQueries(GrillSessionHandle sessionHandle, String state, String userName, String queryName) throws GrillException { try { acquire(sessionHandle); Status status = null; try { status = StringUtils.isBlank(state) ? null : Status.valueOf(state); } catch (IllegalArgumentException e) { throw new BadRequestException("Bad state argument passed, possible" + " values are " + Status.values(), e); } boolean filterByStatus = status != null; queryName = queryName.toLowerCase(); boolean filterByQueryName = StringUtils.isNotBlank(queryName); if (StringUtils.isBlank(userName)) { userName = getSession(sessionHandle).getUserName(); } List<QueryHandle> all = new ArrayList<QueryHandle>(allQueries.keySet()); Iterator<QueryHandle> itr = all.iterator(); while (itr.hasNext()) { QueryHandle q = itr.next(); QueryContext context = allQueries.get(q); if ((filterByStatus && status != context.getStatus().getStatus()) || (filterByQueryName && !context.getQueryName().toLowerCase().contains(queryName)) || (!"all".equalsIgnoreCase(userName) && !userName.equalsIgnoreCase(context.getSubmittedUser())) ) { itr.remove(); } } return all; } finally { release(sessionHandle); } }
Source:
public boolean remove(final K key) throws CacheAccessException { removeObserver.begin(); checkKey(key); final StoreEventSink<K, V> eventSink = storeEventDispatcher.eventSink(); final long now = timeSource.getTimeMillis(); try { final AtomicReference<OnHeapValueHolder<V>> removedValue = new AtomicReference<OnHeapValueHolder<V>>(); map.computeIfPresent(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, OnHeapValueHolder<V> mappedValue) { if (mappedValue != null && mappedValue.isExpired(now, TimeUnit.MILLISECONDS)) { onExpiration(key, mappedValue, eventSink); return null; } if (mappedValue != null) { removedValue.set(mappedValue); eventSink.removed(mappedKey, mappedValue.value()); } return null; } }); storeEventDispatcher.releaseEventSink(eventSink); OnHeapValueHolder<V> removedValueHolder = removedValue.get(); if (removedValueHolder != null) { removeObserver.end(StoreOperationOutcomes.RemoveOutcome.REMOVED); decrementCurrentUsageInBytesIfRequired(removedValueHolder.size()); } else { removeObserver.end(StoreOperationOutcomes.RemoveOutcome.MISS); } return removedValueHolder != null; } catch (RuntimeException re) { storeEventDispatcher.releaseEventSinkAfterFailure(eventSink, re); handleRuntimeException(re); return false; } }

Target:
public boolean remove(final K key) throws CacheAccessException { removeObserver.begin(); checkKey(key); final StoreEventSink<K, V> eventSink = storeEventDispatcher.eventSink(); final long now = timeSource.getTimeMillis(); try { final AtomicReference<OnHeapValueHolder<V>> removedValue = new AtomicReference<OnHeapValueHolder<V>>(); map.computeIfPresent(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, OnHeapValueHolder<V> mappedValue) { if (mappedValue != null && mappedValue.isExpired(now, TimeUnit.MILLISECONDS)) { onExpiration(mappedKey, mappedValue, eventSink); return null; } if (mappedValue != null) { removedValue.set(mappedValue); eventSink.removed(mappedKey, mappedValue.value()); } return null; } }); storeEventDispatcher.releaseEventSink(eventSink); OnHeapValueHolder<V> removedValueHolder = removedValue.get(); if (removedValueHolder != null) { removeObserver.end(StoreOperationOutcomes.RemoveOutcome.REMOVED); decrementCurrentUsageInBytesIfRequired(removedValueHolder.size()); } else { removeObserver.end(StoreOperationOutcomes.RemoveOutcome.MISS); } return removedValueHolder != null; } catch (RuntimeException re) { storeEventDispatcher.releaseEventSinkAfterFailure(eventSink, re); handleRuntimeException(re); return false; } }
Source:
private static void createMappingIfNeeded(JestClient jestClient, String indexName, String typeName) throws IOException { synchronized (CREATE_MAPPING_LOCK) { IndicesExists indicesExists = new IndicesExists.Builder(indexName).build(); boolean indexExists = jestClient.execute(indicesExists).isSucceeded(); if (!indexExists) { CreateIndex createIndex = new CreateIndex.Builder(indexName).build(); jestClient.execute(createIndex); URL url = ElasticWriter.class.getResource("/elastic-mapping.json"); String mapping = Resources.toString(url, Charsets.UTF_8); PutMapping putMapping = new PutMapping.Builder(indexName, typeName,mapping).build(); JestResult result = jestClient.execute(putMapping); if (!result.isSucceeded()) { log.warn("Failed to create mapping: {}", result.getErrorMessage()); } else { log.info("Created mapping for index {}", indexName); } } } }

Target:
private static void createMappingIfNeeded(JestClient jestClient, String indexName, String typeName) throws ElasticWriterException, IOException { synchronized (CREATE_MAPPING_LOCK) { IndicesExists indicesExists = new IndicesExists.Builder(indexName).build(); boolean indexExists = jestClient.execute(indicesExists).isSucceeded(); if (!indexExists) { CreateIndex createIndex = new CreateIndex.Builder(indexName).build(); jestClient.execute(createIndex); URL url = ElasticWriter.class.getResource("/elastic-mapping.json"); String mapping = Resources.toString(url, Charsets.UTF_8); PutMapping putMapping = new PutMapping.Builder(indexName, typeName,mapping).build(); JestResult result = jestClient.execute(putMapping); if (!result.isSucceeded()) { throw new ElasticWriterException(String.format("Failed to create mapping: %s", result.getErrorMessage())); } else { log.info("Created mapping for index {}", indexName); } } } }
Source:
public List<? extends Module> getJacksonModules() { return ImmutableList.of(new SimpleModule("LookupModule-" + UUID.randomUUID().toString())); }

Target:
public List<? extends Module> getJacksonModules() { return Collections.emptyList(); }
Source:
public void onAttach(@NonNull Context context) { super.onAttach(context); mCameraController = new CameraController(context); }

Target:
public void onAttach(@NonNull Context context) { super.onAttach(context); mCameraController = new CameraController(); }
Source:
public Optional<ChargeStatus> getIntermediateChargeStatus(ChargeStatus fromStatus, ChargeStatus toStatus) { if (fromStatus.equals(ChargeStatus.AUTHORISATION_3DS_REQUIRED) && toStatus.equals(ChargeStatus.EXPIRED)) { return Optional.of(ChargeStatus.EXPIRE_CANCEL_READY); } if (fromStatus.equals(ChargeStatus.AUTHORISATION_SUCCESS) && toStatus.equals(ChargeStatus.CAPTURE_ERROR)) { return Optional.of(CAPTURE_READY); } return graph.successors(fromStatus) .stream() .filter(chargeStatus -> graph.predecessors(toStatus).contains(chargeStatus)) .findFirst(); }

Target:
public Optional<ChargeStatus> getIntermediateChargeStatus(ChargeStatus fromStatus, ChargeStatus toStatus) { if (fromStatus.equals(AUTHORISATION_3DS_REQUIRED) && toStatus.equals(EXPIRED)) { return Optional.of(EXPIRE_CANCEL_READY); } if (fromStatus.equals(AUTHORISATION_SUCCESS) && toStatus.equals(CAPTURE_ERROR)) { return Optional.of(CAPTURE_READY); } return graph.successors(fromStatus) .stream() .filter(chargeStatus -> graph.predecessors(toStatus).contains(chargeStatus)) .findFirst(); }
Source:
public @NonNull Iterable<@NonNull TmfAnalysisRequirement> getAnalysisRequirements() { Set<@NonNull TmfAnalysisRequirement> requirements = fAnalysisRequirements; if (requirements == null) { LttngUstTrace trace = getTrace(); ILttngUstEventLayout layout = ILttngUstEventLayout.DEFAULT_LAYOUT; if (trace != null) { layout = trace.getEventLayout(); } @NonNull Set<@NonNull String> requiredEventsFields = ImmutableSet.of( layout.contextProcname(), layout.contextVtid()); @NonNull TmfAnalysisEventFieldRequirement entryReq = new TmfAnalysisEventFieldRequirement( ImmutableSet.of(layout.eventCygProfileFuncEntry(), layout.eventCygProfileFastFuncEntry()), requiredEventsFields, ValuePriorityLevel.MANDATORY); @NonNull TmfAnalysisEventFieldRequirement exitReq = new TmfAnalysisEventFieldRequirement( ImmutableSet.of(layout.eventCygProfileFuncExit(), layout.eventCygProfileFastFuncExit()), requiredEventsFields, ValuePriorityLevel.MANDATORY); exitReq.addInformation(nullToEmptyString(Messages.LttnUstCallStackAnalysisModule_EventsLoadingInformation)); requirements = ImmutableSet.of(entryReq, exitReq); fAnalysisRequirements = requirements; } return requirements; }

Target:
public @NonNull Iterable<@NonNull TmfAnalysisRequirement> getAnalysisRequirements() { Set<@NonNull TmfAnalysisRequirement> requirements = fAnalysisRequirements; if (requirements == null) { LttngUstTrace trace = getTrace(); ILttngUstEventLayout layout = ILttngUstEventLayout.DEFAULT_LAYOUT; if (trace != null) { layout = trace.getEventLayout(); } requirements = ImmutableSet.of(new LttngUstCallStackAnalysisRequirement(layout)); fAnalysisRequirements = requirements; } return requirements; }
Source:
private Pod getPluginBrokerPod(Map<String, Pod> pods) throws InfrastructureException { if (pods.isEmpty()) { throw new InternalInfrastructureException("There is no any pod in plugin broker environment"); } if (pods.size() > 1) { throw new InternalInfrastructureException( "There are multiply pods in plugin broker environment"); } return pods.values().iterator().next(); }

Target:
private Pod getPluginBrokerPod(Map<String, Pod> pods) throws InfrastructureException { if (pods.size() != 1) { throw new InternalInfrastructureException( format( "Plugin broker environment must have only " + "one pod. Workspace `%s` contains `%s` pods.", workspaceId, pods.size())); } return pods.values().iterator().next(); }
Source:
public static Module module() { return new CacheModule() { @Override protected void configure() { persist(NAME, ConflictKey.class, Boolean.class) .maximumWeight(10 << 20) .loader(ConflictsLoader.class); bind(ConflictsCacheImpl.class); bind(ConflictsCache.class).to(ConflictsCacheImpl.class); } }; }

Target:
public static Module module() { return new CacheModule() { @Override protected void configure() { persist(NAME, ConflictKey.class, Boolean.class) .maximumWeight(37400); bind(ConflictsCache.class).to(ConflictsCacheImpl.class); } }; }
Source:
public synchronized void setCrlLocationUrl(String crlLocationUrl) { this.crlLocationUrl = crlLocationUrl; if (handle != null) { handle.cancel(true); } handle = scheduler.scheduleAtFixedRate(this, INITIAL_DELAY, SCHEDULER_INTERVAL, TimeUnit.MINUTES); }

Target:
public synchronized void setCrlLocationUrl(String crlLocationUrl) { this.crlLocationUrl = crlLocationUrl; if (handle != null) { handle.cancel(false); } handle = scheduler.scheduleAtFixedRate(this, INITIAL_DELAY, SCHEDULER_INTERVAL, TimeUnit.MINUTES); }
Source:
private void initGlusterPeerProcess() { List<VDS> vdsList = DbFacade.getInstance().getVdsDAO().getAllForVdsGroup(getVdsGroupId()); if (vdsList != null && vdsList.size() > 1) { VDS upServer = null; for (int i = 0; i < vdsList.size(); i++) { if (!Guid.OpEquality(getVdsId(), vdsList.get(i).getId()) && vdsList.get(i).getstatus() == VDSStatus.Up) { upServer = vdsList.get(i); break; } } if (upServer != null) { if (!hostExists(getGlusterPeers(upServer.getId()), upServer.getId())) { String newServerName = getVds().gethost_name().isEmpty() ? getVds().getManagmentIp() : getVds().gethost_name(); glusterPeerProbe(upServer.getId(), newServerName); } } } }

Target:
private void initGlusterPeerProcess() { List<VDS> vdsList = getVdsDAO().getAllForVdsGroupWithStatus(getVdsGroupId(), VDSStatus.Up); if (vdsList != null && vdsList.size() > 1) { VDS upServer = null; for (VDS vds : vdsList) { if (!Guid.OpEquality(getVdsId(), vds.getId()) && vds.getstatus() == VDSStatus.Up) { upServer = vds; break; } } if (upServer != null) { if (!hostExists(getGlusterPeers(upServer.getId()), getVdsId())) { String newServerName = getVds().gethost_name().isEmpty() ? getVds().getManagmentIp() : getVds().gethost_name(); glusterPeerProbe(upServer.getId(), newServerName); } } } }
Source:
private IEntityAction chooseNewAction() { List<EntityActionEntry> entry = Lists.newArrayList(); int weightsum = 0; for (IEntityAction e : availableActions) { int weight = ((DefaultEntityAction<T>) e).getWeight(entity); if (weight > 0) { entry.add(new EntityActionEntry(weight, e)); } } if (weightsum > 0) { return WeightedRandom.getRandomItem(entity.getRNG(), entry, weightsum).getAction(); } return null; }

Target:
private IEntityAction chooseNewAction() { List<EntityActionEntry> entry = Lists.newArrayList(); int weightsum = 0; for (IEntityAction e : availableActions) { int weight = ((DefaultEntityAction<T>) e).getWeight(entity); if (weight > 0) { entry.add(new EntityActionEntry(weight, e)); weightsum += weight; } } if (weightsum > 0) { return WeightedRandom.getRandomItem(entity.getRNG(), entry, weightsum).getAction(); } return null; }
Source:
private String getCodeCodeableConceptIdIfExists(IBase theValue) { List<IBase> codings = mySearchParameterExtractor.getCodingsFromCodeableConcept(theValue); String codeCodeableConceptId = null; for (IBase nextCoding : codings) { ResourceIndexedSearchParamToken param = mySearchParameterExtractor.createSearchParamForCoding("Observation", new RuntimeSearchParam(null, null, "code", null, null, null, null, null, null, null), nextCoding); if (param != null) { String system = param.getSystem(); String code = param.getValue(); String text = mySearchParameterExtractor.getDisplayTextForCoding(nextCoding); if (code != null && system != null) { codeCodeableConceptId = myObservationIndexedCodeCodingSearchParamDao.findForCodeAndSystem(code, system); } else { codeCodeableConceptId = myObservationIndexedCodeCodingSearchParamDao.findForDisplay(text); } if (codeCodeableConceptId != null) { break; } } } return codeCodeableConceptId; }

Target:
private Optional<String> getCodeCodeableConceptIdIfExists(IBase theValue) { List<IBase> codings = mySearchParameterExtractor.getCodingsFromCodeableConcept(theValue); String codeCodeableConceptId = null; Optional<String> codeCodeableConceptIdOptional = Optional.empty(); for (IBase nextCoding : codings) { ResourceIndexedSearchParamToken param = mySearchParameterExtractor.createSearchParamForCoding("Observation", new RuntimeSearchParam(null, null, "code", null, null, null, null, null, null, null), nextCoding); if (param != null) { String system = param.getSystem(); String code = param.getValue(); String text = mySearchParameterExtractor.getDisplayTextForCoding(nextCoding); if (code != null && system != null) { codeCodeableConceptIdOptional = Optional.ofNullable(myObservationIndexedCodeCodingSearchParamDao.findByCodeAndSystem(code, system)); } else { codeCodeableConceptIdOptional = Optional.ofNullable(myObservationIndexedCodeCodingSearchParamDao.findByDisplay(text)); } if (codeCodeableConceptIdOptional.isPresent()) { break; } } } return codeCodeableConceptIdOptional; }
Source:
public void simpleHostRouteWithEncodedQuery() { this.routes.addRoute("/self/**", "http://localhost:" + this.port + "/"); this.endpoint.reset(); ResponseEntity<String> result = new TestRestTemplate().exchange( "http://localhost:" + this.port + "/self/query?foo={foo}", HttpMethod.GET, new HttpEntity<>((Void) null), String.class, "weird#chars"); assertEquals(HttpStatus.OK, result.getStatusCode()); assertEquals("/query?foo=weird%23chars", result.getBody()); }

Target:
public void simpleHostRouteWithEncodedQuery() { this.routes.addRoute("/self/**", "http://localhost:" + this.port + "/"); this.endpoint.reset(); ResponseEntity<String> result = new TestRestTemplate().exchange( "http://localhost:" + this.port + "/self/query?foo={foo}", HttpMethod.GET, new HttpEntity<>((Void) null), String.class, "weird#chars"); assertEquals(HttpStatus.OK, result.getStatusCode()); assertEquals("/query?foo=weird#chars", result.getBody()); }
Source:
public void copyIncrementalWithResponseCodeSnippet2() { final String snapshot = "copy snapshot"; PageBlobCopyIncrementalRequestConditions destinationRequestConditions = new PageBlobCopyIncrementalRequestConditions() .setIfNoneMatch("snapshotMatch"); Context context = new Context(key, value); CopyStatusType statusType = client .copyIncrementalWithResponse(new PageBlobCopyIncrementalOptions(url, snapshot) .setRequestConditions(destinationRequestConditions), timeout, context).getValue(); if (CopyStatusType.SUCCESS == statusType) { System.out.println("Page blob copied successfully"); } else if (CopyStatusType.FAILED == statusType) { System.out.println("Page blob copied failed"); } else if (CopyStatusType.ABORTED == statusType) { System.out.println("Page blob copied aborted"); } else if (CopyStatusType.PENDING == statusType) { System.out.println("Page blob copied pending"); } END: com.azure.storage.blob.specialized.PageBlobClient.copyIncrementalWithResponse#PageBlobCopyIncrementalOptions-Duration-Context }

Target:
public void copyIncrementalWithResponseCodeSnippet2() { final String snapshot = "copy snapshot"; PageBlobCopyIncrementalRequestConditions destinationRequestConditions = new PageBlobCopyIncrementalRequestConditions() .setIfNoneMatch("snapshotMatch"); Context context = new Context(key, value); CopyStatusType statusType = client .copyIncrementalWithResponse(new PageBlobCopyIncrementalOptions(url, snapshot) .setRequestConditions(destinationRequestConditions), timeout, context).getValue(); switch (statusType) { case SUCCESS: System.out.println("Page blob copied successfully"); break; case FAILED: System.out.println("Page blob copied failed"); break; case ABORTED: System.out.println("Page blob copied aborted"); break; case PENDING: System.out.println("Page blob copied pending"); break; default: break; } END: com.azure.storage.blob.specialized.PageBlobClient.copyIncrementalWithResponse#PageBlobCopyIncrementalOptions-Duration-Context }
Source:
public ModelAndView index(Request request, Response response) { Map<Object, Object> object = new HashMap<Object, Object>() {{ put("viewTitle", "Pipelines"); }}; return new ModelAndView(object, null); }

Target:
public ModelAndView index(Request request, Response response) { Map<Object, Object> object = new HashMap<Object, Object>() {{ put("viewTitle", "Pipeline Configuration"); }}; return new ModelAndView(object, null); }
Source:
public List<CourseAttributes> getCourses(List<String> courseIds) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, courseIds); List<Course> courses = getCourseEntities(courseIds); List<CourseAttributes> courseAttributes = new ArrayList<CourseAttributes>(); for (Course c: courses) { if (c != null) { courseAttributes.add(new CourseAttributes(c)); } } return courseAttributes; }

Target:
public List<CourseAttributes> getCourses(List<String> courseIds) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, courseIds); List<Course> courses = getCourseEntities(courseIds); List<CourseAttributes> courseAttributes = new ArrayList<CourseAttributes>(); for (Course c: courses) { courseAttributes.add(new CourseAttributes(c)); } return courseAttributes; }
Source:
private void onSiteInitialized(long HSId, long masterHSId, long dataSinkHSId, boolean schemaHasNoTables) { String nonce = null; String data = null; synchronized(m_lock) { m_snapshotSites.remove(HSId); if (dataSinkHSId != Long.MIN_VALUE) { m_srcToDest.put(masterHSId, dataSinkHSId); } m_rejoiningSites.add(HSId); nonce = m_nonces.get(HSId); if (m_snapshotSites.isEmpty()) { data = makeSnapshotRequest(m_srcToDest); m_srcToDest.clear(); } } if (nonce == null) { throw new RuntimeException("Received an INITIATION_RESPONSE for an HSID for which no nonce exists: " + CoreUtils.hsIdToString(HSId)); } if (data != null && !schemaHasNoTables) { REJOINLOG.debug("Snapshot request: " + data); SnapshotUtil.requestSnapshot(0l, "", nonce, !m_liveRejoin, SnapshotFormat.STREAM, SnapthotPathType.SNAP_CL, data, SnapshotUtil.fatalSnapshotResponseHandler, true); } }

Target:
private void onSiteInitialized(long HSId, long masterHSId, long dataSinkHSId, boolean schemaHasNoTables) { String nonce = null; String data = null; synchronized(m_lock) { m_snapshotSites.remove(HSId); if (dataSinkHSId != Long.MIN_VALUE) { m_srcToDest.put(masterHSId, dataSinkHSId); } m_rejoiningSites.add(HSId); nonce = m_nonces.get(HSId); if (m_snapshotSites.isEmpty()) { data = makeSnapshotRequest(m_srcToDest); m_srcToDest.clear(); } } if (nonce == null) { throw new RuntimeException("Received an INITIATION_RESPONSE for an HSID for which no nonce exists: " + CoreUtils.hsIdToString(HSId)); } if (data != null && !schemaHasNoTables) { REJOINLOG.debug("Snapshot request: " + data); SnapshotUtil.requestSnapshot(0l, "", nonce, !m_liveRejoin, SnapshotFormat.STREAM, SnapshotPathType.SNAP_NO_PATH, data, SnapshotUtil.fatalSnapshotResponseHandler, true); } }
Source:
public void dispose() { GitProjectData.removeRepositoryChangeListener(repoChangeListener); IndexDiffCache indexDiffCache = Activator.getDefault() .getIndexDiffCache(); if (indexDiffCache != null) indexDiffCache .removeIndexDiffChangedListener(indexDiffChangeListener); super.dispose(); }

Target:
public void dispose() { GitProjectData.removeRepositoryChangeListener(repoChangeListener); ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener); super.dispose(); }
Source:
public long getLength(String path) { return (((Number) getAttributeValue (path, "length")).longValue()); }

Target:
public long getLength(String path) { return ((Number) getAttributeValue (path, "length")).longValue(); }
Source:
public static String streamToString(java.io.InputStream is) { java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A"); return s.hasNext() ? s.next() : ""; }

Target:
public static String streamToString(java.io.InputStream is) { java.util.Scanner s = new java.util.Scanner(is, "UTF-8").useDelimiter("\\A"); return s.hasNext() ? s.next() : ""; }
Source:
private String getAverageExcludingSelfText(boolean showAvgExcludingSelf, DecimalFormat df, Double averageExcludingSelf) { if (showAvgExcludingSelf) { return averageExcludingSelf == null ? "-" : df.format(averageExcludingSelf); } else { return ""; } }

Target:
private String getAverageExcludingSelfText(boolean showAvgExcludingSelf, DecimalFormat df, Double averageExcludingSelf) { if (showAvgExcludingSelf) { return averageExcludingSelf == null ? "-" : df.format(averageExcludingSelf); } return ""; }
Source:
protected static void removeTaskFromDbByTaskId(Guid taskId) { try { if (DbFacade.getInstance().getAsyncTaskDao().remove(taskId) != 0) { log.infoFormat("BaseAsyncTask::RemoveTaskFromDB: Removed task {0} from DataBase", taskId); } } catch (RuntimeException e) { log.error(String.format( "AsyncTaskManager::RemoveTaskFromDB: Removing task %1$s from DataBase threw an exception.", taskId), e); } }

Target:
protected static void removeTaskFromDbByTaskId(Guid taskId) { try { if (DbFacade.getInstance().getAsyncTaskDao().remove(taskId) != 0) { log.infoFormat("Removed task {0} from DataBase", taskId); } } catch (RuntimeException e) { log.error(String.format( "Removing task %1$s from DataBase threw an exception.", taskId), e); } }
Source:
public void switch_statement_with_expression_in_case() { final CFG cfg = buildCFG( "void fun() { int a; switch(b) { case c : System.out.println(1);break; case d || e: System.out.println(2);break;} }"); final CFGChecker cfgChecker = checker( block( element(Kind.CASE_GROUP), element(Kind.IDENTIFIER, "c"), element(Kind.IDENTIFIER, "System"), element(Kind.MEMBER_SELECT), element(INT_LITERAL, "1"), element(Tree.Kind.METHOD_INVOCATION)).successors(0), block( element(Kind.CASE_GROUP), element(Kind.IDENTIFIER, "d")).terminator(Kind.CONDITIONAL_OR).successors(2, 3), block( element(Kind.IDENTIFIER, "e")).successors(2), block( element(Tree.Kind.IDENTIFIER, "System"), element(Tree.Kind.MEMBER_SELECT), element(INT_LITERAL, "2"), element(Tree.Kind.METHOD_INVOCATION)).terminator(Tree.Kind.BREAK_STATEMENT).successors(0), block( element(Tree.Kind.VARIABLE, "a"), element(Tree.Kind.IDENTIFIER, "b")).terminator(Tree.Kind.SWITCH_STATEMENT).successors(0, 4, 5)); cfgChecker.check(cfg); }

Target:
public void switch_statement_with_expression_in_case() { final CFG cfg = buildCFG( "void fun() { int a; switch(b) { case c : System.out.println(1);break; case d || e: System.out.println(2);break;} }"); final CFGChecker cfgChecker = checker( block( element(Kind.IDENTIFIER, "c"), element(Kind.IDENTIFIER, "System"), element(Kind.MEMBER_SELECT), element(INT_LITERAL, "1"), element(Tree.Kind.METHOD_INVOCATION)).hasCaseGroup().successors(0), block( element(Kind.IDENTIFIER, "d")).terminator(Kind.CONDITIONAL_OR).hasCaseGroup().successors(2, 3), block( element(Kind.IDENTIFIER, "e")).successors(2), block( element(Tree.Kind.IDENTIFIER, "System"), element(Tree.Kind.MEMBER_SELECT), element(INT_LITERAL, "2"), element(Tree.Kind.METHOD_INVOCATION)).terminator(Tree.Kind.BREAK_STATEMENT).successors(0), block( element(Tree.Kind.VARIABLE, "a"), element(Tree.Kind.IDENTIFIER, "b")).terminator(Tree.Kind.SWITCH_STATEMENT).successors(0, 4, 5)); cfgChecker.check(cfg); }
Source:
public List<Note> call() throws JGitInternalException { checkCallable(); List<Note> notes = new ArrayList<Note>(); RevWalk walk = new RevWalk(repo); ObjectInserter inserter = repo.newObjectInserter(); NoteMap map = NoteMap.newEmptyMap(); try { Ref ref = repo.getRef(notesRef); if (ref != null) { RevCommit notesCommit = walk.parseCommit(ref.getObjectId()); map = NoteMap.read(walk.getObjectReader(), notesCommit); } Iterator<Note> i = map.iterator(); while (i.hasNext()) notes.add(i.next()); inserter.flush(); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } finally { inserter.release(); walk.release(); } return notes; }

Target:
public List<Note> call() throws JGitInternalException { checkCallable(); List<Note> notes = new ArrayList<Note>(); RevWalk walk = new RevWalk(repo); NoteMap map = NoteMap.newEmptyMap(); try { Ref ref = repo.getRef(notesRef); if (ref != null) { RevCommit notesCommit = walk.parseCommit(ref.getObjectId()); map = NoteMap.read(walk.getObjectReader(), notesCommit); } Iterator<Note> i = map.iterator(); while (i.hasNext()) notes.add(i.next()); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } finally { walk.release(); } return notes; }
Source:
private VmDevice createVmDevice(Guid vmGuid) { Map<String, String> customProp = new LinkedHashMap<>(); customProp.put("prop1", "value1"); return new VmDevice(new VmDeviceId(Guid.newGuid(), vmGuid), VmDeviceGeneralType.DISK, "floppy", "type:'drive', controller:'0', bus:'0', unit:'1'", 2, new HashMap<String, Object>(), true, false, false, "alias", customProp, null, null); }

Target:
private VmDevice createVmDevice(Guid vmGuid) { return new VmDevice(new VmDeviceId(Guid.newGuid(), vmGuid), VmDeviceGeneralType.DISK, "floppy", "type:'drive', controller:'0', bus:'0', unit:'1'", 2, new HashMap<String, Object>(), true, false, false, "alias", Collections.singletonMap("prop1", "value1"), null, null); }
Source:
public Collection<RefRight> getInheritedRights() { if (isSpecialWildProject()) { return Collections.emptySet(); } return inheritedRights.get(); }

Target:
public Collection<RefRight> getInheritedRights() { if (isSpecialWildProject()) { return Collections.emptyList(); } return inheritedRights.get(); }
Source:
void maximize(final MUIElement element) { if (!element.isToBeRendered()) return; List<MUIElement> elementsToMinimize = getElementsToMinimize(element); Shell hostShell = (Shell) modelService.getTopLevelWindowFor(element).getWidget(); MWindow win = getWindowFor(element); FaderAnimationFeedback fader = new FaderAnimationFeedback(hostShell); AnimationEngine engine = new AnimationEngine(win.getContext(), fader, 300); engine.schedule(); restoreMaximizedElement(element, win); for (MUIElement toMinimize : elementsToMinimize) { toMinimize.getTags().add(MINIMIZED); toMinimize.getTags().add(MINIMIZED_BY_ZOOM); } adjustCTFButtons(element); if (MPartStack.class.isInstance(element)) { MArea area = getAreaFor(MPartStack.class.cast(element)); if (area != null && area.getTags().contains(MAXIMIZEABLE_CHILDREN_TAG)) { MPlaceholder placeholder = area.getCurSharedRef(); ignoreTagChanges = true; placeholder.getTags().add(MAXIMIZED); ignoreTagChanges = false; adjustCTFButtons(placeholder); } } }

Target:
void maximize(final MUIElement element) { if (!element.isToBeRendered()) return; List<MUIElement> elementsToMinimize = getElementsToMinimize(element); Shell hostShell = (Shell) modelService.getTopLevelWindowFor(element).getWidget(); MWindow win = getWindowFor(element); FaderAnimationFeedback fader = new FaderAnimationFeedback(hostShell); AnimationEngine engine = new AnimationEngine(win.getContext(), fader, 300); engine.schedule(); restoreMaximizedElement(element, win); for (MUIElement toMinimize : elementsToMinimize) { toMinimize.getTags().add(MINIMIZED); toMinimize.getTags().add(MINIMIZED_BY_ZOOM); } adjustCTFButtons(element); if (element instanceof MPartStack) { MArea area = getAreaFor((MPartStack) element); if (area != null && area.getTags().contains(MAXIMIZEABLE_CHILDREN_TAG)) { MPlaceholder placeholder = area.getCurSharedRef(); ignoreTagChanges = true; try { placeholder.getTags().add(MAXIMIZED); } finally { ignoreTagChanges = false; } adjustCTFButtons(placeholder); } } }
Source:
public void compare(List<JsonObject> expectedEventList, List<JsonObject> trackedEventList) { for (JsonObject expectedEvent : expectedEventList) { Boolean equals = false; for (JsonObject currentEvent : trackedEventList) { equals = currentEvent.equals(expectedEvent); if (equals) { PageObjectLogging.log("compare", "match for expected event found: \n" + "expected event: " + expectedEvent.toString() + "\n" + "compared event: " + currentEvent.toString(), true); trackedEventList.remove(currentEvent); break; } } if (!equals) { PageObjectLogging.log("compare", "didn't find match for expected event: " + expectedEvent.toString(), false); } Assertion.assertTrue(equals); } }

Target:
public void compare(List<JsonObject> expectedEventList, List<JsonObject> trackedEventList) { for (JsonObject expectedEvent : expectedEventList) { Boolean equals = false; for (JsonObject trackedEvent : trackedEventList) { equals = trackedEvent.equals(expectedEvent); if (equals) { PageObjectLogging.log("compare", "match for expected event found: \n" + "expected event: " + expectedEvent.toString() + "\n" + "compared event: " + trackedEvent.toString(), true); trackedEventList.remove(trackedEvent); break; } } Assertion.assertTrue(equals, "didn't match expected event: " + expectedEvent.toString()); } }
Source:
E doIt() throws IOException; } protected <E> E doShared( final Work<E> work ) { if ( timelineLock.readLock().tryLock() ) { if ( started && !indexerIsDead ) { try { return work.doIt(); } catch ( final IOException e ) { try { timelineLock.readLock().unlock(); doExclusively( new Work<Void>() { @Override public Void doIt() throws IOException { try { markIndexerDead( e ); } finally { timelineLock.readLock().lock(); } return null; } } ); } catch ( final IOException ee ) { getLogger().warn( "Unable to cleanly disable Timeline indexer.", e ); } } finally { timelineLock.readLock().unlock(); } } } return null; }

Target:
E doIt() throws IOException; } protected <E> E doShared( final Work<E> work ) { if ( timelineLock.readLock().tryLock() ) { try { if ( started && !indexerIsDead ) { try { return work.doIt(); } catch ( IOException e ) { markIndexerDead( e ); } } } finally { timelineLock.readLock().unlock(); } } return null; }
Source:
private TypeDefinition parseSubType(String id, Range cardinality) throws IOException, ParserException { NativeType nativeType = readNativeType(); TypeDefinition subType = null; if ( nativeType == null ) { subType = new TypeDefinitionLink( getContext(), id, cardinality, token.content() ); getToken(); } else { getToken(); if ( token.is(Scanner.TokenType.LPAREN)){ getToken(); subType = new TypeInlineDefinition(getContext(), id, nativeType, token.content(), cardinality); getToken(); eat(Scanner.TokenType.RPAREN, "expected right parenthesis"); } else { subType = new TypeInlineDefinition( getContext(), id, nativeType, cardinality); } if ( token.is( Scanner.TokenType.LCURLY ) ) { parseSubTypes((TypeInlineDefinition) subType); } } if ( token.is( Scanner.TokenType.PARALLEL ) ) { getToken(); TypeDefinition secondSubType = parseSubType(id, cardinality); TypeChoiceDefinition choiceSubType = new TypeChoiceDefinition( getContext(), id, cardinality, subType, secondSubType); return choiceSubType; } return subType; }

Target:
private TypeDefinition parseSubType(String id, Range cardinality) throws IOException, ParserException { NativeType nativeType = readNativeType(); TypeDefinition subType; if ( nativeType == null ) { subType = new TypeDefinitionLink( getContext(), id, cardinality, token.content() ); getToken(); } else { getToken(); if ( token.is(Scanner.TokenType.LPAREN)){ getToken(); subType = new TypeInlineDefinition(getContext(), id, (StringType) nativeType, token.content(), cardinality); getToken(); eat(Scanner.TokenType.RPAREN, "expected right parenthesis"); } else { subType = new TypeInlineDefinition( getContext(), id, nativeType, cardinality); } if ( token.is( Scanner.TokenType.LCURLY ) ) { parseSubTypes((TypeInlineDefinition) subType); } } if ( token.is( Scanner.TokenType.PARALLEL ) ) { getToken(); TypeDefinition secondSubType = parseSubType(id, cardinality); TypeChoiceDefinition choiceSubType = new TypeChoiceDefinition( getContext(), id, cardinality, subType, secondSubType); return choiceSubType; } return subType; }
Source:
protected void logTimeoutException(TimeoutException e, VDSNetworkException ex) { logException(ex); log.error("Timeout waiting for VDSM response: {}", e.getMessage()); log.debug("Exception", e); }

Target:
protected void logTimeoutException(TimeoutException e, VDSNetworkException ex) { log.error("Timeout waiting for VDSM response: {}", e.getMessage()); log.debug("Exception", e); }