auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void execute(JobExecutionContext context) throws JobExecutionException { JobDataMap map = context.getMergedJobDataMap(); Server server = (Server) map.get(Server.class.getName()); log.debug("+++++ Started server job: {}", server); JMXConnector conn = null; JMXConnectionParams connectionParams = null; try { JMXServiceURL jmxUrl; if(server.getPid() != null) { jmxUrl = extractJMXServiceURLFromPid(server.getPid()); } else { jmxUrl = new JMXServiceURL(server.getUrl()); } connectionParams = new JMXConnectionParams(jmxUrl, server.getEnvironment()); if (!server.isLocal()) { conn = jmxPool.borrowObject(connectionParams); } jmxUtils.processServer(server, conn); } catch (Exception e) { log.error("Error in job for server: " + server, e); throw new JobExecutionException(e); } finally { try { jmxPool.returnObject(connectionParams, conn); } catch (Exception ex) { log.error("Error returning object to pool for server: " + server); } } log.debug("+++++ Finished server job: {}", server); }

Target:
public void execute(JobExecutionContext context) throws JobExecutionException { JobDataMap map = context.getMergedJobDataMap(); Server server = (Server) map.get(Server.class.getName()); log.debug("+++++ Started server job: {}", server); JMXConnector conn = null; JMXConnectionParams connectionParams = null; try { JMXServiceURL jmxUrl = server.getJmxServiceURL(); connectionParams = new JMXConnectionParams(jmxUrl, server.getEnvironment()); if (!server.isLocal()) { conn = jmxPool.borrowObject(connectionParams); } jmxUtils.processServer(server, conn); } catch (Exception e) { log.error("Error in job for server: " + server, e); throw new JobExecutionException(e); } finally { try { jmxPool.returnObject(connectionParams, conn); } catch (Exception ex) { log.error("Error returning object to pool for server: " + server); } } log.debug("+++++ Finished server job: {}", server); }
Source:
public void setDefaultValues() { super.setDefaultValues(); setType(SORTA_MATCH_JOB_TYPE); }

Target:
private void setDefaultValues() { setType(SORTA_MATCH_JOB_TYPE); }
Source:
public boolean equals(Object o) { if (o instanceof MultipleInstanceCollectionOutput) { MultipleInstanceCollectionOutput other = (MultipleInstanceCollectionOutput) o; return (null != value) ? value.equals(other.value) : null == other.value; } return false; }

Target:
public boolean equals(Object o) { if (o instanceof MultipleInstanceCollectionOutput) { MultipleInstanceCollectionOutput other = (MultipleInstanceCollectionOutput) o; return Objects.equals(value, other.value); } return false; }
Source:
public static void notifyCurrentUser(String instructorName, String instructorEmail, String inviteEmail){ String to = instructorEmail; String from = contactEmail; String subjectLine = "Friend Accounts Integration Email"; String host = "deluxe.dsc.umich.edu"; System.out.println("Setting up props"); Properties properties = System.getProperties(); properties.put("mail.smtp.auth", "false"); properties.put("mail.smtp.starttls.enable", "true"); properties.put("mail.smtp.host", host); properties.put("mail.debug", "true"); System.out.println("Initiating Session"); Session session = Session.getInstance(properties); try{ emailMessage = Friend.readFile(requesterEmailFile, StandardCharsets.UTF_8); emailMessage = emailMessage.replace("<instructor>", instructorName); emailMessage = emailMessage.replace("<friend>", inviteEmail); System.out.println("Setting up message"); MimeMessage message = new MimeMessage(session); message.setFrom(new InternetAddress(from)); message.addRecipient(Message.RecipientType.TO, new InternetAddress(to)); message.setSubject(subjectLine); message.setText(emailMessage); System.out.println("Sending message"); Transport.send(message); System.out.println("Message sent to " + instructorName); }catch (Exception e){ System.out.println("quasiNotifyCurrentUser exception:"); e.printStackTrace(); } }

Target:
public static void notifyCurrentUser(String instructorName, String instructorEmail, String inviteEmail){ M_log.debug("Friend notifyCurrentUser() called"); String to = instructorEmail; String from = contactEmail; String host = mailHost; M_log.info("Setting up mailProps"); Properties properties = System.getProperties(); properties.put(MAIL_SMTP_AUTH, "false"); properties.put(MAIL_SMTP_STARTTLS, "true"); properties.put(MAIL_SMTP_HOST, host); properties.put(MAIL_DEBUG, "true"); M_log.debug("Initiating Session for sendMail"); Session session = Session.getInstance(properties); try{ HashMap<String, String> map = new HashMap<String,String>(); map.put("<instructor>", instructorName); map.put("<friend>", inviteEmail); emailMessage = Friend.readFile(requesterEmailFile, StandardCharsets.UTF_8); emailMessage = replacePlaceHolders(emailMessage, map); M_log.debug("Setting up message for sendMail"); MimeMessage message = new MimeMessage(session); message.setFrom(new InternetAddress(from)); message.addRecipient(Message.RecipientType.TO, new InternetAddress(to)); message.setSubject(subjectLine); message.setText(emailMessage); M_log.info("Sending message"); Transport.send(message); M_log.info("Message sent to " + instructorName); }catch (Exception e){ M_log.error("notifyCurrentUser exception: " + e.getMessage()); } }
Source:
private void loadBatch(Long[] ids) { Twitter client = getTwitterClient(); int keepTrying = 0; while (keepTrying < 1) { try { long[] toQuery = new long[ids.length]; for(int i = 0; i < ids.length; i++) toQuery[i] = ids[i]; for (User tStat : client.lookupUsers(toQuery)) { String json = DataObjectFactory.getRawJSON(tStat); providerQueue.offer(new StreamsDatum(json)); } keepTrying = 10; } catch(TwitterException twitterException) { keepTrying += TwitterErrorHandler.handleTwitterError(client, twitterException); } catch(Exception e) { keepTrying += TwitterErrorHandler.handleTwitterError(client, e); } } }

