auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testLanguages() throws Exception { WikipediaHomePage wikipediaHomePage = new WikipediaHomePage(getDriver()); wikipediaHomePage.open(); String welcomeText = wikipediaHomePage.getWelcomeText(); String expectedWelcomeText = L10N.getText("HomePage.welcomeText"); Assert.assertEquals(welcomeText, expectedWelcomeText, "Wikipedia welcome text was not the expected."); }

Target:
public void testLanguages() { WikipediaHomePage wikipediaHomePage = new WikipediaHomePage(getDriver()); wikipediaHomePage.open(); String welcomeText = wikipediaHomePage.getWelcomeText(); String expectedWelcomeText = L10N.getText("HomePage.welcomeText"); Assert.assertEquals(welcomeText, expectedWelcomeText, "Wikipedia welcome text was not the expected."); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CustomerToken that = (CustomerToken) o; if (!accessToken.equals(that.accessToken)) return false; if (!customerId.equals(that.customerId)) return false; return expiresAt.equals(that.expiresAt); }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CustomerToken that = (CustomerToken) o; if (accessToken != null ? !accessToken.equals(that.accessToken) : that.accessToken != null) return false; return customerId != null ? customerId.equals(that.customerId) : that.customerId == null; }
Source:
private List<IdpConfig> getSelectedProviders() { List<IdpConfig> selectedProviders = new ArrayList<>(); if (mUseGoogleProvider.isChecked()) { selectedProviders.add( new IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER) .setPermissions(getGooglePermissions()) .build()); } if (mUseFacebookProvider.isChecked()) { selectedProviders.add( new IdpConfig.Builder(AuthUI.FACEBOOK_PROVIDER) .setPermissions(getFacebookPermissions()) .build()); } if (mUseTwitterProvider.isChecked()) { selectedProviders.add(new IdpConfig.Builder(AuthUI.TWITTER_PROVIDER).build()); } if (mUseEmailProvider.isChecked()) { selectedProviders.add(new IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build()); } if (mUsePhoneProvider.isChecked()) { Bundle params = new Bundle(); params.putString(AuthUI.PHONE_VERIFICATION_DEFAULT_PHONE_EXTRA, "+13099126574"); selectedProviders.add( new IdpConfig.Builder(AuthUI.PHONE_VERIFICATION_PROVIDER) .setParams(params) .build()); } return selectedProviders; }

Target:
private List<IdpConfig> getSelectedProviders() { List<IdpConfig> selectedProviders = new ArrayList<>(); if (mUseGoogleProvider.isChecked()) { selectedProviders.add( new IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER) .setPermissions(getGooglePermissions()) .build()); } if (mUseFacebookProvider.isChecked()) { selectedProviders.add( new IdpConfig.Builder(AuthUI.FACEBOOK_PROVIDER) .setPermissions(getFacebookPermissions()) .build()); } if (mUseTwitterProvider.isChecked()) { selectedProviders.add(new IdpConfig.Builder(AuthUI.TWITTER_PROVIDER).build()); } if (mUseEmailProvider.isChecked()) { selectedProviders.add(new IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build()); } if (mUsePhoneProvider.isChecked()) { selectedProviders.add( new IdpConfig.Builder(AuthUI.PHONE_VERIFICATION_PROVIDER).build()); } return selectedProviders; }
Source:
public void updateCourseStructure(List<CourseUnitDto> courses) { Map<Long, Course> courseMap = new HashMap<>(); Map<Long, Chapter> chapterMap = new HashMap<>(); Map<Long, Lesson> lessonMap = new HashMap<>(); Map<Long, Quiz> quizMap = new HashMap<>(); clearRelationships(courses, courseMap, chapterMap, lessonMap, quizMap); for (CourseUnitDto courseUnitDto : courses) { LOGGER.debug("Start processing course with id and name {}", courseUnitDto.getId(), courseUnitDto.getName()); Course course = courseMap.get(courseUnitDto.getId()); if (course == null) { throw new CourseUnitNotFoundException("Cannot find course with id: " + courseUnitDto.getId()); } List<Chapter> chapters = new ArrayList<>(); if (courseUnitDto.getUnits() != null) { for (CourseUnitDto chapterUnitDto : courseUnitDto.getUnits()) { Chapter chapter = getChapter(chapterUnitDto.getId(), chapterMap); setUpLessons(chapterUnitDto, chapter, lessonMap); setUpQuiz((ChapterUnitDto) chapterUnitDto, chapter, quizMap); chapter.setCourse(course); chapter.setState(CourseUnitState.valueOf(chapterUnitDto.getState())); chapters.add(chapter); chapterMap.remove(chapterUnitDto.getId()); } } course.setState(CourseUnitState.valueOf(courseUnitDto.getState())); course.setChapters(chapters); courseMap.remove(courseUnitDto.getId()); courseDataService.evictAllCache(); courseDataService.update(course); } chapterDataService.evictAllCache(); lessonDataService.evictAllCache(); quizDataService.evictAllCache(); updateUnusedRecords(courseMap, chapterMap, lessonMap, quizMap); }

Target:
public void updateCourseStructure(List<CourseUnitDto> courses) { Map<Long, Course> courseMap = new HashMap<>(); Map<Long, Chapter> chapterMap = new HashMap<>(); Map<Long, Lesson> lessonMap = new HashMap<>(); Map<Long, Quiz> quizMap = new HashMap<>(); clearRelationships(courses, courseMap, chapterMap, lessonMap, quizMap); for (CourseUnitDto courseUnitDto : courses) { LOGGER.debug("Start processing course with id and name {}", courseUnitDto.getId(), courseUnitDto.getName()); Course course = courseMap.get(courseUnitDto.getId()); if (course == null) { throw new CourseUnitNotFoundException("Cannot find course with id: " + courseUnitDto.getId()); } List<Chapter> chapters = new ArrayList<>(); if (courseUnitDto.getUnits() != null) { for (CourseUnitDto chapterUnitDto : courseUnitDto.getUnits()) { Chapter chapter = getChapter(chapterUnitDto.getId(), chapterMap); setUpLessons(chapterUnitDto, chapter, lessonMap); setUpQuiz((ChapterUnitDto) chapterUnitDto, chapter, quizMap); chapter.setCourse(course); chapter.setState(CourseUnitState.valueOf(chapterUnitDto.getState())); chapters.add(chapter); chapterMap.remove(chapterUnitDto.getId()); } } course.setState(CourseUnitState.valueOf(courseUnitDto.getState())); course.setChapters(chapters); courseMap.remove(courseUnitDto.getId()); courseDataService.update(course); } courseDataService.evictEntityCache(true); updateUnusedRecords(courseMap, chapterMap, lessonMap, quizMap); }
Source:
public void setParams(MatrixLib value) { if (value != null) { if (value.numCols() != 1 || value.numRows() == 0) { throw new IllegalArgumentException( "The argument passed into setParams is not a column vector"); } initializeProbabilityVector(value); this.hasP = true; int supportSize = 0; for (int i = 0; i < k; i++) { if (!Util.closeToZero(this.p[i])) { supportSize++; } } this.finiteSupport = new Object[supportSize]; int curSupportIndex = 0; for (int i = 0; i < k; i++) { if (!Util.closeToZero(this.p[i])) { this.finiteSupport[curSupportIndex] = i; curSupportIndex++; } } } }

