auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Cube postCubeLoadAttempt(int cubeX, int cubeY, int cubeZ, @Nullable Cube cube, IColumn column, Requirement req) { if (cube == null) { cube = cubeMap.get(cubeX, cubeY, cubeZ); } if (req == Requirement.LOAD) { return cube; } if (req == Requirement.GENERATE && cube != null) { return cube; } if (cube == null) { cube = generateCube(cubeX, cubeY, cubeZ, column); if (req == Requirement.GENERATE) { return cube; } } if (!cube.isFullyPopulated()) { populateCube(cube); if (req == Requirement.POPULATE) { return cube; } } if (!cube.isInitialLightingDone()) { calculateDiffuseSkylight(cube); } return cube; }

Target:
private Cube postCubeLoadAttempt(int cubeX, int cubeY, int cubeZ, @Nullable Cube cube, IColumn column, Requirement req) { if (cube == null) { cube = getLoadedCube(cubeX, cubeY, cubeZ); } if (req == Requirement.LOAD) { return cube; } if (req == Requirement.GENERATE && cube != null) { return cube; } if (cube == null) { cube = generateCube(cubeX, cubeY, cubeZ, column); if (req == Requirement.GENERATE) { return cube; } } if (!cube.isFullyPopulated()) { populateCube(cube); if (req == Requirement.POPULATE) { return cube; } } if (!cube.isInitialLightingDone()) { calculateDiffuseSkylight(cube); } return cube; }
Source:
public static byte[] fromCanonicalJSON(ImmutableSerializationContext ctx, Reader reader) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); RawProtoStreamWriter writer = RawProtoStreamWriterImpl.newInstance(baos); JsonReader jsonReader = new JsonReader(reader); jsonReader.setLenient(false); try { JsonToken token = jsonReader.peek(); while (jsonReader.hasNext() && !token.equals(END_DOCUMENT)) { token = jsonReader.peek(); switch (token) { case BEGIN_OBJECT: processJsonDocument(ctx, jsonReader, writer); break; case NULL: jsonReader.nextNull(); break; case END_DOCUMENT: break; default: throw new IllegalStateException("Invalid top level object! Found token: " + token); } } writer.flush(); return baos.toByteArray(); } catch (MalformedJsonException e) { throw new IllegalStateException("Invalid Json"); } finally { baos.close(); reader.close(); } }

Target:
public static byte[] fromCanonicalJSON(ImmutableSerializationContext ctx, Reader reader) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); RawProtoStreamWriter writer = RawProtoStreamWriterImpl.newInstance(baos); JsonReader jsonReader = new JsonReader(reader); jsonReader.setLenient(false); try { JsonToken token = jsonReader.peek(); while (jsonReader.hasNext() && !token.equals(END_DOCUMENT)) { token = jsonReader.peek(); switch (token) { case BEGIN_OBJECT: processJsonDocument(ctx, jsonReader, writer); break; case NULL: jsonReader.nextNull(); break; case END_DOCUMENT: break; default: throw new IllegalStateException("Invalid top level object! Found token: " + token); } } writer.flush(); return baos.toByteArray(); } catch (MalformedJsonException e) { throw new IllegalStateException("Invalid JSON", e); } finally { baos.close(); reader.close(); } }
Source:
public static URL join(URL urlBase, File... elements) { if (urlBase == null) { return null; } final StringBuilder buf = new StringBuilder(urlBase.getPath()); for (final File elt : elements) { if (!elt.isAbsolute() && buf.length() == 0 || buf.charAt(buf.length() - 1) != URL_PATH_SEPARATOR_CHAR) { buf.append(URL_PATH_SEPARATOR_CHAR); } buf.append(getFilePath(elt)); } try { if (isJarURL(urlBase)) { return new URL( urlBase.getProtocol(), urlBase.getHost(), urlBase.getPort(), buf.toString()); } return new URI( urlBase.getProtocol(), urlBase.getUserInfo(), urlBase.getHost(), urlBase.getPort(), decodeHTMLEntities(buf.toString()), decodeHTMLEntities(urlBase.getQuery()), urlBase.getRef()).toURL(); } catch (Throwable exception) { } try { return new URL( urlBase.getProtocol(), urlBase.getHost(), buf.toString()); } catch (Throwable exception) { return null; } }

Target:
public static URL join(URL urlBase, File... elements) { if (urlBase == null) { return null; } final StringBuilder buf = new StringBuilder(urlBase.getPath()); for (final File elt : elements) { if (!elt.isAbsolute() && (buf.length() == 0 || buf.charAt(buf.length() - 1) != URL_PATH_SEPARATOR_CHAR)) { buf.append(URL_PATH_SEPARATOR_CHAR); } buf.append(getFilePath(elt)); } try { if (isJarURL(urlBase)) { return new URL( urlBase.getProtocol(), urlBase.getHost(), urlBase.getPort(), buf.toString()); } return new URI( urlBase.getProtocol(), urlBase.getUserInfo(), urlBase.getHost(), urlBase.getPort(), decodeHTMLEntities(buf.toString()), decodeHTMLEntities(urlBase.getQuery()), urlBase.getRef()).toURL(); } catch (Throwable exception) { } try { return new URL( urlBase.getProtocol(), urlBase.getHost(), buf.toString()); } catch (Throwable exception) { return null; } }
Source:
private Set<AnnotationMirror> getSupportedAnnotationsInElementAnnotation( @Nullable Element element, Class<? extends Annotation> annoClass) { Set<AnnotationMirror> found = AnnotationUtils.createAnnotationSet(); if (element == null) { return found; } AnnotationMirror annotation = getDeclAnnotation(element, annoClass); if (annotation == null) { return found; } List<Name> qualClasses = AnnotationUtils.getElementValueClassNames(annotation, "value", true); for (Name qual : qualClasses) { AnnotationMirror annotationMirror = AnnotationBuilder.fromName(elements, qual); if (isSupportedQualifier(annotationMirror)) { found.add(annotationMirror); } } return found; }