Target:
private void loadBatch(Long[] ids) { Twitter client = getTwitterClient(); int keepTrying = 0; while (keepTrying < 1) { try { long[] toQuery = new long[ids.length]; for(int i = 0; i < ids.length; i++) toQuery[i] = ids[i]; for (User tStat : client.lookupUsers(toQuery)) { String json = DataObjectFactory.getRawJSON(tStat); ComponentUtils.offerUntilSuccess(new StreamsDatum(json), providerQueue); } keepTrying = 10; } catch(TwitterException twitterException) { keepTrying += TwitterErrorHandler.handleTwitterError(client, twitterException); } catch(Exception e) { keepTrying += TwitterErrorHandler.handleTwitterError(client, e); } } }
Source:
public void unselectsSelection() throws Exception { bot.radio("SWT.MULTI").click(); bot.checkBox("Listen").select(); bot.button("Clear").click(); table = bot.tableInGroup("Table"); table.select(new int[] { 1, 2, 3 }); SWTBotText text = bot.textInGroup("Listeners"); bot.button("Clear").click(); table.unselect(); assertEquals(0, table.selectionCount()); assertEventMatches(text, "MouseDown [3]: MouseEvent{Table time=-550222259 data=null button=1 stateMask=0x40000 x=0 y=0 count=1}"); assertEventMatches(text, "Selection [13]: SelectionEvent{Table time=-550222256 data=null item=TableItem {Index:1} detail=0 x=0 y=0 width=0 height=0 stateMask=0xc0000 text=null doit=true}"); assertEventMatches(text, "MouseUp [4]: MouseEvent{Table time=-550222255 data=null button=1 stateMask=0xc0000 x=0 y=0 count=1}"); assertEventMatches(text, "Selection [13]: SelectionEvent{Table time=-550222256 data=null item=TableItem {Index:2} detail=0 x=0 y=0 width=0 height=0 stateMask=0xc0000 text=null doit=true}"); assertEventMatches(text, "Selection [13]: SelectionEvent{Table time=-550222256 data=null item=TableItem {Index:3} detail=0 x=0 y=0 width=0 height=0 stateMask=0xc0000 text=null doit=true}"); table.select(new int[] { 1, 2, 3 }); assertEquals(3, table.selectionCount()); table.select(new int[] {}); assertEquals(0, table.selectionCount()); }

Target:
public void unselectsSelection() throws Exception { bot.radio("SWT.MULTI").click(); bot.checkBox("Listen").select(); bot.button("Clear").click(); table = bot.tableInGroup("Table"); table.select(new int[] { 1, 2, 3 }); SWTBotText text = bot.textInGroup("Listeners"); bot.button("Clear").click(); table.unselect(); assertEquals(0, table.selectionCount()); assertEventMatches(text, "MouseDown [3]: MouseEvent{Table time=0 data=null button=1 stateMask=0x40000 x=0 y=0 count=1}"); assertEventMatches(text, "Selection [13]: SelectionEvent{Table time=0 data=null item=TableItem {Index:1} detail=0 x=0 y=0 width=0 height=0 stateMask=0xc0000 text=null doit=true}"); assertEventMatches(text, "MouseUp [4]: MouseEvent{Table time=0 data=null button=1 stateMask=0xc0000 x=0 y=0 count=1}"); assertEventMatches(text, "Selection [13]: SelectionEvent{Table time=0 data=null item=TableItem {Index:2} detail=0 x=0 y=0 width=0 height=0 stateMask=0xc0000 text=null doit=true}"); assertEventMatches(text, "Selection [13]: SelectionEvent{Table time=0 data=null item=TableItem {Index:3} detail=0 x=0 y=0 width=0 height=0 stateMask=0xc0000 text=null doit=true}"); }
Source:
public void testBug331795_1() { MApplication application = ems.createModelElement(MApplication.class); MWindow window = ems.createModelElement(MWindow.class); application.getChildren().add(window); application.setSelectedElement(window); MPart part = ems.createModelElement(MPart.class); part.setContributionURI("bundleclass://org.eclipse.e4.ui.tests/org.eclipse.e4.ui.tests.workbench.SampleView"); window.getChildren().add(part); window.setSelectedElement(part); application.setContext(appContext); appContext.set(MApplication.class, application); wb = new E4Workbench(application, appContext); wb.createAndRunUI(window); assertNotNull(part.getObject()); assertNotNull(part.getContext()); addRuntimeExceptionHandler(); SampleView view = (SampleView) part.getObject(); view.errorOnWidgetDisposal = true; part.setToBeRendered(false); assertTrue("The view should have been destroyed", view.isDestroyed()); assertNull(part.getObject()); assertNull(part.getContext()); resetRuntimeExceptionHandler(); }

Target:
public void testBug331795_1() { MApplication application = ems.createModelElement(MApplication.class); MWindow window = ems.createModelElement(MWindow.class); application.getChildren().add(window); application.setSelectedElement(window); MPart part = ems.createModelElement(MPart.class); part.setContributionURI("bundleclass://org.eclipse.e4.ui.tests/org.eclipse.e4.ui.tests.workbench.SampleView"); window.getChildren().add(part); window.setSelectedElement(part); application.setContext(appContext); appContext.set(MApplication.class, application); wb = new E4Workbench(application, appContext); wb.createAndRunUI(window); assertNotNull(part.getObject()); assertNotNull(part.getContext()); addRuntimeExceptionHandler(); SampleView view = (SampleView) part.getObject(); view.errorOnWidgetDisposal = true; part.setToBeRendered(false); assertTrue("The view should have been destroyed", view.isDestroyed()); assertNull(part.getObject()); assertNull(part.getContext()); }
Source:
public List<EmailWrapper> generateFeedbackSessionOpeningEmails(FeedbackSessionAttributes session) { String template = EmailTemplates.USER_FEEDBACK_SESSION; CourseAttributes course = coursesLogic.getCourse(session.getCourseId()); boolean isEmailNeeded = fsLogic.isFeedbackSessionForStudentsToAnswer(session); List<InstructorAttributes> instructors = isEmailNeeded ? instructorsLogic.getInstructorsForCourse(session.getCourseId()) : new ArrayList<InstructorAttributes>(); List<StudentAttributes> students = isEmailNeeded ? studentsLogic.getStudentsForCourse(session.getCourseId()) : new ArrayList<StudentAttributes>(); String templateWithSupportFragment = template.replace("${supportFragment}", EmailTemplates.DEFAULT_FRAGMENT_FEEDBACK_SESSION_SUPPORT); List<EmailWrapper> emails = generateFeedbackSessionEmailBases(course, session, students, instructors, templateWithSupportFragment, EmailType.FEEDBACK_OPENING.getSubject()); for (EmailWrapper email : emails) { email.setContent(email.getContent().replace("${status}", "is now open")); } return emails; }

