auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private JavaTypeDefinition getTypeDefinitionOfVariableFromScope(Scope scope, String image, Class<?> accessingClass) { if (accessingClass == null) { return null; } for ( ; scope != null; scope = scope.getParent()) { for (Map.Entry<VariableNameDeclaration, List<NameOccurrence>> entry : scope.getDeclarations(VariableNameDeclaration.class).entrySet()) { if (entry.getKey().getImage().equals(image)) { ASTType typeNode = entry.getKey().getDeclaratorId().getTypeNode(); if (typeNode != null) { return null; } if (typeNode.jjtGetChild(0) instanceof ASTReferenceType) { return ((TypeNode) typeNode.jjtGetChild(0)).getTypeDefinition(); } else { return JavaTypeDefinition.build(typeNode.getType()); } } } if (scope instanceof ClassScope) { try { JavaTypeDefinition superClass = getSuperClassTypeDefinition(((ClassScope) scope).getClassDeclaration().getNode(), null); JavaTypeDefinition foundTypeDef = getFieldType(superClass, image, accessingClass); if (foundTypeDef != null) { return foundTypeDef; } } catch (ClassCastException e) { } } } return null; }

Target:
private JavaTypeDefinition getTypeDefinitionOfVariableFromScope(Scope scope, String image, Class<?> accessingClass) { if (accessingClass == null) { return null; } for ( ; scope != null; scope = scope.getParent()) { for (Map.Entry<VariableNameDeclaration, List<NameOccurrence>> entry : scope.getDeclarations(VariableNameDeclaration.class).entrySet()) { if (entry.getKey().getImage().equals(image)) { ASTType typeNode = entry.getKey().getDeclaratorId().getTypeNode(); if (typeNode == null) { return null; } if (typeNode.jjtGetChild(0) instanceof ASTReferenceType) { return ((TypeNode) typeNode.jjtGetChild(0)).getTypeDefinition(); } else { return JavaTypeDefinition.build(typeNode.getType()); } } } if (scope instanceof ClassScope) { try { JavaTypeDefinition superClass = getSuperClassTypeDefinition(((ClassScope) scope).getClassDeclaration().getNode(), null); JavaTypeDefinition foundTypeDef = getFieldType(superClass, image, accessingClass); if (foundTypeDef != null) { return foundTypeDef; } } catch (ClassCastException e) { } } } return null; }
Source:
private void blockPartitionLocationChangesOnReplSource(Database db, Table tbl, EnvironmentContext ec) throws InvalidOperationException { if (!ReplChangeManager.isSourceOfReplication(db)) { return; } if (conf.getBoolean(MetastoreConf.ConfVars.STRICT_MANAGED_TABLES.getHiveName(), false)) { return; } boolean isChangingLocation = false; if (ec.isSetProperties()) { String alterType = ec.getProperties().get(ALTER_TABLE_OPERATION_TYPE); if (alterType != null && alterType.equalsIgnoreCase(ALTERLOCATION)) { isChangingLocation = true; } } if (isChangingLocation && tbl.getTableType().equalsIgnoreCase(TableType.MANAGED_TABLE.name())) { throw new InvalidOperationException("Cannot change location of a managed table " + TableName.getQualified(tbl.getCatName(), tbl.getDbName(), tbl.getTableName()) + " as it is enabled for replication."); } }

Target:
private void blockPartitionLocationChangesOnReplSource(Database db, Table tbl, EnvironmentContext ec) throws InvalidOperationException { if (!ReplChangeManager.isSourceOfReplication(db)) { return; } if (ec.isSetProperties()) { String alterType = ec.getProperties().get(ALTER_TABLE_OPERATION_TYPE); if (alterType != null && alterType.equalsIgnoreCase(ALTERLOCATION) && tbl.getTableType().equalsIgnoreCase(TableType.MANAGED_TABLE.name())) { throw new InvalidOperationException("Cannot change location of a managed table " + TableName.getQualified(tbl.getCatName(), tbl.getDbName(), tbl.getTableName()) + " as it is enabled for replication."); } } }
Source:
protected void drawBackground(final float f, final int mouseX, final int mouseY) { super.drawBackground(f, mouseX, mouseY); final Layer layer = Layer.BACKGROUND; drawString("IN", 100, 43, 4210752, layer); drawSlot(100, 53, layer); drawString("OUT", 140, 43, 4210752, layer); drawSlot(140, 53, layer); }

Target:
protected void drawBackground(final float f, final int mouseX, final int mouseY) { super.drawBackground(f, mouseX, mouseY); final Layer layer = Layer.BACKGROUND; drawString(StringUtils.t("gui.techreborn.unit.in"), 100, 43, 4210752, layer); drawSlot(100, 53, layer); drawString(StringUtils.t("gui.techreborn.unit.out"), 140, 43, 4210752, layer); drawSlot(140, 53, layer); }
Source:
public DbUser(DirectoryUser directoryUser) { externalId = directoryUser.getId(); domain = directoryUser.getDirectoryName(); namespace = directoryUser.getNamespace(); loginName = directoryUser.getPrincipal() != null ? directoryUser.getPrincipal() : directoryUser.getName(); this.setFirstName(directoryUser.getFirstName()); this.setLastName(lastName = directoryUser.getLastName()); this.setDepartment(directoryUser.getDepartment()); email = directoryUser.getEmail(); note = ""; groupNames = new HashSet<>(); for (DirectoryGroup directoryGroup : directoryUser.getGroups()) { groupNames.add(directoryGroup.getName()); } userOptions = emptyMap(); }

Target:
public DbUser(DirectoryUser directoryUser) { externalId = directoryUser.getId(); domain = directoryUser.getDirectoryName(); namespace = directoryUser.getNamespace(); loginName = directoryUser.getPrincipal() != null ? directoryUser.getPrincipal() : directoryUser.getName(); this.setFirstName(directoryUser.getFirstName()); this.setLastName(lastName = directoryUser.getLastName()); this.setDepartment(directoryUser.getDepartment()); email = directoryUser.getEmail(); note = ""; groupNames = new HashSet<>(); for (DirectoryGroup directoryGroup : directoryUser.getGroups()) { groupNames.add(directoryGroup.getName()); } userOptions = Collections.emptyMap(); }
Source:
public void getConceptByNameOrIdOrMap_shouldFindAConceptByItsConceptName() { String conceptName = "COUGH SYRUP"; Assert.assertEquals("3", conceptService.getConceptByNameOrIdOrMap(conceptName).getConceptId().toString()); }

