auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void should_time_out_if_first_node_takes_too_long_to_respond() throws Exception { RequestHandlerTestHarness.Builder harnessBuilder = RequestHandlerTestHarness.builder(); PoolBehavior node1Behavior = harnessBuilder.customBehavior(node1); node1Behavior.setWriteSuccess(); try (RequestHandlerTestHarness harness = harnessBuilder.build()) { CqlRequestAsyncHandler requestHandler = new CqlRequestAsyncHandler( UNDEFINED_IDEMPOTENCE_STATEMENT, harness.getSession(), harness.getContext(), "test"); CompletionStage<AsyncResultSet> resultSetFuture = requestHandler.handle(); Timeout requestTimeout = harness.nextScheduledTimeout(); requestTimeout.task().run(requestTimeout); assertThatStage(resultSetFuture) .isFailed(t -> assertThat(t).isInstanceOf(DriverTimeoutException.class)); } }

Target:
public void should_time_out_if_first_node_takes_too_long_to_respond() throws Exception { RequestHandlerTestHarness.Builder harnessBuilder = RequestHandlerTestHarness.builder(); PoolBehavior node1Behavior = harnessBuilder.customBehavior(node1); node1Behavior.setWriteSuccess(); try (RequestHandlerTestHarness harness = harnessBuilder.build()) { CompletionStage<AsyncResultSet> resultSetFuture = new CqlRequestAsyncHandler( UNDEFINED_IDEMPOTENCE_STATEMENT, harness.getSession(), harness.getContext(), "test") .handle(); CapturedTimeout requestTimeout = harness.nextScheduledTimeout(); Duration configuredTimeoutDuration = harness .getContext() .getConfig() .getDefaultProfile() .getDuration(DefaultDriverOption.REQUEST_TIMEOUT); assertThat(requestTimeout.getDelay(TimeUnit.NANOSECONDS)) .isEqualTo(configuredTimeoutDuration.toNanos()); requestTimeout.task().run(requestTimeout); assertThatStage(resultSetFuture) .isFailed(t -> assertThat(t).isInstanceOf(DriverTimeoutException.class)); } }
Source:
public WorkflowEvent getEvent(String id) { List<WorkflowListener> workflowListenerList = WorkflowServiceDataHolder.getInstance().getWorkflowListenerList(); for (WorkflowListener workflowListener : workflowListenerList) { workflowListener.doPreGetEvent(id); } WorkflowRequestHandler requestHandler = WorkflowServiceDataHolder.getInstance().getRequestHandler(id); if (requestHandler != null) { WorkflowEvent event = new WorkflowEvent(); event.setEventId(requestHandler.getEventId()); event.setEventFriendlyName(requestHandler.getFriendlyName()); event.setEventDescription(requestHandler.getDescription()); event.setEventCategory(requestHandler.getCategory()); if (requestHandler.getParamDefinitions() != null) { Parameter[] parameters = new Parameter[requestHandler.getParamDefinitions().size()]; int i = 0; for (Map.Entry<String, String> paramEntry : requestHandler.getParamDefinitions().entrySet()) { Parameter parameter = new Parameter(); parameter.setParamName(paramEntry.getKey()); parameter.setParamValue(paramEntry.getValue()); parameters[i] = parameter; i++; } event.setParameters(parameters); } for (WorkflowListener workflowListener : workflowListenerList) { workflowListener.doPostGetEvent(id); } return event; } return null; }

Target:
public WorkflowEvent getEvent(String id) { List<WorkflowListener> workflowListenerList = WorkflowServiceDataHolder.getInstance().getWorkflowListenerList(); for (WorkflowListener workflowListener : workflowListenerList) { workflowListener.doPreGetEvent(id); } WorkflowRequestHandler requestHandler = WorkflowServiceDataHolder.getInstance().getRequestHandler(id); WorkflowEvent event = null; if (requestHandler != null) { event = new WorkflowEvent(); event.setEventId(requestHandler.getEventId()); event.setEventFriendlyName(requestHandler.getFriendlyName()); event.setEventDescription(requestHandler.getDescription()); event.setEventCategory(requestHandler.getCategory()); if (requestHandler.getParamDefinitions() != null) { Parameter[] parameters = new Parameter[requestHandler.getParamDefinitions().size()]; int i = 0; for (Map.Entry<String, String> paramEntry : requestHandler.getParamDefinitions().entrySet()) { Parameter parameter = new Parameter(); parameter.setParamName(paramEntry.getKey()); parameter.setParamValue(paramEntry.getValue()); parameters[i] = parameter; i++; } event.setParameters(parameters); } } for (WorkflowListener workflowListener : workflowListenerList) { workflowListener.doPostGetEvent(id, event); } return event; }
Source:
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) { String msg = "Control channel caught exception event: "; if (LOGGER.isDebugEnabled()) { LOGGER.debug(msg, e.getCause()); e.getCause().printStackTrace(); } else { LOGGER.info(msg + e.getCause()); } }

Target:
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) { String msg = "Control channel caught exception event: "; if (LOGGER.isDebugEnabled()) { LOGGER.debug(msg, e.getCause()); } else { LOGGER.info(msg + e.getCause()); } }
Source:
public void clearPushRegistrationId(String registrationId) { if(mPersistentIdentity.getPushId() == registrationId) { mPersistentIdentity.clearPushId(); } remove("$android_devices", registrationId); }

Target:
public void clearPushRegistrationId(String registrationId) { if (registrationId.equalsToString(mPersistentIdentity.getPushId())) { mPersistentIdentity.clearPushId(); } remove("$android_devices", registrationId); }
Source:
public ServiceTaskUploadFormViewImpl() { this.setTitle(Constants.INSTANCE.ServiceTaskUpload()); this.setBody(doUploadForm()); this.add(new ModalFooter() {{ add(new Button(Constants.INSTANCE.Cancel()) {{ addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { hide(); } }); }}); }}); }