Target:
public List<EmailWrapper> generateFeedbackSessionOpeningEmails(FeedbackSessionAttributes session) { String template = EmailTemplates.USER_FEEDBACK_SESSION; CourseAttributes course = coursesLogic.getCourse(session.getCourseId()); boolean isEmailNeeded = fsLogic.isFeedbackSessionForStudentsToAnswer(session); List<InstructorAttributes> instructors = isEmailNeeded ? instructorsLogic.getInstructorsForCourse(session.getCourseId()) : new ArrayList<InstructorAttributes>(); List<StudentAttributes> students = isEmailNeeded ? studentsLogic.getStudentsForCourse(session.getCourseId()) : new ArrayList<StudentAttributes>(); List<EmailWrapper> emails = generateFeedbackSessionEmailBases(course, session, students, instructors, template, EmailType.FEEDBACK_OPENING.getSubject()); for (EmailWrapper email : emails) { email.setContent(email.getContent().replace("${status}", FEEDBACK_STATUS_SESSION_OPENING)); } return emails; }
Source:
private int findInsertPosition(KeyValuePairModell keyValuePair) { ArrayList<String> keys= new ArrayList<>(); for (KeyValuePairModell fKeyValuePair : fKeyValuePairs) { KeyValuePairModell element = fKeyValuePair; if (! (element instanceof LastKeyValuePair)) keys.add(element.getKey()); } int insertIndex= NLSUtil.getInsertionPosition(keyValuePair.getKey(), keys); if (insertIndex < fKeyValuePairs.size() - 1) { insertIndex++; } return insertIndex; }

Target:
private int findInsertPosition(KeyValuePairModell keyValuePair) { ArrayList<String> keys= new ArrayList<>(); for (KeyValuePairModell keyValuePairmodel : fKeyValuePairs) { KeyValuePairModell element = keyValuePairmodel; if (! (element instanceof LastKeyValuePair)) keys.add(element.getKey()); } int insertIndex= NLSUtil.getInsertionPosition(keyValuePair.getKey(), keys); if (insertIndex < fKeyValuePairs.size() - 1) { insertIndex++; } return insertIndex; }
Source:
public boolean isValid (ZestResponse response) { if(rootExpression==null) return true; return rootExpression.evaluate(response); }

Target:
public boolean isValid (ZestResponse response) { if(rootExpression==null){ return false; } return rootExpression.evaluate(response); }
Source:
protected void onInit() throws Exception { super.onInit(); BeanFactory beanFactory = this.getBeanFactory(); if (beanFactory != null) { getMessagingTemplate().setBeanFactory(beanFactory); Assert.state(!(this.discardChannelName != null && this.discardChannel != null), "'discardChannelName' and 'discardChannel' are mutually exclusive."); Assert.state(!(getOutputChannelName() != null && getOutputChannel() != null), "'outputChannelName' and 'outputChannel' are mutually exclusive."); if (this.outputProcessor instanceof BeanFactoryAware) { ((BeanFactoryAware) this.outputProcessor).setBeanFactory(beanFactory); } if (this.correlationStrategy instanceof BeanFactoryAware) { ((BeanFactoryAware) this.correlationStrategy).setBeanFactory(beanFactory); } if (this.releaseStrategy instanceof BeanFactoryAware) { ((BeanFactoryAware) this.releaseStrategy).setBeanFactory(beanFactory); } } if (this.discardChannel == null) { this.discardChannel = new NullChannel(); } if (this.releasePartialSequences) { Assert.isInstanceOf(SequenceSizeReleaseStrategy.class, this.releaseStrategy, "Release strategy of type [" + this.releaseStrategy.getClass().getSimpleName() + "] cannot release partial sequences. Use the default SequenceSizeReleaseStrategy instead."); ((SequenceSizeReleaseStrategy)this.releaseStrategy).setReleasePartialSequences(releasePartialSequences); } this.lockRegistrySet = true; }

Target:
protected void onInit() throws Exception { super.onInit(); BeanFactory beanFactory = this.getBeanFactory(); if (beanFactory != null) { this.messagingTemplate.setBeanFactory(beanFactory); Assert.state(!(this.discardChannelName != null && this.discardChannel != null), "'discardChannelName' and 'discardChannel' are mutually exclusive."); Assert.state(!(getOutputChannelName() != null && getOutputChannel() != null), "'outputChannelName' and 'outputChannel' are mutually exclusive."); if (this.outputProcessor instanceof BeanFactoryAware) { ((BeanFactoryAware) this.outputProcessor).setBeanFactory(beanFactory); } if (this.correlationStrategy instanceof BeanFactoryAware) { ((BeanFactoryAware) this.correlationStrategy).setBeanFactory(beanFactory); } if (this.releaseStrategy instanceof BeanFactoryAware) { ((BeanFactoryAware) this.releaseStrategy).setBeanFactory(beanFactory); } } if (this.discardChannel == null) { this.discardChannel = new NullChannel(); } if (this.releasePartialSequences) { Assert.isInstanceOf(SequenceSizeReleaseStrategy.class, this.releaseStrategy, "Release strategy of type [" + this.releaseStrategy.getClass().getSimpleName() + "] cannot release partial sequences. Use the default SequenceSizeReleaseStrategy instead."); ((SequenceSizeReleaseStrategy)this.releaseStrategy).setReleasePartialSequences(releasePartialSequences); } this.lockRegistrySet = true; }
Source:
private void initOptionsList(FileReportSettings settings) { if (settings != null && settings.getFileProperties() != null && !settings.getFileProperties().isEmpty()) { for (Entry<FileReportDataTypes, Boolean> entry : settings.getFileProperties().entrySet()) { optionStates.put(entry.getKey(), entry.getValue()); options.add(entry.getKey()); } } else { options = Arrays.asList(FileReportDataTypes.values()); for (FileReportDataTypes entry : options) { optionStates.put(entry, Boolean.TRUE); } } model = new OptionsListModel(); optionsList.setModel(model); optionsList.setCellRenderer(new OptionsListRenderer()); optionsList.setVisibleRowCount(-1); selectAllButton.setEnabled(false); deselectAllButton.setEnabled(true); wizPanel.setFinish(true); optionsList.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent evt) { int index = optionsList.locationToIndex(evt.getPoint()); FileReportDataTypes value = model.getElementAt(index); optionStates.put(value, !optionStates.get(value)); optionsList.repaint(); boolean anySelected = anySelected(); deselectAllButton.setEnabled(anySelected); wizPanel.setFinish(anySelected); selectAllButton.setEnabled(notAllSelected()); } }); }

