auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static OperatorType convertOperatorType(String sqlType) { if (sqlType != null) { sqlType = sqlType.trim().toUpperCase(); switch (sqlType) { case "=": case "==": case "EQ": case "EQUALS_TO": return OperatorType.EQUALS_TO; case "<>": case "!=": case "NE": case "NOT_EQUAL": case "NOT_EQUAL_TO": case "NOT_EQUALS": case "NOT_EQUALS_TO": case "DIFFERENT_FROM": return OperatorType.DIFFERENT_FROM; case ">": case "GT": case "GREATER_THAN": return OperatorType.GREATER_THAN; case ">=": case "=>": case "GREATER_THAN_OR_EQUAL": return OperatorType.GREATER_THAN_OR_EQUAL; case "NOT IN": return OperatorType.NOT_IN; case "IN": return OperatorType.IN; case "<": case "LT": case "LESS_THAN": return OperatorType.LESS_THAN; case "<=": case "=<": case "LESS_THAN_OR_EQUAL": return OperatorType.LESS_THAN_OR_EQUAL; case "LIKE": return OperatorType.LIKE; case "NOT_LIKE": return OperatorType.NOT_LIKE; } } return null; }

Target:
public static OperatorType convertOperatorType(String sqlType) { if (sqlType != null) { sqlType = sqlType.trim().toUpperCase(); switch (sqlType) { case "=": case "==": case "EQ": case "EQUALS_TO": return OperatorType.EQUALS_TO; case "<>": case "!=": case "NE": case "NOT_EQUAL": case "NOT_EQUAL_TO": case "NOT_EQUALS": case "NOT_EQUALS_TO": case "DIFFERENT_FROM": return OperatorType.DIFFERENT_FROM; case ">": case "GT": case "GREATER_THAN": return OperatorType.GREATER_THAN; case ">=": case "=>": case "GREATER_THAN_OR_EQUAL": return OperatorType.GREATER_THAN_OR_EQUAL; case "NOT_IN": case "NOT IN": return OperatorType.NOT_IN; case "IN": return OperatorType.IN; case "<": case "LT": case "LESS_THAN": return OperatorType.LESS_THAN; case "<=": case "=<": case "LESS_THAN_OR_EQUAL": return OperatorType.LESS_THAN_OR_EQUAL; case "LIKE": return OperatorType.LIKE; case "NOT_LIKE": case "NOT LIKE": return OperatorType.NOT_LIKE; } } return null; }
Source:
private void displayPopup() { this.popup.center(); this.popup.setData(column.getRowData()); this.popup.setPopupPosition( this.parent.getAbsoluteLeft(), (this.parent.getAbsoluteTop() + this.parent.getOffsetHeight() + 10) ); }

Target:
private void displayPopup() { this.popup.center(); this.popup.setData(column.getRowData()); calculatePopupPosition(); this.popup.setPopupPosition( popupLeftPosition, popupTopPosition ); }
Source:
public static Method lookupMethod(String methodName, Class<?>... parameterTypes) { return lookup0(initData().extensionType, methodName, parameterTypes); }

Target:
public static Method lookupMethod(String methodName, Class<?>... parameterTypes) { return lookupMethod(initData().extensionType, methodName, parameterTypes); }
Source:
public GroupBuilder addApplicationOptions(GroupBuilder gbuilder) { final DefaultOptionBuilder obuilder = new DefaultOptionBuilder(); final ArgumentBuilder abuilder = new ArgumentBuilder(); optVersion = obuilder .withLongName("version") .withDescription("print the version information and exit") .create(); optHelp = obuilder .withShortName("h") .withLongName("help") .withDescription("print this help") .withArgument(abuilder .withName("command") .withMaximum(1) .create() ) .create(); optLogLevel = obuilder .withLongName("log-level") .withDescription("the log4j log level") .withArgument(abuilder .withName("level") .withMaximum(1) .create() ) .create(); optInsecureHttps = obuilder .withLongName("insecure") .withDescription("allow expired ssl certs for https") .withArgument(abuilder .withName("command") .withMaximum(1) .create() ) .create(); optInsecureHttps = obuilder .withLongName("insecure") .withDescription("allow expired ssl certs for https") .withArgument(abuilder .withName("command") .withMaximum(1) .create() ) .create(); gbuilder .withName("Global options:") .withOption(CliCommand.OPT_VERBOSE) .withOption(CliCommand.OPT_QUIET) .withOption(optVersion) .withOption(optLogLevel) .withOption(optHelp) .withOption(optInsecureHttps) .withMinimum(0); return gbuilder; }

Target:
public GroupBuilder addApplicationOptions(GroupBuilder gbuilder) { final DefaultOptionBuilder obuilder = new DefaultOptionBuilder(); final ArgumentBuilder abuilder = new ArgumentBuilder(); optVersion = obuilder .withLongName("version") .withDescription("print the version information and exit") .create(); optHelp = obuilder .withShortName("h") .withLongName("help") .withDescription("print this help") .withArgument(abuilder .withName("command") .withMaximum(1) .create() ) .create(); optLogLevel = obuilder .withLongName("log-level") .withDescription("the log4j log level") .withArgument(abuilder .withName("level") .withMaximum(1) .create() ) .create(); optInsecureHttps = obuilder .withLongName("insecure") .withDescription("allow expired ssl certs for https") .withArgument(abuilder .withName("command") .withMaximum(1) .create() ) .create(); gbuilder .withName("Global options:") .withOption(CliCommand.OPT_VERBOSE) .withOption(CliCommand.OPT_QUIET) .withOption(optVersion) .withOption(optLogLevel) .withOption(optHelp) .withOption(optInsecureHttps) .withMinimum(0); return gbuilder; }
Source:
void lockAllNodesAndConsumeRelationships( long nodeId, final KernelTransactionImplementation transaction ) throws KernelException { boolean retry; do { retry = false; firstRelId = NO_SUCH_RELATIONSHIP; collectAndSortNodeIds( nodeId, transaction ); lockAllNodes( transaction, sortedNodeIds ); NodeCursor nodes = transaction.nodeCursor(); org.neo4j.internal.kernel.api.Read read = transaction.dataRead(); read.singleNode( nodeId, nodes ); RelationshipSelectionCursor rels = RelationshipSelections.allCursor( transaction.cursors(), nodes, null ); boolean first = true; while ( rels.next() && !retry ) { retry = performAction( transaction, rels.relationshipReference(), first ); first = false; } } while ( retry ); }