Target:
public ServiceTaskUploadFormViewImpl() { this.setTitle(Constants.INSTANCE.ServiceTaskUpload()); this.setBody(doUploadForm()); ModalFooter footer = new ModalFooter(); Button cancelButton = new Button(Constants.INSTANCE.Cancel()); cancelButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { hide(); } }); footer.add(cancelButton); this.add(footer); }
Source:
public static Function<GHEventsSubscriber, Void> processEvent(final GHEvent event, final String payload) { return new Function<GHEventsSubscriber, Void>() { @Override public Void apply(GHEventsSubscriber subscriber) { Validate.notNull(subscriber); try { subscriber.onEvent(event, payload); } catch (Throwable t) { LOGGER.error("Subscriber failed to process hook, skipping...", subscriber.getClass().getName(), event, t); } } }; }

Target:
public static Function<GHEventsSubscriber, Void> processEvent(final GHEvent event, final String payload) { return new Function<GHEventsSubscriber, Void>() { @Override public Void apply(GHEventsSubscriber subscriber) { try { notNull(subscriber).onEvent(event, payload); } catch (Error error) { throw error; } catch (Throwable t) { LOGGER.error("Subscriber failed to process hook, skipping...", subscriber.getClass().getName(), event, t); } return null; } }; }
Source:
public byte[] getFileDiff(String projectRoot, String filepath, String commitHash) throws UnableToGetCommitContentException { if (filepath.isEmpty()) { return new byte[0]; } try (Git git = Git.open(new java.io.File(projectRoot))) { ObjectId commitId = ObjectId.fromString(commitHash); RevCommit commit; try (RevWalk revWalk = new RevWalk(git.getRepository())) { commit = revWalk.parseCommit(commitId); } RevCommit firstParent = commit.getParent(0); byte[] fpRawContent = BlobUtils.getRawContent(git.getRepository(), firstParent, filepath); RawText rt1; if (fpRawContent != null) { rt1 = new RawText(fpRawContent); } else { rt1 = new RawText(new byte[0]); } byte[] rawContent = BlobUtils.getRawContent(git.getRepository(), commit, filepath); RawText rt2; if (rawContent != null && rawContent.length != 0) { rt2 = new RawText(BlobUtils.getRawContent(git.getRepository(), commit, filepath)); } else { rt2 = new RawText(new byte[] {'\n'}); } ByteArrayOutputStream out = new ByteArrayOutputStream(); new DiffFormatter(out) .format(new HistogramDiff().diff(RawTextComparator.DEFAULT, rt1, rt2), rt1, rt2); return out.toByteArray(); } catch (IOException e) { throw new UnableToGetCommitContentException(e.getMessage()); } }

Target:
public byte[] getFileDiff(String projectRoot, String filepath, String commitHash) { if (filepath.isEmpty()) { return new byte[0]; } try (Git git = Git.open(new java.io.File(projectRoot))) { ObjectId commitId = ObjectId.fromString(commitHash); RevCommit commit; try (RevWalk revWalk = new RevWalk(git.getRepository())) { commit = revWalk.parseCommit(commitId); } byte[] fpRawContent; if (commit.getParentCount() > 0) { fpRawContent = BlobUtils.getRawContent(git.getRepository(), commit.getParent(0), filepath); } else { fpRawContent = new byte[] {'\n'}; } RawText rt1; if (fpRawContent != null) { rt1 = new RawText(fpRawContent); } else { rt1 = new RawText(new byte[0]); } byte[] rawContent = BlobUtils.getRawContent(git.getRepository(), commit, filepath); RawText rt2; if (rawContent != null && rawContent.length != 0) { rt2 = new RawText(BlobUtils.getRawContent(git.getRepository(), commit, filepath)); } else { rt2 = new RawText(new byte[] {'\n'}); } ByteArrayOutputStream out = new ByteArrayOutputStream(); new DiffFormatter(out) .format(new HistogramDiff().diff(RawTextComparator.DEFAULT, rt1, rt2), rt1, rt2); return out.toByteArray(); } catch (IOException e) { throw new UnableToGetCommitContentException(e.getMessage()); } }
Source:
List<Task<? extends Serializable>> tasks(TaskTracker tracker) { List<Task<? extends Serializable>> tasks = new ArrayList<>(); Iterator<DirCopyWork> itr = work.getPathsToCopyIterator(); int numTaskCanBeAdded = tracker.numTaskCanBeAdded(); Task<? extends Serializable> barrierTask = TaskFactory.get(new DependencyCollectionWork(), conf); while (numTaskCanBeAdded-- > 0 && itr.hasNext()) { DirCopyWork dirCopyWork = itr.next(); Task<DirCopyWork> task = TaskFactory.get(dirCopyWork, conf); tasks.add(task); barrierTask.addDependentTask(task); LOG.debug("added task for {}", dirCopyWork); } if (!tasks.isEmpty()) { tracker.addDependentTask(barrierTask); tracker.addTaskList(tasks); return Collections.singletonList(barrierTask); } else { return tasks; } }

Target:
List<Task<? extends Serializable>> tasks(TaskTracker tracker) { List<Task<? extends Serializable>> tasks = new ArrayList<>(); Iterator<DirCopyWork> itr = work.getPathsToCopyIterator(); while (tracker.canAddMoreTasks() && itr.hasNext()) { DirCopyWork dirCopyWork = itr.next(); Task<DirCopyWork> task = TaskFactory.get(dirCopyWork, conf); tasks.add(task); tracker.addTask(task); LOG.debug("added task for {}", dirCopyWork); } return tasks; }
Source:
public void testCreateIncludedModel() { final String name = "file.dmn"; final String value = "://namespace"; final String path = "/src/path/file"; final IncludedModel includedModel = spy(new IncludedModel(recordEngine)); final Map<String, String> metaData = new HashMap<String, String>() {{ put("path", path); }}; when(view.getModelNameInput()).thenReturn(name); doReturn(includedModel).when(modal).createIncludedModel(); modal.createIncludedModel(new KieAssetsDropdownItem(name, value, metaData)); assertEquals(name, includedModel.getName()); assertEquals(value, includedModel.getNamespace()); assertEquals(path, includedModel.getPath()); verify(includedModel).create(); }