Target:
private Set<AnnotationMirror> getSupportedAnnotationsInElementAnnotation( @Nullable Element element, Class<? extends Annotation> annoClass) { if (element == null) { return Collections.emptySet(); } AnnotationMirror annotation = getDeclAnnotation(element, annoClass); if (annotation == null) { return Collections.emptySet(); } Set<AnnotationMirror> found = AnnotationUtils.createAnnotationSet(); List<Name> qualClasses = AnnotationUtils.getElementValueClassNames(annotation, "value", true); for (Name qual : qualClasses) { AnnotationMirror annotationMirror = AnnotationBuilder.fromName(elements, qual); if (isSupportedQualifier(annotationMirror)) { found.add(annotationMirror); } } return found; }
Source:
void bufferCurrentEventAndScheduleIfRequired(RecordsRetrieved recordsRetrieved, RecordFlow triggeringFlow) { final RecordsRetrievedContext recordsRetrievedContext = new RecordsRetrievedContext(Either.left(recordsRetrieved), triggeringFlow, Instant.now()); try { recordsDeliveryQueue.add(recordsRetrievedContext); if (recordsDeliveryQueue.size() == 1) { subscriber.onNext(recordsRetrieved); } } catch (IllegalStateException e) { log.warn("{}: Unable to enqueue the payload due to capacity restrictions in delivery queue with remaining capacity {}. Last successful response: RequestId - {}, Timestamp - {}", shardId, recordsDeliveryQueue.remainingCapacity(), getLastSuccessfulResponseRequestId(), getLastSuccessfulResponseTimestamp()); throw e; } catch (Throwable t) { log.error("{}: Unable to deliver event to the shard consumer.", shardId, t); throw t; } }

Target:
void bufferCurrentEventAndScheduleIfRequired(RecordsRetrieved recordsRetrieved, RecordFlow triggeringFlow) { final RecordsRetrievedContext recordsRetrievedContext = new RecordsRetrievedContext(Either.left(recordsRetrieved), triggeringFlow, Instant.now()); try { recordsDeliveryQueue.add(recordsRetrievedContext); if (recordsDeliveryQueue.size() == 1) { subscriber.onNext(recordsRetrieved); } } catch (IllegalStateException e) { log.warn("{}: Unable to enqueue the payload due to capacity restrictions in delivery queue with remaining capacity {}. Last successful request details -- {}", shardId, recordsDeliveryQueue.remainingCapacity(), lastSuccessfulRequestDetails); throw e; } catch (Throwable t) { log.error("{}: Unable to deliver event to the shard consumer.", shardId, t); throw t; } }
Source:
private void fireNewSessionEvents() { if (isManagingZkConnection()) { return; } final String sessionId = getHexSessionId(); for (final IZkStateListener stateListener : _stateListener) { _eventThread.send(new ZkEventThread.ZkEvent("New session event sent to " + stateListener, sessionId) { @Override public void run() throws Exception { stateListener.handleNewSession(sessionId); } }); } }

Target:
private void fireNewSessionEvents() { if (!isManagingZkConnection()) { return; } final String sessionId = getHexSessionId(); for (final IZkStateListener stateListener : _stateListener) { _eventThread.send(new ZkEventThread.ZkEvent("New session event sent to " + stateListener, sessionId) { @Override public void run() throws Exception { stateListener.handleNewSession(sessionId); } }); } }
Source:
public PagedIterable<TableItem> listTables() { return new PagedIterable<>(client.listTables(new ListTablesOptions())); }

Target:
public PagedIterable<TableItem> listTables() { return new PagedIterable<>(client.listTables()); }
Source:
public HashSet<PersistentID> doBackup() throws IOException { BackupTask task = currentTask.get(); if (task == null) { throw new IOException("No backup currently in progress"); } task.notifyOtherMembersReady(); HashSet<PersistentID> result; try { result = taskFuture.get(); } catch (InterruptedException | ExecutionException e) { if (e instanceof ExecutionException) { logger.warn("Backup failed with exception: ", e); } result = new HashSet<>(); } finally { cleanup(); } return result; }

Target:
public HashSet<PersistentID> doBackup() throws IOException { BackupTask task = currentTask.get(); if (task == null) { throw new IOException("No backup currently in progress"); } task.notifyOtherMembersReady(); HashSet<PersistentID> result; try { result = taskFuture.get(); } catch (InterruptedException | ExecutionException e) { logger.warn("Backup failed with exception: ", e); result = new HashSet<>(); } finally { cleanup(); } return result; }
Source:
public Attribute createAttribute(HttpRequest request, String name) { Attribute attribute; if (useDisk) { attribute = new DiskAttribute(name, charset); } else if (checkSize) { attribute = new MixedAttribute(name, minSize, charset); } else { attribute = new MemoryAttribute(name); } attribute.setMaxSize(maxSize); List<HttpData> list = getList(request); list.add(attribute); return attribute; }

Target:
public Attribute createAttribute(HttpRequest request, String name) { final Attribute attribute; if (useDisk) { attribute = new DiskAttribute(name, charset); } else if (checkSize) { attribute = new MixedAttribute(name, minSize, charset); } else { attribute = new MemoryAttribute(name); } attribute.setMaxSize(maxSize); List<HttpData> list = getList(request); list.add(attribute); return attribute; }
Source:
protected SortedAssignmentContainer sortByProgress() { List<Assignment> uncompleted = fetchUncompletedAssignments(); Collections.sort(uncompleted); return new SortedAssignmentContainer(uncompleted, assignments.getExpansions()); }

Target:
protected SortedAssignmentContainer sortByProgress() { if (groupedMap.size() == 0) { sortByCategory(); } List<Assignment> uncompleted = new ArrayList<Assignment>(); List<Assignment> completed = new ArrayList<Assignment>(); for (String group : ASSIGNMENT_TYPE) { Pair<List<Assignment>, List<Assignment>> pair = fetchPairedAssignmentLists(group); uncompleted.addAll(pair.first); completed.addAll(pair.second); } Collections.sort(uncompleted); uncompleted.addAll(completed); return new SortedAssignmentContainer(uncompleted, assignments.getExpansions()); }
Source:
private DeserializationResult readInto(IOReadableWritable target) throws IOException { target.read(this); int remaining = remaining(); if (remaining > 0) { return INTERMEDIATE_RECORD_FROM_BUFFER; } else if (remaining == 0) { return LAST_RECORD_FROM_BUFFER; } else { throw new IOException(BROKEN_SERIALIZATION_ERROR_MESSAGE, new IndexOutOfBoundsException("Remaining = " + remaining)); } }