Target:
void lockAllNodesAndConsumeRelationships( long nodeId, final KernelTransactionImplementation transaction ) throws KernelException { boolean retry; do { retry = false; firstRelId = NO_SUCH_RELATIONSHIP; collectAndSortNodeIds( nodeId, transaction ); lockAllNodes( transaction, sortedNodeIds ); NodeCursor nodes = transaction.nodeCursor(); org.neo4j.internal.kernel.api.Read read = transaction.dataRead(); read.singleNode( nodeId, nodes ); if ( nodes.next() ) { RelationshipSelectionCursor rels = RelationshipSelections.allCursor( transaction.cursors(), nodes, null ); boolean first = true; while ( rels.next() && !retry ) { retry = performAction( transaction, rels.relationshipReference(), first ); first = false; } } } while ( retry ); }
Source:
public void collectChanges(Consumer<NodeChange> collector) { boolean hasChanges = false; for (Entry<String, Serializable> entry : getChangeTracker() .entrySet()) { String key = entry.getKey(); Serializable value = entry.getValue(); boolean containsNow = values != null && values.containsKey(key); boolean containedEarlier = value != REMOVED_MARKER; if (containedEarlier && !containsNow) { collector.accept(new MapRemoveChange(this, key)); hasChanges = true; } else if (containsNow) { Object currentValue = values.get(key); if (producePutChange(key, containedEarlier, value)) { collector.accept(new MapPutChange(this, key, currentValue)); hasChanges = true; } } } if (!isPopulated) { if (!hasChanges) { collector.accept(new EmptyChange(this)); } isPopulated = true; } }

Target:
public void collectChanges(Consumer<NodeChange> collector) { boolean hasChanges = false; for (Entry<String, Serializable> entry : getChangeTracker() .entrySet()) { String key = entry.getKey(); Serializable value = entry.getValue(); boolean containsNow = values != null && values.containsKey(key); boolean containedEarlier = value != REMOVED_MARKER; if (containedEarlier && !containsNow) { collector.accept(new MapRemoveChange(this, key)); hasChanges = true; } else if (containsNow && producePutChange(key, containedEarlier, value)) { Object currentValue = values.get(key); collector.accept(new MapPutChange(this, key, currentValue)); hasChanges = true; } } if (!isPopulated) { if (!hasChanges) { collector.accept(new EmptyChange(this)); } isPopulated = true; } }
Source:
public void testValidateStorageDomainClusterMismatch() { when(cluster.getStoragePoolId()).thenReturn(Guid.newGuid()); ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_AND_CLUSTER_IN_DIFFERENT_POOL); }

Target:
public void testValidateStorageDomainClusterMismatch() { Guid newStoragePoolId = Guid.newGuid(); when(cluster.getStoragePoolId()).thenReturn(newStoragePoolId); ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_AND_CLUSTER_IN_DIFFERENT_POOL); }
Source:
public static Archive<?> deployment() { final WebArchive archive = ShrinkWrap .create(WebArchive.class, APP_NAME + ".war") .addClasses(BasicSecurityDomainASetup.class, CXFRSSecureUtils.class) .addPackage(CxfRsRouteBuilder.class.getPackage()) .addAsWebInfResource(new StringAsset(""), "beans.xml") ; SecurityUtils.enhanceArchive(archive, BasicSecurityDomainASetup.SECURITY_DOMAIN, BasicSecurityDomainASetup.AUTH_METHOD, PATH_ROLE_MAP); return archive; }