Target:
public void testCreateIncludedModel() { final String name = "file.dmn"; final String value = "://namespace"; final String path = "/src/path/file"; final String anPackage = "path.file.com"; final IncludedModel includedModel = spy(new IncludedModel(recordEngine)); final Map<String, String> metaData = new Maps.Builder<String, String>().put("path", path).build(); when(view.getModelNameInput()).thenReturn(name); doReturn(includedModel).when(modal).createIncludedModel(); modal.createIncludedModel(new KieAssetsDropdownItem(name, anPackage, value, metaData)); assertEquals(name, includedModel.getName()); assertEquals(value, includedModel.getNamespace()); assertEquals(path, includedModel.getPath()); verify(includedModel).create(); }
Source:
public void incAndReport() { this.exported++; Integer percentage = (int) (exported * 100 / total); if (percentage > lastReportedPercentage && percentage % 10 == 0) { EventBus.publish(ExportEvent.progress(form, percentage.doubleValue() / 100)); lastReportedPercentage = percentage; } }

Target:
public void incAndReport() { exported++; int percentage = (int) (exported * 100 / total); if (percentage > lastReportedPercentage && percentage % STEP_SIZE == 0) { EventBus.publish(ExportEvent.progress(form, percentage / 100D)); lastReportedPercentage = percentage; } }
Source:
public DroolsAbstractBiConstraintStream(DroolsConstraintFactory<Solution_> constraintFactory, DroolsAbstractBiConstraintStream<Solution_, A, B> parent) { super(constraintFactory); if (parent == null && !(this instanceof DroolsJoinBiConstraintStream)) { throw new IllegalArgumentException("Parent of stream (" + this + ") must not be null, of not join stream."); } this.parent = parent; }

Target:
public DroolsAbstractBiConstraintStream(DroolsConstraintFactory<Solution_> constraintFactory, DroolsAbstractBiConstraintStream<Solution_, A, B> parent) { super(constraintFactory); if (parent == null && !(this instanceof DroolsJoinBiConstraintStream)) { throw new IllegalArgumentException("Parent of stream (" + this + ") must not be null, or not join stream."); } this.parent = parent; }
Source:
protected void testAccessControl() throws Exception { InstructorAttributes instructor = typicalBundle.instructors.get("instructor1OfCourse1"); String courseId = instructor.courseId; String courseName = CoursesLogic.inst().getCourse(courseId).getName(); String courseTimeZone = "UTC"; String[] submissionParams = new String[]{ Const.ParamsNames.COURSE_ID, courseId, Const.ParamsNames.COURSE_NAME, courseName, Const.ParamsNames.COURSE_TIME_ZONE, courseTimeZone }; verifyOnlyInstructorsOfTheSameCourseCanAccess(submissionParams); verifyUnaccessibleWithoutModifyStudentPrivilege(submissionParams); }

Target:
protected void testAccessControl() throws Exception { InstructorAttributes instructor = typicalBundle.instructors.get("instructor1OfCourse1"); String courseId = instructor.courseId; String courseName = "Typical Course 1 with 2 Evals"; String courseTimeZone = "UTC"; String[] submissionParams = new String[]{ Const.ParamsNames.COURSE_ID, courseId, Const.ParamsNames.COURSE_NAME, courseName, Const.ParamsNames.COURSE_TIME_ZONE, courseTimeZone }; verifyOnlyInstructorsOfTheSameCourseCanAccess(submissionParams); verifyUnaccessibleWithoutModifyCoursePrivilege(submissionParams); }
Source:
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { Optional<A> optional = findAnnotation(context.getElement(), annotationType); if (optional.isPresent()) { A annotation = optional.get(); String customReason = customDisabledReason.apply(annotation); return isEnabled(annotation) ? enabled(enabledReason) : disabled(disabledReason, customReason); } return enabledByDefault(); }

Target:
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { return findAnnotation(context.getElement(), annotationType) .map(annotation -> isEnabled(annotation) ? enabled(enabledReason) : disabled(disabledReason, customDisabledReason.apply(annotation))) .orElseGet(this::enabledByDefault); }
Source:
public void testNotEquals() { assertFunction("IPADDRESS'2001:0db8:0000:0000:0000:ff00:0042:8329' != IPADDRESS'1.2.3.4'", BOOLEAN, true); assertFunction("CAST('1.2.3.4' AS IPADDRESS) <> CAST('1.2.3.5' AS IPADDRESS)", BOOLEAN, true); }

Target:
public void testNotEquals() { assertFunction("IPADDRESS '2001:0db8:0000:0000:0000:ff00:0042:8329' != IPADDRESS '1.2.3.4'", BOOLEAN, true); assertFunction("CAST('1.2.3.4' AS IPADDRESS) <> CAST('1.2.3.5' AS IPADDRESS)", BOOLEAN, true); assertFunction("CAST('1.2.3.4' AS IPADDRESS) != IPADDRESS '1.2.3.4'", BOOLEAN, false); assertFunction("IPADDRESS '2001:0db8:0000:0000:0000:ff00:0042:8329' <> IPADDRESS '2001:db8::ff00:42:8329'", BOOLEAN, false); assertFunction("CAST('1.2.3.4' AS IPADDRESS) <> CAST('::ffff:1.2.3.4' AS IPADDRESS)", BOOLEAN, false); }
Source:
public PartitionedOutputOperator( OperatorContext operatorContext, List<Type> sourceTypes, Function<Page, Page> pagePreprocessor, PartitionFunction partitionFunction, List<Integer> partitionChannels, List<Optional<ConstantExpression>> partitionConstants, boolean replicatesAnyRow, OptionalInt nullChannel, OutputBuffer outputBuffer, PagesSerdeFactory serdeFactory, DataSize maxMemory) { this.operatorContext = requireNonNull(operatorContext, "operatorContext is null"); this.pagePreprocessor = requireNonNull(pagePreprocessor, "pagePreprocessor is null"); this.partitionFunction = new PagePartitioner( partitionFunction, partitionChannels, partitionConstants, replicatesAnyRow, nullChannel, outputBuffer, serdeFactory, sourceTypes, maxMemory, operatorContext.getDriverContext().getLifespan(), operatorContext); operatorContext.setInfoSupplier(this::getInfo); this.systemMemoryContext = operatorContext.newLocalSystemMemoryContext(PartitionedOutputOperator.class.getSimpleName()); this.partitionsInitialRetainedSize = this.partitionFunction.getRetainedSizeInBytes(); this.systemMemoryContext.setBytes(partitionsInitialRetainedSize); }