Target:
private NextRecordResponse readInto(IOReadableWritable target) throws IOException { try { target.read(this); } catch (IndexOutOfBoundsException e) { throw new IOException(BROKEN_SERIALIZATION_ERROR_MESSAGE, e); } int remaining = remaining(); if (remaining < 0) { throw new IOException(BROKEN_SERIALIZATION_ERROR_MESSAGE, new IndexOutOfBoundsException("Remaining = " + remaining)); } return reusedNextRecordResponse.updated(remaining == 0 ? LAST_RECORD_FROM_BUFFER : INTERMEDIATE_RECORD_FROM_BUFFER, remaining); }
Source:
public ToggleablePolicy.PolicyMode getPolicyMode() { String configKey = PolicyConfigKey.HEALTH_POLICY_MODE.key(); if (configs.containsKey(configKey) && "deactivated".equals((String) configs.get(PolicyConfigKey.HEALTH_POLICY_MODE.key()))) { return ToggleablePolicy.PolicyMode.deactivated; } return ToggleablePolicy.PolicyMode.activated; }

Target:
public ToggleablePolicy.PolicyMode getPolicyMode() { String configKey = PolicyConfigKey.HEALTH_POLICY_MODE.key(); if (configs.containsKey(configKey)) { String val = (String) configs.get(PolicyConfigKey.HEALTH_POLICY_MODE.key()); if (CONF_POLICY_MODE_DEACTIVATED.equals(val)) { return ToggleablePolicy.PolicyMode.deactivated; } else if (CONF_POLICY_MODE_ACTIVATED.equals(val)) { return ToggleablePolicy.PolicyMode.activated; } else { LOG.warning("unknown policy mode config " + val); } } return ToggleablePolicy.PolicyMode.activated; }
Source:
public void handleException(Throwable throwable, boolean fromChild) throws Exception { if (fromChild && !failureHandlingConfig.failParentOnSecondaryFailure) { log.debug("Parent task "+this+" swallowing child error: "+throwable); return; } handleException(throwable); }

Target:
public void handleException(Throwable throwable, boolean fromChild) throws Exception { Exceptions.propagateIfFatal(throwable); if (fromChild && !failureHandlingConfig.failParentOnSecondaryFailure) { log.debug("Parent task "+this+" swallowing child error: "+throwable); return; } handleException(throwable); }
Source:
protected void updateEmptyState() { if (mRecyclerView == null) { return; } boolean empty = false; RecyclerView.Adapter<?> adapter = mRecyclerView.getAdapter(); if (adapter instanceof RootAdapter) { empty = ((RootAdapter) adapter).getCount() == 0; } else if (adapter != null) { empty = adapter.getItemCount() == 0; } mRecyclerView.setVisibility(empty ? View.GONE : View.VISIBLE); mEmptyView.setVisibility(empty ? View.VISIBLE : View.GONE); mEmptyViewContainer.setVisibility(empty ? View.VISIBLE : View.GONE); }

Target:
protected void updateEmptyState() { if (mRecyclerView == null) { return; } boolean empty = false; RecyclerView.Adapter<?> adapter = mRecyclerView.getAdapter(); if (adapter instanceof RootAdapter) { empty = ((RootAdapter) adapter).getCount() == 0; } else if (adapter != null) { empty = adapter.getItemCount() == 0; } mRecyclerView.setVisibility(empty ? View.GONE : View.VISIBLE); mEmptyViewContainer.setVisibility(empty ? View.VISIBLE : View.GONE); }
Source:
private SortedMap<EntityType, List<Entity>> getEntityList(String extensionName, String jobName, List<FormDataBodyPart> feedForms, List<FormDataBodyPart> processForms, InputStream config) throws FalconException, IOException { List<Entity> processes = getProcesses(processForms); List<Entity> feeds = getFeeds(feedForms); ExtensionType extensionType = getExtensionType(extensionName); List<Entity> entities; TreeMap<EntityType, List<Entity>> entityMap = new TreeMap<>(); if (ExtensionType.TRUSTED.equals(extensionType)) { entities = extension.getEntities(jobName, addJobNameToConf(config, jobName)); List<Entity> trustedFeeds = new ArrayList<>(); List<Entity> trustedProcesses = new ArrayList<>(); for (Entity entity : entities) { if (EntityType.FEED.equals(entity.getEntityType())) { trustedFeeds.add(entity); } else { trustedProcesses.add(entity); } } EntityUtil.applyTags(extensionName, jobName, trustedFeeds); EntityUtil.applyTags(extensionName, jobName, trustedProcesses); entityMap.put(EntityType.PROCESS, trustedProcesses); entityMap.put(EntityType.FEED, trustedFeeds); return entityMap; } else { EntityUtil.applyTags(extensionName, jobName, processes); EntityUtil.applyTags(extensionName, jobName, feeds); entityMap.put(EntityType.PROCESS, processes); entityMap.put(EntityType.FEED, feeds); return entityMap; } }

Target:
private SortedMap<EntityType, List<Entity>> getEntityList(String extensionName, String jobName, List<FormDataBodyPart> feedForms, List<FormDataBodyPart> processForms, InputStream config) throws FalconException, IOException { List<Entity> processes = getProcesses(processForms); List<Entity> feeds = getFeeds(feedForms); ExtensionType extensionType = getExtensionType(extensionName); List<Entity> entities; TreeMap<EntityType, List<Entity>> entityMap = new TreeMap<>(); if (ExtensionType.TRUSTED.equals(extensionType)) { entities = extension.getEntities(jobName, addJobNameToConf(config, jobName)); feeds = new ArrayList<>(); processes = new ArrayList<>(); for (Entity entity : entities) { if (EntityType.FEED.equals(entity.getEntityType())) { feeds.add(entity); } else { processes.add(entity); } } } EntityUtil.applyTags(extensionName, jobName, processes); EntityUtil.applyTags(extensionName, jobName, feeds); entityMap.put(EntityType.PROCESS, processes); entityMap.put(EntityType.FEED, feeds); return entityMap; }
Source:
public Templates list() { Templates templates = new Templates(); if (QueryHelper.hasMatrixParam(getUriInfo(), UNREGISTERED_CONSTRAINT_PARAMETER)) { List<org.ovirt.engine.core.common.businessentities.VmTemplate> unregisteredTemplates = getBackendCollection(VdcQueryType.GetUnregisteredVmTemplates, new UnregisteredEntitiesQueryParameters(storageDomainId, VmEntityType.TEMPLATE.name())); List<Template> collection = new ArrayList<Template>(); for (org.ovirt.engine.core.common.businessentities.VmTemplate entity : unregisteredTemplates) { Template vmTemplate = map(entity); collection.add(addLinks(populate(vmTemplate, entity))); } templates.getTemplates().addAll(collection); } return templates; }