Target:
public void getConceptByNameOrIdOrMap_shouldFindAConceptByItsConceptName() { String conceptName = "COUGH SYRUP"; Assert.assertEquals("3", conceptService.getConceptByReference(conceptName).getConceptId().toString()); }
Source:
public static JSONArray walkToJSON(FormEntryModel fem, FormEntryController fec) { try { JSONArray ret = new JSONArray(); FormIndex formIndex = FormIndex.createBeginningOfFormIndex(); Walker walker = new Walker(ret, formIndex, fec, fem); walker.walk(); return ret; } catch (Exception e) { e.printStackTrace(); return null; } }

Target:
public static JSONArray walkToJSON(FormEntryModel fem, FormEntryController fec) { JSONArray ret = new JSONArray(); FormIndex formIndex = FormIndex.createBeginningOfFormIndex(); Walker walker = new Walker(ret, formIndex, fec, fem); walker.walk(); return ret; }
Source:
private Supplier<PartitionProcessor> getPartitionProcessorSupplier() { return () -> new PartitionProcessor() { @Override public Mono<Void> processEvent(PartitionEvent partitionEvent) { return processEvent.apply(partitionEvent); } @Override public Mono<Void> initialize(InitializationContext initializationContext) { if (initializePartition != null) { return initializePartition.apply(initializationContext); } return super.initialize(initializationContext); } @Override public void processError(ErrorContext errorContext) { if (processError != null) { processError.apply(errorContext); return; } super.processError(errorContext); } @Override public Mono<Void> close(CloseContext closeContext) { if (closePartition != null) { return closePartition.apply(closeContext); } return super.close(closeContext); } }; }

Target:
private Supplier<PartitionProcessor> getPartitionProcessorSupplier() { return () -> new PartitionProcessor() { @Override public Mono<Void> processEvent(PartitionEvent partitionEvent) { return processEvent.apply(partitionEvent); } @Override public Mono<Void> initialize(InitializationContext initializationContext) { if (initializePartition != null) { return initializePartition.apply(initializationContext); } return super.initialize(initializationContext); } @Override public void processError(EventProcessingErrorContext eventProcessingErrorContext) { if (processError != null) { processError.apply(eventProcessingErrorContext); } else { super.processError(eventProcessingErrorContext); } } @Override public Mono<Void> close(CloseContext closeContext) { if (closePartition != null) { return closePartition.apply(closeContext); } return super.close(closeContext); } }; }
Source:
public void requestWhenPortMapperTwiceInvokedThenDoesNotOverride() throws Exception { this.spring.register(InvokeTwiceDoesNotOverride.class).autowire(); MvcResult result = this.mockMvc.perform(get("http://localhost:543")).andReturn(); assertThat(result.getResponse().getHeader("Location")).isEqualTo("https://localhost:123"); }

Target:
public void requestWhenPortMapperTwiceInvokedThenDoesNotOverride() throws Exception { this.spring.register(InvokeTwiceDoesNotOverride.class).autowire(); this.mockMvc.perform(get("http://localhost:543")) .andExpect(redirectedUrl("https://localhost:123")); }
Source:
public static void smite(final Player player) { TFM_Util.bcastMsg(player.getName() + " has been a naughty, naughty boy.", ChatColor.RED); player.setOp(false); player.setGameMode(GameMode.SURVIVAL); player.getInventory().clear(); final Location targetPos = player.getLocation(); final World world = player.getWorld(); for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { final Location strike_pos = new Location(world, targetPos.getBlockX() + x, targetPos.getBlockY(), targetPos.getBlockZ() + z); world.strikeLightning(strike_pos); } } player.setHealth(0.0); player.sendMessage("You were smited by:" + sender.getName()); }

Target:
public static void smite(final Player player) { TFM_Util.bcastMsg(player.getName() + " has been a naughty, naughty boy.", ChatColor.RED); player.setOp(false); player.setGameMode(GameMode.SURVIVAL); player.getInventory().clear(); final Location targetPos = player.getLocation(); final World world = player.getWorld(); for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { final Location strike_pos = new Location(world, targetPos.getBlockX() + x, targetPos.getBlockY(), targetPos.getBlockZ() + z); world.strikeLightning(strike_pos); } } player.setHealth(0.0); }
Source:
public AbstractStringAssert<?> asHexString() { objects.assertNotNull(info, actual); return Assertions.assertThat(Hexadecimals.toHexString(actual)); }

Target:
public AbstractStringAssert<?> asHexString() { objects.assertNotNull(info, actual); return Assertions.assertThat(toHexString(actual)); }
Source:
public VisualEditorSaveChangesDialog clickPublishButton() { waitForElementNotPresent(saveButtonDisabled); waitForElementClickableByElement(savePageButton); savePageButton.click(); return new VisualEditorSaveChangesDialog(driver); }

Target:
public VisualEditorSaveChangesDialog clickPublishButton() { waitForElementNotPresent(publishButtonDisabled); waitForElementClickableByElement(publishPageButton); publishPageButton.click(); return new VisualEditorSaveChangesDialog(driver); }
Source:
public static void showRateDialog(final Activity activity) { final RateDialogFragment fragment = RateDialogFragment.newInstance(sIsShoWNeutralButton); fragment.show(activity.getFragmentManager(), TAG); }

Target:
private static void showRateDialog(final Activity activity) { final RateDialogFragment fragment = RateDialogFragment.newInstance(sIsShoWNeutralButton); fragment.show(activity.getFragmentManager(), TAG); }
Source:
public boolean equals(Object obj) { if (!(obj instanceof SetViewportToSizeOf)) return false; SetViewportToSizeOf other = (SetViewportToSizeOf) obj; return getWidth() == other.getWidth() && getHeight() == other.getHeight(); }

Target:
public boolean equals(Object obj) { if (!(obj instanceof SetViewportToSizeOf)) return false; SetViewportToSizeOf other = (SetViewportToSizeOf) obj; return getFbo().width() == other.getFbo().width() && getFbo().height() == other.getFbo().height(); }
Source:
private void InitVdsBroker() { log.infoFormat("Initialize vdsBroker ({0},{1})", vds.getHostName(), vds.getPort()); vdsProxy = new VdsServerWrapper(vds.getHostName(), vds.getPort()); }