Target:
public PartitionedOutputOperator( OperatorContext operatorContext, List<Type> sourceTypes, Function<Page, Page> pagePreprocessor, PartitionFunction partitionFunction, List<Integer> partitionChannels, List<Optional<ConstantExpression>> partitionConstants, boolean replicatesAnyRow, OptionalInt nullChannel, OutputBuffer outputBuffer, PagesSerdeFactory serdeFactory, DataSize maxMemory) { this.operatorContext = requireNonNull(operatorContext, "operatorContext is null"); this.pagePreprocessor = requireNonNull(pagePreprocessor, "pagePreprocessor is null"); this.partitionFunction = new PagePartitioner( partitionFunction, partitionChannels, partitionConstants, replicatesAnyRow, nullChannel, outputBuffer, serdeFactory, sourceTypes, maxMemory, operatorContext); operatorContext.setInfoSupplier(this::getInfo); this.systemMemoryContext = operatorContext.newLocalSystemMemoryContext(PartitionedOutputOperator.class.getSimpleName()); this.partitionsInitialRetainedSize = this.partitionFunction.getRetainedSizeInBytes(); this.systemMemoryContext.setBytes(partitionsInitialRetainedSize); }
Source:
private boolean canPasteAll(IJavaElement destination) { for (TypedSource fSource : fSources) { if (!canPaste(fSource.getType(), destination)) { return false; } } return true; }

Target:
private boolean canPasteAll(IJavaElement destination) { for (TypedSource source : fSources) { if (!canPaste(source.getType(), destination)) { return false; } } return true; }
Source:
private static void waitUntilFinished(FluoConfiguration config) { try (Environment env = new Environment(config)) { List<TableRange> ranges = getRanges(env); outer: while (true) { long ts1 = env.getSharedResources().getOracleClient().getStamp().getTxTimestamp(); for (TableRange range : ranges) { boolean sawNotifications = waitTillNoNotifications(env, range); if (sawNotifications) { ranges = getRanges(env); continue outer; } } long ts2 = env.getSharedResources().getOracleClient().getStamp().getTxTimestamp(); if (ts1 == (ts2 - 1)) { break; } } } catch (Exception e) { log.error("An exception was thrown -", e); System.exit(-1); } }

Target:
private static void waitUntilFinished(FluoConfiguration config) { try (Environment env = new Environment(config)) { List<TableRange> ranges = getRanges(env); outer: while (true) { long ts1 = env.getSharedResources().getOracleClient().getStamp().getTxTimestamp(); for (TableRange range : ranges) { boolean sawNotifications = waitTillNoNotifications(env, range); if (sawNotifications) { ranges = getRanges(env); continue outer; } } long ts2 = env.getSharedResources().getOracleClient().getStamp().getTxTimestamp(); if (ts2 - ts1 == 1) { break; } } } catch (Exception e) { log.error("An exception was thrown -", e); System.exit(-1); } }
Source:
public void validateUpdateDatastreams(List<Datastream> datastreams, List<Datastream> allDatastreams) throws DatastreamValidationException { _connector.validateUpdateDatastreams(datastreams, allDatastreams); }

Target:
public void validateUpdateDatastreams(List<Datastream> datastreams, List<Datastream> allDatastreams) throws DatastreamValidationException { logApiStart("validateUpdateDatastreams"); _connector.validateUpdateDatastreams(datastreams, allDatastreams); logApiEnd("validateUpdateDatastreams"); }
Source:
public void saveAccount(String accountName) { if (accountName == null || accountName.isEmpty()) return; SharedPreferences prefs = mContext.getSharedPreferences(KEY_SHARED_PREF_ACCOUNT_LIST, Activity.MODE_PRIVATE); String accountList = prefs.getString(KEY_APP_ACCOUNTS_FOR_TOKEN_REMOVAL, ""); accountList += KEY_ACCOUNT_LIST_DELIM + accountName; Editor prefsEditor = prefs.edit(); prefsEditor.putString(KEY_APP_ACCOUNTS_FOR_TOKEN_REMOVAL, accountList); prefsEditor.apply(); }

Target:
public void saveAccount(String accountName) { if (accountName == null || accountName.isEmpty()) return; SharedPreferences prefs = mContext.getSharedPreferences(KEY_SHARED_PREF_ACCOUNT_LIST, Activity.MODE_PRIVATE); String accountList = prefs.getString(KEY_APP_ACCOUNTS_FOR_TOKEN_REMOVAL, ""); if (!accountList.contains(KEY_ACCOUNT_LIST_DELIM + accountName)) { accountList += KEY_ACCOUNT_LIST_DELIM + accountName; Editor prefsEditor = prefs.edit(); prefsEditor.putString(KEY_APP_ACCOUNTS_FOR_TOKEN_REMOVAL, accountList); prefsEditor.apply(); } }
Source:
private CommentModel getComment(int position) { if (position == getCount() - 1) { mOnLoadMoreListener.onLoadMore(); } return mCommentList.get(position); }

Target:
private CommentModel getComment(int position) { if (position == getCount() - 1 && mOnLoadMoreListener != null) { mOnLoadMoreListener.onLoadMore(); } return mCommentList.get(position); }
Source:
private void setCustomServerWithNoUrl() { SharedPreferences userPreferences = AnkiDroidApp.getSharedPrefs(AnkiDroidApp.getInstance()); userPreferences.edit().putBoolean("useCustomSyncServer", true).commit(); }

Target:
private void setCustomServerWithNoUrl() { SharedPreferences userPreferences = AnkiDroidApp.getSharedPrefs(AnkiDroidApp.getInstance()); userPreferences.edit().putBoolean("useCustomSyncServer", true).apply(); }
Source:
public ApiResponse usage(Map options) throws Exception { if (options == null) options = ObjectUtils.emptyMap(); Map params = ObjectUtils.only(options, "date"); Object date = params.get("date"); if (date instanceof Date) { params.put("date", ObjectUtils.toUsageApiDateFormat((Date)date)); } return callApi(HttpMethod.GET, Arrays.asList("usage"), params, options); }