Target:
public Templates list() { Templates templates = new Templates(); if (QueryHelper.hasMatrixParam(getUriInfo(), UNREGISTERED_CONSTRAINT_PARAMETER)) { List<org.ovirt.engine.core.common.businessentities.VmTemplate> unregisteredTemplates = getBackendCollection(VdcQueryType.GetUnregisteredVmTemplates, new UnregisteredEntitiesQueryParameters(storageDomainId, VmEntityType.TEMPLATE.name())); List<Template> collection = new ArrayList<Template>(); for (org.ovirt.engine.core.common.businessentities.VmTemplate entity : unregisteredTemplates) { Template vmTemplate = map(entity); collection.add(addLinks(populate(vmTemplate, entity))); } templates.getTemplates().addAll(collection); } else { templates.getTemplates().addAll(getCollection()); } return templates; }
Source:
protected DataDogPortUnificationHandler( final String handle, final HealthCheckManager healthCheckManager, final ReportableEntityHandler<ReportPoint, String> pointHandler, final int fanout, final boolean synchronousMode, final boolean processSystemMetrics, final boolean processServiceChecks, @Nullable final HttpClient requestRelayClient, @Nullable final String requestRelayTarget, @Nullable final Supplier<ReportableEntityPreprocessor> preprocessor) { super(TokenAuthenticatorBuilder.create().build(), healthCheckManager, handle); this.pointHandler = pointHandler; this.threadpool = new ScheduledThreadPoolExecutor(fanout, new NamedThreadFactory("dd-relay")); this.synchronousMode = synchronousMode; this.processSystemMetrics = processSystemMetrics; this.processServiceChecks = processServiceChecks; this.requestRelayClient = requestRelayClient; this.requestRelayTarget = requestRelayTarget; this.preprocessorSupplier = preprocessor; this.jsonParser = new ObjectMapper(); this.httpRequestSize = Metrics.newHistogram(new TaggedMetricName("listeners", "http-requests.payload-points", "port", handle)); Metrics.newGauge(new TaggedMetricName("listeners", "tags-cache-size", "port", handle), new Gauge<Long>() { @Override public Long value() { return tagsCache.estimatedSize(); } }); Metrics.newGauge(new TaggedMetricName("listeners", "http-relay.threadpool.queue-size", "port", handle), new Gauge<Integer>() { @Override public Integer value() { return threadpool.getQueue().size(); } }); }

Target:
protected DataDogPortUnificationHandler( final String handle, final HealthCheckManager healthCheckManager, final ReportableEntityHandler<ReportPoint, String> pointHandler, final int fanout, final boolean synchronousMode, final boolean processSystemMetrics, final boolean processServiceChecks, @Nullable final HttpClient requestRelayClient, @Nullable final String requestRelayTarget, @Nullable final Supplier<ReportableEntityPreprocessor> preprocessor) { super(TokenAuthenticatorBuilder.create().build(), healthCheckManager, handle); this.pointHandler = pointHandler; this.threadpool = new ScheduledThreadPoolExecutor(fanout, new NamedThreadFactory("dd-relay")); this.synchronousMode = synchronousMode; this.processSystemMetrics = processSystemMetrics; this.processServiceChecks = processServiceChecks; this.requestRelayClient = requestRelayClient; this.requestRelayTarget = requestRelayTarget; this.preprocessorSupplier = preprocessor; this.jsonParser = new ObjectMapper(); this.httpRequestSize = Metrics.newHistogram(new TaggedMetricName("listeners", "http-requests.payload-points", "port", handle)); this.httpStatusCounterCache = Caffeine.newBuilder().build(status -> Metrics.newCounter(new TaggedMetricName("listeners", "http-relay.status." + status + ".count", "port", handle))); Metrics.newGauge(new TaggedMetricName("listeners", "tags-cache-size", "port", handle), new Gauge<Long>() { @Override public Long value() { return tagsCache.estimatedSize(); } }); Metrics.newGauge(new TaggedMetricName("listeners", "http-relay.threadpool.queue-size", "port", handle), new Gauge<Integer>() { @Override public Integer value() { return threadpool.getQueue().size(); } }); }
Source:
public FbStatus(final int code, final Fallback fallback) { this( new Filtered<Integer>( (status) -> { return code == status.intValue(); }, code ), fallback ); }

Target:
public FbStatus(final int code, final Fallback fallback) { this( new Filtered<Integer>( (status) -> code == status.intValue(), code ), fallback ); }
Source:
protected List<ITimeEvent> getEventList(TimeGraphEntry entry, long startTime, long endTime, long resolution, IProgressMonitor monitor) { if (!(entry instanceof XmlEntry)) { return new ArrayList<>(); } XmlEntry xmlEntry = (XmlEntry) entry; ITmfStateSystem ssq = xmlEntry.getStateSystem(); final long realStart = Math.max(startTime, entry.getStartTime()); final long realEnd = Math.min(endTime, entry.getEndTime()); if (realEnd <= realStart) { return null; } List<ITimeEvent> eventList = null; int quark = xmlEntry.getDisplayQuark(); try { if (xmlEntry.getType().equals(EntryDisplayType.DISPLAY)) { List<ITmfStateInterval> statusIntervals = ssq.queryHistoryRange(quark, realStart, realEnd - 1, resolution, monitor); eventList = new ArrayList<>(statusIntervals.size()); long lastEndTime = -1; for (ITmfStateInterval statusInterval : statusIntervals) { if (monitor.isCanceled()) { return null; } int status = statusInterval.getStateValue().unboxInt(); long time = statusInterval.getStartTime(); long duration = statusInterval.getEndTime() - time + 1; if (!statusInterval.getStateValue().isNull()) { if (lastEndTime != time && lastEndTime != -1) { eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime)); } eventList.add(new TimeEvent(entry, time, duration, status)); } else if (lastEndTime == -1 || time + duration >= endTime) { eventList.add(new NullTimeEvent(entry, time, duration)); } lastEndTime = time + duration; } } } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException | StateSystemDisposedException e) { } return eventList; }