Target:
public static Archive<?> deployment() { final WebArchive archive = ShrinkWrap .create(WebArchive.class, APP_NAME + ".war") .addClasses(BasicSecurityDomainASetup.class, CXFRSSecureUtils.class) .addPackage(CxfRsRouteBuilder.class.getPackage()) .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") ; SecurityUtils.enhanceArchive(archive, BasicSecurityDomainASetup.SECURITY_DOMAIN, BasicSecurityDomainASetup.AUTH_METHOD, PATH_ROLE_MAP); return archive; }
Source:
public void handleCustomEvent(UIEvent event) { EventType<UIEvent> eventType = (EventType<UIEvent>) event .getEventType(); if (eventType.equals(UIEvent.TAP)) { for(Node n : cup.getChildren()){ if(n instanceof Block){ if(((Block) n).isSelected){ ((Block) n).setSelected(false); } } } this.setSelected(true); System.out.println("Block is selected"); } else if (eventType.equals(UIEvent.TAP_HOLD)) { } }

Target:
public void handleCustomEvent(UIEvent event) { EventType eventType = event .getEventType(); if (eventType.equals(UIEvent.TAP)) { for(Node n : cup.getChildren()){ if(n instanceof Block){ if(((Block) n).isSelected){ ((Block) n).setSelected(false); } } } this.setSelected(true); System.out.println("Block is selected"); } else if (eventType.equals(UIEvent.TAP_HOLD)) { } }
Source:
public void toggleFlagDown() { if (flagdown == true) { flagdown = false; } if (flagdown == false) { flagdown = true; } }

Target:
public void toggleFlagDown() { flagdown = !flagdown; }
Source:
public void setFastViewBarVisible(boolean visible) { boolean oldValue = fastViewBarVisible; fastViewBarVisible = visible; if (oldValue != fastViewBarVisible) { } }

Target:
public void setFastViewBarVisible(boolean visible) { }
Source:
public ArrayList<Pair<AbstractIngredient[], Float>> lookupShapedRecipes(Item i) { if (shapedReverseLookupTable.get(i) != null) return shapedReverseLookupTable.get(i); return new ArrayList<Pair<AbstractIngredient[], Float>>(); }

Target:
public List<Pair<AbstractIngredient[], Float>> lookupShapedRecipes(Item i) { return shapedReverseLookupTable.get(i); }
Source:
public void onServerTickEnd(CallbackInfo ci) { TimingsManager.FULL_SERVER_TICK.stopTiming(); }

Target:
public void onServerTickEnd(CallbackInfo ci) { int lastAnimTick = SpongeCommonEventFactory.lastAnimationPacketTick; int lastPrimaryTick = SpongeCommonEventFactory.lastPrimaryPacketTick; int lastSecondaryTick = SpongeCommonEventFactory.lastSecondaryPacketTick; if (SpongeCommonEventFactory.lastAnimationPlayer != null) { EntityPlayerMP player = SpongeCommonEventFactory.lastAnimationPlayer.get(); if (player != null && lastAnimTick != lastPrimaryTick && lastAnimTick != lastSecondaryTick && lastAnimTick != 0 && lastAnimTick - lastPrimaryTick > 3 && lastAnimTick - lastSecondaryTick > 3) { BlockSnapshot blockSnapshot = BlockSnapshot.NONE; final RayTraceResult result = SpongeImplHooks.rayTraceEyes(player, SpongeImplHooks.getBlockReachDistance(player) + 1); if (result != null && result.getBlockPos() != null) { return; } Sponge.getCauseStackManager().pushCause(player); if (!player.getHeldItemMainhand().isEmpty() && SpongeCommonEventFactory.callInteractItemEventPrimary(player, player.getHeldItemMainhand(), EnumHand.MAIN_HAND, null, blockSnapshot).isCancelled()) { SpongeCommonEventFactory.lastAnimationPacketTick = 0; Sponge.getCauseStackManager().popCause(); return; } SpongeCommonEventFactory.callInteractBlockEventPrimary(player, player.getHeldItemMainhand(), EnumHand.MAIN_HAND, null); Sponge.getCauseStackManager().popCause(); } } SpongeCommonEventFactory.lastAnimationPacketTick = 0; TimingsManager.FULL_SERVER_TICK.stopTiming(); }
Source:
public void handleMessage(Message<?> message) { Assert.notNull(message, "Message must not be null"); Assert.notNull(message.getPayload(), "Message payload must not be null"); if (this.loggingEnabled && this.logger.isDebugEnabled()) { this.logger.debug(this + " received message: " + message); } MetricsContext start = null; boolean countsEnabled = this.countsEnabled; AbstractMessageHandlerMetrics handlerMetrics = this.handlerMetrics; try { if (this.shouldTrack) { message = MessageHistory.write(message, this, this.getMessageBuilderFactory()); } if (handlerMetrics.getTimer() != null && countsEnabled) { final Message<?> messageToSend = message; handlerMetrics.getTimer().record(() -> { try { handleMessageInternal(messageToSend); } catch (Exception e) { if (e instanceof MessagingException) { throw (MessagingException) e; } throw new MessageHandlingException(messageToSend, "error occurred in message handler [" + this + "]", e); } }); } else { if (countsEnabled) { start = handlerMetrics.beforeHandle(); } handleMessageInternal(message); if (countsEnabled) { handlerMetrics.afterHandle(start, true); } } } catch (Exception e) { if (countsEnabled) { if (handlerMetrics.getErrorCounter() != null) { handlerMetrics.getErrorCounter().increment(); } else { handlerMetrics.afterHandle(start, false); } } if (e instanceof MessagingException) { throw (MessagingException) e; } throw new MessageHandlingException(message, "error occurred in message handler [" + this + "]", e); } }

Target:
public void handleMessage(Message<?> message) { Assert.notNull(message, "Message must not be null"); Assert.notNull(message.getPayload(), "Message payload must not be null"); if (this.loggingEnabled && this.logger.isDebugEnabled()) { this.logger.debug(this + " received message: " + message); } MetricsContext start = null; boolean countsEnabled = this.countsEnabled; AbstractMessageHandlerMetrics handlerMetrics = this.handlerMetrics; try { if (this.shouldTrack) { message = MessageHistory.write(message, this, this.getMessageBuilderFactory()); } if (countsEnabled) { if (handlerMetrics.getTimer() != null) { final Message<?> messageToSend = message; handlerMetrics.getTimer().recordCallable(() -> { handleMessageInternal(messageToSend); return null; }); } else { start = handlerMetrics.beforeHandle(); handleMessageInternal(message); handlerMetrics.afterHandle(start, true); } } else { handleMessageInternal(message); } } catch (Exception e) { if (countsEnabled) { if (handlerMetrics.getErrorCounter() != null) { handlerMetrics.getErrorCounter().increment(); } else { handlerMetrics.afterHandle(start, false); } } if (e instanceof MessagingException) { throw (MessagingException) e; } throw new MessageHandlingException(message, "error occurred in message handler [" + this + "]", e); } }
Source:
private String getDisplayedRooms(Session session) { List<Room> rooms = session.rooms(); StringBuilder sb = new StringBuilder(); for (Room room : rooms) { sb.append(room.getName()).append(", "); } if (sb.length() > 2) { sb.delete(sb.length() - 2, sb.length() - 1); } return rooms.get(0).getName(); }

Target:
private String getDisplayedRooms(Session session) { List<Room> rooms = session.rooms(); StringBuilder sb = new StringBuilder(); for (Room room : rooms) { sb.append(room.getName()).append(", "); } if (sb.length() > 2) { sb.delete(sb.length() - 2, sb.length() - 1); } return sb.toString(); }
Source:
public MessageBuilder appendCustomMessage(Result buildResult) { String customMessage = notifier.getCustomMessage(); if (buildResult != null) { if (buildResult == Result.SUCCESS) { customMessage = notifier.getCustomMessageSuccess(); } else if (buildResult == Result.ABORTED) { customMessage = notifier.getCustomMessageAborted(); } else if (buildResult == Result.NOT_BUILT) { customMessage = notifier.getCustomMessageNotBuilt(); } else if (buildResult == Result.UNSTABLE) { customMessage = notifier.getCustomMessageUnstable(); } else if (buildResult == Result.FAILURE) { customMessage = notifier.getCustomMessageFailure(); } } try { String replaced = TokenMacro.expandAll(build, new LogTaskListener(logger, INFO), customMessage); message.append("\n"); message.append(replaced); } catch (MacroEvaluationException e) { logger.log(SEVERE, e.getMessage(), e); } catch (IOException e) { logger.log(SEVERE, e.getMessage(), e); } catch (InterruptedException e) { logger.log(SEVERE, e.getMessage(), e); } return this; }

Target:
public MessageBuilder appendCustomMessage(Result buildResult) { String customMessage = ""; if (buildResult != null) { if (buildResult == Result.SUCCESS) { customMessage = notifier.getCustomMessageSuccess(); } else if (buildResult == Result.ABORTED) { customMessage = notifier.getCustomMessageAborted(); } else if (buildResult == Result.NOT_BUILT) { customMessage = notifier.getCustomMessageNotBuilt(); } else if (buildResult == Result.UNSTABLE) { customMessage = notifier.getCustomMessageUnstable(); } else if (buildResult == Result.FAILURE) { customMessage = notifier.getCustomMessageFailure(); } } if (customMessage.isEmpty()) { customMessage = notifier.getCustomMessage(); } try { String replaced = TokenMacro.expandAll(build, new LogTaskListener(logger, INFO), customMessage, false, null); message.append("\n"); message.append(replaced); } catch (MacroEvaluationException | IOException | InterruptedException e) { logger.log(SEVERE, e.getMessage(), e); } return this; }
Source:
public FeedbackResponseCommentRow(FeedbackResponseCommentAttributes frc, String giverDisplay, String giverName, String recipientName, String showCommentToString, String showGiverNameToString, Map<FeedbackParticipantType, Boolean> responseVisibilities, Map<String, String> instructorEmailNameTable) { this(frc, giverDisplay, instructorEmailNameTable); setDataForAddEditDelete(frc, giverName, recipientName, showCommentToString, showGiverNameToString, responseVisibilities); setCommentGiverName(giverDisplay); setCommentLastEditorName(frc.lastEditorEmail); this.questionId = frc.feedbackQuestionId; this.editedAt = setEditedAtText(frc.createdAt, frc.lastEditedAt); }

Target:
public FeedbackResponseCommentRow(FeedbackResponseCommentAttributes frc, String giverDisplay, String giverName, String recipientName, String showCommentToString, String showGiverNameToString, Map<FeedbackParticipantType, Boolean> responseVisibilities, Map<String, String> instructorEmailNameTable) { this(frc, giverDisplay, instructorEmailNameTable); setDataForAddEditDelete(frc, giverName, recipientName, showCommentToString, showGiverNameToString, responseVisibilities); }
Source:
default PlanNode resolve(PlanNode node) { return getOnlyElement(resolveGroup(node).iterator()); }

Target:
default PlanNode resolve(PlanNode node) { return resolveGroup(node).collect(toOptional()).get(); }
Source:
private void processingMovements() { distributionOrders.entrySet().stream().filter(entry -> entry != null).forEach(entry -> { I_DD_Order distributionOrder = entry.getValue(); List<Integer> orderIds = new ArrayList<Integer>(); orderIds.add(distributionOrder.getDD_Order_ID()); ProcessInfo processInfo = ProcessBuilder.create(getCtx()) .process(MovementGenerate.getProcessId()) .withSelectedRecordsIds(MDDOrder.Table_ID, orderIds) .withParameter(MWMInOutBound.COLUMNNAME_M_Warehouse_ID, distributionOrder.getM_Warehouse_ID()) .withParameter(MMovement.COLUMNNAME_MovementDate, getMovementDate()) .withoutTransactionClose() .execute(get_TrxName()); if (processInfo.isError()) throw new AdempiereException(processInfo.getSummary()); addLog(processInfo.getSummary()); Arrays.stream(processInfo.getIDs()).forEach(recordId -> { Optional<MMovement> maybeMovement = Optional.ofNullable(new MMovement(getCtx(), recordId, get_TrxName())); maybeMovement.ifPresent(movement -> { documentCreated++; printDocument(movement, "Inventory Move Hdr (Example)"); }); }); }); }

Target:
private void processingMovements() { distributionOrders.entrySet().stream().filter(entry -> entry != null).forEach(entry -> { I_DD_Order distributionOrder = entry.getValue(); List<Integer> orderIds = new ArrayList<Integer>(); orderIds.add(distributionOrder.getDD_Order_ID()); ProcessInfo processInfo = ProcessBuilder.create(getCtx()) .process(MovementGenerate.getProcessId()) .withSelectedRecordsIds(MDDOrder.Table_ID, orderIds) .withParameter(MWMInOutBound.COLUMNNAME_M_Warehouse_ID, distributionOrder.getM_Warehouse_ID()) .withParameter(MMovement.COLUMNNAME_MovementDate, getMovementDate()) .withoutTransactionClose() .execute(get_TrxName()); if (processInfo.isError()) throw new AdempiereException(processInfo.getSummary()); addLog(processInfo.getSummary()); Arrays.stream(processInfo.getIDs()).forEach(recordId -> { Optional<MMovement> maybeMovement = Optional.ofNullable(new MMovement(getCtx(), recordId, get_TrxName())); maybeMovement.ifPresent(movement -> { documentCreated++; printDocument(movement, true); }); }); }); }
Source:
public void checkCodeValidationFeature() { editor.selectTabByName(GO_FILE_NAME); editor.waitAllMarkersInvisibility(ERROR); editor.goToCursorPositionVisible(13, 1); editor.typeTextIntoEditor("p"); editor.waitMarkerInPosition(ERROR, 13); editor.moveToMarkerAndWaitAssistContent(ERROR); editor.waitTextIntoAnnotationAssist("expected 'package', found 'IDENT' ppackage"); editor.goToCursorPositionVisible(13, 1); editor.typeTextIntoEditor(Keys.DELETE.toString()); editor.waitAllMarkersInvisibility(ERROR); editor.goToCursorPositionVisible(13, 1); editor.launchCommentCodeFeature(); editor.waitTextIntoEditor(" editor.launchCommentCodeFeature(); editor.waitTextIntoEditor("package main"); }

Target:
public void checkCodeValidationFeature() { editor.selectTabByName(GO_FILE_NAME); editor.waitAllMarkersInvisibility(ERROR); editor.goToCursorPositionVisible(13, 1); editor.typeTextIntoEditor("p"); editor.waitMarkerInPosition(ERROR, 13); editor.moveToMarkerAndWaitAssistContent(ERROR); editor.waitTextIntoAnnotationAssist("expected 'package', found 'IDENT' ppackage"); editor.goToCursorPositionVisible(13, 1); editor.typeTextIntoEditor(Keys.DELETE.toString()); editor.waitAllMarkersInvisibility(ERROR); editor.goToCursorPositionVisible(13, 1); editor.launchCommentCodeFeature(); editor.waitTextIntoEditor(" editor.launchCommentCodeFeature(); editor.waitTextNotPresentIntoEditor(" }
Source:
public Boolean execute(ServiceProvider context) { final RemoteJob job = context.service(RemoteJob.class); final String user = job.getUser(); final Map<String, CodeSystemEntry> codeSystemsByShortName = fetchAllCodeSystems(context); final CodeSystemEntry codeSystem = codeSystemsByShortName.get(codeSystemShortName); if (codeSystem == null) { throw new CodeSystemNotFoundException(codeSystemShortName); } final String newVersionPath = String.format("%s%s%s", codeSystem.getBranchPath(), Branch.SEPARATOR, versionId); Branch.BranchNameValidator.DEFAULT.checkName(versionId); try { RepositoryRequests.branching() .prepareGet(newVersionPath) .build(codeSystem.getRepositoryUuid()) .execute(context.service(IEventBus.class)) .getSync(); throw new ConflictException("An existing branch with path '%s' conflicts with the specified version identifier.", newVersionPath); } catch (NotFoundException e) { } final Map<CodeSystemEntry, IVersioningManager> versioningManagersByCodeSystem = createVersioningManagers(context, codeSystemsByShortName, codeSystem); acquireLocks(context, user, versioningManagersByCodeSystem.keySet()); for (Entry<CodeSystemEntry, IVersioningManager> entry : versioningManagersByCodeSystem.entrySet()) { createVersion(context, entry.getValue(), entry.getKey(), user); } releaseLocks(context); return Boolean.TRUE; }

Target:
public Boolean execute(ServiceProvider context) { final RemoteJob job = context.service(RemoteJob.class); final String user = job.getUser(); final Map<String, CodeSystemEntry> codeSystemsByShortName = fetchAllCodeSystems(context); final CodeSystemEntry codeSystem = codeSystemsByShortName.get(codeSystemShortName); if (codeSystem == null) { throw new CodeSystemNotFoundException(codeSystemShortName); } final String newVersionPath = String.format("%s%s%s", codeSystem.getBranchPath(), Branch.SEPARATOR, versionId); Branch.BranchNameValidator.DEFAULT.checkName(versionId); try { RepositoryRequests.branching() .prepareGet(newVersionPath) .build(codeSystem.getRepositoryUuid()) .execute(context.service(IEventBus.class)) .getSync(); throw new ConflictException("An existing branch with path '%s' conflicts with the specified version identifier.", newVersionPath); } catch (NotFoundException e) { } final Map<CodeSystemEntry, IVersioningManager> versioningManagersByCodeSystem = createVersioningManagers(context, codeSystemsByShortName, codeSystem); try { acquireLocks(context, user, versioningManagersByCodeSystem.keySet()); for (Entry<CodeSystemEntry, IVersioningManager> entry : versioningManagersByCodeSystem.entrySet()) { createVersion(context, entry.getValue(), entry.getKey(), user); } return Boolean.TRUE; } finally { releaseLocks(context); } }
Source:
public void prepare() { configureServices(); logger.debug("Preparing kjar"); KieServices ks = KieServices.Factory.get(); ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION); List<String> processes = new ArrayList<String>(); processes.add("repo/processes/general/customtask.bpmn"); processes.add("repo/processes/general/humanTask.bpmn"); processes.add("repo/processes/general/import.bpmn"); processes.add("repo/processes/general/signal.bpmn"); processes.add("repo/processes/general/signalWithExpression.bpmn2"); processes.add("repo/processes/general/callactivity.bpmn"); DeploymentDescriptor customDescriptor = new DeploymentDescriptorImpl("org.jbpm.domain"); DeploymentDescriptorBuilder ddBuilder = customDescriptor.getBuilder(); ddBuilder.auditMode(AuditMode.NONE); Map<String, String> extraResources = new HashMap<String, String>(); extraResources.put("src/main/resources/" + DeploymentDescriptor.META_INF_LOCATION, customDescriptor.toXml()); InternalKieModule kJar1 = createKieJar(ks, releaseId, processes, extraResources); File pom = new File("target/kmodule", "pom.xml"); pom.getParentFile().mkdir(); try { FileOutputStream fs = new FileOutputStream(pom); fs.write(getPom(releaseId).getBytes()); fs.close(); } catch (Exception e) { } KieMavenRepository repository = getKieMavenRepository(); repository.deployArtifact(releaseId, kJar1, pom); }

Target:
public void prepare() { configureServices(); logger.debug("Preparing kjar"); KieServices ks = KieServices.Factory.get(); ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION); List<String> processes = new ArrayList<String>(); processes.add("repo/processes/general/customtask.bpmn"); processes.add("repo/processes/general/humanTask.bpmn"); processes.add("repo/processes/general/import.bpmn"); processes.add("repo/processes/general/signal.bpmn"); processes.add("repo/processes/general/signalWithExpression.bpmn2"); processes.add("repo/processes/general/callactivity.bpmn"); DeploymentDescriptor customDescriptor = new DeploymentDescriptorImpl("org.jbpm.domain"); DeploymentDescriptorBuilder ddBuilder = customDescriptor.getBuilder(); ddBuilder.auditMode(AuditMode.NONE); Map<String, String> extraResources = new HashMap<String, String>(); extraResources.put("src/main/resources/" + DeploymentDescriptor.META_INF_LOCATION, customDescriptor.toXml()); InternalKieModule kJar1 = createKieJar(ks, releaseId, processes, extraResources); File pom = new File("target/kmodule", "pom.xml"); pom.getParentFile().mkdir(); try { FileOutputStream fs = new FileOutputStream(pom); fs.write(getPom(releaseId).getBytes()); fs.close(); } catch (Exception e) { throw new RuntimeException("Unable to save pom content", e); } KieMavenRepository repository = getKieMavenRepository(); repository.deployArtifact(releaseId, kJar1, pom); }
Source:
public void changeListener_syncIfNeeded_updatedFromOtherThread() { final Realm realm = Realm.getInstance(looperThread.createConfiguration("Foo")); populateTestRealm(realm, 10); final RealmResults<AllTypes> results = realm.where(AllTypes.class).lessThan(AllTypes.FIELD_LONG, 10).findAll(); assertEquals(10, results.size()); realm.executeTransactionAsync(new Realm.Transaction() { @Override public void execute(Realm realm) { realm.where(AllTypes.class).equalTo(AllTypes.FIELD_LONG, 0).findFirst().removeFromRealm(); } }, new Realm.Transaction.OnSuccess() { @Override public void onSuccess() { assertEquals(9, results.size()); realm.close(); looperThread.testComplete(); } }); }

Target:
public void changeListener_syncIfNeeded_updatedFromOtherThread() { final Realm realm = Realm.getInstance(looperThread.createConfiguration("Foo")); populateTestRealm(realm, 10); final RealmResults<AllTypes> results = realm.where(AllTypes.class).lessThan(AllTypes.FIELD_LONG, 10).findAll(); assertEquals(10, results.size()); realm.executeTransactionAsync(new Realm.Transaction() { @Override public void execute(Realm realm) { realm.where(AllTypes.class).equalTo(AllTypes.FIELD_LONG, 0).findFirst().deleteFromRealm(); } }, new Realm.Transaction.OnSuccess() { @Override public void onSuccess() { assertEquals(9, results.size()); realm.close(); looperThread.testComplete(); } }); }
Source:
public void testDeleteFromListColumnIndexTable_NullColumn() { ColumnModel multiValue = null; Set<Long> rowIdFilter = null; assertThrows(IllegalArgumentException.class, ()->{ tableIndexDAO.populateListColumnIndexTable(tableId, multiValue, rowIdFilter); }); }

Target:
public void testDeleteFromListColumnIndexTable_NullColumn() { ColumnModel multiValue = null; Set<Long> rowIdFilter = Sets.newHashSet(1L); String message = assertThrows(IllegalArgumentException.class, ()->{ tableIndexDAO.populateListColumnIndexTable(tableId, multiValue, rowIdFilter); }).getMessage(); assertEquals("listColumn is required.", message); }
Source:
private List<Flux<CoreEvent>> collectPublishers() { List<Flux<CoreEvent>> routes = this.routes.stream() .map(ExecutableRoute::getPublisher) .collect(toCollection(ArrayList::new)); Integer lastRouteIndex = routes.size() - 1; routes.set(lastRouteIndex, subscribeFluxOnPublisherSubscription(routes.get(lastRouteIndex), router)); return routes; }

Target:
private List<Flux<CoreEvent>> collectPublishers() { List<Flux<CoreEvent>> routes = new ArrayList<>(); for (Iterator routesIterator = this.routes.iterator(); routesIterator.hasNext();) { ExecutableRoute nextRoute = (ExecutableRoute) routesIterator.next(); if (routesIterator.hasNext()) { routes.add(nextRoute.getPublisher()); } else { routes.add(subscribeFluxOnPublisherSubscription(nextRoute.getPublisher(), router)); } } return routes; }
Source:
public void testExplicitWaffleString() throws Exception { stmt.setString(3, I_AM_A_STRING); replay(stmt); foreman.waffle(String.class, I_AM_A_STRING, null).apply(3, stmt, null); }

Target:
public void testExplicitWaffleString() throws Exception { foreman.waffle(String.class, I_AM_A_STRING, null).apply(3, stmt, null); verify(stmt).setString(3, I_AM_A_STRING); }
Source:
public InstructorFeedbackEditCopyData(AccountAttributes account, String errorMessage) { this(account, "", errorMessage); }

Target:
public InstructorFeedbackEditCopyData(AccountAttributes account, String errorMessage) { this(account, null, errorMessage); }
Source:
public DurableScheduledService(@NotNull final String serviceName, @NotNull final Duration runInterval, @NotNull final Duration timeout, @NotNull final Duration watcherInterval, @NotNull final Duration shutdownTimeout) { _serviceName = serviceName; _runInterval = runInterval; _timeout = timeout; _watcherInterval = watcherInterval; _shutdownTimeout = shutdownTimeout; _watcherService = createWatcherService(); }

Target:
public DurableScheduledService(@NotNull final String serviceName, @NotNull final Duration runInterval, @NotNull final Duration timeout, @NotNull final Duration watcherInterval, @NotNull final Duration shutdownTimeout) { Validate.notEmpty(serviceName); _serviceName = serviceName; _runInterval = runInterval; _timeout = timeout; _watcherInterval = watcherInterval; _shutdownTimeout = shutdownTimeout; _watcherService = createWatcherService(); }
Source:
public ByteBufferPool(int bufferSize, int maxPoolSize, boolean directByteBuffer) { this.bufferSize = bufferSize; this.maxPoolSize = maxPoolSize; this.directByteBuffer = directByteBuffer; LOG.info("Created with bufferSize={} and maxPoolSize={}", org.apache.hadoop.util.StringUtils.byteDesc(bufferSize), maxPoolSize); this.count = new AtomicInteger(0); }

Target:
public ByteBufferPool(int bufferSize, int maxPoolSize, boolean directByteBuffer) { this.bufferSize = bufferSize; this.maxPoolSize = maxPoolSize; this.directByteBuffer = directByteBuffer; LOG.info("Created with bufferSize={}, maxPoolSize={} and totalBufferSize={}", org.apache.hadoop.util.StringUtils.byteDesc(bufferSize), maxPoolSize, org.apache.hadoop.util.StringUtils.byteDesc((long) (bufferSize * maxPoolSize))); this.count = new AtomicInteger(0); }
Source:
protected void applySorting(List<ProcessDefinition> input, final QueryContext queryContext) { if (queryContext != null && queryContext.getOrderBy() != null && !queryContext.getOrderBy().isEmpty()) { Collections.sort(input, new Comparator<ProcessDefinition>() { @Override public int compare(ProcessDefinition o1, ProcessDefinition o2) { if ("ProcessName".equals(queryContext.getOrderBy())) { return o1.getName().compareToIgnoreCase(o2.getName()); } else if ("ProcessVersion".equals(queryContext.getOrderBy())) { return o1.getVersion().compareTo(o2.getVersion()); } else if ("Project".equals(queryContext.getOrderBy())) { return o1.getDeploymentId().compareTo(o2.getDeploymentId()); } return 0; } }); if (!queryContext.isAscending()) { Collections.reverse(input); } } }

Target:
protected void applySorting(List<ProcessDefinition> input, final QueryContext queryContext) { if (queryContext != null && queryContext.getOrderBy() != null && !queryContext.getOrderBy().isEmpty()) { Collections.sort(input, new Comparator<ProcessDefinition>() { @Override public int compare(ProcessDefinition o1, ProcessDefinition o2) { if ("ProcessName".equals(queryContext.getOrderBy())) { return o1.getName().compareToIgnoreCase(o2.getName()); } else if ("ProcessVersion".equals(queryContext.getOrderBy())) { return o1.getVersion().compareTo(o2.getVersion()); } else if ("Project".equals(queryContext.getOrderBy())) { return o1.getDeploymentId().compareToIgnoreCase(o2.getDeploymentId()); } return 0; } }); if (!queryContext.isAscending()) { Collections.reverse(input); } } }
Source:
public void disconnect() { context.unbindService(serviceConnection); }

Target:
public void disconnect() { context.unbindService(serviceConnection); Intent intent = new Intent(context, FusedLocationProviderService.class); context.stopService(intent); }
Source:
public DatasetVersion getDatasetVersion(String datasetID, String edition, String version) throws IOException, DatasetAPIException { if (StringUtils.isEmpty(datasetID) || StringUtils.isEmpty(edition)) { throw new BadRequestException("A dataset ID, edition, and version must be provided."); } String path = "/datasets/" + datasetID + "/editions/" + edition + "/versions/" + version ; logInfo("Calling dataset API") .addParameter("path", path) .addParameter("method", "GET") .log(); HttpGet httpget = new HttpGet(datasetAPIURL + path); httpget.addHeader(authTokenHeaderName, datasetAPIAuthToken); try (CloseableHttpResponse response = client.execute(httpget)) { switch (response.getStatusLine().getStatusCode()) { case HttpStatus.SC_OK: String responseString = EntityUtils.toString(response.getEntity()); return ContentUtil.deserialise(responseString, DatasetVersion.class); case HttpStatus.SC_NOT_FOUND: throw new DatasetNotFoundException("The dataset API returned 404 for " + path); default: throw new UnexpectedResponseException( String.format("The dataset API returned a %s response for %s", response.getStatusLine().getStatusCode(), path)); } } }

Target:
public DatasetVersion getDatasetVersion(String datasetID, String edition, String version) throws IOException, DatasetAPIException { if (StringUtils.isEmpty(datasetID) || StringUtils.isEmpty(edition)) { throw new BadRequestException("A dataset ID, edition, and version must be provided."); } String path = String.format("/datasets/%s/editions/%s/versions/%s", datasetID, edition, version); URI uri; try { uri = new URIBuilder(datasetAPIURL) .setPath(path) .build(); } catch (URISyntaxException e) { throw new BadRequestException(e.getMessage()); } logInfo("Calling dataset API") .addParameter("uri", uri) .addParameter("method", "GET") .log(); HttpGet httpget = new HttpGet(uri); httpget.addHeader(authTokenHeaderName, datasetAPIAuthToken); try (CloseableHttpResponse response = client.execute(httpget)) { switch (response.getStatusLine().getStatusCode()) { case HttpStatus.SC_OK: String responseString = EntityUtils.toString(response.getEntity()); return ContentUtil.deserialise(responseString, DatasetVersion.class); case HttpStatus.SC_NOT_FOUND: throw new DatasetNotFoundException("The dataset API returned 404 for " + path); default: throw new UnexpectedResponseException( String.format("The dataset API returned a %s response for %s", response.getStatusLine().getStatusCode(), path)); } } }
Source:
private PutChunk getChunkToFill() { if (chunkToFill != null && chunkToFill.isBuilding()) { return chunkToFill; } chunkToFill = null; for (PutChunk chunk : putChunks) { if (chunk.isFree()) { chunkCounter++; chunk.prepareForBuilding(chunkCounter, getSizeOfChunkAt(chunkCounter)); chunkToFill = chunk; routerMetrics.chunkFillerWaitingTrunkTimeMs.update(time.milliseconds() - timeFilledPreviousChunkMs); timeStartFillingCurrentChunkMs = time.milliseconds(); break; } } return chunkToFill; }

Target:
private PutChunk getChunkToFill() { if (chunkToFill != null && chunkToFill.isBuilding()) { return chunkToFill; } chunkToFill = null; for (PutChunk chunk : putChunks) { if (chunk.isFree()) { chunkCounter++; chunk.prepareForBuilding(chunkCounter, getSizeOfChunkAt(chunkCounter)); chunkToFill = chunk; break; } } return chunkToFill; }
Source:
public MoshiConverterFactory asLenient() { if (lenient) { return this; } return create(moshi, true); }

Target:
public MoshiConverterFactory asLenient() { return new MoshiConverterFactory(moshi, true); }
Source:
protected void executeVmCommand() { addCustomValue("InterfaceType", VmInterfaceType.forValue(getInterface().getType()).getDescription().toString()); boolean succeeded = false; boolean macAddedToPool = false; try { if (isVnicProfileChanged(oldIface, getInterface())) { Network newNetwork = networkHelper.getNetworkByVnicProfileId(getInterface().getVnicProfileId()); Network oldNetwork = networkHelper.getNetworkByVnicProfileId(oldIface.getVnicProfileId()); if (!Objects.equals(oldNetwork, newNetwork)) { externalNetworkManagerFactory.create(oldIface).deallocateIfExternal(); } } macAddedToPool = allocateMacFromRequest(); if (mustChangeAddress(oldIface.getType(), getInterface().getType())) { vmDeviceDao.clearDeviceAddress(getInterface().getId()); } getInterface().setSpeed(VmInterfaceType.forValue(getInterface().getType()).getSpeed()); succeeded = Boolean.TRUE.equals(TransactionSupport.executeInNewTransaction(() -> { bumpVmVersion(); updatePassthoughDeviceIfNeeded(); getCompensationContext().snapshotEntity(oldIface); vmNicDao.update(getInterface()); saveNetworkFilterParameters(); getCompensationContext().stateChanged(); return true; })); succeeded &= updateHost(); } finally { setSucceeded(succeeded); macPoolCleanupAfterExecution(macAddedToPool); } }

Target:
protected void executeVmCommand() { addCustomValue("InterfaceType", VmInterfaceType.forValue(getInterface().getType()).getDescription().toString()); boolean succeeded = false; boolean macAddedToPool = false; try { if (isVnicProfileChanged(oldIface, getInterface())) { Network newNetwork = networkHelper.getNetworkByVnicProfileId(getInterface().getVnicProfileId()); Network oldNetwork = networkHelper.getNetworkByVnicProfileId(oldIface.getVnicProfileId()); if (!Objects.equals(oldNetwork, newNetwork)) { externalNetworkManagerFactory.create(oldIface).deallocateIfExternal(); } } macAddedToPool = allocateMacFromRequest(); if (mustChangeAddress(oldIface.getType(), getInterface().getType())) { vmDeviceDao.clearDeviceAddress(getInterface().getId()); } getInterface().setSpeed(VmInterfaceType.forValue(getInterface().getType()).getSpeed()); TransactionSupport.executeInNewTransaction(() -> { bumpVmVersion(); updatePassthoughDeviceIfNeeded(); getCompensationContext().snapshotEntity(oldIface); vmNicDao.update(getInterface()); saveNetworkFilterParameters(); getCompensationContext().stateChanged(); return null; }); succeeded = updateHost(); } finally { setSucceeded(succeeded); macPoolCleanupAfterExecution(macAddedToPool); } }
Source:
private int getMapMode () { String map_mode = PreferenceUtils.getValue(context, PreferenceUtils.KEY_SETTING_MAP_MODE); return (map_mode.equals("0") || map_mode.equals("1") || map_mode.equals("2")) ? Integer.valueOf(map_mode) : 0; }

Target:
private int getMapMode () { String mapMode = PreferenceUtils.getValue(context, PreferenceUtils.KEY_SETTING_MAP_MODE); return Arrays.asList("0", "1", "2").contains(mapMode) ? Integer.valueOf(mapMode) : 0; }
Source:
final void setNewGeneration(final Generation generation) { this.generation = generation; }

Target:
final synchronized void setNewGeneration(final Generation generation) { this.generation = generation; }
Source:
protected boolean InitializeVds() { boolean returnValue = true; if (getVds() == null) { List<VDS> runningVdss = getAllRunningVdssInPool(); setVds(runningVdss.isEmpty() ? null : runningVdss.get(0)); if (getVds() == null) { returnValue = false; addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NO_VDS_IN_POOL); } } return returnValue; }

Target:
protected boolean InitializeVds() { boolean returnValue = true; if (getVds() == null) { List<VDS> runningVdss = getAllRunningVdssInPool(); if (runningVdss.isEmpty()) { returnValue = false; addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NO_VDS_IN_POOL); } else { setVds(runningVdss.get(0)); } } return returnValue; }
Source:
private GQuery updateHeight() { return $(error).height(Window.getClientHeight() - 113); }