Target:
public ApiResponse usage(Map options) throws Exception { if (options == null) options = ObjectUtils.emptyMap(); final List<String> uri = new ArrayList<String>(); uri.add("usage"); Object date = options.get("date"); if (date != null) { if (date instanceof Date) { date = ObjectUtils.toUsageApiDateFormat((Date) date); } uri.add(date.toString()); } return callApi(HttpMethod.GET, uri, ObjectUtils.emptyMap(), options); }
Source:
public void testFilterInitiator(){ String variableNameWithInitiator = "initiator"; String variableValueWithInitiator = "initiator people"; String variableNameWithoutInitiator = "noinitiator"; String variableValueWithoutInitiator = "other people"; assertEquals(presenter.filterInitiator(variableNameWithInitiator,variableValueWithInitiator,variableValueWithInitiator),true); assertEquals(presenter.filterInitiator(variableNameWithoutInitiator,variableValueWithoutInitiator,variableValueWithoutInitiator),false); assertEquals(presenter.filterInitiator(variableNameWithInitiator,variableValueWithInitiator,variableValueWithoutInitiator),false); assertEquals(presenter.filterInitiator(variableNameWithoutInitiator,variableValueWithoutInitiator,variableValueWithInitiator),false); }

Target:
public void testFilterInitiator(){ String variableNameWithInitiator = "initiator"; String variableValueWithInitiator = "initiator people"; String variableNameWithoutInitiator = "noinitiator"; String variableValueWithoutInitiator = "other people"; assertEquals(true, presenter.filterInitiator(variableNameWithInitiator, variableValueWithInitiator, variableValueWithInitiator)); assertEquals(false, presenter.filterInitiator(variableNameWithoutInitiator, variableValueWithoutInitiator, variableValueWithoutInitiator)); assertEquals(false, presenter.filterInitiator(variableNameWithInitiator, variableValueWithInitiator, variableValueWithoutInitiator)); assertEquals(false, presenter.filterInitiator(variableNameWithoutInitiator, variableValueWithoutInitiator, variableValueWithInitiator)); }
Source:
public Cursor query(Uri uri, String[] projection, String where, String[] selectionArgs, String sortOrder) { switch (matchUri(uri)) { case LOCAL_VALUES_URI: break; case REMOTE_VALUES_URI: try { return commonSense.query(uri, projection, where, selectionArgs, sortOrder); } catch (Exception e) { Log.e(TAG, "Failed to query the CommonSense data points", e); return null; } default: throw new IllegalArgumentException("Unknown URI " + uri); } if (projection == null) { projection = DEFAULT_PROJECTION; } Cursor inMemoryCursor = inMemory.query(projection, where, selectionArgs, sortOrder); Cursor persistedCursor = persisted.query(projection, where, selectionArgs, sortOrder); if (inMemoryCursor.getCount() > 0) { if (persistedCursor.getCount() > 0) { return new MergeCursor(new Cursor[] { persistedCursor, inMemoryCursor }); } else { return inMemoryCursor; } } else { return persistedCursor; } }

Target:
public Cursor query(Uri uri, String[] projection, String where, String[] selectionArgs, String sortOrder) { switch (matchUri(uri)) { case LOCAL_VALUES_URI: break; case REMOTE_VALUES_URI: try { return commonSense.query(uri, projection, where, selectionArgs, sortOrder); } catch (Exception e) { Log.e(TAG, "Failed to query the CommonSense data points", e); return null; } default: throw new IllegalArgumentException("Unknown URI " + uri); } if (projection == null) { projection = DEFAULT_PROJECTION; } Cursor inMemoryCursor = inMemory.query(projection, where, selectionArgs, sortOrder); Cursor persistedCursor = persisted.query(projection, where, selectionArgs, sortOrder); if (inMemoryCursor.getCount() > 0) { if (persistedCursor.getCount() > 0) { return new MergeCursor(new Cursor[] { persistedCursor, inMemoryCursor }); } else { persistedCursor.close(); return inMemoryCursor; } } else { inMemoryCursor.close(); return persistedCursor; } }
Source:
public TmfSimpleTimestamp(final ITmfTimestamp timestamp) { super(timestamp.getValue(), 0, 0); if (timestamp.getScale() != 0 || timestamp.getPrecision() != 0) { throw new IllegalArgumentException(); } }

Target:
public TmfSimpleTimestamp(final ITmfTimestamp timestamp) { super(timestamp.getValue(), 0, 0); }
Source:
public void checkOutputSpecs(JobContext context) throws IOException, InterruptedException { Configuration conf = context.getConfiguration(); BasicAWSCredentials awsCred = new BasicAWSCredentials(conf.get(Properties.KinesisRealtimeSink.ACCESS_ID), conf.get(Properties.KinesisRealtimeSink.ACCESS_KEY)); if (kinesisClient == null) { LOG.info("Creating amazon kinesis client for stream {}", Properties.KinesisRealtimeSink.NAME); kinesisClient = new AmazonKinesisClient(awsCred); try { KinesisUtil.createAndWaitForStream(kinesisClient, conf.get(Properties.KinesisRealtimeSink.NAME), Integer.valueOf(conf.get(Properties.KinesisRealtimeSink.SHARD_COUNT))); } catch (AmazonServiceException e) { throw new IllegalArgumentException("AWS credentials are not correct", e); } } }

Target:
public void checkOutputSpecs(JobContext context) throws IOException, InterruptedException { Configuration conf = context.getConfiguration(); BasicAWSCredentials awsCred = new BasicAWSCredentials(conf.get(Properties.KinesisRealtimeSink.ACCESS_ID), conf.get(Properties.KinesisRealtimeSink.ACCESS_KEY)); if (kinesisClient == null) { LOG.info("Creating amazon kinesis client for stream {}", Properties.KinesisRealtimeSink.NAME); kinesisClient = new AmazonKinesisClient(awsCred); KinesisUtil.createAndWaitForStream(kinesisClient, conf.get(Properties.KinesisRealtimeSink.NAME), Integer.valueOf(conf.get(Properties.KinesisRealtimeSink.SHARD_COUNT))); } }
Source:
protected void addStream(String uploadType, String batchId, String fileIdx, InputStream is, String fileName, String mimeType, long uploadedSize, int chunkCount, int uploadChunkIndex, long fileSize) throws IOException { String uploadedSizeDisplay = uploadedSize > -1 ? uploadedSize + "b" : "unknown size"; if (UPLOAD_TYPE_CHUNKED.equals(uploadType)) { log.debug(String.format("Uploading chunk [index=%d / total=%d] (%s) for file %s", uploadChunkIndex, chunkCount, uploadedSizeDisplay, fileName)); Framework.getService(BatchManager.class).addStream(batchId, fileIdx, is, chunkCount, uploadChunkIndex, fileName, mimeType, fileSize); } else { log.debug(String.format("Uploading file %s (%s)", fileName, uploadedSizeDisplay)); Framework.getService(BatchManager.class).addStream(batchId, fileIdx, is, fileName, mimeType); } }