Target:
public void setParams(MatrixLib value) { if (value != null) { if (value.numCols() != 1 || value.numRows() == 0) { throw new IllegalArgumentException( "The argument passed into setParams is not a column vector"); } initializeProbabilityVector(value); this.hasP = true; this.finiteSupport = null; } }
Source:
static ByteBuf decompressDomainName(ByteBuf compression) { String domainName = decodeDomainName(compression); ByteBuf result = Unpooled.buffer(domainName.length() << 1); encodeDomainName(domainName, result); return result; }

Target:
static ByteBuf decompressDomainName(ByteBuf compression) { String domainName = decodeDomainName(compression); ByteBuf result = compression.alloc().buffer(domainName.length() << 1); encodeDomainName(domainName, result); return result; }
Source:
private void validateSchema(final EventTypeBase eventType) throws InvalidEventTypeException { try { final String eventTypeSchema = eventType.getSchema().getSchema(); JsonUtils.checkEventTypeSchemaValid(eventTypeSchema); final JSONObject schemaAsJson = new JSONObject(eventTypeSchema); final Schema schema = SchemaLoader.load(schemaAsJson); if (eventType.getCategory() == EventCategory.BUSINESS && schema.definesProperty("#/metadata")) { throw new InvalidEventTypeException("\"metadata\" property is reserved"); } if (featureToggleService.isFeatureEnabled(CHECK_PARTITIONS_KEYS)) { validatePartitionKeys(schema, eventType); } if (eventType.getCompatibilityMode() != CompatibilityMode.NONE) { validateJsonSchemaConstraints(eventType, schemaAsJson); } } catch (final JSONException e) { throw new InvalidEventTypeException("schema must be a valid json"); } catch (final SchemaException e) { throw new InvalidEventTypeException("schema must be a valid json-schema"); } }

Target:
private void validateSchema(final EventTypeBase eventType) throws InvalidEventTypeException { try { final String eventTypeSchema = eventType.getSchema().getSchema(); JsonUtils.checkEventTypeSchemaValid(eventTypeSchema); final JSONObject schemaAsJson = new JSONObject(eventTypeSchema); validateJsonSchemaConstraints(eventType.getCompatibilityMode(), schemaAsJson); final Schema schema = SchemaLoader.load(schemaAsJson); if (eventType.getCategory() == EventCategory.BUSINESS && schema.definesProperty("#/metadata")) { throw new InvalidEventTypeException("\"metadata\" property is reserved"); } if (featureToggleService.isFeatureEnabled(CHECK_PARTITIONS_KEYS)) { validatePartitionKeys(schema, eventType); } } catch (final JSONException e) { throw new InvalidEventTypeException("schema must be a valid json"); } catch (final SchemaException e) { throw new InvalidEventTypeException("schema must be a valid json-schema"); } }
Source:
private ExecutionFailureInfo rewriteTransportFailure(ExecutionFailureInfo executionFailureInfo) { if (executionFailureInfo.getRemoteHost() != null && failureDetector.getState(executionFailureInfo.getRemoteHost()) == GONE) { return new ExecutionFailureInfo( executionFailureInfo.getType(), executionFailureInfo.getMessage(), executionFailureInfo.getCause(), executionFailureInfo.getSuppressed(), executionFailureInfo.getStack(), executionFailureInfo.getErrorLocation(), REMOTE_HOST_GONE.toErrorCode(), executionFailureInfo.getRemoteHost()); } else { return executionFailureInfo; } }

Target:
private ExecutionFailureInfo rewriteTransportFailure(ExecutionFailureInfo executionFailureInfo) { if (executionFailureInfo.getRemoteHost() == null || failureDetector.getState(executionFailureInfo.getRemoteHost()) != GONE) { return executionFailureInfo; } return new ExecutionFailureInfo( executionFailureInfo.getType(), executionFailureInfo.getMessage(), executionFailureInfo.getCause(), executionFailureInfo.getSuppressed(), executionFailureInfo.getStack(), executionFailureInfo.getErrorLocation(), REMOTE_HOST_GONE.toErrorCode(), executionFailureInfo.getRemoteHost()); }
Source:
public void onSaveClicked() { final CommandConfiguration selectedConfiguration; if (view.getSelectedConfiguration() == null) { return; } onNameChanged(); selectedConfiguration = view.getSelectedConfiguration(); updateCommand(selectedConfiguration).then(new Operation<WorkspaceDto>() { @Override public void apply(WorkspaceDto arg) throws OperationException { commandProcessingCallback = getCommandProcessingCallback(); fetchCommands(); fireConfigurationUpdated(selectedConfiguration); } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { dialogFactory.createMessageDialog("Error", arg.toString(), null).show(); } }); }

Target:
public void onSaveClicked() { final CommandConfiguration selectedConfiguration; if (view.getSelectedConfiguration() == null) { return; } onNameChanged(); selectedConfiguration = view.getSelectedConfiguration(); updateCommand(selectedConfiguration).then(new Operation<WorkspaceDto>() { @Override public void apply(WorkspaceDto arg) throws OperationException { commandProcessingCallback = getCommandProcessingCallback(); fetchCommands(); fireConfigurationUpdated(selectedConfiguration); } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { dialogFactory.createMessageDialog("Error", arg.getMessage(), null).show(); } }); }
Source:
public Builder withCosmosKeyCredential(CosmosKeyCredential cosmosKeyCredential) { if (cosmosKeyCredential != null && StringUtils.isEmpty(cosmosKeyCredential.getMasterKey())) { throw new IllegalArgumentException("Cannot build client with empty key credential"); } this.cosmosKeyCredential = cosmosKeyCredential; return this; }