Target:
private void InitVdsBroker() { log.infoFormat("Initialize vdsBroker ({0},{1})", vds.getHostName(), vds.getPort()); int clientTimeOut = Config.<Integer> getValue(ConfigValues.vdsTimeout) * 1000; int connectionTimeOut = Config.<Integer> getValue(ConfigValues.vdsConnectionTimeout) * 1000; int heartbeat = Config.<Integer> getValue(ConfigValues.vdsHeartbeatInSeconds) * 1000; int clientRetries = Config.<Integer> getValue(ConfigValues.vdsRetries); vdsProxy = TransportFactory.createVdsServer( vds.getProtocol(), vds.getHostName(), vds.getPort(), clientTimeOut, connectionTimeOut, clientRetries, heartbeat); }
Source:
private boolean createAndStartSupervisorInternal(SupervisorSpec spec, boolean persistSpec) { String id = spec.getId(); if (supervisors.containsKey(id)) { return false; } Supervisor supervisor = spec.createSupervisor(); supervisor.start(); if (persistSpec) { try { metadataSupervisorManager.insert(id, spec); } catch (Exception e) { supervisor.stop(false); Throwables.propagate(e); } } supervisors.put(id, Pair.of(supervisor, spec)); return true; }

Target:
private boolean createAndStartSupervisorInternal(SupervisorSpec spec, boolean persistSpec) { String id = spec.getId(); if (supervisors.containsKey(id)) { return false; } if (persistSpec) { metadataSupervisorManager.insert(id, spec); } Supervisor supervisor = null; try { supervisor = spec.createSupervisor(); supervisor.start(); } catch (Exception e) { if (persistSpec) { metadataSupervisorManager.insert(id, new NoopSupervisorSpec()); } Throwables.propagate(e); } supervisors.put(id, Pair.of(supervisor, spec)); return true; }
Source:
private void getTestProcedureTraceability(BranchId testProcedureBranch) { Map<String, Artifact> testProcedureBranchReqsToReqsBranchMap = new HashMap<>(); List<Artifact> artifacts = ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SoftwareRequirement, testProcedureBranch); if (artifacts != null) { ViewIdUtility.removeExcludedArtifacts(artifacts.iterator(), excludedArtifactIdMap); } if (artifacts != null) { for (Artifact tpRequirement : artifacts) { testProcedureBranchReqsToReqsBranchMap.put(tpRequirement.getName(), tpRequirement); } } Set<String> testProceduresFilter = getAllowedTestProcedures(); for (Entry<String, Artifact> entry : testProcedureBranchReqsToReqsBranchMap.entrySet()) { Artifact requirement = entry.getValue(); Set<Artifact> foundProcedures = new HashSet<Artifact>(requirement.getRelatedArtifacts(CoreRelationTypes.Validation__Validator)); ViewIdUtility.removeExcludedArtifacts(foundProcedures.iterator(), excludedArtifactIdMap); Set<Artifact> toAdd = new HashSet<>(); if (testProceduresFilter.isEmpty() != true) { for (Artifact artifact : foundProcedures) { if (testProceduresFilter.contains(artifact.getName())) { toAdd.add(artifact); } } } else { toAdd = foundProcedures; } requirementNameToTestProcedures.put(entry.getKey(), toAdd); for (Artifact artifact : toAdd) { this.testProcedures.put(artifact.getName(), artifact); } } }

Target:
private void getTestProcedureTraceability(BranchId testProcedureBranch) { Map<String, Artifact> testProcedureBranchReqsToReqsBranchMap = new HashMap<>(); List<Artifact> artifacts = ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SoftwareRequirement, testProcedureBranch); if (artifacts != null) { ViewIdUtility.removeExcludedArtifacts(artifacts.iterator(), excludedArtifactIdMap); for (Artifact tpRequirement : artifacts) { testProcedureBranchReqsToReqsBranchMap.put(tpRequirement.getName(), tpRequirement); } } Set<String> testProceduresFilter = getAllowedTestProcedures(); for (Entry<String, Artifact> entry : testProcedureBranchReqsToReqsBranchMap.entrySet()) { Artifact requirement = entry.getValue(); Set<Artifact> foundProcedures = new HashSet<Artifact>(requirement.getRelatedArtifacts(CoreRelationTypes.Validation__Validator)); ViewIdUtility.removeExcludedArtifacts(foundProcedures.iterator(), excludedArtifactIdMap); Set<Artifact> toAdd = new HashSet<>(); if (testProceduresFilter.isEmpty() != true) { for (Artifact artifact : foundProcedures) { if (testProceduresFilter.contains(artifact.getName())) { toAdd.add(artifact); } } } else { toAdd = foundProcedures; } requirementNameToTestProcedures.put(entry.getKey(), toAdd); for (Artifact artifact : toAdd) { this.testProcedures.put(artifact.getName(), artifact); } } }
Source:
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { switch (world.provider.getDimension()) { case -1: break; case 0: generateSurface(world, random, chunkX * 16, chunkZ * 16); break; case 1: break; } }

Target:
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { switch (world.provider.getDimension()) { case -1: generateNether(world, random, chunkX * 16, chunkZ * 16); break; case 0: generateSurface(world, random, chunkX * 16, chunkZ * 16); break; case 1: generateEnd(world, random, chunkX * 16, chunkZ * 16); break; } }
Source:
public void testGetStrippedVdsUniqueIdOnlyAllowrdChars() { RegisterVdsParameters paramsMock = getQueryParameters(); when(paramsMock.getVdsUniqueId()).thenReturn("Test_123"); String result = getQuery().getStrippedVdsUniqueId(); assertEquals("Test_123", result); }

Target:
public void testGetStrippedVdsUniqueIdOnlyAllowrdChars() { RegisterVdsParameters paramsMock = getQueryParameters(); when(paramsMock.getVdsUniqueId()).thenReturn("Test_123"); String result = getQuery().getStrippedVdsUniqueId(); assertEquals("Vds id doesn't equal to the expected value", "Test_123", result); }
Source:
public void registerOutput(IAnalysisOutput output) { fOutputs.add(output); }

Target:
public void registerOutput(IAnalysisOutput output) { if (!fOutputs.contains(output)) { fOutputs.add(output); } }
Source:
public default IVariableBinding[] getSyntheticOuterLocals() { return null; }

