auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Estimate calculateDataSizeForPartitioningKey( HiveColumnHandle partitionColumn, List<HivePartition> queriedPartitions, Map<String, PartitionStatistics> statisticsSample, Estimate rowCount, OptionalDouble rowsPerPartition) { if (rowCount.isValueUnknown() || !rowsPerPartition.isPresent()) { return Estimate.unknownValue(); } String baseType = partitionColumn.getTypeSignature().getBase(); if (!VARCHAR.equals(baseType) && !CHAR.equalsIgnoreCase(baseType)) { return Estimate.unknownValue(); } double knownRowCount = 0; double knownDataSize = 0; for (HivePartition partition : queriedPartitions) { NullableValue value = partition.getKeys().get(partitionColumn); int length = value.isNull() ? 0 : ((Slice) value.getValue()).length(); HiveBasicStatistics partitionStats = statisticsSample.get(partition.getPartitionId()).getBasicStatistics(); double partitionRowCount = partitionStats.getRowCount().isPresent() ? partitionStats.getRowCount().getAsLong() : rowsPerPartition.getAsDouble(); knownRowCount += partitionRowCount; knownDataSize += length * partitionRowCount; } if (knownRowCount <= 0) { return Estimate.unknownValue(); } return new Estimate(knownDataSize / knownRowCount * rowCount.getValue()); }

Target:
private Estimate calculateDataSizeForPartitioningKey( HiveColumnHandle partitionColumn, List<HivePartition> queriedPartitions, Map<String, PartitionStatistics> statisticsSample, Estimate rowCount, OptionalDouble rowsPerPartition) { if (rowCount.isValueUnknown() || !rowsPerPartition.isPresent()) { return Estimate.unknownValue(); } String baseType = partitionColumn.getTypeSignature().getBase(); if (!VARCHAR.equals(baseType) && !CHAR.equalsIgnoreCase(baseType)) { return Estimate.unknownValue(); } double knownRowCount = 0; double knownDataSize = 0; for (HivePartition partition : queriedPartitions) { NullableValue value = partition.getKeys().get(partitionColumn); int length = value.isNull() ? 0 : ((Slice) value.getValue()).length(); double partitionRowCount = orElse( Optional.ofNullable(statisticsSample.get(partition.getPartitionId())) .orElseGet(PartitionStatistics::empty) .getBasicStatistics() .getRowCount(), rowsPerPartition.getAsDouble()); knownRowCount += partitionRowCount; knownDataSize += length * partitionRowCount; } if (knownRowCount == 0) { return Estimate.unknownValue(); } return new Estimate(knownDataSize / knownRowCount * rowCount.getValue()); }
Source:
private void emitOutlinks(Tuple tuple, String url, Metadata metadata, List<Link> links) { URL url_; try { url_ = new URL(url); } catch (MalformedURLException e1) { LOG.error("MalformedURLException on {}", url); eventCounter.scope( "error_outlinks_parsing_" + e1.getClass().getSimpleName()) .incr(); return; } Set<String> slinks = new HashSet<String>(links.size()); for (Link l : links) { if (StringUtils.isBlank(l.getUri())) { continue; } String urlOL = null; try { URL tmpURL = URLUtil.resolveURL(url_, l.getUri()); urlOL = tmpURL.toExternalForm(); } catch (MalformedURLException e) { LOG.debug("MalformedURLException on {}", l.getUri()); eventCounter.scope( "error_out_link_parsing_" + e.getClass().getSimpleName()).incrBy(1); continue; } if (urlFilters != null) { urlOL = urlFilters.filter(url_, metadata, urlOL); if (urlOL == null) { eventCounter.scope("outlink_filtered").incrBy(1); } } if (urlOL != null) { slinks.add(urlOL); eventCounter.scope("outlink_kept").incrBy(1); } } for (String outlink : slinks) { Metadata linkMetadata = metadataTransfer.getMetaForOutlink(url, metadata); collector.emit(StatusStreamName, tuple, new Values(outlink, linkMetadata, Status.DISCOVERED)); } }

Target:
private void emitOutlinks(Tuple tuple, String url, Metadata metadata, List<Link> links) { URL url_; try { url_ = new URL(url); } catch (MalformedURLException e1) { LOG.error("MalformedURLException on {}", url); eventCounter.scope("error_invalid_source_url").incrBy(1); return; } Set<String> slinks = new HashSet<String>(links.size()); for (Link l : links) { if (StringUtils.isBlank(l.getUri())) { continue; } String urlOL = null; try { URL tmpURL = URLUtil.resolveURL(url_, l.getUri()); urlOL = tmpURL.toExternalForm(); } catch (MalformedURLException e) { LOG.debug("MalformedURLException on {}", l.getUri()); eventCounter .scope("error_outlink_parsing_" + e.getClass().getSimpleName()).incrBy(1); continue; } if (urlFilters != null) { urlOL = urlFilters.filter(url_, metadata, urlOL); if (urlOL == null) { eventCounter.scope("outlink_filtered").incrBy(1); } } if (urlOL != null) { slinks.add(urlOL); eventCounter.scope("outlink_kept").incrBy(1); } } for (String outlink : slinks) { Metadata linkMetadata = metadataTransfer.getMetaForOutlink(url, metadata); collector.emit(StatusStreamName, tuple, new Values(outlink, linkMetadata, Status.DISCOVERED)); } }
Source:
public void setWebDialogEnabled(boolean isEnabled) { isWebDialogEnabled = isEnabled; addConfig("webDialogEnabled", isWebDialogEnabled ? "true" : "false"); }

Target:
public void setWebDialogEnabled(boolean isEnabled) { isWebDialogEnabled = isEnabled; }
Source:
private void doMutation(final Mutation mutation) throws RetriesExhaustedWithDetailsException { Long sequenceId = null; try { sequenceId = sizeManager.registerOperationWithHeapSize(mutation.heapSize()); } catch (InterruptedException e) { synchronized (globalExceptions) { addGlobalException(mutation, e); handleExceptions(); } Thread.currentThread().interrupt(); } AccountingFutureCallback callback = new AccountingFutureCallback(mutation, sequenceId); ListenableFuture<? extends GeneratedMessage> request = null; try { request = batchExecutor.issueRequest(mutation); } catch (RuntimeException e) { synchronized (globalExceptions) { callback.onFailure(e); handleExceptions(); } } Futures.addCallback(request, callback, heapSizeExecutor); }