Target:
public Builder withCosmosKeyCredential(CosmosKeyCredential cosmosKeyCredential) { if (cosmosKeyCredential != null && StringUtils.isEmpty(cosmosKeyCredential.key())) { throw new IllegalArgumentException("Cannot build client with empty key credential"); } this.cosmosKeyCredential = cosmosKeyCredential; return this; }
Source:
public void getCreatedOffers() { final String offerToken = createOffer(user, "test", AccessLevel.WRITE, null); PermissionManager pm = user.getPermissionManager(); looperThread.closeAfterTest(pm); pm.getCreatedOffers(new PermissionManager.OffersCallback() { @Override public void onSuccess(RealmResults<PermissionOffer> offers) { RealmResults filteredOffers = offers.where() .equalTo("token", offerToken) .findAllAsync(); looperThread.keepStrongReference(offers); filteredOffers.addChangeListener(new RealmChangeListener<RealmResults>() { @Override public void onChange(RealmResults results) { switch (results.size()) { case 0: return; case 1: looperThread.testComplete(); break; case 2: fail("To many offers: " + Arrays.toString(results.toArray())); } } }); } @Override public void onError(ObjectServerError error) { fail(error.toString()); } }); }

Target:
public void getCreatedOffers() { final String offerToken = createOffer(user, "test", AccessLevel.WRITE, null); PermissionManager pm = user.getPermissionManager(); looperThread.closeAfterTest(pm); pm.getCreatedOffers(new PermissionManager.OffersCallback() { @Override public void onSuccess(RealmResults<PermissionOffer> offers) { RealmResults filteredOffers = offers.where() .equalTo("token", offerToken) .findAllAsync(); looperThread.keepStrongReference(offers); filteredOffers.addChangeListener(new RealmChangeListener<RealmResults>() { @Override public void onChange(RealmResults results) { switch (results.size()) { case 0: return; case 1: looperThread.testComplete(); break; default: fail("To many offers: " + Arrays.toString(results.toArray())); } } }); } @Override public void onError(ObjectServerError error) { fail(error.toString()); } }); }
Source:
private void sendMessage(final RawData message, final DTLSSession session) { try { final CorrelationContext ctx = new DtlsCorrelationContext( session.getSessionIdentifier().toString(), String.valueOf(session.getWriteEpoch()), session.getWriteStateCipher()); if (!checkOutboundCorrelationContext(message, ctx)) { return; } Record record = new Record( ContentType.APPLICATION_DATA, session.getWriteEpoch(), session.getSequenceNumber(), new ApplicationMessage(message.getBytes(), message.getInetSocketAddress()), session); sendRecord(record); message.onSent(ctx); } catch (GeneralSecurityException e) { LOGGER.log(Level.FINE, String.format("Cannot send APPLICATION record to peer [%s]", message.getInetSocketAddress()), e); } }

Target:
private void sendMessage(final RawData message, final DTLSSession session) { try { final CorrelationContext ctx = new DtlsCorrelationContext( session.getSessionIdentifier().toString(), String.valueOf(session.getWriteEpoch()), session.getWriteStateCipher()); if (!checkOutboundCorrelationContext(message, ctx)) { return; } message.onContextEstablished(ctx); Record record = new Record( ContentType.APPLICATION_DATA, session.getWriteEpoch(), session.getSequenceNumber(), new ApplicationMessage(message.getBytes(), message.getInetSocketAddress()), session); sendRecord(record); message.onSent(); } catch (IOException e) { message.onError(e); } catch (GeneralSecurityException e) { LOGGER.log(Level.FINE, String.format("Cannot send APPLICATION record to peer [%s]", message.getInetSocketAddress()), e); message.onError(e); } }
Source:
public void staffUserCanMoveThreadToOtherBoard() { ForumPageObject forumMainPage = new ForumPageObject(driver); String title = PageContent.FORUM_TITLE_PREFIX + forumMainPage.getTimeStamp(); String message = PageContent.FORUM_MESSAGE + forumMainPage.getTimeStamp(); forumMainPage.openForumMainPage(wikiURL); List<String> forumNames = forumMainPage.getForumNamesList(); ForumBoardPageObject forumBoard = forumMainPage.openForumBoard(); ForumThreadPageObject forumThread = forumBoard.startDiscussion(title, message, false); forumThread.verifyDiscussionTitleAndMessage(title, message); forumThread.moveThread(forumNames.get(1)); forumThread.verifyParentBoard(forumNames.get(1)); }

Target:
public void staffUserCanMoveThreadToOtherBoard() { ForumPageObject forumMainPage = new ForumPageObject(driver); String title = String.format(PageContent.FORUM_TITLE_PREFIX, forumMainPage.getTimeStamp()); String message = String.format(PageContent.FORUM_MESSAGE + forumMainPage.getTimeStamp()); forumMainPage.openForumMainPage(wikiURL); List<String> forumNames = forumMainPage.getForumNamesList(); ForumBoardPageObject forumBoard = forumMainPage.openForumBoard(); ForumThreadPageObject forumThread = forumBoard.startDiscussion(title, message, false); forumThread.verifyDiscussionTitleAndMessage(title, message); forumThread.moveThread(forumNames.get(1)); forumThread.verifyParentBoard(forumNames.get(1)); }
Source:
private DefaultExecutorListProviderImpl( @Parameter(NumExecutors.class) final int numExecutors) throws InjectionException { this.executors = new LinkedList<>(); for (int i = 0; i < numExecutors; i++) { final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder(); jcb.bindNamedParameter(MistExecutorId.class, "MistExecutor-" + i); final Injector injector = Tang.Factory.getTang().newInjector(jcb.build()); final MistExecutor executor = injector.getInstance(MistExecutor.class); this.executors.add(executor); } }

Target:
private DefaultExecutorListProviderImpl( @Parameter(NumExecutors.class) final int numExecutors) throws InjectionException { if (numExecutors <= 0) { throw new RuntimeException("The number of executors should be greater than zero"); } this.executors = new LinkedList<>(); for (int i = 0; i < numExecutors; i++) { final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder(); final StringBuffer sb = new StringBuffer(); sb.append("MistExecutor-"); sb.append(i); jcb.bindNamedParameter(MistExecutorId.class, sb.toString()); final Injector injector = Tang.Factory.getTang().newInjector(jcb.build()); final MistExecutor executor = injector.getInstance(MistExecutor.class); this.executors.add(executor); } }
Source:
public int getTreeDepth() { if (currVisit == null) return 0; return currVisit.depth; }