Target:
protected List<ITimeEvent> getEventList(TimeGraphEntry entry, long startTime, long endTime, long resolution, IProgressMonitor monitor) { if (!(entry instanceof XmlEntry)) { return new ArrayList<>(); } XmlEntry xmlEntry = (XmlEntry) entry; ITmfStateSystem ssq = xmlEntry.getStateSystem(); final long realStart = Math.max(startTime, entry.getStartTime()); final long realEnd = Math.min(endTime, entry.getEndTime()); if (realEnd <= realStart) { return null; } List<ITimeEvent> eventList = null; int quark = xmlEntry.getDisplayQuark(); try { if (xmlEntry.getType() == EntryDisplayType.DISPLAY) { List<ITmfStateInterval> statusIntervals = ssq.queryHistoryRange(quark, realStart, realEnd - 1, resolution, monitor); eventList = new ArrayList<>(statusIntervals.size()); long lastEndTime = -1; for (ITmfStateInterval statusInterval : statusIntervals) { if (monitor.isCanceled()) { return null; } int status = statusInterval.getStateValue().unboxInt(); long time = statusInterval.getStartTime(); long duration = statusInterval.getEndTime() - time + 1; if (!statusInterval.getStateValue().isNull()) { if (lastEndTime != time && lastEndTime != -1) { eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime)); } eventList.add(new TimeEvent(entry, time, duration, status)); } else if (lastEndTime == -1 || time + duration >= endTime) { eventList.add(new NullTimeEvent(entry, time, duration)); } lastEndTime = time + duration; } } } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException | StateSystemDisposedException e) { } return eventList; }
Source:
public WorkflowInstanceAction mapRow(ResultSet rs, int rowNum) throws SQLException { int actionId = rs.getInt("id"); Map<String, String> actionState = actionStates.getOrDefault(actionId, emptyMap()); return new WorkflowInstanceAction.Builder() .setId(rs.getInt("id")) .setWorkflowInstanceId(rs.getInt("workflow_id")) .setExecutorId(rs.getInt("executor_id")) .setType(WorkflowActionType.valueOf(rs.getString("type"))) .setState(rs.getString("state")) .setStateText(rs.getString("state_text")) .setUpdatedStateVariables(actionState) .setRetryNo(rs.getInt("retry_no")) .setExecutionStart(toDateTime(rs.getTimestamp("execution_start"))) .setExecutionEnd(toDateTime(rs.getTimestamp("execution_end"))).build(); }

Target:
public WorkflowInstanceAction mapRow(ResultSet rs, int rowNum) throws SQLException { int actionId = rs.getInt("id"); Map<String, String> actionState = actionStates.getOrDefault(actionId, emptyMap()); return new WorkflowInstanceAction.Builder() .setId(actionId) .setWorkflowInstanceId(rs.getInt("workflow_id")) .setExecutorId(rs.getInt("executor_id")) .setType(WorkflowActionType.valueOf(rs.getString("type"))) .setState(rs.getString("state")) .setStateText(rs.getString("state_text")) .setUpdatedStateVariables(actionState) .setRetryNo(rs.getInt("retry_no")) .setExecutionStart(toDateTime(rs.getTimestamp("execution_start"))) .setExecutionEnd(toDateTime(rs.getTimestamp("execution_end"))).build(); }
Source:
private static String removeDeviceFromPathOnWindows(String path) { final String os = System.getProperty("os.name", "Unix"); String fixedPath = path; if (os.startsWith("Windows")) { fixedPath = path.substring(path.indexOf(':') + 1); } return fixedPath; }

Target:
private static String removeDeviceFromPathOnWindows(String path) { String fixedPath = path; final String os = System.getProperty("os.name", "Unix"); if (os.startsWith("Windows")) { fixedPath = path.substring(path.indexOf(':') + 1); } return fixedPath; }
Source:
public String solveProblemForAll() { try { for (Task s : this.steps) { this.currentStep = s; serviceManager.getWorkflowService().setSolution(getSolution()); try { setCurrentStep(serviceManager.getWorkflowService().solveProblem(this.currentStep, this.solutionTask)); } catch (DataException e) { logger.error("Problem couldn't be solved: " + e); } saveStep(); } this.solution.setMessage(""); this.solutionTask = ""; AktuelleSchritteForm asf = (AktuelleSchritteForm) Helper.getManagedBeanValue("#{AktuelleSchritteForm}"); return asf.filterAll(); } catch (AuthenticationException e) { Helper.setFehlerMeldung(e.getMessage()); return ""; } }

Target:
public String solveProblemForAll() { try { for (Task s : this.steps) { this.currentStep = s; serviceManager.getWorkflowService().setSolution(getSolution()); try { setCurrentStep(serviceManager.getWorkflowService().solveProblem(this.currentStep, this.solutionTask)); saveStep(); } catch (DataException e) { logger.error("Problem couldn't be solved: " + e); } } this.solution.setMessage(""); this.solutionTask = ""; AktuelleSchritteForm asf = (AktuelleSchritteForm) Helper.getManagedBeanValue("#{AktuelleSchritteForm}"); return asf.filterAll(); } catch (AuthenticationException e) { Helper.setFehlerMeldung(e.getMessage()); return ""; } }
Source:
private String getDeviceIpAddressFromSessionProvider(final DlmsDevice dlmsDevice) throws ProtocolAdapterException { final SessionProvider sessionProvider = this.sessionProviderService.getSessionProvider(dlmsDevice .getCommunicationProvider()); String deviceIpAddress = null; try { deviceIpAddress = sessionProvider.getIpAddress(dlmsDevice.getIccId()); if (deviceIpAddress == null) { this.jasperWirelessSmsClient.sendWakeUpSMS(dlmsDevice.getIccId()); for (int i = 0; i < this.jasperGetSessionRetries; i++) { Thread.sleep(this.jasperGetSessionSleepBetweenRetries); deviceIpAddress = sessionProvider.getIpAddress(dlmsDevice.getIccId()); if (deviceIpAddress != null) { return deviceIpAddress; } } } } catch (final InterruptedException e) { throw new ProtocolAdapterException( "Interrupted while sleeping before calling the sessionProvider.getIpAddress", e); } catch (SessionProviderUnsupportedException | SessionProviderException e) { throw new ProtocolAdapterException("", e); } if (deviceIpAddress == null || "".equals(deviceIpAddress)) { throw new ProtocolAdapterException("Session provider: " + dlmsDevice.getCommunicationProvider() + " did not return an IP address for device: " + dlmsDevice.getDeviceIdentification() + " and iccId: " + dlmsDevice.getIccId()); } else { return deviceIpAddress; } }