Target:
private void doMutation(final Mutation mutation) throws RetriesExhaustedWithDetailsException { Long sequenceId = null; try { sequenceId = sizeManager.registerOperationWithHeapSize(mutation.heapSize()); } catch (InterruptedException e) { synchronized (globalExceptions) { addGlobalException(mutation, e); handleExceptions(); } Thread.currentThread().interrupt(); return; } AccountingFutureCallback callback = new AccountingFutureCallback(mutation, sequenceId); Futures.addCallback(issueRequest(mutation), callback, heapSizeExecutor); }
Source:
public BoxRequestsMetadata.UpdateFileMetadata getUpdateMetadataRequest(String id, String scope, String template) { BoxRequestsMetadata.UpdateFileMetadata request = new BoxRequestsMetadata.UpdateFileMetadata(getFileMetadataUrl(id, scope, template), mSession); return request; }

Target:
public BoxRequestsMetadata.UpdateFileMetadata getUpdateMetadataRequest(String id, String scope, String template) { return getUpdateFileMetadataRequest(id, scope, template); }
Source:
void testFilterInstances() { for (String region : view.unwrapApi(EC2Api.class).getAvailabilityZoneAndRegionApi().get().describeRegions().keySet()) { Set<? extends Reservation<? extends RunningInstance>> allResults = client.describeInstancesInRegion(region); assertNotNull(allResults); assert allResults.size() >= 0 : allResults.size(); if (!allResults.isEmpty()) { RunningInstance instance = getFirst(getFirst(allResults, null), null); assertNotNull(instance); Set<? extends Reservation<? extends RunningInstance>> filterResults = client.describeInstancesInRegionWithFilter(region, ImmutableMultimap.<String, String>builder() .put("key-name", instance.getKeyName()) .build()); assertNotNull(filterResults); assertTrue(!filterResults.isEmpty(), "No results found for filter, but there should be."); } } }

Target:
void testFilterInstances() { for (String region : view.unwrapApi(EC2Api.class).getAvailabilityZoneAndRegionApi().get().describeRegions().keySet()) { Set<? extends Reservation<? extends RunningInstance>> allResults = client.describeInstancesInRegion(region); assertNotNull(allResults); if (!allResults.isEmpty()) { RunningInstance instance = getFirst(getFirst(allResults, null), null); assertNotNull(instance); Set<? extends Reservation<? extends RunningInstance>> filterResults = client.describeInstancesInRegionWithFilter(region, ImmutableMultimap.<String, String>builder() .put("key-name", instance.getKeyName()) .build()); assertNotNull(filterResults); assertTrue(!filterResults.isEmpty(), "No results found for filter, but there should be."); } } }
Source:
private void getInstalledFontList() { final Set<String> browserFonts = new TreeSet<String>(); JsArrayString candidates = userPrefs_.browserFixedWidthFonts().getGlobalValue(); for (String candidate: JsUtil.asIterable(candidates)) { if (FontDetector.isFontSupported(candidate)) { browserFonts.add(candidate); } } server_.getInstalledFonts(new ServerRequestCallback<JsArrayString>() { @Override public void onResponseReceived(JsArrayString fonts) { browserFonts.addAll(JsUtil.toList(fonts)); populateFontList(browserFonts.toArray(new String[browserFonts.size()])); fontFace_.insertValue(0, DEFAULT_FONT_NAME, DEFAULT_FONT_VALUE); String font = null; if (userPrefs_.serverEditorFontEnabled().getValue()) { font = userPrefs_.serverEditorFont().getValue(); } if (StringUtil.isNullOrEmpty(font)) { fontFace_.setValue(DEFAULT_FONT_VALUE); } else { fontFace_.setValue(font); preview_.setFont(font, true); } initialFontFace_ = StringUtil.notNull(fontFace_.getValue()); } @Override public void onError(ServerError error) { fontFace_.setLabel("Editor font:"); Debug.logError(error); } }); }

Target:
private void getInstalledFontList() { final Set<String> browserFonts = new TreeSet<>(); JsArrayString candidates = userPrefs_.browserFixedWidthFonts().getGlobalValue(); for (String candidate: JsUtil.asIterable(candidates)) { if (FontDetector.isFontSupported(candidate)) { browserFonts.add(candidate); } } server_.getInstalledFonts(new ServerRequestCallback<JsArrayString>() { @Override public void onResponseReceived(JsArrayString fonts) { browserFonts.addAll(JsUtil.toList(fonts)); populateFontList(browserFonts.toArray(new String[browserFonts.size()])); fontFace_.insertValue(0, DEFAULT_FONT_NAME, DEFAULT_FONT_VALUE); String font = null; if (userPrefs_.serverEditorFontEnabled().getValue()) { font = userPrefs_.serverEditorFont().getValue(); } if (StringUtil.isNullOrEmpty(font)) { fontFace_.setValue(DEFAULT_FONT_VALUE); } else { fontFace_.setValue(font); preview_.setFont(font, true); } initialFontFace_ = StringUtil.notNull(fontFace_.getValue()); } @Override public void onError(ServerError error) { fontFace_.setLabel("Editor font:"); Debug.logError(error); } }); }
Source:
public Map<String, SourceFile> processImports(String content, Version version, SourceCodeRepoInterface sourceCodeRepoInterface) { Map<String, SourceFile> imports = new HashMap<>(); SourceFile.FileType fileType = SourceFile.FileType.DOCKSTORE_WDL; final File tempDesc; try { tempDesc = File.createTempFile("temp", ".wdl", Files.createTempDir()); Files.asCharSink(tempDesc, StandardCharsets.UTF_8).write(content); List<String> lines = FileUtils.readLines(tempDesc, StandardCharsets.UTF_8); ArrayList<String> importPaths = new ArrayList<>(); Pattern p = Pattern.compile("^import\\s+\"(\\S+)\""); for (String line : lines) { Matcher m = p.matcher(line); while (m.find()) { String match = m.group(1); if (!match.startsWith("http://") && !match.startsWith("https://")) { importPaths.add(match.replaceFirst("file://", "")); } } } for (String importPath : importPaths) { SourceFile importFile = new SourceFile(); final String fileResponse = sourceCodeRepoInterface.readGitRepositoryFile(fileType, version, importPath); if (fileResponse == null) { SourceCodeRepoInterface.LOG.error("Could not read: " + importPath); continue; } importFile.setContent(fileResponse); importFile.setPath(importPath); importFile.setType(SourceFile.FileType.DOCKSTORE_WDL); imports.put(importFile.getPath(), importFile); } for (SourceFile sf : imports.values()) { imports.putAll(processImports(sf.getContent(), version, sourceCodeRepoInterface)); } } catch (IOException e) { throw new CustomWebApplicationException("Internal server error, out of space", HttpStatus.SC_INSUFFICIENT_SPACE_ON_RESOURCE); } return imports; }