Target:
public int getTreeDepth() { if (currVisit == null) { return 0; } return currVisit.depth; }
Source:
public static boolean confirmHardReset(Shell shell, final Repository repo) { String question = UIText.ResetTargetSelectionDialog_ResetConfirmQuestion; ILaunchConfiguration launch = LaunchFinder .getRunningLaunchConfiguration(Collections.singleton(repo), null); if (launch != null) { question = MessageFormat.format(question, "\n\n" + MessageFormat.format( UIText.LaunchFinder_RunningLaunchMessage, launch.getName())); } else { question = MessageFormat.format(question, ""); } MessageDialog messageDialog = new MessageDialog(shell, UIText.ResetTargetSelectionDialog_ResetQuestion, null, question, MessageDialog.QUESTION, 0, UIText.CommandConfirmationHardResetDialog_resetButtonLabel, IDialogConstants.NO_LABEL); return messageDialog.open() == Window.OK; }

Target:
public static boolean confirmHardReset(Shell shell, final Repository repo) { String question = UIText.ResetTargetSelectionDialog_ResetConfirmQuestion; ILaunchConfiguration launch = LaunchFinder .getRunningLaunchConfiguration(Collections.singleton(repo), null); if (launch != null) { question = MessageFormat.format(question, "\n\n" + MessageFormat.format( UIText.LaunchFinder_RunningLaunchMessage, launch.getName())); } else { question = MessageFormat.format(question, ""); } MessageDialog messageDialog = new MessageDialog(shell, UIText.ResetTargetSelectionDialog_ResetQuestion, null, question, MessageDialog.QUESTION, 0, UIText.CommandConfirmationHardResetDialog_resetButtonLabel, IDialogConstants.CANCEL_LABEL); return messageDialog.open() == Window.OK; }
Source:
public void visitToken(DetailAST ast) { final ComponentCounter counter = new ComponentCounter(); countComponents(counter, ast); checkCounter(counter, ast); }

Target:
public void visitToken(DetailAST ast) { final DetailAST modifiers = ast.findFirstToken(TokenTypes.MODIFIERS); final AccessModifierOption accessModifier = CheckUtil.getAccessModifierFromModifiersToken(modifiers); if (matchAccessModifiers(accessModifier)) { final DetailAST recordComponents = ast.findFirstToken(TokenTypes.RECORD_COMPONENTS); final int componentCount = countComponents(recordComponents); if (componentCount > max) { log(ast, MSG_KEY, componentCount, max); } } }
Source:
QosIoException(QosException qosException, Response response) { super("Failed to complete the request due to a server-side QoS condition"); this.qosException = qosException; this.response = response; }

Target:
QosIoException(QosException qosException, Response response) { super("Failed to complete the request due to a server-side QoS condition: " + response.code(), qosException); this.qosException = qosException; this.response = response; }
Source:
public String getWorkflowDag(@ApiParam(hidden = true) @Auth Optional<User> user, @ApiParam(value = "workflowId", required = true) @PathParam("workflowId") Long workflowId, @ApiParam(value = "workflowVersionId", required = true) @PathParam("workflowVersionId") Long workflowVersionId) { Workflow workflow = workflowDAO.findById(workflowId); checkEntry(workflow); checkOptionalAuthRead(user, workflow); WorkflowVersion workflowVersion = getWorkflowVersion(workflow, workflowVersionId); SourceFile mainDescriptor = getMainDescriptorFile(workflowVersion); if (workflowVersion.getDagJson() != null) { return workflowVersion.getDagJson(); } if (mainDescriptor != null) { Set<SourceFile> secondaryDescContent = extractDescriptorAndSecondaryFiles(workflowVersion); LanguageHandlerInterface lInterface = LanguageHandlerFactory.getInterface(workflow.getFileType()); String dagJson = lInterface.getCleanDAG(workflowVersion.getWorkflowPath(), mainDescriptor.getContent(), secondaryDescContent, LanguageHandlerInterface.Type.DAG, toolDAO); if (workflowVersion.getReferenceType() == Version.ReferenceType.TAG && workflowVersion.isValid()) { workflowVersion.setDagJson(dagJson); } return dagJson; } return null; }

Target:
public String getWorkflowDag(@ApiParam(hidden = true) @Auth Optional<User> user, @ApiParam(value = "workflowId", required = true) @PathParam("workflowId") Long workflowId, @ApiParam(value = "workflowVersionId", required = true) @PathParam("workflowVersionId") Long workflowVersionId) { Workflow workflow = workflowDAO.findById(workflowId); checkEntry(workflow); checkOptionalAuthRead(user, workflow); WorkflowVersion workflowVersion = getWorkflowVersion(workflow, workflowVersionId); SourceFile mainDescriptor = getMainDescriptorFile(workflowVersion); if (workflowVersion.getDagJson() != null) { return workflowVersion.getDagJson(); } if (mainDescriptor != null) { Set<SourceFile> secondaryDescContent = extractDescriptorAndSecondaryFiles(workflowVersion); LanguageHandlerInterface lInterface = LanguageHandlerFactory.getInterface(workflow.getFileType()); final String dagJson = lInterface.getCleanDAG(workflowVersion.getWorkflowPath(), mainDescriptor.getContent(), secondaryDescContent, LanguageHandlerInterface.Type.DAG, toolDAO); workflowVersion.setDagJson(dagJson); return dagJson; } return null; }
Source:
public String captureGesture(String gestureName) { StringBuffer script = new StringBuffer(); DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); Date date = new Date(); String indentSpace = ""; script.append("# - " + date + " - Captured gesture :\n"); if (gestureName != null) { indentSpace = " "; script.append(String.format("def %s():\n", gestureName)); } if (head != null) { script.append(indentSpace); script.append(head.getScript(getName())); } if (leftArm != null) { script.append(indentSpace); script.append(leftArm.getScript(getName())); } if (rightArm != null) { script.append(indentSpace); script.append(rightArm.getScript(getName())); } if (leftHand != null) { script.append(indentSpace); script.append(leftHand.getScript(getName())); } if (rightHand != null) { script.append(indentSpace); script.append(rightHand.getScript(getName())); } if (torso != null) { script.append(indentSpace); script.append(torso.getScript(getName())); } if (eyelids != null) { script.append(indentSpace); script.append(eyelids.getScript(getName())); } send("python", "appendScript", script.toString()); return script.toString(); }