Target:
private void initOptionsList(FileReportSettings settings) { if (settings != null && settings.getFileProperties() != null && !settings.getFileProperties().isEmpty()) { for (Entry<FileReportDataTypes, Boolean> entry : settings.getFileProperties().entrySet()) { optionStates.put(entry.getKey(), entry.getValue()); options.add(entry.getKey()); } } else { options = Arrays.asList(FileReportDataTypes.values()); for (FileReportDataTypes entry : options) { optionStates.put(entry, Boolean.TRUE); } } model = new OptionsListModel(); optionsList.setModel(model); optionsList.setCellRenderer(new OptionsListRenderer()); optionsList.setVisibleRowCount(-1); selectAllButton.setEnabled(notAllSelected()); deselectAllButton.setEnabled(anySelected()); wizPanel.setFinish(anySelected()); optionsList.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent evt) { int index = optionsList.locationToIndex(evt.getPoint()); FileReportDataTypes value = model.getElementAt(index); optionStates.put(value, !optionStates.get(value)); optionsList.repaint(); boolean anySelected = anySelected(); deselectAllButton.setEnabled(anySelected); wizPanel.setFinish(anySelected); selectAllButton.setEnabled(notAllSelected()); } }); }
Source:
private static FilteredDropEditPolicy filter(EditPolicy delegate) { BiPredicate<EObject, EditPart> baseFilter = FilteredDropEditPolicy::hasView; BiPredicate<EObject, EditPart> invalidPortOnPart = RTCapsuleStructureDiagramDragDropEditPolicy::isInvalidPortOnCapsulePart; BiPredicate<EObject, EditPart> invalidPortOnCapsule = RTCapsuleStructureDiagramDragDropEditPolicy::isInvalidPortOnCapsule; return new FilteredDropEditPolicy(delegate, (baseFilter.or(invalidPortOnPart)).or(invalidPortOnCapsule)); }

Target:
private static FilteredDropEditPolicy filter(EditPolicy delegate) { BiPredicate<EObject, EditPart> baseFilter = FilteredDropEditPolicy::hasView; BiPredicate<EObject, EditPart> invalidPortOnPart = RTCapsuleStructureDiagramDragDropEditPolicy::isInvalidPortOnCapsulePart; BiPredicate<EObject, EditPart> invalidTypeOnCapsule = RTCapsuleStructureDiagramDragDropEditPolicy::isInvalidTypeOnCapsule; BiPredicate<EObject, EditPart> invalidPortOnCapsule = RTCapsuleStructureDiagramDragDropEditPolicy::isInvalidPortOnCapsule; return new FilteredDropEditPolicy(delegate, baseFilter.or(invalidPortOnPart).or(invalidTypeOnCapsule).or(invalidPortOnCapsule)); }
Source:
public static <T> List<T> convertMultiValue(Pattern separatorPattern, Function<Object, T> elementConverter, Object value) { if ( value instanceof Collection ) { return ( (Collection<?>) value ).stream() .map( ConvertUtils::trimIfString ) .filter( Objects::nonNull ) .map( elementConverter ) .collect( Collectors.toList() ); } else if ( value instanceof String ) { return separatorPattern.splitAsStream( (CharSequence) value ) .map( ConvertUtils::trimIfString ) .filter( Objects::nonNull ) .map( elementConverter ) .collect( Collectors.toList() ); } else { throw log.invalidMultiPropertyValue(); } }

Target:
public static <T> List<T> convertMultiValue(Pattern separatorPattern, Function<Object, T> elementConverter, Object value) { if ( value instanceof Collection ) { return ( (Collection<?>) value ).stream() .map( ConvertUtils::trimIfString ) .filter( Objects::nonNull ) .map( elementConverter ) .collect( Collectors.toList() ); } else if ( value instanceof String ) { return separatorPattern.splitAsStream( (String) value ) .map( ConvertUtils::trimIfString ) .filter( Objects::nonNull ) .map( elementConverter ) .collect( Collectors.toList() ); } else { throw log.invalidMultiPropertyValue(); } }
Source:
public String originalToString() { StringBuilder sb = new StringBuilder(); Iterator it = edges.entrySet() .iterator(); while (it.hasNext()) { Map.Entry pair = (Map.Entry) it.next(); if (!((Edge) pair.getValue()).isPrinted()) { sb.append(getLabel()); sb.append(" --- "); sb.append(((Edge) pair.getValue()).getWeight()); sb.append(" --- "); sb.append(((Vertex) pair.getKey()).getLabel()); sb.append("\n"); ((Edge) pair.getValue()).setPrinted(true); } } return sb.toString(); }

Target:
public String originalToString(){ StringBuilder sb = new StringBuilder(); Iterator<Map.Entry<Vertex,Edge>> it = edges.entrySet().iterator(); while (it.hasNext()) { Map.Entry<Vertex,Edge> pair = it.next(); if (!pair.getValue().isPrinted()) { sb.append(getLabel()); sb.append(" --- "); sb.append(pair.getValue().getWeight()); sb.append(" --- "); sb.append(pair.getKey().getLabel()); sb.append("\n"); pair.getValue().setPrinted(true); } } return sb.toString(); }
Source:
public void handle(@Nonnull CorfuPayloadMsg<OrchestratorMsg> msg, @Nonnull ChannelHandlerContext ctx, @Nonnull IServerRouter r) { OrchestratorMsg orchReq = msg.getPayload(); IWorkflow workflow; switch (orchReq.getRequest().getType()) { case QUERY: query(msg, ctx, r); break; case ADD_NODE: workflow = new AddNodeWorkflow((AddNodeRequest) orchReq.getRequest(), streamLog); dispatch(workflow, msg, ctx, r); break; case REMOVE_NODE: workflow = new RemoveNodeWorkflow((RemoveNodeRequest) orchReq.getRequest()); dispatch(workflow, msg, ctx, r); break; case HEAL_NODE: workflow = new HealNodeWorkflow((HealNodeRequest) orchReq.getRequest(), streamLog); dispatch(workflow, msg, ctx, r); break; case FORCE_REMOVE_NODE: workflow = new ForceRemoveWorkflow((ForceRemoveNodeRequest) orchReq.getRequest()); dispatch(workflow, msg, ctx, r); break; case RESTORE_REDUNDANCY_MERGE_SEGMENTS: workflow = new RestoreRedundancyMergeSegmentsWorkflow( (RestoreRedundancyMergeSegmentsRequest) orchReq.getRequest(), streamLog); dispatch(workflow, msg, ctx, r); break; default: log.error("handle: Unknown request type {}", orchReq.getRequest().getType()); } }