Target:
private String getDeviceIpAddressFromSessionProvider(final DlmsDevice dlmsDevice) throws ProtocolAdapterException { final SessionProvider sessionProvider = this.sessionProviderService.getSessionProvider(dlmsDevice .getCommunicationProvider()); String deviceIpAddress = null; try { deviceIpAddress = sessionProvider.getIpAddress(dlmsDevice.getIccId()); if (deviceIpAddress != null) { return deviceIpAddress; } this.jasperWirelessSmsClient.sendWakeUpSMS(dlmsDevice.getIccId()); for (int i = 0; i < this.jasperGetSessionRetries; i++) { Thread.sleep(this.jasperGetSessionSleepBetweenRetries); deviceIpAddress = sessionProvider.getIpAddress(dlmsDevice.getIccId()); if (deviceIpAddress != null) { break; } } } catch (final InterruptedException e) { throw new ProtocolAdapterException( "Interrupted while sleeping before calling the sessionProvider.getIpAddress", e); } catch (SessionProviderUnsupportedException | SessionProviderException e) { throw new ProtocolAdapterException("", e); } if (deviceIpAddress == null || "".equals(deviceIpAddress)) { throw new ProtocolAdapterException("Session provider: " + dlmsDevice.getCommunicationProvider() + " did not return an IP address for device: " + dlmsDevice.getDeviceIdentification() + "and iccId: " + dlmsDevice.getIccId()); } return deviceIpAddress; }
Source:
public void processWatermark(ControlTuple.Watermark watermark) { currentWatermark = watermark.getTimestamp(); long horizon = currentWatermark - allowedLatenessMillis; if (allowedLatenessMillis >= 0) { dataStorage.removeUpTo(horizon); } for (Iterator<Map.Entry<Window, WindowState>> it = windowStateMap.iterator(); it.hasNext(); ) { Map.Entry<Window, WindowState> entry = it.next(); Window window = entry.getKey(); WindowState windowState = entry.getValue(); if (allowedLatenessMillis >= 0 && window.getBeginTimestamp() + window.getDurationMillis() < horizon) { it.remove(); } else if (window.getBeginTimestamp() + window.getDurationMillis() < currentWatermark) { if (windowState.watermarkArrivalTime == -1) { windowState.watermarkArrivalTime = currentDerivedTimestamp; if (triggerAtWatermark) { fireTrigger(window, windowState); } } } } controlOutput.emit(watermark); }

Target:
public void processWatermark(ControlTuple.Watermark watermark) { this.watermarkTimestamp = watermark.getTimestamp(); }
Source:
private List<EmailWrapper> generateFeedbackSessionEmailBasesForInstructorReminders( CourseAttributes course, FeedbackSessionAttributes session, List<InstructorAttributes> instructors, String template, String subject) { List<EmailWrapper> emails = new ArrayList<EmailWrapper>(); String coOwnersLine = generateCoOwnersEmailsLine(generateCoOwnersList(course.getId())); for (InstructorAttributes instructor : instructors) { emails.add(generateFeedbackSessionEmailBaseForInstructorReminders(course, session, instructor, template, subject, coOwnersLine)); } return emails; }

Target:
private List<EmailWrapper> generateFeedbackSessionEmailBasesForInstructorReminders( CourseAttributes course, FeedbackSessionAttributes session, List<InstructorAttributes> instructors, String template, String subject) { List<EmailWrapper> emails = new ArrayList<EmailWrapper>(); String coOwnersLine = generateCoOwnersEmailsLine(course.getId()); for (InstructorAttributes instructor : instructors) { emails.add(generateFeedbackSessionEmailBaseForInstructorReminders(course, session, instructor, template, subject, coOwnersLine)); } return emails; }
Source:
private Set<EPackage> collectEPackagesToRegister(final EObject target) { final Set<EPackage.Registry> localEPackageRegistries = Sets.newLinkedHashSet(); final Set<EPackage> knownEPackages = Sets.newLinkedHashSet(); for (EObject targetEObject : Iterables.filter(context.getTargetNotifiers(), EObject.class)) { EPackage ePackage = targetEObject.eClass().getEPackage(); if (ePackage != null && ePackage.getNsURI() != null) { knownEPackages.add(ePackage); } if (target.eResource() != null && target.eResource().getResourceSet() != null) { localEPackageRegistries.add(target.eResource().getResourceSet().getPackageRegistry()); } } Set<String> localyRegisteredNsURIs = Sets.newLinkedHashSet(); for (EPackage.Registry registry : localEPackageRegistries) { localyRegisteredNsURIs.addAll(registry.keySet()); for (String nsURI : registry.keySet()) { Object value = registry.get(nsURI); if (value instanceof EPackage) { knownEPackages.add((EPackage) value); } } } for (String nsURI : EPackage.Registry.INSTANCE.keySet()) { if (localyRegisteredNsURIs.size() == 0 || !localyRegisteredNsURIs.contains(nsURI)) { Object value = EPackage.Registry.INSTANCE.get(nsURI); if (value instanceof EPackage) { knownEPackages.add((EPackage) value); } } } return knownEPackages; }

Target:
private Set<EPackage> collectEPackagesToRegister(final EObject target) { final Set<EPackage.Registry> localEPackageRegistries = Sets.newLinkedHashSet(); final Set<EPackage> knownEPackages = Sets.newLinkedHashSet(); for (EObject targetEObject : Iterables.filter(context.getTargetNotifiers(), EObject.class)) { EPackage ePackage = targetEObject.eClass().getEPackage(); if (ePackage != null && ePackage.getNsURI() != null) { knownEPackages.add(ePackage); } Resource targetEObjectResource = targetEObject.eResource(); if (targetEObjectResource != null && targetEObjectResource.getResourceSet() != null) { localEPackageRegistries.add(targetEObjectResource.getResourceSet().getPackageRegistry()); } } Set<String> localyRegisteredNsURIs = Sets.newLinkedHashSet(); for (EPackage.Registry registry : localEPackageRegistries) { localyRegisteredNsURIs.addAll(registry.keySet()); for (String nsURI : registry.keySet()) { Object value = registry.get(nsURI); if (value instanceof EPackage) { knownEPackages.add((EPackage) value); } } } for (String nsURI : EPackage.Registry.INSTANCE.keySet()) { if (localyRegisteredNsURIs.size() == 0 || !localyRegisteredNsURIs.contains(nsURI)) { Object value = EPackage.Registry.INSTANCE.get(nsURI); if (value instanceof EPackage) { knownEPackages.add((EPackage) value); } } } return knownEPackages; }
Source:
private String stripLeadingAndTrailingSlash(String string) { int startIndex = string.startsWith("/") ? 1 : 0; int endIndex = Math.max(string.length() - (string.endsWith("/") ? 1 : 0), startIndex); return string.substring(startIndex, endIndex); }