Target:
private GQuery updateHeight() { return $(error).height(Window.getClientHeight() - $("footer").height()); }
Source:
public void addsFriend() throws Exception { final Docs docs = new MkBase().user("urn:test:1").docs(); final Doc doc = docs.doc("hey"); final String friend = "urn:test:2"; MatcherAssert.assertThat( Lists.newArrayList(doc.friends().names()), Matchers.not(Matchers.hasItem(friend)) ); MatcherAssert.assertThat( new RsPrint(new TkAddFriend(doc, friend).act()).print(), Matchers.containsString("document+shared") ); MatcherAssert.assertThat( Lists.newArrayList(doc.friends().names()), Matchers.hasItem(friend) ); }

Target:
public void addsFriend() throws Exception { final Docs docs = new MkBase().user("urn:test:1").docs(); final Doc doc = docs.doc("hey"); final String friend = "The Dude"; MatcherAssert.assertThat( Lists.newArrayList(doc.friends().names()), Matchers.not(Matchers.hasItem(friend)) ); MatcherAssert.assertThat( new RsPrint( new TkAddFriend(doc).act( new RqFake( "POST", "/", String.format("friend=%s", friend) ) ) ).print(), Matchers.containsString("document+shared") ); MatcherAssert.assertThat( Lists.newArrayList(doc.friends().names()), Matchers.hasItem(friend) ); }
Source:
@Test public void nullUrlThrows() { try { Endpoint.createFixed(" "); } catch (IllegalArgumentException expected) { assertThat(expected).hasMessage("url is empty"); } }