Target:
public void handle(@Nonnull CorfuPayloadMsg<OrchestratorMsg> msg, @Nonnull ChannelHandlerContext ctx, @Nonnull IServerRouter r) { OrchestratorMsg orchReq = msg.getPayload(); IWorkflow workflow; switch (orchReq.getRequest().getType()) { case QUERY: query(msg, ctx, r); break; case ADD_NODE: workflow = new AddNodeWorkflow((AddNodeRequest) orchReq.getRequest()); dispatch(workflow, msg, ctx, r); break; case REMOVE_NODE: workflow = new RemoveNodeWorkflow((RemoveNodeRequest) orchReq.getRequest()); dispatch(workflow, msg, ctx, r); break; case HEAL_NODE: workflow = new HealNodeWorkflow((HealNodeRequest) orchReq.getRequest()); dispatch(workflow, msg, ctx, r); break; case FORCE_REMOVE_NODE: workflow = new ForceRemoveWorkflow((ForceRemoveNodeRequest) orchReq.getRequest()); dispatch(workflow, msg, ctx, r); break; case RESTORE_REDUNDANCY_MERGE_SEGMENTS: workflow = new RestoreRedundancyMergeSegmentsWorkflow( (RestoreRedundancyMergeSegmentsRequest) orchReq.getRequest()); dispatch(workflow, msg, ctx, r); break; default: log.error("handle: Unknown request type {}", orchReq.getRequest().getType()); } }
Source:
public boolean isValidInput() { boolean isValidInput = super.isValidInput(); if(isValidInput){ if(!InputValidationUtil.isValidEmail(getCurrentValue().getAsString())){ handleError(getView().getResources().getString(R.string.error_invalid_email)); return false; } } return true; }

Target:
public boolean isValidInput() { boolean isValidInput = super.isValidInput(); if(isValidInput){ if(!InputValidationUtil.isValidEmail(getCurrentValue().getAsString())){ handleError(getView().getResources().getString(R.string.error_invalid_email)); isValidInput = false; } } return isValidInput; }
Source:
public void copy(RenderableElement other) { this.texture = other.texture; this.drawableLevel = other.drawableLevel; this.relativePosition = other.relativePosition.cpy(); this.relativeAngle = other.relativeAngle; this.width = other.width; this.height = other.height; this.tint = other.tint; }

Target:
public void copy(RenderableElement other) { this.texture = new TextureAtlas.AtlasRegion(other.texture); this.drawableLevel = other.drawableLevel; this.relativePosition = other.relativePosition.cpy(); this.relativeAngle = other.relativeAngle; this.width = other.width; this.height = other.height; this.tint = other.tint.cpy(); }
Source:
private void reloadOnce() throws IOException { Map<String, ReftableReader> current = stack.stream() .collect(Collectors.toMap(e -> e.name, e -> e.reftableReader)); stack.clear(); ReftableReader last = null; try (BufferedReader br = new BufferedReader( new InputStreamReader(new FileInputStream(stackPath), UTF_8))) { String line; while ((line = br.readLine()) != null) { StackEntry entry = new StackEntry(); entry.name = line; if (current.containsKey(line)) { entry.reftableReader = current.remove(line); } else { File subtable = new File(reftableDir, line); FileInputStream is; try { is = new FileInputStream(subtable); } catch (FileNotFoundException e) { throw new RetryException(); } entry.reftableReader = new ReftableReader( BlockSource.from(is)); } if (last != null) { if (last.maxUpdateIndex() >= entry.reftableReader .minUpdateIndex()) { throw new IllegalStateException(String.format( "index numbers not increasing %s: min %d, last max %d", line, entry.reftableReader.minUpdateIndex(), last.maxUpdateIndex())); } } last = entry.reftableReader; stack.add(entry); } } catch (FileNotFoundException e) { } catch (Exception e) { close(); throw e; } finally { current.values().forEach(r -> { try { r.close(); } catch (IOException e) { } }); } }

Target:
private void reloadOnce() throws IOException { Map<String, ReftableReader> current = stack.stream() .collect(Collectors.toMap(e -> e.name, e -> e.reftableReader)); stack.clear(); ReftableReader last = null; try (BufferedReader br = new BufferedReader( new InputStreamReader(new FileInputStream(stackPath), UTF_8))) { String line; while ((line = br.readLine()) != null) { StackEntry entry = new StackEntry(); entry.name = line; if (current.containsKey(line)) { entry.reftableReader = current.remove(line); } else { File subtable = new File(reftableDir, line); FileInputStream is; try { is = new FileInputStream(subtable); } catch (FileNotFoundException e) { throw new RetryException(); } entry.reftableReader = new ReftableReader( BlockSource.from(is)); } if (last != null) { if (last.maxUpdateIndex() >= entry.reftableReader .minUpdateIndex()) { throw new IllegalStateException(MessageFormat.format( JGitText.get().indexNumbersNotIncreasing, line, Long.valueOf( entry.reftableReader.minUpdateIndex()), Long.valueOf(last.maxUpdateIndex()))); } } last = entry.reftableReader; stack.add(entry); } } catch (FileNotFoundException e) { } catch (Exception e) { close(); throw e; } finally { current.values().forEach(r -> { try { r.close(); } catch (IOException e) { LOG.error(e.getMessage(), e); } }); } }
Source:
public StoneColumnFamily(BlockFamilyDefinition definition, BlockBuilderHelper blockBuilder) { super(definition, blockBuilder); blocks = new TByteObjectHashMap<Block>(); blockUri = new BlockUri(definition.getUrn()); registerBlock(blockUri, definition, blockBuilder,"standby", (byte) 0 , Collections.singleton(Rotation.none())); registerBlock(blockUri, definition, blockBuilder,"bottom", SideBitFlag.getSide(Side.TOP) , Collections.singleton(Rotation.none())); registerBlock(blockUri, definition, blockBuilder,"top", SideBitFlag.getSide(Side.BOTTOM) , Collections.singleton(Rotation.none())); registerBlock(blockUri, definition, blockBuilder,"middle", SideBitFlag.getSides(Side.TOP, Side.BOTTOM) , Collections.singleton(Rotation.none())); this.setCategory(definition.getCategories()); }