Target:
protected void addStream(String uploadType, String batchId, String fileIdx, InputStream is, String fileName, String mimeType, long uploadedSize, int chunkCount, int uploadChunkIndex, long fileSize) throws IOException { String uploadedSizeDisplay = uploadedSize > -1 ? uploadedSize + "b" : "unknown size"; if (UPLOAD_TYPE_CHUNKED.equals(uploadType)) { if (log.isDebugEnabled()) { log.debug(String.format("Uploading chunk [index=%d / total=%d] (%s) for file %s", uploadChunkIndex, chunkCount, uploadedSizeDisplay, fileName)); } Framework.getService(BatchManager.class).addStream(batchId, fileIdx, is, chunkCount, uploadChunkIndex, fileName, mimeType, fileSize); } else { if (log.isDebugEnabled()) { log.debug(String.format("Uploading file %s (%s)", fileName, uploadedSizeDisplay)); } Framework.getService(BatchManager.class).addStream(batchId, fileIdx, is, fileName, mimeType); } }
Source:
public void writePage(BytesInput bytes, int valueCount, Statistics statistics, Encoding rlEncoding, Encoding dlEncoding, Encoding valuesEncoding) throws IOException { long uncompressedSize = bytes.size(); if (uncompressedSize > Integer.MAX_VALUE) { throw new ParquetEncodingException( "Cannot write page larger than Integer.MAX_VALUE bytes: " + uncompressedSize); } BytesInput compressedBytes = compressor.compress(bytes); long compressedSize = compressedBytes.size(); if (compressedSize > Integer.MAX_VALUE) { throw new ParquetEncodingException( "Cannot write compressed page larger than Integer.MAX_VALUE bytes: " + compressedSize); } if (statistics != null) { this.totalStatistics.mergeStatistics(statistics); } else { statistics = new BooleanStatistics(); } parquetMetadataConverter.writeDataPageHeader( (int)uncompressedSize, (int)compressedSize, valueCount, statistics, rlEncoding, dlEncoding, valuesEncoding, buf); this.uncompressedLength += uncompressedSize; this.compressedLength += compressedSize; this.totalValueCount += valueCount; this.pageCount += 1; compressedBytes.writeAllTo(buf); encodings.add(rlEncoding); encodings.add(dlEncoding); encodings.add(valuesEncoding); }

Target:
public void writePage(BytesInput bytes, int valueCount, Statistics statistics, Encoding rlEncoding, Encoding dlEncoding, Encoding valuesEncoding) throws IOException { long uncompressedSize = bytes.size(); if (uncompressedSize > Integer.MAX_VALUE) { throw new ParquetEncodingException( "Cannot write page larger than Integer.MAX_VALUE bytes: " + uncompressedSize); } BytesInput compressedBytes = compressor.compress(bytes); long compressedSize = compressedBytes.size(); if (compressedSize > Integer.MAX_VALUE) { throw new ParquetEncodingException( "Cannot write compressed page larger than Integer.MAX_VALUE bytes: " + compressedSize); } parquetMetadataConverter.writeDataPageHeader( (int)uncompressedSize, (int)compressedSize, valueCount, statistics, rlEncoding, dlEncoding, valuesEncoding, buf); this.uncompressedLength += uncompressedSize; this.compressedLength += compressedSize; this.totalValueCount += valueCount; this.pageCount += 1; this.totalStatistics.mergeStatistics(statistics); compressedBytes.writeAllTo(buf); encodings.add(rlEncoding); encodings.add(dlEncoding); encodings.add(valuesEncoding); }
Source:
public void onNameAdded(String name, int amount, String listName) { listInfo = new DataSource(getContext()).getListInfo(listName); settings.setListSize(listInfo.getNumNames()); settingsDialog.refreshSetting(); }

Target:
public void onNameAdded(String name, int amount, String listName) { listInfo.addNames(name, amount); settings.setNameListSize(listInfo.getNumInstances()); settingsDialog.refreshSetting(); }
Source:
protected static void removeContainer(final DockerClient dockerClient, final String containerId) throws Exception { Polling.await(1, MINUTES, new Callable<Object>() { @Override public Object call() throws Exception { try { dockerClient.killContainer(containerId); } catch (DockerException e) { if ((e instanceof DockerRequestException) && ((DockerRequestException) e).message().contains("is not running")) { } else { throw e; } } try { dockerClient.removeContainer(containerId); return true; } catch (ContainerNotFoundException e) { return true; } catch (DockerException e) { if ((e instanceof DockerRequestException) && ((DockerRequestException) e).message().contains( "Driver btrfs failed to remove root filesystem")) { return true; } else { return null; } } } }); }

Target:
protected static void removeContainer(final DockerClient dockerClient, final String containerId) throws Exception { Polling.await(1, MINUTES, new Callable<Object>() { @Override public Object call() throws Exception { try { dockerClient.killContainer(containerId); } catch (DockerRequestException e) { if (e.message().contains("is not running")) { } else { throw e; } } try { dockerClient.removeContainer(containerId); return true; } catch (ContainerNotFoundException e) { return true; } catch (DockerException e) { if ((e instanceof DockerRequestException) && ((DockerRequestException) e).message().contains( "Driver btrfs failed to remove root filesystem")) { return true; } else { return null; } } } }); }
Source:
public void initialize(final Map<String, String> configuration) { configuration.forEach( (key, value) -> { String[] newRoles = value.split("\\s+"); for (String newRole : newRoles) { Set<String> rolesToMappedRole = reverseRoleMap.get(newRole); if (rolesToMappedRole == null) { rolesToMappedRole = new LinkedHashSet<>(); reverseRoleMap.put(newRole, rolesToMappedRole); } rolesToMappedRole.add(value); } } ); }