Target:
@Test public void nullUrlThrows() { try { Endpoint.createFixed(null); fail(); } catch (NullPointerException e) { assertThat(e).hasMessage("url == null"); } }
Source:
private void setupSuggestionServiceAndAdapter() { if (!isAdded() || mSiteStore.hasWPComOrJetpackSiteWithSiteId(mSite.getSiteId())) { return; } mSuggestionServiceConnectionManager = new SuggestionServiceConnectionManager(getActivity(), mSite.getSiteId()); mSuggestionAdapter = SuggestionUtils.setupSuggestions(mSiteStore.getSiteBySiteId(mSite.getSiteId()), getActivity(), mSuggestionServiceConnectionManager); if (mSuggestionAdapter != null) { mEditReply.setAdapter(mSuggestionAdapter); } }

Target:
private void setupSuggestionServiceAndAdapter() { if (!isAdded() || !mSite.isWPCom()) { return; } mSuggestionServiceConnectionManager = new SuggestionServiceConnectionManager(getActivity(), mSite.getSiteId()); mSuggestionAdapter = SuggestionUtils.setupSuggestions(mSiteStore.getSiteBySiteId(mSite.getSiteId()), getActivity(), mSuggestionServiceConnectionManager); if (mSuggestionAdapter != null) { mEditReply.setAdapter(mSuggestionAdapter); } }
Source:
private static double weightedAverageSorted(double x1, double w1, double x2, double w2) { checkArgument(x1 <= x2, "error"); final double x = (x1 * w1 + x2 * w2) / (w1 + w2); return Math.max(x1, Math.min(x, x2)); }