Target:
public Map<String, SourceFile> processImports(String content, Version version, SourceCodeRepoInterface sourceCodeRepoInterface) { return processImports(content, version, sourceCodeRepoInterface, new HashMap<>()); }
Source:
public WebDavHarvester(String address, Set<Listener> initialListeners) { super(5L); Validate.notEmpty(address, "address {location} cannot be empty"); persistenceProvider = new FileSystemPersistenceProvider("harvest/webdav"); webdavListener = new HarvestedResourceListener(); initialListeners.forEach(this::registerListener); persistentKey = DigestUtils.sha1Hex(address); observer = getCachedObserverOrCreate(persistentKey, address); super.init(); }

Target:
public WebDavHarvester(String address, Set<Listener> initialListeners) { super(5L); Validate.notEmpty(address, "Argument address may not be empty"); persistenceProvider = new FileSystemPersistenceProvider("harvest/webdav"); webdavListener = new HarvestedResourceListener(); initialListeners.forEach(this::registerListener); persistentKey = Hashing.sha256().hashString(address, StandardCharsets.UTF_8).toString(); observer = getCachedObserverOrCreate(persistentKey, address); super.init(); }
Source:
private <A> Optional<A> getAnnotation(Class<A> annotationClass) { return Optional.ofNullable((A) annotations.get(annotationClass)); }

Target:
private <A extends Annotation> Optional<A> getAnnotation(Class<A> annotationClass) { return Optional.ofNullable(annotationClass.cast(annotations.get(annotationClass))); }
Source:
private void executePostLoad(Object instance) { ClassInfo classInfo = metadata.classInfo(instance); MethodInfo postLoadMethod = classInfo.postLoadMethodOrNull(); if (postLoadMethod != null) { final Method method = classInfo.getMethod(postLoadMethod); try { method.invoke(instance); } catch (IllegalAccessException | InvocationTargetException e) { logger.error("Failed to execute post load method", e); } } }

Target:
private void executePostLoad(Object instance) { ClassInfo classInfo = metadata.classInfo(instance); MethodInfo postLoadMethod = classInfo.postLoadMethodOrNull(); if (postLoadMethod != null) { final Method method = classInfo.getMethod(postLoadMethod); try { method.invoke(instance); } catch (IllegalAccessException | InvocationTargetException e) { logger.warn("Cannot call PostLoad annotated method on class {}. " + "Make sure it is public and has no arguments", method.getName(), classInfo.name(), e); } } }
Source:
public void dispatchHandle(final Command command) { if (command instanceof DeletePresentationModelCommand) { handleDeletePresentationModelCommand((DeletePresentationModelCommand) command); } else if (command instanceof CreatePresentationModelCommand) { handleCreatePresentationModelCommand((CreatePresentationModelCommand) command); } else if (command instanceof ValueChangedCommand) { handleValueChangedCommand((ValueChangedCommand) command); } else if (command instanceof AttributeMetadataChangedCommand) { handleAttributeMetadataChangedCommand((AttributeMetadataChangedCommand) command); } else { LOG.info("C: cannot handle unknown command '{}'", command ); } }