Target:
public void initialize(final Map<String, String> configuration) { if (initialized) { throw log.roleMappedAlreadyInitialized(); } reverseRoleMap.clear(); configuration.forEach( (key, value) -> { String[] newRoles = value.split("\\s+"); for (String newRole : newRoles) { Set<String> rolesToMappedRole = reverseRoleMap.get(newRole); if (rolesToMappedRole == null) { rolesToMappedRole = new LinkedHashSet<>(); reverseRoleMap.put(newRole, rolesToMappedRole); } rolesToMappedRole.add(key); } }); initialized = true; }
Source:
long gtk_size_allocate (long widget, long allocation) { GtkAllocation widgetAllocation = new GtkAllocation (); OS.gtk_widget_get_allocation (shellHandle, widgetAllocation); int width = widgetAllocation.width; int height = widgetAllocation.height; if ((!resized || oldWidth != width || oldHeight != height) && (OS.GTK3 ? ((style & SWT.RESIZE) != 0) : true)) { oldWidth = width; oldHeight = height; resizeBounds (width, height, true); } return 0; }

Target:
long gtk_size_allocate (long widget, long allocation) { GtkAllocation widgetAllocation = new GtkAllocation (); OS.gtk_widget_get_allocation (shellHandle, widgetAllocation); int width = widgetAllocation.width; int height = widgetAllocation.height; if ((!resized || oldWidth != width || oldHeight != height) && (OS.GTK3 && !OS.isX11() ? ((style & SWT.RESIZE) != 0) : true)) { oldWidth = width; oldHeight = height; resizeBounds (width, height, true); } return 0; }
Source:
private static boolean isInJavaTimePackage(String className) { if (className.contains(".")) { return "java.time".equals(className.substring(0, className.lastIndexOf('.'))); } else { return false; } }

Target:
private static boolean isInJavaTimePackage(String className) { return className.startsWith("java.time"); }
Source:
public List<Project> getGroupProjects(User user) { List<Project> array = new ArrayList<Project>(); List<Project> projects = getProjects(); for (Project project : projects) { if (project.hasGroupPermission(user, Type.READ)) { array.add(project); } } return array; }

Target:
public List<Project> getGroupProjects(User user) { List<Project> groupProjects = new ArrayList<>(); for (Project project : getProjects()) { if (project.hasGroupPermission(user, Type.READ)) { groupProjects.add(project); } } return groupProjects; }
Source:
public void closePort() { try { inputStream.close(); } catch (IOException e) { e.printStackTrace(); } try { outputStream.close(); } catch (IOException e) { e.printStackTrace(); } if (typeIsSerial) { serialPort.close(); logger.debug("port closed: " + port); } else { try { ipSocket.close(); logger.debug("ipSocket closed: " + hostName + " on port " + ipPortNumber); } catch (IOException e) { e.printStackTrace(); } } }

Target:
public void closePort() { try { inputStream.close(); } catch (IOException e) { logger.debug("closePort inputStream.close error", e); } try { outputStream.close(); } catch (IOException e) { logger.debug("closePort outputStream.close error", e); } if (typeIsSerial) { serialPort.close(); logger.debug("port closed: {}", port); } else { try { ipSocket.close(); logger.debug("ipSocket closed: on port {}", hostName, ipPortNumber); } catch (IOException e) { logger.debug("I/O error when closing ip communication", e); } } }
Source:
protected boolean contains(URI location, ProvisioningSession session) { URI[] knownRepositories = getKnownRepositories(session); for (URI knownRepositorie : knownRepositories) { if (URIUtil.sameURI(knownRepositorie, location)) { return true; } } return false; }

Target:
protected boolean contains(URI location, ProvisioningSession session) { URI[] knownRepositories = getKnownRepositories(session); for (URI repository : knownRepositories) { if (URIUtil.sameURI(repository, location)) { return true; } } return false; }
Source:
private static void shutdown() { logger.info("Got shutdown request..."); shuttingDown = true; long killDelay = 30 * 1000; killUnlessShutdownWithin(killDelay); if (simpleSocketServer != null) { try { simpleSocketServer.close(); } catch (Exception e) { logger.debug("Caught exception while shuttin down simpleSocketSserver. Was is not started?", e); } } else { logger.trace("simpleSocketServer was null"); } if (server != null) { try { server.shutdown(); return; } catch (Exception e) { logger.debug("Caught exception while shuttin down the server. Was it not started?", e); System.exit(1); } } else { logger.trace("server was null"); } }

Target:
public void shutdown() { logger.info("Got shutdown request..."); shuttingDown = true; long killDelay = TimeUnit.SECONDS.toMillis(30); killUnlessShutdownWithin(killDelay); if (simpleSocketServer != null) { try { simpleSocketServer.close(); } catch (Exception e) { logger.debug("Caught exception while shuttin down simpleSocketSserver. Was is not started?", e); } } else { logger.trace("simpleSocketServer was null"); } if (server != null) { try { server.shutdown(); return; } catch (Exception e) { logger.debug("Caught exception while shuttin down the server. Was it not started?", e); System.exit(1); } } else { logger.trace("server was null"); } }
Source:
public RoamingGroup(ID id, String name, String description, RoamingGroupType type, List<Operator> operators) { this.id = id; this.name = name; this.description = description; this.type = type; this.operators = operators; }

Target:
public RoamingGroup(ID id, String name, String description, RoamingGroupType type, List<Operator> operators) { this.id = id; this.name = name; this.description = description; this.type = type; this.operators = ImmutableList.copyOf(operators); }
Source:
public SystemConsumer getConsumer(String systemName, Config config, MetricsRegistry registry) { jobToManager.putIfAbsent(parseJobId(config), new InMemoryManager()); return new InMemorySystemConsumer(jobToManager.get(parseJobId(config))); }