Target:
public String captureGesture(String gestureName) { StringBuffer script = new StringBuffer(); Date date = new Date(); String indentSpace = ""; script.append("# - " + date + " - Captured gesture :\n"); if (gestureName != null) { indentSpace = " "; script.append(String.format("def %s():\n", gestureName)); } if (head != null) { script.append(indentSpace); script.append(head.getScript(getName())); } if (leftArm != null) { script.append(indentSpace); script.append(leftArm.getScript(getName())); } if (rightArm != null) { script.append(indentSpace); script.append(rightArm.getScript(getName())); } if (leftHand != null) { script.append(indentSpace); script.append(leftHand.getScript(getName())); } if (rightHand != null) { script.append(indentSpace); script.append(rightHand.getScript(getName())); } if (torso != null) { script.append(indentSpace); script.append(torso.getScript(getName())); } if (eyelids != null) { script.append(indentSpace); script.append(eyelids.getScript(getName())); } send("python", "appendScript", script.toString()); return script.toString(); }
Source:
protected void installLocations() { super.installLocations(); bind(ImplicitLocationSupplier.class) .to(OnlyLocationOrFirstZone.class) .in(Scopes.SINGLETON); }

Target:
protected void installLocations() { super.installLocations(); bind(ImplicitLocationSupplier.class).to(FirstRegion.class).in(Scopes.SINGLETON); }
Source:
public ParameterizedState(final List<Parameter<T, ?>> parameters) { Utils.nonNull(parameters, "List of parameters cannot be null."); Utils.nonEmpty(parameters, "List of parameters cannot be empty."); final LinkedHashMap<T, Parameter<T, ?>> map = new LinkedHashMap<>(); for (final Parameter<T, ?> parameter : parameters) { final T key = parameter.getName(); if (map.containsKey(key)) { throw new IllegalArgumentException("List of parameters cannot contain duplicate parameter key names."); } map.put(parameter.getName(), parameter); } final Class<T> keyClass = parameters.get(0).getName().getDeclaringClass(); final Set<T> keySet = EnumSet.allOf(keyClass); if (!keySet.equals(map.keySet())) { throw new IllegalArgumentException("List of parameters does not contain all parameters specified by ParameterEnum."); } parameterMap = map; }

Target:
public ParameterizedState(final List<Parameter<T, ?>> parameters) { Utils.nonNull(parameters, "List of parameters cannot be null."); Utils.nonEmpty(parameters, "List of parameters cannot be empty."); final int numUniqueParameters = (int) parameters.stream().map(Parameter::getName).distinct().count(); Utils.validateArg(numUniqueParameters == parameters.size(), "List of parameters may not contain duplicates."); final LinkedHashMap<T, Parameter<T, ?>> map = new LinkedHashMap<>(); parameters.stream().forEach(p -> map.put(p.getName(), p)); final Class<T> keyClass = parameters.get(0).getName().getDeclaringClass(); final Set<T> keySet = EnumSet.allOf(keyClass); Utils.validateArg(keySet.equals(map.keySet()), "List of parameters does not contain all parameters specified by ParameterEnum."); parameterMap = map; }
Source:
protected void execute(ProcessContext process) throws Exception { process.log("Computing changes..."); schema.computeRequiredSchemaChanges(); process.log("Exporting changes..."); Map<String, PrintWriter> writers = new HashMap<>(); try { for (SchemaUpdateAction action : schema.getSchemaUpdateActions()) { PrintWriter writer = writers.computeIfAbsent(action.getRealm(), realm -> createWriter(process, realm)); action.getSql().forEach(writer::print); writer.print(";"); writer.println(); } } finally { writers.values().forEach(writer -> safeCloseWriter(writer, process)); } }

Target:
protected void execute(ProcessContext process) throws Exception { process.log("Computing changes..."); schema.computeRequiredSchemaChanges(); process.log("Exporting changes..."); Map<String, PrintWriter> writers = new HashMap<>(); try { for (SchemaUpdateAction action : schema.getSchemaUpdateActions()) { PrintWriter writer = writers.computeIfAbsent(action.getRealm(), realm -> createWriter(process, realm)); action.getSql().stream().map(sql -> sql + ";\n").forEach(writer::print); } } finally { writers.values().forEach(writer -> safeCloseWriter(writer, process)); } }
Source:
public FileManager(String dataFolder) { if (dataFolder == null || "".equals(dataFolder)) { dataFolder = Paths.get(System.getProperty("java.io.tmpdir"), "blynk").toString(); } try { this.dataDir = createDatadir(dataFolder); this.deletedDataDir = createDatadir(String.format("%s/%s", dataFolder, DELETED_DATA_DIR_NAME)); } catch (RuntimeException e) { this.dataDir = createDatadir(Paths.get(System.getProperty("java.io.tmpdir"), "blynk")); this.deletedDataDir = createDatadir(String.format("%s/%s", this.dataDir.toString(), DELETED_DATA_DIR_NAME)); } log.info("Using data dir '{}'", dataDir); }

Target:
public FileManager(String dataFolder) { if (dataFolder == null || "".equals(dataFolder)) { dataFolder = Paths.get(System.getProperty("java.io.tmpdir"), "blynk").toString(); } try { this.dataDir = createDatadir(dataFolder); this.deletedDataDir = createDatadir(Paths.get(dataFolder, DELETED_DATA_DIR_NAME)); } catch (RuntimeException e) { this.dataDir = createDatadir(Paths.get(System.getProperty("java.io.tmpdir"), "blynk")); this.deletedDataDir = createDatadir(Paths.get(this.dataDir.toString(), DELETED_DATA_DIR_NAME)); } log.info("Using data dir '{}'", dataDir); }
Source:
private static List<SimpleInterval> constructUntrimmedSegments(final Genome genome, final SortedMap<String, List<Breakpoint>> breakpointsByContig) { final List<SimpleInterval> segments = new ArrayList<>(); for (final String contig : breakpointsByContig.keySet()) { final List<Breakpoint> breakpoints = breakpointsByContig.get(contig); int start = breakpoints.get(0).getStart(); for (int i = 1; i < breakpoints.size(); i++) { final Breakpoint breakpoint = breakpoints.get(i); int end; switch (breakpoint.getType()) { case START: end = breakpoint.getSite() - 1; break; case END: end = breakpoint.getSite(); break; default: throw new GATKException.ShouldNeverReachHereException("Unknown breakpoint type in segment union."); } if (end < start) { continue; } final SimpleInterval segment = new SimpleInterval(contig, start, end); if (genome.getTargets().targetCount(segment) > 0 || genome.getSNPs().targetCount(segment) > 0) { segments.add(segment); } start = segment.getEnd() + 1; } } return segments; }