Target:
public default IVariableBinding[] getSyntheticOuterLocals() { return new IVariableBinding[0]; }
Source:
public void fetchImageServingUrl() { try { RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET, uploader.getBaseUrl() + "/image_url"); requestBuilder.sendRequest(null, new RequestCallback() { @Override public void onResponseReceived(Request request, Response response) { servingUrl = response.getText(); setStateAfterUpload(); } @Override public void onError(Request request, Throwable exception) { Log.error("Failed to fetch image serving url. ", exception); setStateAfterUpload(); } }); } catch (Exception e) { Log.error("Failed to send request for fetching serving url. ", e); setStateAfterUpload(); } }

Target:
public void fetchImageServingUrl() { try { RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET, uploader.getBaseUrl() + "/imageUrl"); requestBuilder.sendRequest(null, new RequestCallback() { @Override public void onResponseReceived(Request request, Response response) { if (response.getStatusCode() == Http.Status.OK.getCode()) { servingUrl = response.getText(); setState(State.LOADED); } else { setState(State.FAILED); } } @Override public void onError(Request request, Throwable exception) { Log.error("Failed to fetch image serving url. ", exception); setState(State.FAILED); } }); } catch (Exception e) { Log.error("Failed to send request for fetching serving url. ", e); setState(State.FAILED); } }
Source:
public int read() throws IOException { if(isClosed) { return -1; } while(true) { synchronized(currentBB) { if(currentBB.remaining() > 0) { return currentBB.get() & MergedByteBuffers.UNSIGNED_BYTE_MASK; } else { if(c.getReadBufferSize() > 0) { currentBB.add(c.getRead()); } else if(isClosed) { return -1; } else { try { currentBB.wait(1000); } catch (InterruptedException e) { Thread.currentThread().interrupt(); ExceptionUtils.handleException(e); } } } } } }

Target:
public int read() throws IOException { if(isClosed) { return -1; } synchronized(currentBB) { while(true) { if(currentBB.remaining() > 0) { return currentBB.get() & MergedByteBuffers.UNSIGNED_BYTE_MASK; } else { if(c.getReadBufferSize() > 0) { currentBB.add(c.getRead()); } else if(isClosed) { return -1; } else { try { currentBB.wait(1000); } catch (InterruptedException e) { Thread.currentThread().interrupt(); ExceptionUtils.handleException(e); } } } } } }
Source:
public long getPeriod() { return timeUnit.convert(nsPeriod, TimeUnit.NANOSECONDS); }

Target:
public long getPeriod() { return period; }
Source:
public static boolean isMarkdownEnabled(){ return doesPropertyMatch(MARKDOWN_ENABLED, BuildConfig.DEBUG ? CommCarePreferences.YES : CommCarePreferences.NO, CommCarePreferences.YES); }

Target:
public static boolean isMarkdownEnabled(){ return doesPropertyMatch(MARKDOWN_ENABLED, CommCarePreferences.NO, CommCarePreferences.YES); }
Source:
public PushTagsPage(Repository repository, Collection<String> tagNamesToSelect) { super(UIText.PushTagsPage_PageName); setTitle(UIText.PushTagsPage_PageTitle); setMessage(UIText.PushTagsPage_PageMessage); this.repository = repository; for (String tagName : tagNamesToSelect) { if (tagName.startsWith(Constants.R_TAGS)) { tagRefNamesToSelect.add(tagName); } else { tagRefNamesToSelect.add(Constants.R_TAGS + tagName); } } }

Target:
public PushTagsPage(Repository repository, Collection<String> tagNamesToSelect) { super(UIText.PushTagsPage_PageName); setTitle(UIText.PushTagsPage_PageTitle); setMessage(UIText.PushTagsPage_PageMessage); this.repository = repository; for (String tagName : tagNamesToSelect) { if (tagName.startsWith(Constants.R_TAGS)) tagRefNamesToSelect.add(tagName); else tagRefNamesToSelect.add(Constants.R_TAGS + tagName); } }
Source:
public static ByteBuf createTaggingContent(ByteBufAllocator allocator, Collection<String> tags) { CompositeByteBuf taggingContent = allocator.compositeBuffer(); tags.stream() .map(tag -> tag.getBytes(StandardCharsets.UTF_8)) .filter(bytes -> bytes.length > 0 && bytes.length < TAG_LENGTH_MAX) .forEach( bytes -> { int capacity = bytes.length + 1; ByteBuf tagByteBuf = allocator.buffer(capacity); tagByteBuf.writeByte(bytes.length); tagByteBuf.writeBytes(bytes); taggingContent.addComponent(true, tagByteBuf); }); return taggingContent; }

Target:
public static ByteBuf createTaggingContent(ByteBufAllocator allocator, Collection<String> tags) { CompositeByteBuf taggingContent = allocator.compositeBuffer(); for (String key : tags) { int length = ByteBufUtil.utf8Bytes(key); if (length == 0 || length > TAG_LENGTH_MAX) { continue; } ByteBuf byteBuf = allocator.buffer().writeByte(length); byteBuf.writeCharSequence(key, StandardCharsets.UTF_8); taggingContent.addComponent(true, byteBuf); } return taggingContent; }
Source:
private Task<? extends Serializable> alterDbTask(Database dbObj) { return alterDbTask(dbObj.getName(), updateDbProps(dbObj, context.dumpDirectory, false), context.hiveConf); }

Target:
private Task<? extends Serializable> alterDbTask(Database dbObj) { return alterDbTask(dbObj.getName(), updateDbProps(dbObj, context.dumpDirectory, !isTableLevelLoad), context.hiveConf); }
Source:
public boolean runCheck() { BukkitTagContext tagContext = new BukkitTagContext(null, null, null, false, null); tagContext.contextSource = source; ObjectTag object = TagManager.tagObject(tag , tagContext); return object.asType(ElementTag.class, tagContext).asBoolean(); }