Target:
private String stripLeadingAndTrailingSlash(String string) { return string.replaceAll("^/|/$", ""); }
Source:
private void validate() { if (!containsMacro("delimiter") && !delimMap.containsKey(delimiter)) { throw new IllegalArgumentException("Unknown delimiter '" + delimiter + "' specified. "); } if (!containsMacro("format") && (format == null || format.isEmpty())) { throw new IllegalArgumentException("Format is not specified. Allowed values are DELIMITED, EXCEL, MYSQL," + " RFC4180 & TDF"); } if (!containsMacro("format") && !format.equalsIgnoreCase("DELIMITED") && !format.equalsIgnoreCase("EXCEL") && !format.equalsIgnoreCase("MYSQL") && !format.equalsIgnoreCase("RFC4180") && !format.equalsIgnoreCase("TDF")) { throw new IllegalArgumentException("Format specified is not one of the allowed values. Allowed values are " + "DELIMITED, EXCEL, MYSQL, RFC4180 & TDF"); } }

Target:
private void validate() { if (!containsMacro("delimiter") && !delimMap.containsKey(delimiter)) { throw new IllegalArgumentException("Unknown delimiter '" + delimiter + "' specified. Allowed values are " + Joiner.on(", ").join(delimMap.keySet())); } if (!containsMacro("format") && (format == null || format.isEmpty())) { throw new IllegalArgumentException("Format is not specified. Allowed values are DELIMITED, EXCEL, MYSQL," + " RFC4180 & TDF"); } if (!containsMacro("format") && !format.equalsIgnoreCase("DELIMITED") && !format.equalsIgnoreCase("EXCEL") && !format.equalsIgnoreCase("MYSQL") && !format.equalsIgnoreCase("RFC4180") && !format.equalsIgnoreCase("TDF")) { throw new IllegalArgumentException("Format specified is not one of the allowed values. Allowed values are " + "DELIMITED, EXCEL, MYSQL, RFC4180 & TDF"); } }
Source:
public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (getActivity().getActionBar() != null) { getActivity().getActionBar().setTitle(R.string.title_check_email); } if (!(getActivity() instanceof CheckEmailListener)) { throw new IllegalStateException("Activity must implement CheckEmailListener"); } this.mListener = (CheckEmailListener) getActivity(); String email = getArguments().getString(ExtraConstants.EXTRA_EMAIL); if (!TextUtils.isEmpty(email)) { mEmailEditText.setText(email); validateAndProceed(); } if (mHelper.getFlowParams().smartLockEnabled) { showEmailAutoCompleteHint(); } }

Target:
public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (getActivity().getActionBar() != null) { getActivity().getActionBar().setTitle(R.string.title_check_email); } if (!(getActivity() instanceof CheckEmailListener)) { throw new IllegalStateException("Activity must implement CheckEmailListener"); } mListener = (CheckEmailListener) getActivity(); if (savedInstanceState != null) { return; } String email = getArguments().getString(ExtraConstants.EXTRA_EMAIL); if (!TextUtils.isEmpty(email)) { mEmailEditText.setText(email); validateAndProceed(); } else if (mHelper.getFlowParams().smartLockEnabled) { showEmailAutoCompleteHint(); } }
Source:
public static void pickle(final AndroidFxAccount account, final String filename) { final ExtendedJSONObject o = new ExtendedJSONObject(); o.put(KEY_PICKLE_VERSION, new Long(PICKLE_VERSION)); o.put(KEY_PICKLE_TIMESTAMP, new Long(System.currentTimeMillis())); o.put(KEY_ACCOUNT_VERSION, AndroidFxAccount.CURRENT_PREFS_VERSION); o.put(KEY_ACCOUNT_TYPE, FxAccountConstants.ACCOUNT_TYPE); o.put(KEY_EMAIL, account.getEmail()); o.put(KEY_PROFILE, account.getProfile()); o.put(KEY_IDP_SERVER_URI, account.getAccountServerURI()); o.put(KEY_TOKEN_SERVER_URI, account.getTokenServerURI()); o.put(KEY_IS_SYNCING_ENABLED, account.isSyncingEnabled()); final ExtendedJSONObject bundle = account.unbundle(); if (bundle == null) { Logger.warn(LOG_TAG, "Unable to obtain account bundle; aborting."); return; } o.put(KEY_BUNDLE, bundle); writeToDisk(account.context, filename, o); }

Target:
public static void pickle(final AndroidFxAccount account, final String filename) { final ExtendedJSONObject o = new ExtendedJSONObject(); o.put(KEY_PICKLE_VERSION, Long.valueOf(PICKLE_VERSION)); o.put(KEY_PICKLE_TIMESTAMP, Long.valueOf(System.currentTimeMillis())); o.put(KEY_ACCOUNT_VERSION, AndroidFxAccount.CURRENT_ACCOUNT_VERSION); o.put(KEY_ACCOUNT_TYPE, FxAccountConstants.ACCOUNT_TYPE); o.put(KEY_EMAIL, account.getEmail()); o.put(KEY_PROFILE, account.getProfile()); o.put(KEY_IDP_SERVER_URI, account.getAccountServerURI()); o.put(KEY_TOKEN_SERVER_URI, account.getTokenServerURI()); o.put(KEY_IS_SYNCING_ENABLED, account.isSyncingEnabled()); final ExtendedJSONObject bundle = account.unbundle(); if (bundle == null) { Logger.warn(LOG_TAG, "Unable to obtain account bundle; aborting."); return; } o.put(KEY_BUNDLE, bundle); writeToDisk(account.context, filename, o); }
Source:
public void setup(Context.OperatorContext context) { blocksDir = context.getValue(DAGContext.APPLICATION_PATH) + Path.SEPARATOR + BlockWriter.SUBDIR_BLOCKS; try { outputFS = getOutputFSInstance(); outputFS.setWriteChecksum(writeChecksum); } catch (IOException ex) { throw new RuntimeException("Exception in getting output file system.", ex); } try { appFS = getAppFSInstance(); } catch (IOException ex) { try { outputFS.close(); } catch (IOException e) { throw new RuntimeException("Exception in closing output file system.", e); } throw new RuntimeException("Exception in getting application file system.", ex); } super.setup(context); }

Target:
public void setup(Context.OperatorContext context) { blocksDirectoryPath = context.getValue(DAGContext.APPLICATION_PATH) + Path.SEPARATOR + blocksDirectory; try { outputFS = getOutputFSInstance(); outputFS.setWriteChecksum(writeChecksum); } catch (IOException ex) { throw new RuntimeException("Exception in getting output file system.", ex); } try { appFS = getAppFSInstance(); } catch (IOException ex) { try { outputFS.close(); } catch (IOException e) { throw new RuntimeException("Exception in closing output file system.", e); } throw new RuntimeException("Exception in getting application file system.", ex); } super.setup(context); }
Source:
private void checkDataSizeLimit(String path, byte[] data) { if (data == null) { return; } int sizeLimit = ZNRecordUtil.getSerializerWriteSizeLimit(); if (data.length > sizeLimit) { throw new ZkMarshallingError( "Path: " + path + " data size is larger than " + sizeLimit + " bytes"); } }