Target:
private static List<SimpleInterval> constructUntrimmedSegments(final Genome genome, final SortedMap<String, List<Breakpoint>> breakpointsByContig) { final List<SimpleInterval> segments = new ArrayList<>(); for (final String contig : breakpointsByContig.keySet()) { final List<Breakpoint> breakpoints = breakpointsByContig.get(contig); int start = breakpoints.get(0).getStart(); for (int i = 1; i < breakpoints.size(); i++) { final Breakpoint breakpoint = breakpoints.get(i); final int end = breakpoint.getSite() - (breakpoint.getType() == BreakpointType.START ? 1 : 0); if (end < start) { continue; } final SimpleInterval segment = new SimpleInterval(contig, start, end); if (genome.getTargets().targetCount(segment) > 0 || genome.getSNPs().targetCount(segment) > 0) { segments.add(segment); } start = segment.getEnd() + 1; } } return segments; }
Source:
public boolean restart(Integer containerId) { if (containerId == null) { throw new UnsupportedOperationException("Not implemented"); } if (stateMgrAdaptor == null) { LOG.warning("SchedulerStateManagerAdaptor not initialized"); return false; } StMgr contaienrInfo = stateMgrAdaptor.getPhysicalPlan(topologyName).getStmgrs(containerId); String ip = contaienrInfo.getHostName(); int port = contaienrInfo.getShellPort(); String url = "http://" + ip + ":" + port + "/killexecutor"; String payload = "secret=" + topologyName; LOG.info("sending `kill container` to " + url + "; payload: " + payload); HttpURLConnection con = NetworkUtils.getHttpConnection(url); NetworkUtils.sendHttpPostRequest(con, "X", payload.getBytes()); boolean ret = NetworkUtils.checkHttpResponseCode(con, 200); con.disconnect(); return ret; }

Target:
public boolean restart(Integer containerId) { if (containerId == null) { throw new UnsupportedOperationException("Not implemented"); } if (stateMgrAdaptor == null) { LOG.warning("SchedulerStateManagerAdaptor not initialized"); return false; } StMgr contaienrInfo = stateMgrAdaptor.getPhysicalPlan(topologyName).getStmgrs(containerId); String host = contaienrInfo.getHostName(); int port = contaienrInfo.getShellPort(); String url = "http://" + host + ":" + port + "/killexecutor"; String payload = "secret=" + topologyName; LOG.info("sending `kill container` to " + url + "; payload: " + payload); HttpURLConnection con = NetworkUtils.getHttpConnection(url); try { NetworkUtils.sendHttpPostRequest(con, "X", payload.getBytes()); return NetworkUtils.checkHttpResponseCode(con, 200); } finally { con.disconnect(); } }
Source:
public void testAcceptableTokensMakeSense() { final int expectedTokenTypesTotalNumber = 170; assertEquals(expectedTokenTypesTotalNumber, TokenUtil.getTokenTypesTotalNumber(), "Total number of TokenTypes has changed, acceptable tokens in" + " IllegalTokenTextCheck need to be reconsidered."); final IllegalTokenTextCheck check = new IllegalTokenTextCheck(); final int[] allowedTokens = check.getAcceptableTokens(); final List<Integer> tokenTypesWithMutableText = Arrays.asList( TokenTypes.NUM_DOUBLE, TokenTypes.NUM_FLOAT, TokenTypes.NUM_INT, TokenTypes.NUM_LONG, TokenTypes.IDENT, TokenTypes.COMMENT_CONTENT, TokenTypes.STRING_LITERAL, TokenTypes.CHAR_LITERAL ); for (int tokenType : allowedTokens) { assertTrue(tokenTypesWithMutableText.contains(tokenType), TokenUtil.getTokenName(tokenType) + " should not be allowed" + " in this check as its text is a constant (IllegalTokenCheck should be used for" + " such cases)."); } }

Target:
public void testAcceptableTokensMakeSense() { final int expectedTokenTypesTotalNumber = 171; assertEquals(expectedTokenTypesTotalNumber, TokenUtil.getTokenTypesTotalNumber(), "Total number of TokenTypes has changed, acceptable tokens in" + " IllegalTokenTextCheck need to be reconsidered."); final IllegalTokenTextCheck check = new IllegalTokenTextCheck(); final int[] allowedTokens = check.getAcceptableTokens(); final List<Integer> tokenTypesWithMutableText = Arrays.asList( TokenTypes.NUM_DOUBLE, TokenTypes.NUM_FLOAT, TokenTypes.NUM_INT, TokenTypes.NUM_LONG, TokenTypes.IDENT, TokenTypes.COMMENT_CONTENT, TokenTypes.STRING_LITERAL, TokenTypes.CHAR_LITERAL ); for (int tokenType : allowedTokens) { assertTrue(tokenTypesWithMutableText.contains(tokenType), TokenUtil.getTokenName(tokenType) + " should not be allowed" + " in this check as its text is a constant (IllegalTokenCheck should be used for" + " such cases)."); } }
Source:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> hostSubjects = vdsIds.stream() .map(vdsId -> new PermissionSubject(vdsId, VdcObjectType.VDS, getActionType().getActionGroup())) .collect(Collectors.toList()); hostSubjects.add(new PermissionSubject(getClusterId(), VdcObjectType.Cluster, ActionGroup.CONFIGURE_HOST_NETWORK)); return hostSubjects; }

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { return vdsIds.stream() .map(vdsId -> new PermissionSubject(vdsId, VdcObjectType.VDS, getActionType().getActionGroup())) .collect(Collectors.toList()); }
Source:
private String findCheckpointDir() throws Exception { final List<Path> checkpoint = new ArrayList<>(); CommonUtils.waitFor("Checkpoint list:", () -> { List<Path> checkpointTest = null; try { checkpointTest = Files.list(mDumpDir.toPath()) .filter(p -> p.toString().contains("checkpoints-")).collect(toList()); } catch (IOException e) { throw new RuntimeException(e); } if (checkpointTest.size() == 0) { return false; } else if (checkpointTest.size() == 1) { checkpoint.add(checkpointTest.get(0)); return true; } fail("Unexpected checkpoint list: " + checkpoint); return false; }, WaitForOptions.defaults().setTimeoutMs(500)); return checkpoint.get(0).toString(); }