Target:
public StoneColumnFamily(BlockFamilyDefinition definition, BlockBuilderHelper blockBuilder) { super(definition, blockBuilder); BlockUri blockUri; blocks = new TByteObjectHashMap<Block>(); blockUri = new BlockUri(definition.getUrn()); registerBlock(blockUri, definition, blockBuilder,"standby", (byte) 0 , Collections.singleton(Rotation.none())); registerBlock(blockUri, definition, blockBuilder,"bottom", SideBitFlag.getSide(Side.TOP) , Collections.singleton(Rotation.none())); registerBlock(blockUri, definition, blockBuilder,"top", SideBitFlag.getSide(Side.BOTTOM) , Collections.singleton(Rotation.none())); registerBlock(blockUri, definition, blockBuilder,"middle", getSides(Side.TOP, Side.BOTTOM) , Collections.singleton(Rotation.none())); this.setCategory(definition.getCategories()); }
Source:
public void setup() { metadata = getQueryRunner().getMetadata(); builder = new PlanBuilder(new PlanNodeIdAllocator(), metadata); ConnectorId connectorId = getCurrentConnectorId(); TableHandle nationTableHandle = new TableHandle( connectorId, new TpchTableHandle("nation", 1.0), TestingTransactionHandle.create(), Optional.of(TestingHandle.INSTANCE)); TableLayoutHandle nationTableLayoutHandle = new TableLayoutHandle(connectorId, TestingTransactionHandle.create(), new TpchTableLayoutHandle((TpchTableHandle) nationTableHandle.getConnectorHandle(), TupleDomain.all())); TpchColumnHandle nationkeyColumnHandle = new TpchColumnHandle("nationkey", BIGINT); symbol = new Symbol("nationkey"); tableScanNode = builder.tableScan(nationTableHandle, ImmutableList.of(symbol), ImmutableMap.of(symbol, nationkeyColumnHandle), Optional.of(nationTableLayoutHandle)); }

Target:
public void setup() { metadata = getQueryRunner().getMetadata(); builder = new PlanBuilder(new PlanNodeIdAllocator(), metadata); ConnectorId connectorId = getCurrentConnectorId(); TpchTableHandle nationTpchTableHandle = new TpchTableHandle("nation", 1.0); TableHandle nationTableHandle = new TableHandle( connectorId, nationTpchTableHandle, TestingTransactionHandle.create(), Optional.of(new TpchTableLayoutHandle(nationTpchTableHandle, TupleDomain.all()))); TpchColumnHandle nationkeyColumnHandle = new TpchColumnHandle("nationkey", BIGINT); symbol = new Symbol("nationkey"); tableScanNode = builder.tableScan(nationTableHandle, ImmutableList.of(symbol), ImmutableMap.of(symbol, nationkeyColumnHandle)); }
Source:
public static ActivitiMessageEvent createMessageEvent(ActivitiEventType type, DelegateExecution execution, String messageName, String correlationKey, Object payload) { ActivitiMessageEventImpl newEvent = new ActivitiMessageEventImpl(type); newEvent.setMessageName(messageName); newEvent.setMessageCorrelationKey(correlationKey); newEvent.setMessageData(payload); if (execution != null) { newEvent.setActivityId(execution.getCurrentActivityId()); newEvent.setExecutionId(execution.getId()); newEvent.setProcessDefinitionId(execution.getProcessDefinitionId()); newEvent.setProcessInstanceId(execution.getProcessInstanceId()); newEvent.setMessageBusinessKey(execution.getProcessInstanceBusinessKey()); if (execution.getCurrentFlowElement() instanceof FlowNode) { FlowNode flowNode = (FlowNode) execution.getCurrentFlowElement(); newEvent.setActivityType(parseActivityType(flowNode)); newEvent.setBehaviorClass(parseActivityBehavior(flowNode)); newEvent.setActivityName(flowNode.getName()); } } return newEvent; }

Target:
private static ActivitiMessageEvent createMessageEvent(ActivitiEventType type, DelegateExecution execution, String messageName, String correlationKey, Object payload) { ActivitiMessageEventImpl newEvent = new ActivitiMessageEventImpl(type); newEvent.setMessageName(messageName); newEvent.setMessageCorrelationKey(correlationKey); newEvent.setMessageData(payload); if (execution != null) { newEvent.setActivityId(execution.getCurrentActivityId()); newEvent.setExecutionId(execution.getId()); newEvent.setProcessDefinitionId(execution.getProcessDefinitionId()); newEvent.setProcessInstanceId(execution.getProcessInstanceId()); newEvent.setMessageBusinessKey(execution.getProcessInstanceBusinessKey()); if (execution.getCurrentFlowElement() instanceof FlowNode) { FlowNode flowNode = (FlowNode) execution.getCurrentFlowElement(); newEvent.setActivityType(parseActivityType(flowNode)); newEvent.setBehaviorClass(parseActivityBehavior(flowNode)); newEvent.setActivityName(flowNode.getName()); } } return newEvent; }
Source:
public void addText(String text) { if (text == null) { return; } List<String> paragraphs = Arrays.asList(text.split("\\r?\\n", -1)); for (String paragraph : paragraphs) { String remainder = paragraph; while (remainder != null && !remainder.isEmpty()) { String[] split = remainder.split(" ", 2); String word = split[0]; if (split.length > 1) { remainder = split[1]; } else { remainder = null; } addWord(word); } if (remainder != null) { addWord(remainder); } endLine(); } }

Target:
public void addText(String text) { List<String> paragraphs = Arrays.asList(text.split("\\r?\\n", -1)); for (String paragraph : paragraphs) { String remainder = paragraph; while (remainder != null && !remainder.isEmpty()) { String[] split = remainder.split(" ", 2); String word = split[0]; if (split.length > 1) { remainder = split[1]; } else { remainder = null; } addWord(word); } if (remainder != null) { addWord(remainder); } endLine(); } }
Source:
protected void registerMockEntryForRead(long ledgerId, long entryId, BookieSocketAddress bookieSocketAddress, byte[] entryData, long lastAddConfirmed) throws BKException{ if (failedBookies.contains(bookieSocketAddress)) { throw BKException.create(NoBookieAvailableException); } getMockLedgerContentsInBookie(ledgerId, bookieSocketAddress).put(entryId, new MockEntry(entryData, lastAddConfirmed)); }

Target:
protected void registerMockEntryForRead(long ledgerId, long entryId, BookieSocketAddress bookieSocketAddress, byte[] entryData, long lastAddConfirmed) { getMockLedgerContentsInBookie(ledgerId, bookieSocketAddress).put(entryId, new MockEntry(entryData, lastAddConfirmed)); }
Source:
public List<VmNumaNode> getVmNumaNodes(VM vm) { int numOfVmCpus = vm.getNumOfCpus(); int vcpus = FeatureSupported.supportedInConfig(ConfigValues.HotPlugCpuSupported, vm.getCompatibilityVersion(), vm.getClusterArch()) ? VmCpuCountHelper.calcMaxVCpu(vm, vm.getClusterCompatibilityVersion()) : numOfVmCpus; List<VmNumaNode> vmNumaNodes = vmNumaNodeDao.getAllVmNumaNodeByVmId(vm.getId()); if (!vmNumaNodes.isEmpty()) { if (vcpus != numOfVmCpus) { int numaCount = vmNumaNodes.size(); int index = -1; for (VmNumaNode vmNode : vmNumaNodes) { for (Integer cpuId : vmNode.getCpuIds()) { if (index < cpuId) { index = cpuId; } } } for (VmNumaNode vmNode : vmNumaNodes) { if (numaCount <= 0) { break; } for (int i = vmNode.getCpuIds().size(); i < vcpus / numaCount; i++) { vmNode.getCpuIds().add(++index); } vcpus -= vcpus / numaCount; --numaCount; } } return vmNumaNodes; } if (FeatureSupported.hotPlugMemory(vm.getCompatibilityVersion(), vm.getClusterArch())) { VmNumaNode vmNode = new VmNumaNode(); vmNode.setIndex(0); vmNode.setMemTotal(vm.getMemSizeMb()); for (int i = 0; i < vcpus; i++) { vmNode.getCpuIds().add(i); } return Collections.singletonList(vmNode); } return Collections.emptyList(); }