Target:
private void checkDataSizeLimit(String path, byte[] data) { if (data == null) { return; } if (data.length > WRITE_SIZE_LIMIT) { throw new ZkClientException("Data size of path " + path + " is greater than write size limit " + WRITE_SIZE_LIMIT + " bytes"); } }
Source:
public AuthenticationException(ADALError code, String details, Throwable throwable) { super(details, throwable); mCode = code; if (null == throwable) { return; } if (throwable instanceof AuthenticationException) { mServiceStatusCode = ((AuthenticationException) throwable).getServiceStatusCode(); mResponseBody = ((AuthenticationException) throwable).getResponseBody(); mHttpResponseHeaders = ((AuthenticationException) throwable).getHttpResponseHeaders(); } }

Target:
public AuthenticationException(ADALError code, String details, Throwable throwable) { super(details, throwable); mCode = code; if (null == throwable) { return; } if (throwable instanceof AuthenticationException) { mServiceStatusCode = ((AuthenticationException) throwable).getServiceStatusCode(); if (null != ((AuthenticationException) throwable).getHttpResponseBody()) { mHttpResponseBody = new HashMap<>(((AuthenticationException) throwable).getHttpResponseBody()); } if (null != ((AuthenticationException) throwable).getHttpResponseHeaders()) { mHttpResponseHeaders = new HashMap<>(((AuthenticationException) throwable).getHttpResponseHeaders()); } } }
Source:
public void initAfterFirstDbConnection() { logger.debug("JDBC::initAfterFirstDbConnection: Initializing step, after db is connected."); dbMeta = new DbMetaData(); if (dbMeta.isDbVersionGreater(5, 1)) { sqlTypes.put("DATETIMEITEM", "TIMESTAMP(3)"); sqlTypes.put("TABLEPRIMARYKEY", "TIMESTAMP(3)"); sqlTypes.put("TABLEPRIMARYVALUE", "NOW(3)"); } }

Target:
public void initAfterFirstDbConnection() { logger.debug("JDBC::initAfterFirstDbConnection: Initializing step, after db is connected."); dbMeta = new DbMetaData(); if (dbMeta.isDbVersionGreater(5, 1)) { sqlTypes.put("DATETIMEITEM", "TIMESTAMP(3)"); sqlTypes.put("tablePrimaryKey", "TIMESTAMP(3)"); sqlTypes.put("tablePrimaryValue", "NOW(3)"); } }
Source:
public void init() { Date date = new Date(); long initialTime = date.getTime(); while (jmxConnectionTimeout.getValue() > (date.getTime() - initialTime)) { try { connections = AgentUtils.getMBeanConnections( AgentUtils.getJMXConnectors(AgentUtils.splitServices(jmxServices), name + " collect from jmx port ", urlFormat)); break; } catch (IOException e) { log.error("Error during JMX initializing", e); TimeUtils.sleepMillis(3000); } } if (connections.size() == 0) { throw new RuntimeException("Error during JMX initialization. ZERO connections created for url " + jmxServices + "."); } }

Target:
public void init() { long initialTime = System.currentTimeMillis(); while (jmxConnectionTimeout.getValue() > (System.currentTimeMillis() - initialTime)) { try { connections = AgentUtils.getMBeanConnections( AgentUtils.getJMXConnectors(AgentUtils.splitServices(jmxServices), name + " collect from jmx port ", urlFormat)); break; } catch (IOException e) { log.error("Error during JMX initializing", e); TimeUtils.sleepMillis(jmxConnectionRetryDelay.getValue()); } } if (connections.size() == 0) { throw new RuntimeException("Error during JMX initialization. ZERO connections created for url " + jmxServices + "."); } }
Source:
public Builder measurementMappings(Map<String, String> measurementMappings) { this.measurementMappings = measurementMappings; return this; }

Target:
public Builder measurementMappings(Map<String, String> measurementMappings) { Map<String, Pattern> mappingsByPattern = new HashMap<String, Pattern>(); for(Map.Entry<String, String> entry: measurementMappings.entrySet()) { try { final Pattern pattern = Pattern.compile(entry.getValue()); mappingsByPattern.put(entry.getKey(), pattern); } catch (PatternSyntaxException e) { throw new RuntimeException("Could not compile regex: " + entry.getValue(), e); } } this.measurementMappings = mappingsByPattern; return this; }
Source:
DefaultEndpoint(final URI uri, final InetAddress ip) { this.uri = checkNotNull(uri); this.ip = checkNotNull(ip); final String scheme = this.uri.getScheme(); final String host = this.uri.getHost(); final int port = this.uri.getPort(); if (!VALID_PROTOCOLS.contains(scheme) || host == null || port == -1) { throw new IllegalArgumentException(String.format( "Master endpoints must be of the form \"%s://heliosmaster.domain.net:<port>\"", VALID_PROTOCOLS_STR)); } }

Target:
DefaultEndpoint(final URI uri, final InetAddress ip) { this.uri = checkNotNull(uri); this.ip = checkNotNull(ip); final String scheme = this.uri.getScheme(); final String host = this.uri.getHost(); final int port = this.uri.getPort(); if (!VALID_PROTOCOLS.contains(scheme) || host == null || port == -1) { throw new IllegalArgumentException(String.format( "Master endpoints must be of the form \"%s://<hostname>:<port>\"", VALID_PROTOCOLS_STR)); } }
Source:
public void testEmbeddedAnnotationWithServerTemplateOCPStorage() { System.setProperty(CFG_KIE_CONTROLLER_OCP_ENABLED, "true"); final ProcessAnnotatedType annotatedType = createAnnotatedType(ServerTemplateOCPStorage.class); extension.processEmbeddedController(annotatedType); verify(annotatedType, never()).veto(); }

Target:
public void testEmbeddedAnnotationWithServerTemplateOCPStorage() { ControllerUtils.getConfigProps().put(CFG_KIE_CONTROLLER_OCP_ENABLED, "true"); final ProcessAnnotatedType annotatedType = createAnnotatedType(ServerTemplateOCPStorage.class); extension.processEmbeddedController(annotatedType); verify(annotatedType, never()).veto(); }