Target:
private String findCheckpointDir() throws Exception { final List<Path> checkpoint = new ArrayList<>(); CommonUtils.waitFor("Checkpoint list:", () -> { List<Path> checkpointTest = null; try { checkpointTest = Files.list(mDumpDir.toPath()) .filter(p -> p.toString().contains("checkpoints-")).collect(toList()); } catch (IOException e) { throw new RuntimeException(e); } if (checkpointTest.size() == 0) { return false; } checkpoint.addAll(checkpointTest); return true; }, WaitForOptions.defaults().setTimeoutMs(500)); assertEquals("Unexpected checkpoint list: " + checkpoint, 1, checkpoint.size()); return checkpoint.get(0).toString(); }
Source:
public void importObject(Reader reader) throws IOException { Rules existingRules = curator.getRules(); Rules newRules = new Rules(StringFromReader.asString(reader)); if (VersionUtil.getRulesVersionCompatibility(existingRules.getVersion(), newRules.getVersion())) { log.info("Importing new rules from manifest, current version: " + existingRules.getVersion() + " new version: " + newRules.getVersion()); curator.update(newRules); sink.emitRulesModified(existingRules, newRules); jsProvider.get(); } else { log.info("Ignoring older rules in manifest, current version: " + existingRules.getVersion() + " new version: " + newRules.getVersion()); } }

Target:
public void importObject(Reader reader) throws IOException { Rules existingRules = curator.getRules(); Rules newRules = new Rules(StringFromReader.asString(reader)); if (VersionUtil.getRulesVersionCompatibility(existingRules.getVersion(), newRules.getVersion())) { log.info("Importing new rules from manifest, current version: " + existingRules.getVersion() + " new version: " + newRules.getVersion()); curator.update(newRules); sink.emitRulesModified(existingRules, newRules); jsProvider.compileRules(); } else { log.info("Ignoring older rules in manifest, current version: " + existingRules.getVersion() + " new version: " + newRules.getVersion()); } }
Source:
private List<String> sparkClasspath() { String sparkJars = System.getProperty("spark.jars"); Pattern isKotlinJar = Pattern.compile("/kotlin-(runtime|stdlib|compiler|reflect)(-.*)?\\.jar"); Stream<File> addedJars = Arrays.stream(Utils.resolveURIs(sparkJars).split(",")) .filter(s -> !s.trim().equals("")) .filter(s -> !isKotlinJar.matcher(s).find()) .map(s -> { int p = s.indexOf(':'); return new File(s.substring(p + 1)); }); Stream<File> systemJars = Arrays.stream( System.getProperty("java.class.path").split(File.pathSeparator)) .map(File::new); return Stream.concat(addedJars, systemJars) .map(file -> { try { return file.getCanonicalPath(); } catch (IOException e) { return ""; } }) .collect(Collectors.toList()); }

Target:
private static List<String> sparkClasspath() { String sparkJars = System.getProperty("spark.jars"); Pattern isKotlinJar = Pattern.compile("/kotlin-[a-z]*(-.*)?\\.jar"); Stream<File> addedJars = Arrays.stream(Utils.resolveURIs(sparkJars).split(",")) .filter(s -> !s.trim().equals("")) .filter(s -> !isKotlinJar.matcher(s).find()) .map(s -> { int p = s.indexOf(':'); return new File(s.substring(p + 1)); }); Stream<File> systemJars = Arrays.stream( System.getProperty("java.class.path").split(File.pathSeparator)) .map(File::new); return Stream.concat(addedJars, systemJars) .map(file -> { try { return file.getCanonicalPath(); } catch (IOException e) { return ""; } }) .collect(Collectors.toList()); }
Source:
public static CinderDisk volumeToCinderDisk(Volume volume, Guid storageDomainId) { CinderDisk cinderDisk = new CinderDisk(); cinderDisk.setId(Guid.createGuidFromString(volume.getId())); cinderDisk.setImageId(Guid.createGuidFromString(volume.getId())); cinderDisk.setDiskAlias(volume.getName()); cinderDisk.setDescription(volume.getDescription()); cinderDisk.setSizeInGigabytes(volume.getSize()); cinderDisk.setCinderVolumeType(volume.getVolumeType()); cinderDisk.setStorageIds(new ArrayList<>(Arrays.asList(storageDomainId))); cinderDisk.setActive(true); cinderDisk.setImageStatus(ImageStatus.OK); cinderDisk.setvolumeFormat(VolumeFormat.RAW); cinderDisk.setDiskInterface(DiskInterface.VirtIO); try { cinderDisk.setCreationDate(new SimpleDateFormat(DATE_FORMAT).parse(volume.getCreatedAt())); } catch (ParseException e) { cinderDisk.setCreationDate(null); log.error("Invalid disk creation date format", e); } return cinderDisk; }

Target:
public static CinderDisk volumeToCinderDisk(Volume volume, Guid storageDomainId) { CinderDisk cinderDisk = new CinderDisk(); cinderDisk.setId(Guid.createGuidFromString(volume.getId())); cinderDisk.setImageId(Guid.createGuidFromString(volume.getId())); cinderDisk.setDiskAlias(volume.getName()); cinderDisk.setDescription(volume.getDescription()); cinderDisk.setSizeInGigabytes(volume.getSize()); cinderDisk.setCinderVolumeType(volume.getVolumeType()); cinderDisk.setStorageIds(new ArrayList<>(Arrays.asList(storageDomainId))); cinderDisk.setActive(true); cinderDisk.setImageStatus(ImageStatus.OK); cinderDisk.setvolumeFormat(VolumeFormat.RAW); cinderDisk.setDiskInterface(DiskInterface.VirtIO); try { cinderDisk.setCreationDate(new SimpleDateFormat(DATE_FORMAT).parse(volume.getCreatedAt())); } catch (ParseException e) { cinderDisk.setCreationDate(null); log.error("Invalid disk creation date format, id: '{}' (info: {})", volume.getId(), e.getMessage()); } return cinderDisk; }
Source:
public static Iterable<Object[]> getParameters() { return Arrays.asList(new Object[][] { { 0, "0" }, { 3, "3" }, { 975, "975" }, { 1000, "1 k" }, { 4000, "4 k" }, { -4000, "-4 k" }, { 4000L, "4 k" }, { 4000.0, "4 k" }, { 12345678, "12.3 M" }, { Integer.MAX_VALUE, "2.1 G" }, { Integer.MIN_VALUE, "-2.1 G" }, { Long.MAX_VALUE, "9223.4 P" }, { 98765432.123456, "98.8 M" }, { -98765432.123456, "-98.8 M" }, { 555555555555L, "555.6 G" }, { 555555555555555L, "555.6 T" }, { 100100000, "100.1 M" }, { 0.1, "100 m" }, { 0.001, "1 m" }, { 0.000001, "1 µ" }, { 0.000000001, "1 n" }, { 0.000000000001, "1 p" }, { -0.04, "-40 m" }, { 0.002, "2 m" }, { 0.0555, "55.5 m" }, { 0.0004928373928, "492.8 µ" }, { 0.000000251, "251 n"}, { 0.000000000043, "43 p"}, { 0.000000045643, "45.6 n"}, { Double.MAX_VALUE, "179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 P" }, { Double.POSITIVE_INFINITY, "∞" }, { Double.MIN_NORMAL, "0" }, { Double.NEGATIVE_INFINITY, "-∞" }, { Double.NaN, "�" }, }); }