Target:
public boolean runCheck() { TagContext tagContext = CoreUtilities.noDebugContext.clone(); tagContext.contextSource = source; ObjectTag object = TagManager.tagObject(tag, tagContext); return object.asType(ElementTag.class, tagContext).asBoolean(); }
Source:
public void addRows(Iterable<InputRow> rows) throws InterruptedException { for (final InputRow row : rows) { boolean added = false; while (!closed && !added) { added = buffer.offer(row, 500, TimeUnit.MILLISECONDS); if (!added) { long currTime = System.currentTimeMillis(); if (currTime - lastBufferAddFailMsgTime.get() > 10000) { lastBufferAddFailMsgTime.set(currTime); log.warn("Failed to add event to buffer with current size [%s] . Retrying...", buffer.size()); } } } if (!added) { throw new IllegalStateException("Cannot add events to closed firehose!"); } } }

Target:
public void addRows(Iterable<InputRow> rows) throws InterruptedException { for (final InputRow row : rows) { boolean added = false; while (!closed && !added) { added = buffer.offer(row, 500, TimeUnit.MILLISECONDS); if (!added) { long currTime = System.currentTimeMillis(); long lastTime = lastBufferAddFailMsgTime.get(); if (currTime - lastTime > 10000 && lastBufferAddFailMsgTime.compareAndSet(lastTime, currTime)) { log.warn("Failed to add event to buffer with current size [%s] . Retrying...", buffer.size()); } } } if (!added) { throw new IllegalStateException("Cannot add events to closed firehose!"); } } }
Source:
public List<URL> findAllRepositories() { for (StreamService ss : streams) { return ss.findAllRepositories(); } return null; }

Target:
public List<URL> findAllRepositories() { checkStreamServiceExists(); List<URL> urls=new ArrayList<>(); for (StreamService ss : streams) { urls.addAll(ss.findAllRepositories()); } return urls; }
Source:
private void validate() { ArgChecker.inRangeInclusive(recoveryRate, 0d, 1d, "recovery rate must be between 0 and 1"); }

Target:
private void validate() { ArgChecker.inRangeInclusive(recoveryRate, 0d, 1d, "recoveryRate"); }
Source:
void disconnect() { running = false; queryExecutor.shutdown(); try { if (!queryExecutor.awaitTermination(5, TimeUnit.SECONDS)) { logger.warn("Awaited Query Bus termination for 5 seconds. Wait period extended by 30 seconds."); } if (!queryExecutor.awaitTermination(20, TimeUnit.SECONDS)) { logger.warn("Awaited Query Bus termination for 35 seconds. Will shutdown forcefully."); queryExecutor.shutdownNow(); } } catch (InterruptedException e) { logger.warn("Awaiting termination of Query Bus got interrupted. Will shutdown immediately", e); queryExecutor.shutdownNow(); Thread.currentThread().interrupt(); } Optional.ofNullable(this.outboundStreamObserver).ifPresent(StreamObserver::onCompleted); }

Target:
void disconnect() { if (outboundStreamObserver != null) { outboundStreamObserver.onCompleted(); } running = false; queryExecutor.shutdown(); try { if (!queryExecutor.awaitTermination(5, TimeUnit.SECONDS)) { logger.warn("Awaited Query Bus termination for 5 seconds. Wait period extended by 30 seconds."); } if (!queryExecutor.awaitTermination(30, TimeUnit.SECONDS)) { logger.warn("Awaited Query Bus termination for 35 seconds. Will shutdown forcefully."); queryExecutor.shutdownNow(); } } catch (InterruptedException e) { logger.warn("Awaiting termination of Query Bus got interrupted. Will shutdown immediately", e); queryExecutor.shutdownNow(); Thread.currentThread().interrupt(); } Optional.ofNullable(this.outboundStreamObserver).ifPresent(StreamObserver::onCompleted); }
Source:
private void resetAdminPasswordIfNecessary() { if (config.getControllerProperties().getPropertyBoolean(PROP_CONTROLLER_ADMIN_PASSWORD_RESET)) { User admin = userRepository.findOneByUserId("admin"); if (admin == null) { createUser("admin", "admin", ADMIN, "admin", "admin@nhn.com"); } else { admin.setRole(ADMIN); admin.setPassword(passwordEncoder.encode("admin", "admin")); userRepository.saveAndFlush(admin); } } }

Target:
private void resetAdminPasswordIfNecessary() { if (config.getControllerProperties().getPropertyBoolean(PROP_CONTROLLER_ADMIN_PASSWORD_RESET)) { User admin = userRepository.findOneByUserId("admin"); if (admin == null) { createUser("admin", "admin", ADMIN, "admin", "ngrinder-admin@naver.com"); } else { admin.setRole(ADMIN); admin.setPassword(passwordEncoder.encode("admin", "admin")); userRepository.saveAndFlush(admin); } } }
Source:
public AcknowledgementType auditLog(LogEventRequestType request, AssertionType assertion) { AcknowledgementType result = new AcknowledgementType(); if (request.getAuditMessage() == null) { LOG.error("Audit Request Message is null."); return result; } try { String url = oProxyHelper.getUrlLocalHomeCommunity(NhincConstants.AUDIT_REPO_SERVICE_NAME); if (NullChecker.isNotNullish(url)) { ServicePortDescriptor<AuditRepositoryManagerPortType> portDescriptor = new AuditRepositoryUnsecuredServicePortDescriptor(); CONNECTClient<AuditRepositoryManagerPortType> client = CONNECTCXFClientFactory.getInstance() .getCONNECTClientUnsecured(portDescriptor, url, assertion); result = (AcknowledgementType) client.invokePort(AuditRepositoryManagerPortType.class, invokeMethodName, request); } } catch (Exception e) { LOG.error("Failed to call the web service ({}). An unexpected exception occurred. Exception: {}", NhincConstants.AUDIT_REPO_SERVICE_NAME, e.getLocalizedMessage(), e); } LOG.debug("In AuditRepositoryProxyWebServiceUnsecuredImpl.auditLog(...) - completed called to " + "ConnectionManager to retrieve endpoint."); return result; }