Target:
public void dispatchHandle(final Command command) { if (command instanceof DeletePresentationModelCommand) { handleDeletePresentationModelCommand((DeletePresentationModelCommand) command); } else if (command instanceof CreatePresentationModelCommand) { handleCreatePresentationModelCommand((CreatePresentationModelCommand) command); } else if (command instanceof ValueChangedCommand) { handleValueChangedCommand((ValueChangedCommand) command); } else if (command instanceof AttributeMetadataChangedCommand) { handleAttributeMetadataChangedCommand((AttributeMetadataChangedCommand) command); } else { LOG.error("C: cannot handle unknown command '{}'", command ); } }
Source:
public Builder mergeFrom(io.netty.example.worldclock.WorldClockProtocol.Location other) { if (other == io.netty.example.worldclock.WorldClockProtocol.Location.getDefaultInstance()) { return this; } if (other.hasContinent()) { setContinent(other.getContinent()); } if (other.hasCity()) { bitField0_ |= 0x00000002; city_ = other.city_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }

Target:
public Builder mergeFrom(io.netty.example.worldclock.WorldClockProtocol.Location other) { if (other == io.netty.example.worldclock.WorldClockProtocol.Location.getDefaultInstance()) return this; if (other.hasContinent()) { setContinent(other.getContinent()); } if (other.hasCity()) { bitField0_ |= 0x00000002; city_ = other.city_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
Source:
public void sanitizeForSaving() { this.courseId = this.courseId.trim(); this.commentText = Sanitizer.sanitizeTextField(this.commentText); this.courseId = Sanitizer.sanitizeForHtml(courseId); this.giverEmail = Sanitizer.sanitizeForHtml(giverEmail); if (commentText != null) { String sanitizedText = Sanitizer.sanitizeForHtml(commentText.getValue()).replace("\n", "\n<br>"); this.commentText = new Text(sanitizedText); } if (recipientType != null) { sanitizeForVisibilityOptions(); } removeIrrelevantVisibilityOptions(); }

Target:
public void sanitizeForSaving() { this.courseId = this.courseId.trim(); this.commentText = Sanitizer.sanitizeTextField(this.commentText); this.courseId = Sanitizer.sanitizeForHtml(courseId); this.giverEmail = Sanitizer.sanitizeForHtml(giverEmail); if (recipients != null) { HashSet<String> sanitizedRecipients = new HashSet<String>(); for (String recipientId : recipients) { sanitizedRecipients.add(Sanitizer.sanitizeForHtml(recipientId)); } recipients = sanitizedRecipients; } if (commentText != null) { String sanitizedText = Sanitizer.sanitizeForHtml(commentText.getValue()).replace("\n", "\n<br>"); this.commentText = new Text(sanitizedText); } if (recipientType != null) { sanitizeForVisibilityOptions(); } removeIrrelevantVisibilityOptions(); }
Source:
public void process(EntityUpdatedMessage message) { rotateTelescope(); String eid = message.getEntityId(); Content content = resolveId(idCodec.decode(eid).longValue()); if (content == null) { log.warn("{} resolved null/not Content for {}", new Object[]{message.getMessageId(), message.getEntitySource(), message.getEntityType(), eid}); return; } if (filter.apply(content)) { log.debug("{} updating equivalence: {}", new Object[]{message.getMessageId(), message.getEntitySource(), message.getEntityType(), eid}); try { equivUpdater.updateEquivalences(content, telescope); } catch (ContainerSummaryRequiredException e) { log.error(e.getMessage()); } } else { log.trace("{} skipping equiv update: {}", new Object[]{message.getMessageId(), message.getEntitySource(), message.getEntityType(), eid}); } }

Target:
public void process(EntityUpdatedMessage message) { rotateTelescope(); String eid = message.getEntityId(); Content content = resolveId(idCodec.decode(eid).longValue()); if (content == null) { log.warn("{} resolved null/not Content for {}", new Object[]{message.getMessageId(), message.getEntitySource(), message.getEntityType(), eid}); return; } if (filter.apply(content)) { log.debug("{} updating equivalence: {}", new Object[]{message.getMessageId(), message.getEntitySource(), message.getEntityType(), eid}); try { equivUpdater.updateEquivalences(content, telescope); } catch (ContainerSummaryRequiredException containerSummaryError) { log.trace("Container summary required, attempting to run", containerSummaryError); try { Maybe<Identified> maybeContainer = contentResolver.findByCanonicalUris( ImmutableSet.of(containerSummaryError.getItem() .getContainer() .getUri())).getFirstValue(); if (maybeContainer.hasValue()) { Identified container = maybeContainer.requireValue(); equivUpdater.updateEquivalences((Content) container, telescope); equivUpdater.updateEquivalences(containerSummaryError.getItem(), telescope); } else { log.error("Container summary missing AND container not resolved. Unable to " + "run equivalence on item with ID: " + content.getId()); } } catch (Exception e) { log.error("Failed to rerun equivalence for missing container summary", e); } } } else { log.trace("{} skipping equiv update: {}", new Object[]{message.getMessageId(), message.getEntitySource(), message.getEntityType(), eid}); } }
Source:
public void initTraceState(Map<String, Object> state) { Object traceId = state.get(Constants.HAWKULAR_APM_TRACEID); Object transaction = state.get(Constants.HAWKULAR_APM_TXN); Object level = state.get(Constants.HAWKULAR_APM_LEVEL); if (traceId != null) { setTraceId(traceId.toString()); } else { log.severe("Trace id has not been propagated"); } if (transaction != null) { setTransaction(transaction.toString()); } if (level != null) { setReportingLevel(ReportingLevel.All.valueOf(level.toString())); } }

Target:
public void initTraceState(Map<String, Object> state) { Object traceId = state.get(Constants.HAWKULAR_APM_TRACEID); Object transaction = state.get(Constants.HAWKULAR_APM_TXN); Object level = state.get(Constants.HAWKULAR_APM_LEVEL); if (traceId != null) { setTraceId(traceId.toString()); } else { log.severe("Trace id has not been propagated"); } if (transaction != null) { setTransaction(transaction.toString()); } if (level != null) { setReportingLevel(ReportingLevel.valueOf(level.toString())); } }
Source:
public static Page submit(HtmlForm htmlForm, HtmlElement submitElement) throws IOException { final HtmlPage htmlPage = (HtmlPage) htmlForm.getPage(); final WebClient webClient = htmlPage.getWebClient(); try { if (submitElement != null && !(submitElement instanceof SubmittableElement)) { return submitElement.click(); } try { htmlForm.submit((SubmittableElement) submitElement); } finally { webClient.loadDownloadedResponses(); Page resultPage = webClient.getCurrentWindow().getEnclosedPage(); if (resultPage == htmlPage) { return submitElement.click(); } return resultPage; } } finally { WebClientUtil.waitForJSExec(webClient); } }

Target:
public static Page submit(HtmlForm htmlForm, HtmlElement submitElement) throws IOException { final HtmlPage htmlPage = (HtmlPage) htmlForm.getPage(); final WebClient webClient = htmlPage.getWebClient(); try { if (submitElement != null && !(submitElement instanceof SubmittableElement)) { return submitElement.click(); } try { htmlForm.submit((SubmittableElement) submitElement); } finally { webClient.loadDownloadedResponses(); Page resultPage = webClient.getCurrentWindow().getEnclosedPage(); if (resultPage == htmlPage) { return HtmlElementUtil.click(submitElement); } else { return resultPage; } } } finally { WebClientUtil.waitForJSExec(webClient); } }
Source:
public void testLeftBubblePositionAfterMoveX() { Float expectedXLeft = 5.0f; Float expectedYLeft = EXPECTED_Y_STD; sprite.look.setX(SPRITE_X_FOR_MOVE_X); ShowBubbleActor bubbleActor = new ShowBubbleActor(OBJECT_NAME, sprite, Constants.SAY_BRICK); assertEquals(expectedXLeft, bubbleActor.calculateLeftImageX(CALC_X_LEFT)); assertEquals(expectedYLeft, bubbleActor.calculateImageY(CALC_Y_LEFT)); }

Target:
public void testLeftBubblePositionAfterMoveX() { sprite.look.setX(SPRITE_X_FOR_MOVE_X); ShowBubbleActor bubbleActor = new ShowBubbleActor(OBJECT_NAME, sprite, Constants.SAY_BRICK); assertEquals(EXPECTED_X_LEFT_FOR_MOVE_X, bubbleActor.calculateLeftImageX(CALC_X_LEFT)); assertEquals(EXPECTED_Y_STD, bubbleActor.calculateImageY(CALC_Y_LEFT)); }
Source:
public void open() { try { if (!mDevice.isScreenOn()) { mDevice.wakeUp(); } } catch (RemoteException e) { throw new RuntimeException("Could not unlock the device.", e); } if (mDevice.hasObject(By.res("com.android.systemui", "keyguard_bottom_area"))) { mDevice.pressMenu(); mDevice.waitForIdle(); } String pkg = getPackage(); long launchInitiationTimeMs = System.currentTimeMillis(); if (mFavorShellCommands) { String output = null; try { Intent intent = mInstrumentation .getContext() .getPackageManager() .getLaunchIntentForPackage(pkg); mInstrumentation.getContext().startActivity(intent); Log.i(LOG_TAG, String.format("Sent command to launch: %s", pkg)); } catch (ActivityNotFoundException e) { throw new RuntimeException(String.format("Failed to find package: %s", pkg), e); } } else { String id = getLauncherName(); registerWatcher( AppIsNotRespondingWatcher.class.getSimpleName(), new AppIsNotRespondingWatcher(InstrumentationRegistry.getInstrumentation())); if (!mDevice.hasObject(By.pkg(pkg).depth(0))) { mLauncherStrategy.launch(id, pkg); Log.i(LOG_TAG, "Launched package: id=" + id + ", pkg=" + pkg); } removeWatcher(AppIsNotRespondingWatcher.class.getSimpleName()); } if (!mDevice.wait(Until.hasObject(By.pkg(pkg).depth(0)), mLaunchTimeout)) { throw new IllegalStateException( String.format( "Did not find package, %s, in foreground after %d ms.", pkg, System.currentTimeMillis() - launchInitiationTimeMs)); } }

Target:
public void open() { try { if (!mDevice.isScreenOn()) { mDevice.wakeUp(); } } catch (RemoteException e) { throw new RuntimeException("Could not unlock the device.", e); } if (mDevice.hasObject(By.res("com.android.systemui", "keyguard_bottom_area"))) { mDevice.pressMenu(); mDevice.waitForIdle(); } String pkg = getPackage(); long launchInitiationTimeMs = System.currentTimeMillis(); registerWatcher( AppIsNotRespondingWatcher.class.getSimpleName(), new AppIsNotRespondingWatcher(InstrumentationRegistry.getInstrumentation())); if (mFavorShellCommands) { String output = null; try { Intent intent = mInstrumentation .getContext() .getPackageManager() .getLaunchIntentForPackage(pkg); mInstrumentation.getContext().startActivity(intent); Log.i(LOG_TAG, String.format("Sent command to launch: %s", pkg)); } catch (ActivityNotFoundException e) { removeWatcher(AppIsNotRespondingWatcher.class.getSimpleName()); throw new RuntimeException(String.format("Failed to find package: %s", pkg), e); } } else { String id = getLauncherName(); if (!mDevice.hasObject(By.pkg(pkg).depth(0))) { mLauncherStrategy.launch(id, pkg); Log.i(LOG_TAG, "Launched package: id=" + id + ", pkg=" + pkg); } } if (!mDevice.wait(Until.hasObject(By.pkg(pkg).depth(0)), mLaunchTimeout)) { removeWatcher(AppIsNotRespondingWatcher.class.getSimpleName()); throw new IllegalStateException( String.format( "Did not find package, %s, in foreground after %d ms.", pkg, System.currentTimeMillis() - launchInitiationTimeMs)); } removeWatcher(AppIsNotRespondingWatcher.class.getSimpleName()); }
Source:
public void testDelete() { try { fixture.setDirectory(testResourcesDir); fixture.copyTo(txtFilename, copyFilename); fixture.delete(copyFilename); } catch (IOException ioe) { fail("Should not happen: " + ioe.getMessage()); } catch (SlimFixtureException sfe) { fail("Should not happen: " + sfe.getMessage()); } }

Target:
public void testDelete() { try { fixture.setDirectory(testResourcesDir); fixture.copyTo(txtFilename, copyFilename); fixture.delete(copyFilename); } catch (Exception ex) { fail("Should not happen: " + ex.getMessage()); } }
Source:
public OffsetFetchRequest build(short version) { if (isAllTopicPartitions() && version < 2) { throw new UnsupportedVersionException("The broker only supports OffsetFetchRequest " + "v" + version + ", but we need v2 or newer to request all topic partitions."); } if (data.requireStable() && version < 7) { log.warn("Fallback the requireStable flag to false as broker " + "only supports OffsetFetchRequest version {}. Need " + "v7 or newer to enable this feature", version); return new OffsetFetchRequest(new OffsetFetchRequestData() .setGroupId(data.groupId()) .setTopics(data.topics()) .setRequireStable(false), version); } return new OffsetFetchRequest(data, version); }

Target:
public OffsetFetchRequest build(short version) { if (isAllTopicPartitions() && version < 2) { throw new UnsupportedVersionException("The broker only supports OffsetFetchRequest " + "v" + version + ", but we need v2 or newer to request all topic partitions."); } if (data.requireStable() && version < 7) { log.info("Fallback the requireStable flag to false as broker " + "only supports OffsetFetchRequest version {}. Need " + "v7 or newer to enable this feature", version); return new OffsetFetchRequest(data.setRequireStable(false), version); } return new OffsetFetchRequest(data, version); }
Source:
public ImmutableListValue<Living> targets() { return new ImmutableSpongeListValue<>(Keys.TARGETS, ImmutableList.copyOf(this.value)); }

Target:
public ImmutableListValue<Living> targets() { return getValueGetter(); }
Source:
public void patchAndCheckJsonFork() throws IOException { final String nidentifier = "id"; final String norganization = "organization"; final int identifier = 1; final String organization = "some organization"; final String porganization = "some patched organization"; final MkAnswer first = new MkAnswer.Simple( HttpURLConnection.HTTP_OK, Json.createObjectBuilder() .add(norganization, organization) .add(nidentifier, identifier) .build().toString() ); final MkAnswer second = new MkAnswer.Simple( HttpURLConnection.HTTP_OK, Json.createObjectBuilder() .add(norganization, porganization) .add(nidentifier, identifier) .build().toString() ); final MkAnswer third = new MkAnswer.Simple( HttpURLConnection.HTTP_OK, Json.createObjectBuilder() .add(norganization, organization) .add(nidentifier, identifier) .build().toString() ); final MkContainer container = new MkGrizzlyContainer().next(first).next(second).next(third) .start(); final MkContainer forksContainer = new MkGrizzlyContainer().start(); final RtRepo repo = new RtRepo( new MkGithub(), new ApacheRequest(forksContainer.home()), new Coordinates.Simple("test_user", "test_repo") ); final RtFork fork = new RtFork( new ApacheRequest(container.home()), repo, identifier ); fork.patch(Json.createObjectBuilder() .add(norganization, porganization) .add(nidentifier, identifier) .build() ); MatcherAssert.assertThat( fork.json().getString(norganization), Matchers.equalTo(porganization) ); container.stop(); forksContainer.stop(); }

Target:
public void patchAndCheckJsonFork() throws IOException { final String original = "some organization"; final String patched = "some patched organization"; final MkContainer container = new MkGrizzlyContainer().next(answer(original)) .next(answer(patched)).next(answer(original)).start(); final MkContainer forksContainer = new MkGrizzlyContainer().start(); final RtRepo repo = new RtRepo( new MkGithub(), new ApacheRequest(forksContainer.home()), new Coordinates.Simple("test_user", "test_repo") ); final RtFork fork = new RtFork( new ApacheRequest(container.home()), repo, 1 ); fork.patch(fork(patched)); MatcherAssert.assertThat( fork.json().getString(ORGANIZATION), Matchers.equalTo(patched) ); container.stop(); forksContainer.stop(); }
Source:
public void init() throws Exception { _handler = new RewriteHandler(); _handler.setRewriteRequestURI(true); _rule = new RewritePatternRule(); _rule.setPattern("/cheese/*"); _rule.setReplacement("/rule"); _fooRule = new RewritePatternRule(); _fooRule.setPattern("/cheese/bar/*"); _fooRule.setReplacement("/cheese/fooRule"); _fooContainerRule = new VirtualHostRuleContainer(); _fooContainerRule.setVirtualHosts(new String[]{"foo.com"}); _fooContainerRule.setRules(new Rule[]{_fooRule}); start(false); _request.setHttpURI(HttpURI.build(_request.getHttpURI(), "/cheese/bar").asImmutable()); _handler.setServer(_server); _handler.start(); }

Target:
public void init() throws Exception { _handler = new RewriteHandler(); _handler.setRewriteRequestURI(true); _rule = new RewritePatternRule(); _rule.setPattern("/cheese/*"); _rule.setReplacement("/rule"); _fooRule = new RewritePatternRule(); _fooRule.setPattern("/cheese/bar/*"); _fooRule.setReplacement("/cheese/fooRule"); _fooContainerRule = new VirtualHostRuleContainer(); _fooContainerRule.setVirtualHosts(new String[]{"foo.com"}); _fooContainerRule.setRules(new Rule[]{_fooRule}); start(false); _request.setHttpURI(HttpURI.build(_request.getHttpURI(), "/cheese/bar")); _handler.setServer(_server); _handler.start(); }
Source:
void writeBranches(FileReftableStack stack, String template, int start, int N) throws IOException { for (int i = 0; i < N; i++) { while (true) { final long next = stack.getMergedReftable().maxUpdateIndex() + 1; System.err.println(next + template); String name = String.format(template, Integer.valueOf(start + i)); Ref r = newRef(name, ObjectId.zeroId()); boolean ok = stack.addReftable(rw -> { rw.setMinUpdateIndex(next).setMaxUpdateIndex(next).begin() .writeRef(r); }); if (ok) { break; } } } }

Target:
void writeBranches(FileReftableStack stack, String template, int start, int N) throws IOException { for (int i = 0; i < N; i++) { while (true) { final long next = stack.getMergedReftable().maxUpdateIndex() + 1; String name = String.format(template, Integer.valueOf(start + i)); Ref r = newRef(name, ObjectId.zeroId()); boolean ok = stack.addReftable(rw -> { rw.setMinUpdateIndex(next).setMaxUpdateIndex(next).begin() .writeRef(r); }); if (ok) { break; } } } }
Source:
public OpenTok build() { if (this.apiUrl != null && this.proxy != null) { OpenTok openTok = new OpenTok(apiKey, apiSecret); HttpClient.Builder clientBuilder = new HttpClient.Builder(apiKey, apiSecret).apiUrl(apiUrl) .proxy(proxy); openTok.setClient(clientBuilder.build()); return openTok; } else if (this.apiUrl != null) { OpenTok openTok = new OpenTok(apiKey, apiSecret); HttpClient.Builder clientBuilder = new HttpClient.Builder(apiKey, apiSecret).apiUrl(apiUrl); openTok.setClient(clientBuilder.build()); return openTok; } else return new OpenTok(apiKey, apiSecret); }

Target:
public OpenTok build() { HttpClient.Builder clientBuilder = new HttpClient.Builder(apiKey, apiSecret); if (this.apiUrl != null) { clientBuilder.apiUrl(this.apiUrl); } if (this.proxy != null) { clientBuilder.proxy(this.proxy); } return new OpenTok(this.apiKey, this.apiSecret, clientBuilder.build()); }
Source:
private void deliverAudioLevelsToMediaStream() { final AudioMediaStreamImpl stream = mediaStream.get(); final long[] latestAudioLevels = levels.getAndSet(null); if (stream != null && latestAudioLevels != null) { stream.audioLevelsReceived(latestAudioLevels); } }

Target:
private void deliverAudioLevelsToMediaStream() { if (!running.get()) { return; } final long[] latestAudioLevels = levels.getAndSet(null); if (latestAudioLevels != null) { mediaStream.audioLevelsReceived(latestAudioLevels); } }
Source:
protected Object doReceive() { Assert.state(this.running.get(), () -> getComponentName() + " is not running"); AbstractFileInfo<F> file = poll(); while (file != null) { if (this.filter != null && this.filter.supportsSingleFileFiltering() && !this.filter.accept(file.getFileInfo())) { if (this.toBeReceived.size() > 0) { file = poll(); continue; } else { break; } } if (file != null) { try { String remotePath = remotePath(file); Session<?> session = this.remoteFileTemplate.getSession(); try { return getMessageBuilderFactory() .withPayload(session.readRaw(remotePath)) .setHeader(IntegrationMessageHeaderAccessor.CLOSEABLE_RESOURCE, session) .setHeader(FileHeaders.REMOTE_DIRECTORY, file.getRemoteDirectory()) .setHeader(FileHeaders.REMOTE_FILE, file.getFilename()) .setHeader(FileHeaders.REMOTE_HOST_PORT, session.getHostPort()) .setHeader(FileHeaders.REMOTE_FILE_INFO, this.fileInfoJson ? file.toJson() : file); } catch (IOException e) { throw new UncheckedIOException("IOException when retrieving " + remotePath, e); } } catch (RuntimeException e) { resetFilterIfNecessary(file); throw e; } } } return null; }

Target:
protected Object doReceive() { Assert.state(this.running.get(), () -> getComponentName() + " is not running"); AbstractFileInfo<F> file = poll(); while (file != null) { if (this.filter != null && this.filter.supportsSingleFileFiltering() && !this.filter.accept(file.getFileInfo())) { if (this.toBeReceived.size() > 0) { file = poll(); continue; } else { break; } } try { String remotePath = remotePath(file); Session<?> session = this.remoteFileTemplate.getSession(); try { return getMessageBuilderFactory() .withPayload(session.readRaw(remotePath)) .setHeader(IntegrationMessageHeaderAccessor.CLOSEABLE_RESOURCE, session) .setHeader(FileHeaders.REMOTE_DIRECTORY, file.getRemoteDirectory()) .setHeader(FileHeaders.REMOTE_FILE, file.getFilename()) .setHeader(FileHeaders.REMOTE_HOST_PORT, session.getHostPort()) .setHeader(FileHeaders.REMOTE_FILE_INFO, this.fileInfoJson ? file.toJson() : file); } catch (IOException e) { throw new UncheckedIOException("IOException when retrieving " + remotePath, e); } } catch (RuntimeException e) { resetFilterIfNecessary(file); throw e; } } return null; }
Source:
private String getPrimaryActionText() { switch (getPrimaryAction()) { case SUBMIT_FOR_REVIEW: return getString(R.string.submit_for_review); case PUBLISH_NOW: return getString(R.string.button_publish); case SCHEDULE: return getString(R.string.schedule_verb); case UPDATE: return getString(R.string.update_verb); case SAVE: return getString(R.string.save); } return getString(R.string.save); }

Target:
private String getPrimaryActionText() { switch (getPrimaryAction()) { case SUBMIT_FOR_REVIEW: return getString(R.string.submit_for_review); case PUBLISH_NOW: return getString(R.string.button_publish); case SCHEDULE: return getString(R.string.schedule_verb); case UPDATE: return getString(R.string.update_verb); case SAVE: return getString(R.string.save); } throw new IllegalStateException( "Switch in getPrimaryActionText is missing a required case or the case is missing \"return\" keyword "); }
Source:
public synchronized void addChild(AbstractCalledFunction child, AggregatedCalledFunction aggregatedChild) { fSelfTime -= aggregatedChild.getDuration(); if (child.getDepth() >= 0) { aggregatedChild.getFunctionStatistics().update(child); } AggregatedCalledFunction node = fChildren.get(aggregatedChild.getSymbol()); if (node == null) { fChildren.put(aggregatedChild.getSymbol(), aggregatedChild); } else { merge(node, aggregatedChild); } }

Target:
public synchronized void addChild(AbstractCalledFunction child, AggregatedCalledFunction aggregatedChild) { if (child.getDepth() >= 0) { fSelfTime -= aggregatedChild.getDuration(); aggregatedChild.getFunctionStatistics().update(child); } AggregatedCalledFunction node = fChildren.get(aggregatedChild.getSymbol()); if (node == null) { fChildren.put(aggregatedChild.getSymbol(), aggregatedChild); } else { merge(node, aggregatedChild); } }
Source:
public void testManualImmediateRuleWithActions() throws InterruptedException { RetentionRule testRule = createImmediateRuleMillis(RetentionRule.ApplicationPolicy.MANUAL, 100L, null, Arrays.asList("Document.Trash")); file = service.attachRule(file, testRule, session); assertTrue(session.isRecord(file.getRef())); assertTrue(session.isUnderRetentionOrLegalHold(file.getRef())); awaitRetentionExpiration(1000L); file = session.getDocument(file.getRef()); assertFalse(session.isUnderRetentionOrLegalHold(file.getRef())); assertTrue(file.isTrashed()); }

Target:
public void testManualImmediateRuleWithActions() throws InterruptedException { RetentionRule testRule = createImmediateRuleMillis(RetentionRule.ApplicationPolicy.MANUAL, 100, null, Arrays.asList("Document.Trash")); file = service.attachRule(file, testRule, session); assertTrue(session.isRecord(file.getRef())); assertTrue(session.isUnderRetentionOrLegalHold(file.getRef())); awaitRetentionExpiration(1000); file = session.getDocument(file.getRef()); assertFalse(session.isUnderRetentionOrLegalHold(file.getRef())); assertTrue(file.isTrashed()); }
Source:
public void init() { LOGGER.debug("Configuring monitor for {}", monitoredDirectory); security.runAsAdmin( () -> { CompletableFuture.runAsync(this::configure, configurationExecutor); return null; }); }

Target:
public void init() { CDM_LOGGER.debug("Initializing monitor for {}", monitoredDirectory); security.runAsAdmin( () -> { CompletableFuture.runAsync(this::configure, configurationExecutor); return null; }); }
Source:
public RxSharedPreferences(final SharedPreferences sharedPreferences) { this.sharedPreferences = checkNotNull(sharedPreferences, "sharedPreferences == null"); this.changedKeys = Observable.create(new Observable.OnSubscribe<String>() { @Override public void call(final Subscriber<? super String> subscriber) { final OnSharedPreferenceChangeListener listener = new OnSharedPreferenceChangeListener() { @Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { subscriber.onNext(key); } }; Subscription subscription = Subscriptions.create(new Action0() { @Override public void call() { sharedPreferences.unregisterOnSharedPreferenceChangeListener(listener); } }); subscriber.add(subscription); sharedPreferences.registerOnSharedPreferenceChangeListener(listener); } }).share(); }

Target:
private RxSharedPreferences(final SharedPreferences sharedPreferences) { this.sharedPreferences = checkNotNull(sharedPreferences, "sharedPreferences == null"); this.changedKeys = Observable.create(new Observable.OnSubscribe<String>() { @Override public void call(final Subscriber<? super String> subscriber) { final OnSharedPreferenceChangeListener listener = new OnSharedPreferenceChangeListener() { @Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { subscriber.onNext(key); } }; Subscription subscription = Subscriptions.create(new Action0() { @Override public void call() { sharedPreferences.unregisterOnSharedPreferenceChangeListener(listener); } }); subscriber.add(subscription); sharedPreferences.registerOnSharedPreferenceChangeListener(listener); } }).share(); }
Source:
public Response getWorkflowZip(@ApiParam(hidden = true) @Auth Optional<User> user, @ApiParam(value = "workflowId", required = true) @PathParam("workflowId") Long workflowId, @ApiParam(value = "workflowVersionId", required = true) @PathParam("workflowVersionId") Long workflowVersionId) { Workflow workflow; if (user.isPresent()) { workflow = workflowDAO.findById(workflowId); checkEntry(workflow); checkCanReadWorkflow(user.get(), workflow); } else { workflow = workflowDAO.findPublishedById(workflowId); checkEntry(workflow); } WorkflowVersion workflowVersion = getWorkflowVersion(workflow, workflowVersionId); Set<SourceFile> sourceFiles = workflowVersion.getSourceFiles(); if (sourceFiles == null || sourceFiles.size() == 0) { return null; } String fileName = workflow.getWorkflowPath().replaceAll("/", "-") + ".zip"; File returnZipFile = downloadAsZip(sourceFiles, fileName); return Response .ok(returnZipFile) .header("Content-Disposition", "attachment; filename=\"" + fileName + "\"") .build(); }

Target:
public Response getWorkflowZip(@ApiParam(hidden = true) @Auth Optional<User> user, @ApiParam(value = "workflowId", required = true) @PathParam("workflowId") Long workflowId, @ApiParam(value = "workflowVersionId", required = true) @PathParam("workflowVersionId") Long workflowVersionId) { Workflow workflow; if (user.isPresent()) { workflow = workflowDAO.findById(workflowId); checkEntry(workflow); checkCanReadWorkflow(user.get(), workflow); } else { workflow = workflowDAO.findPublishedById(workflowId); checkEntry(workflow); } WorkflowVersion workflowVersion = getWorkflowVersion(workflow, workflowVersionId); Set<SourceFile> sourceFiles = workflowVersion.getSourceFiles(); if (sourceFiles == null || sourceFiles.size() == 0) { throw new CustomWebApplicationException("no files found to zip", HttpStatus.SC_NO_CONTENT); } String fileName = workflow.getWorkflowPath().replaceAll("/", "-") + ".zip"; return Response.ok().entity((StreamingOutput)output -> writeStreamAsZip(sourceFiles, output)) .header("Content-Disposition", "attachment; filename=\"" + fileName + "\"").build(); }
Source:
Optional<Dataset<Row>> versionMarker(SparkSession spark) { if (marker == null) { return Optional.empty(); } Row row = RowFactory.create( Collections.singletonList(Method.M0Run.ALGO), wiki, MARKER_SCORE, MARKER_QUERY, marker); return Optional.of(spark.createDataFrame( Collections.singletonList(row), SuggestionAggregator.SCHEMA_OUT)); }

Target:
Optional<Dataset<Row>> versionMarker(SparkSession spark) { if (marker == null) { return Optional.empty(); } Row row = RowFactory.create( Method.algos(), wiki, MARKER_SCORE, query, marker); return Optional.of(spark.createDataFrame( singletonList(row), SuggestionAggregator.SCHEMA_OUT)); }
Source:
public Object visitPrepareCommand(TxInvocationContext ctx, PrepareCommand command) throws Throwable { VersionedPrepareCommand versionedPrepareCommand = (VersionedPrepareCommand) command; if (ctx.isOriginLocal()) { versionedPrepareCommand.setVersionsSeen(ctx.getCacheTransaction().getVersionsRead()); } InvocationStage invocationStage = wrapEntriesForPrepare(ctx, command); if (invocationStage == null) { return prepareHandler.apply(ctx, command, null); } else { return invocationStage.thenApply(ctx, command, prepareHandler); } }

Target:
public Object visitPrepareCommand(TxInvocationContext ctx, PrepareCommand command) throws Throwable { VersionedPrepareCommand versionedPrepareCommand = (VersionedPrepareCommand) command; if (ctx.isOriginLocal()) { versionedPrepareCommand.setVersionsSeen(ctx.getCacheTransaction().getVersionsRead()); } return wrapEntriesForPrepareAndApply(ctx, command, prepareHandler); }
Source:
public boolean needsProgressMonitor() { if (fResources != null && fResources.length > 0) return true; if (fJavaElements != null) { for (IJavaElement fJavaElement : fJavaElements) { int type= fJavaElement.getElementType(); if (type <= IJavaElement.CLASS_FILE) return true; } } return false; }

Target:
public boolean needsProgressMonitor() { if (fResources != null && fResources.length > 0) return true; if (fJavaElements != null) { for (IJavaElement javaElement : fJavaElements) { int type= javaElement.getElementType(); if (type <= IJavaElement.CLASS_FILE) return true; } } return false; }
Source:
public void testCreateTableInNonDefaultSchema() { assertUpdate(format("CREATE SCHEMA %s.schema1", CATALOG)); assertUpdate(format("CREATE SCHEMA %s.schema2", CATALOG)); assertQueryResult(format("SHOW SCHEMAS FROM %s", CATALOG), "default", "information_schema", "schema1", "schema2"); assertUpdate(format("CREATE TABLE %s.schema1.nation AS SELECT * FROM tpch.tiny.nation WHERE nationkey %% 2 = 0", CATALOG), "SELECT count(*) FROM nation WHERE MOD(nationkey, 2) = 0"); assertUpdate(format("CREATE TABLE %s.schema2.nation AS SELECT * FROM tpch.tiny.nation WHERE nationkey %% 2 = 1", CATALOG), "SELECT count(*) FROM nation WHERE MOD(nationkey, 2) = 1"); assertQueryResult(format("SELECT count(*) FROM %s.schema1.nation", CATALOG), 13L); assertQueryResult(format("SELECT count(*) FROM %s.schema2.nation", CATALOG), 12L); assertUpdate(format("DROP SCHEMA %s.schema1", CATALOG)); assertUpdate(format("DROP SCHEMA %s.schema2", CATALOG)); }

Target:
public void testCreateTableInNonDefaultSchema() { assertUpdate("CREATE SCHEMA schema1"); assertUpdate("CREATE SCHEMA schema2"); assertQueryResult("SHOW SCHEMAS", "default", "information_schema", "schema1", "schema2"); assertUpdate("CREATE TABLE schema1.nation AS SELECT * FROM tpch.tiny.nation WHERE nationkey % 2 = 0", "SELECT count(*) FROM nation WHERE MOD(nationkey, 2) = 0"); assertUpdate("CREATE TABLE schema2.nation AS SELECT * FROM tpch.tiny.nation WHERE nationkey % 2 = 1", "SELECT count(*) FROM nation WHERE MOD(nationkey, 2) = 1"); assertQueryResult("SELECT count(*) FROM schema1.nation", 13L); assertQueryResult("SELECT count(*) FROM schema2.nation", 12L); }
Source:
public boolean accepts(Class<?> aClass) { return aClass.isPrimitive() || aClass.isEnum() || Number.class.isAssignableFrom(aClass) || String.class.equals(aClass) || Character.class.equals(aClass) || Boolean.class.equals(aClass) || java.util.Date.class.isAssignableFrom(aClass) || java.util.Calendar.class.isAssignableFrom(aClass); }

Target:
public boolean accepts(Class<?> aClass) { return aClass.isPrimitive() || Number.class.isAssignableFrom(aClass) || String.class.equals(aClass) || Character.class.equals(aClass) || Boolean.class.equals(aClass) || java.util.Date.class.isAssignableFrom(aClass) || java.util.Calendar.class.isAssignableFrom(aClass) || aClass.isEnum(); }