Target:
public static Iterable<Object[]> getParameters() { return Arrays.asList(new Object[][] { { 0, "0" }, { 3, "3" }, { 975, "975" }, { 1000, "1 k" }, { 4000, "4 k" }, { -4000, "-4 k" }, { 4000L, "4 k" }, { 4000.0, "4 k" }, { 12345678, "12.3 M" }, { Integer.MAX_VALUE, "2.1 G" }, { Integer.MIN_VALUE, "-2.1 G" }, { Long.MAX_VALUE, "9223.4 P" }, { 98765432.123456, "98.8 M" }, { -98765432.123456, "-98.8 M" }, { 555555555555L, "555.6 G" }, { 555555555555555L, "555.6 T" }, { 100100000, "100.1 M" }, { 0.1, "100 m" }, { 0.001, "1 m" }, { 0.000001, "1 µ" }, { 0.000000001, "1 n" }, { 0.000000000001, "1 p" }, { -0.04, "-40 m" }, { 0.002, "2 m" }, { 0.0555, "55.5 m" }, { 0.0004928373928, "492.8 µ" }, { 0.000000251, "251 n"}, { 0.000000000043, "43 p"}, { 0.000000045643, "45.6 n"}, }); }
Source:
void requestMemoryRevokingIfNeeded() { List<MemoryPool> poolsToCheck = memoryPools.stream() .filter(this::memoryRevokingNeeded) .collect(toList()); if (potentiallyOverflowingPools.addAll(poolsToCheck)) { log.debug("Scheduling check for pools: ", poolsToCheck); scheduleRevoking(); } }

Target:
void requestMemoryRevokingIfNeeded() { if (checkPending.compareAndSet(false, true)) { runMemoryRevoking(); } }
Source:
void moduleInit() throws IngestModuleException { try { currentCase = Case.getCurrentCaseThrows(); fileManager = currentCase.getServices().getFileManager(); absOutputFolderName = RAImageIngestModule.getRAOutputPath(currentCase, moduleName); relOutputFolderName = RAImageIngestModule.getRelModuleOutputPath() + File.separator + moduleName; File dir = new File(absOutputFolderName); if (dir.exists() == false) { dir.mkdirs(); } } catch (NoCurrentCaseException ex) { String msg = "Failed to get current case."; throw new IngestModuleException(msg, ex); } }

Target:
void moduleInit() throws IngestModuleException { try { currentCase = Case.getCurrentCaseThrows(); fileManager = currentCase.getServices().getFileManager(); absOutputFolderName = RAImageIngestModule.getRAOutputPath(currentCase, moduleName); relOutputFolderName = Paths.get( RAImageIngestModule.getRelModuleOutputPath(), moduleName).normalize().toString(); File dir = new File(absOutputFolderName); if (dir.exists() == false) { dir.mkdirs(); } } catch (NoCurrentCaseException ex) { String msg = "Failed to get current case."; throw new IngestModuleException(msg, ex); } }
Source:
public static void saveDefinedFunctions() { for (String name : FunctionDescriptor.defined_functions) { FunctionDescriptor fd = FunctionDescriptor.by_LC_name.get(name); FunctionDescriptor.by_LC_name.remove(name); m_savedFunctionDfns.put(name, fd); } FunctionDescriptor.defined_functions.clear(); }

Target:
public static void saveDefinedFunctions() { for (String name : FunctionDescriptor.defined_functions) { FunctionDescriptor fd = FunctionDescriptor.by_LC_name.get(name); assert(fd != null); FunctionDescriptor.by_LC_name.remove(name); m_savedFunctionDfns.put(name, fd); } FunctionDescriptor.defined_functions.clear(); }
Source:
public StreamInputPacketIndexEntry(long dataOffsetBits, long fileSizeBytes) { fContentSizeBits = (fileSizeBytes * Byte.SIZE); fPacketSizeBits = (fileSizeBytes * Byte.SIZE); fOffsetBytes = (dataOffsetBits / Byte.SIZE); fLostEvents = 0; fTarget = ""; fTargetID = 0; fTimestampBegin = Long.MIN_VALUE; fTimestampEnd = Long.MAX_VALUE; }

Target:
public StreamInputPacketIndexEntry(long dataOffsetBits, long fileSizeBytes) { fContentSizeBits = (fileSizeBytes * Byte.SIZE); fPacketSizeBits = (fileSizeBytes * Byte.SIZE); fOffsetBits = dataOffsetBits; fLostEvents = 0; fTarget = ""; fTargetID = 0; fTimestampBegin = Long.MIN_VALUE; fTimestampEnd = Long.MAX_VALUE; }
Source:
public Response terminateAll() { return asLeaderWithSupervisorManager( manager -> { Set<String> supervisorIds = manager.getSupervisorIds(); supervisorIds.forEach(manager::stopAndRemoveSupervisor); return Response.ok(ImmutableMap.of( "ids", String.join(",", supervisorIds) )).build(); } ); }

Target:
public Response terminateAll() { return asLeaderWithSupervisorManager( manager -> { manager.stopAndRemoveAllSupervisors(); return Response.ok(ImmutableMap.of("status", "success")).build(); } ); }
Source:
public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { if ("http".equals(context.getHttpRequest().getUrl().getProtocol())) { return Mono.error(new RuntimeException("token credentials require a URL using the HTTPS protocol scheme")); } context.getHttpRequest().setHeader(API_KEY, this.apiKey.getApiKey()); return next.process(); }

Target:
public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { if ("http".equals(context.getHttpRequest().getUrl().getProtocol())) { return Mono.error(new RuntimeException("Search api-key credentials require a URL using the HTTPS protocol " + "scheme.")); } context.getHttpRequest().setHeader(API_KEY, this.apiKey.getApiKey()); return next.process(); }