Target:
private static double weightedAverageSorted(double x1, double w1, double x2, double w2) { final double x = (x1 * w1 + x2 * w2) / (w1 + w2); return Math.max(x1, Math.min(x, x2)); }
Source:
private Element handle() { return textElement(BlogConstants.BLOG_HANDLE, entity.getHandle()); }

Target:
private Element handle() { return textElement(BLOG_HANDLE, entity.getHandle()); }
Source:
public int size() { return authValue.length(); }

Target:
public int size() { if (authValue == null) { getAuthValue(); } return authValue == null ? 0 : authValue.length(); }
Source:
public static final void translate(Group group, Vector3d v) { for (Atom atom : group.getAtoms()) { translate(atom, v); } for (Group altG : group.getAltLocs()) { for (Atom atom : altG.getAtoms()) { translate(atom, v); } } }

Target:
public static final void translate(Group group, Vector3d v) { for (Atom atom : group.getAtoms()) { translate(atom, v); } for (Group altG : group.getAltLocs()) { translate(altG, v); } }
Source:
public Statement apply(final Statement base, final Description description) { return new Statement() { @Override public void evaluate() throws Throwable { State.runnerStarted(); if (!State.hasTestAdaptor()) { if (State.hasInitializationException()) { throw new RuntimeException( "Arquillian has previously been attempted initialized, but failed. " + "See cause for previous exception", State.getInitializationException()); } else { try { TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder .build(); adaptor.beforeSuite(); State.testAdaptor(adaptor); } catch (Exception e) { State.caughtInitializationException(e); State.runnerFinished(); if (State.isLastRunner()) { State.clean(); } throw e; } } } if (State.hasTestAdaptor()) { adaptor = State.getTestAdaptor(); } adaptor.beforeClass(description.getTestClass(), LifecycleMethodExecutor.NO_OP); try { base.evaluate(); } finally { adaptor.afterClass(description.getTestClass(), LifecycleMethodExecutor.NO_OP); State.runnerFinished(); if (State.isLastRunner()) { try { adaptor.afterSuite(); adaptor.shutdown(); } finally { State.clean(); } } adaptor = null; } } }; }

Target:
public Statement apply(final Statement base, final Description description) { return new Statement() { @Override public void evaluate() throws Throwable { State.runnerStarted(); if (!State.hasTestAdaptor()) { if (State.hasInitializationException()) { throw new RuntimeException( "Arquillian initialization has already been attempted, but failed. See previous exceptions for cause", State.getInitializationException()); } else { try { TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder .build(); adaptor.beforeSuite(); State.testAdaptor(adaptor); } catch (Exception e) { State.caughtInitializationException(e); State.runnerFinished(); if (State.isLastRunner()) { State.clean(); } throw e; } } } if (State.hasTestAdaptor()) { adaptor = State.getTestAdaptor(); } adaptor.beforeClass(description.getTestClass(), LifecycleMethodExecutor.NO_OP); try { base.evaluate(); } finally { adaptor.afterClass(description.getTestClass(), LifecycleMethodExecutor.NO_OP); State.runnerFinished(); if (State.isLastRunner()) { try { adaptor.afterSuite(); adaptor.shutdown(); } finally { State.clean(); } } adaptor = null; } } }; }