Target:
public List<VmNumaNode> getVmNumaNodes(VM vm) { int numOfVmCpus = vm.getNumOfCpus(); int vcpus = FeatureSupported.supportedInConfig(ConfigValues.HotPlugCpuSupported, vm.getCompatibilityVersion(), vm.getClusterArch()) ? VmCpuCountHelper.calcMaxVCpu(vm, vm.getClusterCompatibilityVersion()) : numOfVmCpus; int offlineCpus = vcpus - numOfVmCpus; List<VmNumaNode> vmNumaNodes = vmNumaNodeDao.getAllVmNumaNodeByVmId(vm.getId()); if (!vmNumaNodes.isEmpty()) { if (offlineCpus > 0) { int numaCount = vmNumaNodes.size(); int index = numOfVmCpus; for (VmNumaNode vmNode : vmNumaNodes) { if (numaCount <= 0) { break; } for (int i = vmNode.getCpuIds().size(); i < vcpus / numaCount; i++) { vmNode.getCpuIds().add(index++); } vcpus -= vcpus / numaCount; --numaCount; } } return vmNumaNodes; } if (offlineCpus > 0) { VmNumaNode vmNode = new VmNumaNode(); vmNode.setIndex(0); vmNode.setMemTotal(vm.getMemSizeMb()); for (int i = 0; i < vcpus; i++) { vmNode.getCpuIds().add(i); } return Collections.singletonList(vmNode); } return Collections.emptyList(); }
Source:
private PreTransactionalOperation<TransactionContext, RefundEntity> prepareForRefund(PaymentProviders providers, ChargeEntity chargeEntity, RefundRequest refundRequest) { return context -> { ChargeEntity reloadedCharge = chargeDao.merge(chargeEntity); ExternalChargeRefundAvailability refundAvailability = providers.byName(chargeEntity.getPaymentGatewayName()).getExternalChargeRefundAvailability(chargeEntity); GatewayAccountEntity gatewayAccount = reloadedCharge.getGatewayAccount(); checkIfChargeIsRefundableOrTerminate(reloadedCharge, refundAvailability, gatewayAccount); long totalAmountToBeRefunded = reloadedCharge.getTotalAmountToBeRefunded(); checkIfRefundRequestIsInConflictOrTerminate(refundRequest, reloadedCharge, totalAmountToBeRefunded); checkIfRefundAmountWithinLimitOrTerminate(refundRequest, reloadedCharge, refundAvailability, gatewayAccount, totalAmountToBeRefunded); RefundEntity refundEntity = completePrepareRefund(refundRequest, reloadedCharge); logger.info("Card refund request sent - charge_external_id={}, status={}, amount={}, transaction_id={}, account_id={}, operation_type=Refund, amount_available_refund={}, amount_requested_refund={}, provider={}, provider_type={}, refundedBy={}", chargeEntity.getExternalId(), fromString(chargeEntity.getStatus()), chargeEntity.getAmount(), chargeEntity.getGatewayTransactionId(), gatewayAccount.getId(), totalAmountToBeRefunded, refundRequest.getAmount(), gatewayAccount.getGatewayName(), gatewayAccount.getType(), refundRequest.getRefundedBy()); return refundEntity; }; }

Target:
private PreTransactionalOperation<TransactionContext, RefundEntity> prepareForRefund(PaymentProviders providers, ChargeEntity chargeEntity, RefundRequest refundRequest) { return context -> { ChargeEntity reloadedCharge = chargeDao.merge(chargeEntity); ExternalChargeRefundAvailability refundAvailability = providers.byName(chargeEntity.getPaymentGatewayName()).getExternalChargeRefundAvailability(chargeEntity); GatewayAccountEntity gatewayAccount = reloadedCharge.getGatewayAccount(); checkIfChargeIsRefundableOrTerminate(reloadedCharge, refundAvailability, gatewayAccount); long totalAmountToBeRefunded = reloadedCharge.getTotalAmountToBeRefunded(); checkIfRefundRequestIsInConflictOrTerminate(refundRequest, reloadedCharge, totalAmountToBeRefunded); checkIfRefundAmountWithinLimitOrTerminate(refundRequest, reloadedCharge, refundAvailability, gatewayAccount, totalAmountToBeRefunded); RefundEntity refundEntity = completePrepareRefund(refundRequest, reloadedCharge); logger.info("Card refund request sent - charge_external_id={}, status={}, amount={}, transaction_id={}, account_id={}, operation_type=Refund, amount_available_refund={}, amount_requested_refund={}, provider={}, provider_type={}, user_external_id={}", chargeEntity.getExternalId(), fromString(chargeEntity.getStatus()), chargeEntity.getAmount(), chargeEntity.getGatewayTransactionId(), gatewayAccount.getId(), totalAmountToBeRefunded, refundRequest.getAmount(), gatewayAccount.getGatewayName(), gatewayAccount.getType(), refundRequest.getUserExternalId()); return refundEntity; }; }
Source:
public boolean matchesFilter(@Nullable FluidStack fluidStack) { if (fluidStack == null) { return filter == null || filter.get() == null; } if (filter != null) { return Conditions.check(filter.get(), fluidStack, Fluids::areEqual); } return true; }

Target:
public boolean matchesFilter(@Nullable FluidStack fluidStack) { if (fluidStack == null) return true; if (filter != null) { return Conditions.check(filter.get(), fluidStack, Fluids::areEqual); } return true; }
Source:
public void freeId( long id ) { if ( freeIdCondition.getAsBoolean() ) { idContainer.freeId( id ); } }

Target:
public synchronized void freeId( long id ) { idContainer.freeId( id ); }
Source:
public void loadLocale(final LOCALE locale) { Map<String, String> results = null; if (I18N_CUSTOM_DIR != null) { results = loadLocale(locale, FileUtils.listDir(I18N_CUSTOM_DIR)); } if (results == null || results.isEmpty()) { results = loadLocale(getStreams(locale)); } setLocale(locale, results); }