Target:
public SystemConsumer getConsumer(String systemName, Config config, MetricsRegistry registry) { return new InMemorySystemConsumer(getOrDefaultInMemoryManagerByTestId(config)); }
Source:
public QueryListDTO(List<Integer> values) { this.values = ImmutableList.copyOf(values); }

Target:
QueryListDTO(List<Integer> values) { this.values = ImmutableList.copyOf(values); }
Source:
public void deploy(DeploymentPhaseContext deploymentPhaseContext) throws DeploymentUnitProcessingException { ROOT_LOGGER.processingDeployment(); final DeploymentUnit deploymentUnit = deploymentPhaseContext.getDeploymentUnit(); if (DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { return; } final CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); if (support.hasCapability(WELD_CAPABILITY_NAME)) { try { final WeldCapability weldCapability = support.getCapabilityRuntimeAPI(WELD_CAPABILITY_NAME, WeldCapability.class); if (!weldCapability.isPartOfWeldDeployment(deploymentUnit)) { ROOT_LOGGER.noCdiDeployment(); return; } } catch (CapabilityServiceSupport.NoSuchCapabilityException e) { throw new DeploymentUnitProcessingException(ROOT_LOGGER.deploymentRequiresCapability( deploymentPhaseContext.getDeploymentUnit().getName(), WELD_CAPABILITY_NAME )); } } setServiceName(deploymentUnit); addListeners(deploymentUnit); }

Target:
public void deploy(DeploymentPhaseContext deploymentPhaseContext) throws DeploymentUnitProcessingException { ROOT_LOGGER.processingDeployment(); final DeploymentUnit deploymentUnit = deploymentPhaseContext.getDeploymentUnit(); if (DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { return; } final CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); try { final WeldCapability weldCapability = support.getCapabilityRuntimeAPI(WELD_CAPABILITY_NAME, WeldCapability.class); if (!weldCapability.isPartOfWeldDeployment(deploymentUnit)) { ROOT_LOGGER.noCdiDeployment(); return; } } catch (CapabilityServiceSupport.NoSuchCapabilityException e) { throw new DeploymentUnitProcessingException(ROOT_LOGGER.deploymentRequiresCapability( deploymentPhaseContext.getDeploymentUnit().getName(), WELD_CAPABILITY_NAME )); } setServiceName(deploymentUnit); addListeners(deploymentUnit); }
Source:
private void showAddBagDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(getString(R.string.nav_add)); final View view = getLayoutInflater().inflate(R.layout.dialog_add, null); builder.setView(view); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { TextView textView = (TextView)view.findViewById(R.id.page_url); ServiceHelper.addLink(getBaseContext(), textView.getText().toString()); } }); builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); builder.show(); }

Target:
private void showAddBagDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.dialog_add_label); @SuppressLint("InflateParams") final View view = getLayoutInflater().inflate(R.layout.dialog_add, null); builder.setView(view); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { TextView textView = (TextView)view.findViewById(R.id.page_url); ServiceHelper.addLink(getBaseContext(), textView.getText().toString()); } }); builder.setNegativeButton(android.R.string.cancel, null); builder.show(); }
Source:
public synchronized void startPolling(CatalogContext catalogContext) { m_startPolling = true; CatalogMap<Connector> connectors = CatalogUtil.getConnectors(catalogContext); if(!CatalogUtil.hasEnabledConnectors(connectors)) { exportLog.info("System is not using any export functionality or connectors configured are disabled."); return; } ExportDataProcessor processor = m_processor.get(); Preconditions.checkState(processor != null, "guest processor is not set"); processor.startPolling(); cleanupStaleBuffers(); }

Target:
public synchronized void startPolling(CatalogContext catalogContext) { m_startPolling = true; CatalogMap<Connector> connectors = CatalogUtil.getConnectors(catalogContext); if(!CatalogUtil.hasEnabledConnectors(connectors)) { exportLog.info("System is not using any export functionality or connectors configured are disabled."); return; } ExportDataProcessor processor = m_processor.get(); Preconditions.checkState(processor != null, "guest processor is not set"); cleanupStaleBuffers(); processor.startPolling(); }
Source:
public void testAtsProgramInsertionFeatureBadInsertionRestCall() throws Exception { String result = doRequestString( "/ats/program/" + getSawProgram().getArtId() + "/insertion/" + getSawTeam().getArtId() + "/feature", HttpMethod.GET, null, javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); Assert.assertTrue(result.contains("SERVER_ERROR")); }

Target:
public void testAtsProgramInsertionFeatureBadInsertionRestCall() throws Exception { String result = doRequestString("/ats/program/" + getSawProgram().getUuid() + "/insertion/" + getSawTeam() + "/feature", HttpMethod.GET, null, javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); Assert.assertTrue(result.contains("SERVER_ERROR")); }
Source:
public void offer(StreamBlock streamBlock) throws IOException { m_persistentDeque.offer(streamBlock.asBBContainer()); long unreleasedSeqNo = streamBlock.unreleasedSequenceNumber(); if (m_memoryDeque.size() < 2) { StreamBlock fromPBD = pollPersistentDeque(false); if ((streamBlock.startSequenceNumber() == fromPBD.startSequenceNumber()) && (unreleasedSeqNo > streamBlock.startSequenceNumber())) { fromPBD.releaseTo(unreleasedSeqNo - 1); assert(fromPBD.unreleasedSequenceNumber() <= fromPBD.lastSequenceNumber()); } } }

Target:
public void offer(StreamBlock streamBlock) throws IOException { m_persistentDeque.offer(streamBlock.asBBContainer(), !DISABLE_COMPRESSION); long unreleasedSeqNo = streamBlock.unreleasedSequenceNumber(); if (m_memoryDeque.size() < 2) { StreamBlock fromPBD = pollPersistentDeque(false); if ((streamBlock.startSequenceNumber() == fromPBD.startSequenceNumber()) && (unreleasedSeqNo > streamBlock.startSequenceNumber())) { fromPBD.releaseTo(unreleasedSeqNo - 1); } } }
Source:
protected GlusterVolumeSnapshotSchedule getSchedule() { return this.schedule; }

Target:
protected GlusterVolumeSnapshotSchedule getSchedule() { return schedule; }