Target:
public AcknowledgementType auditLog(LogEventRequestType request, AssertionType assertion) { AcknowledgementType result = new AcknowledgementType(); if (request.getAuditMessage() == null) { LOG.error("Audit Request Message is null."); return result; } try { String url = oProxyHelper.getUrlLocalHomeCommunity(NhincConstants.AUDIT_REPO_SERVICE_NAME); if (NullChecker.isNotNullish(url)) { ServicePortDescriptor<AuditRepositoryManagerPortType> portDescriptor = new AuditRepositoryUnsecuredServicePortDescriptor(); CONNECTClient<AuditRepositoryManagerPortType> client = CONNECTCXFClientFactory.getInstance() .getCONNECTClientUnsecured(portDescriptor, url, assertion); result = (AcknowledgementType) client.invokePort(AuditRepositoryManagerPortType.class, invokeMethodName, request); } } catch (Exception e) { LOG.error("Failed to call the web service ({}). An unexpected exception occurred. Exception: {}", NhincConstants.AUDIT_REPO_SERVICE_NAME, e.getLocalizedMessage(), e); } LOG.debug( "In AuditRepositoryProxyWebServiceUnsecuredImpl.auditLog(...) - completed called to ConnectionManager to retrieve endpoint."); return result; }
Source:
public void testBug547691() throws Exception { String projectName = getUniqueString(); IWorkspace workspace = getWorkspace(); IProject project = workspace.getRoot().getProject(projectName); IProjectDescription projectDescription = workspace.newProjectDescription(projectName); project.create(projectDescription, null); project.open(null); FileSystemResourceManager manager = ((Workspace) getWorkspace()).getFileSystemManager(); URI location = manager.locationURIFor(project); assertNotNull("Expected location for accessible project to not be null", location); project.delete(true, null); location = manager.locationURIFor(project); assertNotNull("Expected location for deleted project to not be null", location); }

Target:
public void testBug547691() throws Exception { String projectName = getUniqueString(); IWorkspace workspace = getWorkspace(); IProject project = workspace.getRoot().getProject(projectName); IProjectDescription projectDescription = workspace.newProjectDescription(projectName); project.create(projectDescription, null); project.open(null); FileSystemResourceManager manager = ((Workspace) getWorkspace()).getFileSystemManager(); URI location = manager.locationURIFor(project); assertNotNull("Expected location for accessible project to not be null", location); project.delete(true, null); URI locationAfterDelete = manager.locationURIFor(project); assertEquals("Expected location of project to not change after delete", location, locationAfterDelete); }
Source:
public void resourceChanged(IResourceChangeEvent event) { if (event.getType() == IResourceChangeEvent.PRE_DELETE || event.getType() == IResourceChangeEvent.PRE_CLOSE) { if (event.getResource() instanceof IProject) { IProject project = (IProject) event.getResource(); try { if (project.hasNature(TmfProjectNature.ID)) { TmfProjectElement tmfProjectElement = registry.get(project); if (tmfProjectElement == null) { return; } final List<TmfTraceElement> traces = tmfProjectElement.getTracesFolder().getTraces(); if (!traces.isEmpty()) { Display.getDefault().syncExec(new Runnable() { @Override public void run() { for (TmfTraceElement traceElement : traces) { traceElement.closeEditors(); } } }); } } } catch (CoreException e) { Activator.getDefault().logError("Error handling resource change event for " + project.getName(), e); } } } else if (event.getType() == IResourceChangeEvent.POST_CHANGE) { for (IResourceDelta delta : event.getDelta().getAffectedChildren()) { if (delta.getResource() instanceof IProject) { IProject project = (IProject) delta.getResource(); try { if (delta.getKind() == IResourceDelta.CHANGED && project.isOpen() && project.hasNature(TmfProjectNature.ID)) { TmfProjectElement projectElement = getProject(project, true); projectElement.refresh(); } else if (delta.getKind() == IResourceDelta.REMOVED) { registry.remove(project); } } catch (CoreException e) { Activator.getDefault().logError("Error handling resource change event for " + project.getName(), e); } } } } }

Target:
public void resourceChanged(IResourceChangeEvent event) { if (event.getType() == IResourceChangeEvent.PRE_DELETE || event.getType() == IResourceChangeEvent.PRE_CLOSE) { if (event.getResource() instanceof IProject) { IProject project = (IProject) event.getResource(); try { if (project.isAccessible() && project.hasNature(TmfProjectNature.ID)) { TmfProjectElement tmfProjectElement = registry.get(project); if (tmfProjectElement == null) { return; } final List<TmfTraceElement> traces = tmfProjectElement.getTracesFolder().getTraces(); if (!traces.isEmpty()) { Display.getDefault().syncExec(new Runnable() { @Override public void run() { for (TmfTraceElement traceElement : traces) { traceElement.closeEditors(); } } }); } } } catch (CoreException e) { Activator.getDefault().logError("Error handling resource change event for " + project.getName(), e); } } } else if (event.getType() == IResourceChangeEvent.POST_CHANGE) { for (IResourceDelta delta : event.getDelta().getAffectedChildren()) { if (delta.getResource() instanceof IProject) { IProject project = (IProject) delta.getResource(); try { if (delta.getKind() == IResourceDelta.CHANGED && project.isOpen() && project.hasNature(TmfProjectNature.ID)) { TmfProjectElement projectElement = getProject(project, true); projectElement.refresh(); } else if (delta.getKind() == IResourceDelta.REMOVED) { registry.remove(project); } } catch (CoreException e) { Activator.getDefault().logError("Error handling resource change event for " + project.getName(), e); } } } } }
Source:
public BoxDto createBox(@RequestBody BoxDto box, UriComponentsBuilder uriBuilder, HttpServletResponse response) throws IOException { Box boxObj = Dtos.to(box); ValidationResult validation = new ValidationResult(); boxObj.setUse(boxService.getUse(box.getUseId())); boxObj.setSize(boxService.getSize(box.getSizeId())); boxObj.setStorageLocation(storageLocationService.getByBarcode(box.getStorageLocationBarcode())); validation.throwIfInvalid(); Long id = boxService.save(boxObj); return Dtos.asDto(boxService.get(id), false); }