Target:
public void loadLocale(final LOCALE locale) { Map<String, String> results = loadLocale(getStreams(locale)); if (I18N_CUSTOM_DIR != null) { results.putAll(loadLocale(locale, FileUtils.listDir(I18N_CUSTOM_DIR))); } setLocale(locale, results); }
Source:
public String getServiceAddress() { return "<LINK_0>"; }

Target:
public String getServiceAddress() { return new CacheManager(null).ServiceAddress; }
Source:
public void onQueueClosed() { if (!queueVisible) return; animateView(queueLayout, SLIDE_AND_ALPHA, false, DEFAULT_CONTROLS_DURATION, 0, () -> { queueLayout.setTranslationY(-queueLayout.getHeight() * 5); }); queueVisible = false; }

Target:
public void onQueueClosed() { if (!queueVisible) { return; } animateView(queueLayout, SLIDE_AND_ALPHA, false, DEFAULT_CONTROLS_DURATION, 0, () -> { queueLayout.setTranslationY(-queueLayout.getHeight() * 5); }); queueVisible = false; playPauseButton.requestFocus(); }
Source:
public static Framework getFramework(Configuration jobConf) { if (jobConf.get(Constants.PIG_CONF_KEY) != null) { return Framework.PIG; } if ((jobConf.get(Constants.CASCADING_FLOW_ID_CONF_KEY) != null) && (jobConf.get(Constants.CASCADING_FLOW_ID_CONF_KEY).length() != 0)) { return Framework.SCALDING; } if ((jobConf.get(Constants.FRAMEWORK_CONF_KEY) != null) && (Constants.FRAMEWORK_CONF_SPARK_VALUE .equalsIgnoreCase(jobConf.get(Constants.FRAMEWORK_CONF_KEY)))) { return Framework.SPARK; } return Framework.NONE; }

Target:
public static Framework getFramework(Configuration jobConf) { if (jobConf.get(Constants.PIG_CONF_KEY) != null) { return Framework.PIG; } if ((jobConf.get(Constants.CASCADING_FLOW_ID_CONF_KEY) != null) && (jobConf.get(Constants.CASCADING_FLOW_ID_CONF_KEY).length() != 0)) { return Framework.SCALDING; } if (Constants.FRAMEWORK_CONF_SPARK_VALUE .equalsIgnoreCase(jobConf.get(Constants.FRAMEWORK_CONF_KEY))) { return Framework.SPARK; } return Framework.NONE; }
Source:
RealmAsyncTask logOutAsync(RealmUser user, Callback<RealmUser> callback) { checkLooperThread("Asynchronous log out is only possible from looper threads."); return new Request<RealmUser>(SyncManager.NETWORK_POOL_EXECUTOR, callback) { @Override public RealmUser run() throws ObjectServerError { RealmLog.error("Log out user"); logOut(user); return user; } }.start(); }

Target:
RealmAsyncTask logOutAsync(RealmUser user, Callback<RealmUser> callback) { checkLooperThread("Asynchronous log out is only possible from looper threads."); return new Request<RealmUser>(SyncManager.NETWORK_POOL_EXECUTOR, callback) { @Override public RealmUser run() throws ObjectServerError { logOut(user); return user; } }.start(); }
Source:
static UserDTO createInstance(User userEntity) { if (userEntity == null) { return null; } return new UserDTO(userEntity.getID(), userEntity.getFirstName(), userEntity.getLastName(), userEntity.getMobileNumber(), userEntity.isMobileNumberConfirmed()); }

Target:
static UserDTO createInstance(User userEntity) { if (userEntity == null) { throw new IllegalArgumentException("userEntity cannot be null"); } return new UserDTO(userEntity.getID(), userEntity.getFirstName(), userEntity.getLastName(), userEntity.getMobileNumber(), userEntity.isMobileNumberConfirmed()); }
Source:
public PingThread(Channel channel, long timeout, long interval) { this(channel, 4*60*1000 , interval, false); }

Target:
public PingThread(Channel channel, long timeout, long interval) { super("Ping thread for channel "+channel); this.channel = channel; this.timeout = timeout; this.interval = interval; setDaemon(true); }
Source:
protected void autonomousMain() throws AutonomousModeOverException, InterruptedException { Elevator.setBottom.event(); waitUntil(Elevator.atBottom); Rollers.open.set(true); Rollers.direction.set(false); Rollers.running.set(true); waitUntil(BooleanMixing.invert(AutoLoader.crateInPosition)); waitForTime(timeout); Rollers.running.set(false); running.set(false); }

Target:
protected void autonomousMain() throws AutonomousModeOverException, InterruptedException { try { Elevator.setBottom.event(); waitUntil(Elevator.atBottom); Rollers.open.set(true); Rollers.direction.set(false); Rollers.running.set(true); waitUntil(BooleanMixing.invert(AutoLoader.crateInPosition)); waitForTime(timeout); Rollers.running.set(false); } finally { running.set(false); } }
Source:
public static KeyBuilder.RowStep builder() { return new KeyBuilder.AbstractKeyBuilder(true); }

Target:
public static KeyBuilder.RowStep builder() { return new KeyBuilder.KeyBuilderImpl(true); }
Source:
public Bullet(int id, TranslatedPoint position, double radius, Vector2 velocity, int damage, Type type, Image image, int ownerId) { super(id); this.ownerId = ownerId; this.type = type; this.damage = damage; this.setBody(new Body(this, position, radius, radius, BODYTYPE)); this.setPhysics(new Physics(this, velocity.getMagnitude())); getPhysics().setVelocity(velocity); this.view = new View(this, image); lifeTime = 5; new Thread(() -> { timer = new Timer(); timer.start(); while ((timer.getDuration() < 1000 * lifeTime)) { try { Thread.sleep(20); } catch (Exception e) { e.printStackTrace(); } } notifyObservers(Observation.EXTERMINATION); }).start(); ; }

Target:
public Bullet(int id, TranslatedPoint position, double radius, Vector2 velocity, int damage, Type type, Image image, int ownerId) { super(id); this.ownerId = ownerId; this.type = type; this.damage = damage; this.setBody(new Body(this, position, radius, radius, BODYTYPE)); this.setPhysics(new Physics(this, velocity.getMagnitude())); getPhysics().setVelocity(velocity); this.view = new View(this, image); lifeTime = 5; new Thread(() -> { timer = new Timer(); timer.start(); while ((timer.getDuration() < 1000 * lifeTime)) { try { Thread.sleep(20); } catch (Exception e) { e.printStackTrace(); } } destroy(); }).start(); ; }