Target:
public BoxDto createBox(@RequestBody BoxDto box, UriComponentsBuilder uriBuilder, HttpServletResponse response) throws IOException { Box boxObj = Dtos.to(box); ValidationResult validation = new ValidationResult(); BoxUse use = new BoxUse(); BoxSize size = new BoxSize(); use.setId(box.getUseId()); size.setId(box.getSizeId()); boxObj.setUse(use); boxObj.setSize(size); boxObj.setStorageLocation(storageLocationService.getByBarcode(box.getStorageLocationBarcode())); validation.throwIfInvalid(); Long id = boxService.save(boxObj); return Dtos.asDto(boxService.get(id), false); }
Source:
public void setUp() throws Exception { ProfileGenerator.RulesConfiguration rulesConfiguration = new ProfileGenerator.RulesConfiguration() .add("IllegalTabCheck", "markAll", "true") .add("XPathCheck", "expression", "count( .add("XPathCheck", "message", "Don't do that"); Set<String> excludedRules = Collections.singleton("XmlSchemaCheck"); File profile = ProfileGenerator.generateProfile(orchestrator.getServer().getUrl(), "xml", "xml", rulesConfiguration, excludedRules); orchestrator.getServer().restoreProfile(FileLocation.of(profile)); }

Target:
public void setUp() throws Exception { ProfileGenerator.RulesConfiguration rulesConfiguration = new ProfileGenerator.RulesConfiguration() .add("IllegalTabCheck", "markAll", "true"); File profile = ProfileGenerator.generateProfile(orchestrator.getServer().getUrl(), LANGUAGE, LANGUAGE, rulesConfiguration, Collections.emptySet()); orchestrator.getServer().restoreProfile(FileLocation.of(profile)); createTemplateRule("XPathCheck", "NumberDependencies", "expression=\"count(/project/dependencies/dependency)>0\";message=\"Don't do that, dammit!\""); }
Source:
private void deleteMail(Account.Id id, final String mailAddress) throws UnloggedFailure { if (mailAddress.equals("ALL")) { ResultSet<AccountExternalId> ids; try { ids = db.accountExternalIds().byAccount(id); } catch (OrmException e) { throw die("Could not query database: " + e.getMessage()); } for (AccountExternalId extId : ids) { if (extId.getEmailAddress() != null) { unlink(id, extId.getEmailAddress()); } } } else { unlink(id, mailAddress); } }

Target:
private void deleteMail(Account.Id id, final String mailAddress) throws UnloggedFailure, OrmException { if (mailAddress.equals("ALL")) { ResultSet<AccountExternalId> ids = db.accountExternalIds().byAccount(id); for (AccountExternalId extId : ids) { if (extId.isScheme(AccountExternalId.SCHEME_MAILTO)) { unlink(id, extId.getEmailAddress()); } } } else { AccountExternalId.Key key = new AccountExternalId.Key( AccountExternalId.SCHEME_MAILTO, mailAddress); AccountExternalId extId = db.accountExternalIds().get(key); if (extId != null) { unlink(id, mailAddress); } } }
Source:
public CreateBranchDialog(Shell parentShell, Repository repo) { super(parentShell, repo, SHOW_LOCAL_BRANCHES | SHOW_REMOTE_BRANCHES | SHOW_TAGS | SHOW_REFERENCES); }

Target:
public CreateBranchDialog(Shell parentShell, Repository repo) { super(parentShell, repo, SHOW_LOCAL_BRANCHES | SHOW_REMOTE_BRANCHES | SHOW_TAGS | SHOW_REFERENCES | SELECT_CURRENT_REF); }
Source:
private void _openSession( String server, long hardTimeout, long softTimeout ) throws Exception { log.debug( String.format( "_openSession enter (%1$s, %2$d, %3$d)", server, hardTimeout, softTimeout ) ); try { if (this.client != null) { log.debug("_openSession already has client"); } else { this.client = new SSHClient(); this.client.setHardTimeout(hardTimeout); this.client.setSoftTimeout(softTimeout); this.client.setHost(server, this.port); log.debug("connecting"); this.client.connect(); } } catch(Exception e) { log.debug( String.format( "Could not connect to server %1$s: %2$s", this.client.getDisplayHost(), e.getMessage() ), e ); throw e; } log.debug("_openSession return"); }

Target:
private void _openSession( String server, long hardTimeout, long softTimeout ) throws Exception { log.debug( String.format( "_openSession enter (%1$s, %2$d, %3$d)", server, hardTimeout, softTimeout ) ); try { if (this.client != null) { log.debug("_openSession already has client"); } else { this.client = new SSHClient(); this.client.setHardTimeout(hardTimeout); this.client.setSoftTimeout(softTimeout); this.client.setHost(server, this.port); log.debug("connecting"); this.client.connect(); } } catch(Exception e) { log.debug( String.format( "Could not connect to server %1$s", this.client.getDisplayHost(), ), e ); throw e; } log.debug("_openSession return"); }
Source:
public Vector<T> drop(int n) { if (n <= 0) { return this; } else if (n >= length()) { return empty(); } throw new UnsupportedOperationException(); }

Target:
public Vector<T> drop(int n) { if (n <= 0) { return this; } else if (n >= length()) { return empty(); } else { if (n < leadingLength()) { final int newLeadingOffset = leadingOffset + n; return normalized(type, leading, newLeadingOffset, middle, trailing, trailingLength); } else if (n < trailingStartIndex()) { final VectorTree<T> newMiddle = middle.drop(n - leadingLength()); return normalized(type, emptyArray(), 0, newMiddle, trailing, trailingLength); } else { final int from = n - trailingStartIndex(); final Object newTrailing = copyRange(trailing, from, trailingLength); return normalized(type, emptyArray(), 0, emptyTree(), newTrailing, trailingLength - from); } } }
Source:
public void fetchSegmentToLocal(List<URI> uris, File dest) throws Exception { if (uris == null) { throw new IllegalArgumentException("The input uri list is empty"); } Random r = new Random(); fetchSegmentToLocal(uris.get(r.nextInt(uris.size())), dest); }

Target:
public void fetchSegmentToLocal(List<URI> uris, File dest) throws Exception { if (uris == null) { throw new IllegalArgumentException("The input uri list is empty"); } Random r = new Random(); RetryPolicies.exponentialBackoffRetryPolicy(_retryCount, _retryWaitMs, _retryDelayScaleFactor).attempt(() -> { URI uri = uris.get(r.nextInt(uris.size())); try { fetchSegmentToLocalWithoutRetry(uri, dest); _logger.info("Fetched segment from: to: of size: {}", uri, dest, dest.length()); return true; } catch (Exception e) { _logger.warn("Caught exception while fetching segment from: to: {}", uri, dest, e); return false; } }); }
Source:
private Pod getChePodByContainerId(String containerId) throws IOException { Map<String, String> podLabels = new HashMap<>(); String labelKey = CHE_CONTAINER_IDENTIFIER_LABEL_KEY; podLabels.put(labelKey, containerId.substring(0,12)); PodList pods = openShiftClient.pods() .inNamespace(this.cheOpenShiftProjectName) .withLabel(CHE_CONTAINER_IDENTIFIER_LABEL_KEY,containerId.substring(0,12)) .list(); if (pods.getItems().size() == 0) { LOG.error("An OpenShift Pod with label " + labelKey + "=" + containerId+" could not be found"); throw new IOException("An OpenShift Pod with label " + labelKey + "=" + containerId+" could not be found"); } if (pods.getItems().size() > 1) { LOG.error("There are " + pods.getItems().size() + " pod with label " + labelKey + "=" + containerId+" (just one was expeced)"); throw new IOException("There are " + pods.getItems().size() + " pod with label " + labelKey + "=" + containerId+" (just one was expeced)"); } return pods.getItems().get(0); }

Target:
private Pod getChePodByContainerId(String containerId) throws IOException { PodList pods = openShiftClient.pods() .inNamespace(this.openShiftCheProjectName) .withLabel(CHE_CONTAINER_IDENTIFIER_LABEL_KEY, getLabelFromContainerID(containerId)) .list(); List<Pod> items = pods.getItems(); if (items.isEmpty()) { LOG.error("An OpenShift Pod with label {}={} could not be found", CHE_CONTAINER_IDENTIFIER_LABEL_KEY, containerId); throw new IOException("An OpenShift Pod with label " + CHE_CONTAINER_IDENTIFIER_LABEL_KEY + "=" + containerId +" could not be found"); } if (items.size() > 1) { LOG.error("There are pod with label {}={} (just one was expeced)", items.size(), CHE_CONTAINER_IDENTIFIER_LABEL_KEY, containerId ); throw new IOException("There are " + items.size() + " pod with label " + CHE_CONTAINER_IDENTIFIER_LABEL_KEY + "=" + containerId + " (just one was expeced)"); } return items.get(0); }
Source:
private void sendOrQueueSubscribeMessage(final InternalChannel channel) { factory.queueOnEventThread(new Runnable() { @Override public void run() { if (connection.getState() == ConnectionState.CONNECTED) { try { if (channel instanceof PrivateEncryptedChannelImpl) { ((PrivateEncryptedChannelImpl)channel).prepareChannel(); } final String message = channel.toSubscribeMessage(); connection.sendMessage(message); channel.updateState(ChannelState.SUBSCRIBE_SENT); } catch (final AuthorizationFailureException e) { clearDownSubscription(channel, e); } } } }); }

Target:
private void sendOrQueueSubscribeMessage(final InternalChannel channel) { factory.queueOnEventThread(new Runnable() { @Override public void run() { if (connection.getState() == ConnectionState.CONNECTED) { try { final String message = channel.toSubscribeMessage(); connection.sendMessage(message); channel.updateState(ChannelState.SUBSCRIBE_SENT); } catch (final AuthorizationFailureException e) { handleAuthenticationFailure(channel, e); } } } }); }
Source:
public boolean contains(Command command) { final Message message = Commands.getMessage(command); if (messages.contains(message)) { final int messageIndex = messages.indexOf(message); final CommandContext actualContext = command.getContext(); final CommandContext expectedContext = contexts.get(messageIndex); return actualContext.equals(expectedContext); } return false; }

Target:
public boolean contains(Command command) { final Message message = Commands.getMessage(command); if (messages.contains(message)) { final int messageIndex = messages.indexOf(message); final CommandContext actualContext = command.getContext(); final CommandContext storedContext = contexts.get(messageIndex); return actualContext.equals(storedContext); } return false; }
Source:
protected void doStart() throws Exception { if (jobLauncher == null) { jobLauncher = resolveJobLauncher(); } if (job == null && jobName != null && jobName.compareTo("dynamic")!=0) { job = CamelContextHelper.mandatoryLookup(getCamelContext(), jobName, Job.class); } }

Target:
protected void doStart() throws Exception { if (jobLauncher == null) { jobLauncher = resolveJobLauncher(); } if (job == null && jobName != null && jobFromHeader == null) { job = CamelContextHelper.mandatoryLookup(getCamelContext(), jobName, Job.class); } }
Source:
public LocalDBEntry getLocalDBEntry(final FileUploadResult fileUploadResult) throws Exception { LocalDB localDB = getLocalDB(fileUploadResult); if (localDB == null || localDB.getLocalDb() == null || localDB.getLocalDb().isEmpty()) return null; return getLocalDBEntry(fileUploadResult, localDB); }

Target:
public LocalDBEntry getLocalDBEntry(final FileUploadResult fileUploadResult) throws Exception { LocalDB localDB = readAndGetLocalDB(fileUploadResult); return getLocalDBEntry(fileUploadResult, localDB); }
Source:
@Test public void testDistinctCountOnMetric() { String sql = "select count(distinct \"store_sales\") from \"foodmart\" " + "where \"store_state\" = 'WA'"; String expectedSubExplain = "PLAN=EnumerableInterpreter\n" + " BindableAggregate(group=[{}], EXPR$0=[COUNT($0)])\n" + " DruidQuery(table=[[foodmart, foodmart]], " + "intervals=[[1900-01-09T00:00:00.000Z/2992-01-10T00:00:00.000Z]], filter=[=($63, 'WA')" + "], groups=[{90}], aggs=[[]])\n" + "\n"; testCountWithApproxDistinct(true, sql, expectedSubExplain, "\"queryType\":\"groupBy\""); testCountWithApproxDistinct(false, sql, expectedSubExplain, "\"queryType\":\"groupBy\""); }

Target:
@Test public void testDistinctCountOnMetric() { String sql = "select count(distinct \"store_sales\") from \"foodmart\" " + "where \"store_state\" = 'WA'"; String expectedSubExplain = "PLAN=EnumerableInterpreter\n" + " BindableAggregate(group=[{}], EXPR$0=[COUNT($0)])\n" + " DruidQuery(table=[[foodmart, foodmart]], " + "intervals=[[1900-01-09T00:00:00.000Z/2992-01-10T00:00:00.000Z]], filter=[=($63, 'WA')" + "], groups=[{90}], aggs=[[]])"; testCountWithApproxDistinct(true, sql, expectedSubExplain, "\"queryType\":\"groupBy\""); testCountWithApproxDistinct(false, sql, expectedSubExplain, "\"queryType\":\"groupBy\""); }