auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private ActivityPayload createActivityPayload(Duration deviceTimeOffset, AppActivityDTO.Activity appActivity) { Date correctedStartTime = correctTime(deviceTimeOffset, appActivity.getStartTime()); Date correctedendTime = correctTime(deviceTimeOffset, appActivity.getEndTime()); return new ActivityPayload(correctedStartTime, correctedendTime, appActivity.getApplication()); }

Target:
private ActivityPayload createActivityPayload(Duration deviceTimeOffset, AppActivityDTO.Activity appActivity) { Date correctedStartTime = correctTime(deviceTimeOffset, appActivity.getStartTime()); Date correctedEndTime = correctTime(deviceTimeOffset, appActivity.getEndTime()); return new ActivityPayload(correctedStartTime, correctedEndTime, appActivity.getApplication()); }
Source:
public static void addInvocationRateAndCountToSensor(final Sensor sensor, final String group, final Map<String, String> tags, final String operation) { addInvocationRateAndCountToSensor( sensor, group, tags, operation, "The average per-second number of " + operation, "The total number of " + operation ); }

Target:
public static void addInvocationRateAndCountToSensor(final Sensor sensor, final String group, final Map<String, String> tags, final String operation) { addInvocationRateAndCountToSensor( sensor, group, tags, operation, RATE_DESCRIPTION + operation, TOTAL_DESCRIPTION + operation ); }
Source:
public TestSuites parse(File report) { try (InputStream inputStream = new FileInputStream(report)) { final Object parsedObject = xstream().fromXML(inputStream); TestSuites testSuites = (TestSuites) parsedObject; return testSuites; } catch (IOException e) { throw new IllegalStateException("Can't read PhpUnit report : " + report.getAbsolutePath(), e); } }

Target:
public TestSuites parse(File report) { try (InputStream inputStream = new FileInputStream(report)) { final Object parsedObject = xstream().fromXML(inputStream); return (TestSuites) parsedObject; } catch (IOException e) { throw new IllegalStateException("Can't read PhpUnit report : " + report.getAbsolutePath(), e); } }
Source:
private void validateProperty(ModelNode operation) { ModelNode addressModelNode = operation.get(CommonAttributes.ADDRESS); if (!addressModelNode.getType().toString().equals("u")) { List<Property> propertyListModelNode = addressModelNode.asPropertyList(); for (Property property : propertyListModelNode) { if (property.getName().equals(CommonAttributes.PROPERTY)) { ConnectorUtils.getAndValidateOption(property.getValue().asString()); } } } }

Target:
private void validateProperty(ModelNode operation) throws OperationFailedException { ModelNode addressModelNode = operation.get(ModelDescriptionConstants.ADDRESS); final ClassLoader loader = WildFlySecurityManager.getClassLoaderPrivileged(ConnectorChildResource.class); if (addressModelNode.isDefined()) { List<Property> propertyListModelNode = addressModelNode.asPropertyList(); for (Property property : propertyListModelNode) { if (property.getName().equals(CommonAttributes.PROPERTY)) { ConnectorUtils.getAndValidateOption(loader, property.getValue().asString()); } } } }
Source:
private void registerCustomCredential(final Props props, final Credentials hadoopCred, final String userToProxy, final Logger jobLogger) { String credentialClassName = "unknown class"; try { credentialClassName = props .getString(Constants.ConfigurationKeys.CUSTOM_CREDENTIAL_NAME); logger.info("custom credential class name: " + credentialClassName); final Class credentialClass = Class.forName(credentialClassName); final Constructor[] constructors = credentialClass.getConstructors(); for (final Constructor constructor : constructors) { if (constructor.getParameterCount() == 3) { final CredentialProvider customCredential = (CredentialProvider) constructors[1] .newInstance(hadoopCred, props, jobLogger); customCredential.register(userToProxy); return; } } logger.error("cannot find the appropriate credential constructor."); throw new Exception("launching credential instance failed."); } catch (final Exception e) { logger.error("Encountered error while loading and instantiating " + credentialClassName, e); throw new IllegalStateException("Encountered error while loading and instantiating " + credentialClassName, e); } }

Target:
private void registerCustomCredential(final Props props, final Credentials hadoopCred, final String userToProxy, final Logger jobLogger) { String credentialClassName = "unknown class"; try { credentialClassName = props .getString(Constants.ConfigurationKeys.CUSTOM_CREDENTIAL_NAME); logger.info("custom credential class name: " + credentialClassName); final Class credentialClass = Class.forName(credentialClassName); Constructor constructor = credentialClass.getConstructor (new Class[] {Credentials.class, Props.class, Logger.class}); final CredentialProvider customCredential = (CredentialProvider) constructor .newInstance(hadoopCred, props, jobLogger); customCredential.register(userToProxy); } catch (final Exception e) { logger.error("Encountered error while loading and instantiating " + credentialClassName, e); throw new IllegalStateException("Encountered error while loading and instantiating " + credentialClassName, e); } }
Source:
public void verifyCollapsibleCriteriaNoDefaultFocusWindow() throws IOException, InterruptedException { topologyUiPage.clearFocus(); String categoryName = "Servers"; topologyUiPage.search(categoryName).selectItemThatContains(categoryName); topologyUiPage.testCase.findElementByXpath(" }

Target:
public void verifyCollapsibleCriteriaNoDefaultFocusWindow() throws IOException, InterruptedException { topologyUiPage.clearFocus(); String categoryName = "Switches"; topologyUiPage.search(categoryName).selectItemThatContains(categoryName); topologyUiPage.testCase.findElementByXpath(" }
Source:
protected void activateChannel(@Nullable BluetoothCharacteristic characteristic, ChannelTypeUID channelTypeUID, @Nullable String name) { if (characteristic != null) { String channelId = name != null ? name : characteristic.getGattCharacteristic().name(); if (channelId == null) { channelId = channelTypeUID.getId(); } if (getThing().getChannel(channelId) == null) { ThingBuilder updatedThing = editThing(); Channel channel = ChannelBuilder.create(new ChannelUID(getThing().getUID(), channelId), "Number") .withType(channelTypeUID).build(); updatedThing.withChannel(channel); updateThing(updatedThing.build()); logger.debug("Added channel '{}' to Thing '{}'", channelId, getThing().getUID()); } if (isLinked(channelId)) { deviceCharacteristics.add(characteristic); device.enableNotifications(characteristic); device.readCharacteristic(characteristic); } } else { logger.debug("Characteristic is null - not activating any channel."); } }

Target:
protected void activateChannel(@Nullable BluetoothCharacteristic characteristic, ChannelTypeUID channelTypeUID, @Nullable String name) { if (characteristic != null) { String channelId = name != null ? name : characteristic.getGattCharacteristic().name(); if (channelId == null) { channelId = channelTypeUID.getId(); } if (getThing().getChannel(channelId) == null) { ThingBuilder updatedThing = editThing(); Channel channel = ChannelBuilder.create(new ChannelUID(getThing().getUID(), channelId), "Number") .withType(channelTypeUID).build(); updatedThing.withChannel(channel); updateThing(updatedThing.build()); logger.debug("Added channel '{}' to Thing '{}'", channelId, getThing().getUID()); } deviceCharacteristics.add(characteristic); device.enableNotifications(characteristic); if (isLinked(channelId)) { device.readCharacteristic(characteristic); } } else { logger.debug("Characteristic is null - not activating any channel."); } }
Source:
public Map<BundleDependency, List<BundleDependency>> resolveDependencies(List<BundleDependency> mulePlugins, Collection<ClassLoaderModel> mulePluginsClassLoaderModels) { Map<BundleDependency, List<BundleDependency>> pluginsWithAdditionalDeps = new LinkedHashMap<>(); for (Plugin pluginWithAdditionalDependencies : pluginsWithAdditionalDependencies) { BundleDependency pluginBundleDependency = getPluginBundleDependency(pluginWithAdditionalDependencies, mulePlugins); ClassLoaderModel pluginClassLoaderModel = getPluginClassLoaderModel(pluginWithAdditionalDependencies, mulePluginsClassLoaderModels); List<BundleDependency> additionalDependencies = new ArrayList<>(); pluginWithAdditionalDependencies.getAdditionalDependencies().stream() .filter(additionalDep -> !isPresentInClassLoaderModel(pluginClassLoaderModel, additionalDep)) .forEach( dep -> { additionalDependencies.add(aetherMavenClient .resolveBundleDescriptor(toBundleDescriptor(dep))); additionalDependencies.addAll(aetherMavenClient .resolveBundleDescriptorDependencies(false, false, toBundleDescriptor(dep))); }); if (!additionalDependencies.isEmpty()) { pluginsWithAdditionalDeps.put(pluginBundleDependency, additionalDependencies); } } return pluginsWithAdditionalDeps; }

Target:
public Map<BundleDependency, List<BundleDependency>> resolveDependencies(List<BundleDependency> mulePlugins, Collection<ClassLoaderModel> mulePluginsClassLoaderModels) { Map<BundleDependency, List<BundleDependency>> pluginsWithAdditionalDeps = new LinkedHashMap<>(); for (Plugin pluginWithAdditionalDependencies : pluginsWithAdditionalDependencies) { BundleDependency pluginBundleDependency = getPluginBundleDependency(pluginWithAdditionalDependencies, mulePlugins); ClassLoaderModel pluginClassLoaderModel = getPluginClassLoaderModel(pluginWithAdditionalDependencies, mulePluginsClassLoaderModels); List<BundleDependency> additionalDependencies = new ArrayList<>(); pluginWithAdditionalDependencies.getAdditionalDependencies().stream() .filter(additionalDep -> !isPresentInClassLoaderModel(pluginClassLoaderModel, additionalDep)) .forEach(dep -> additionalDependencies.addAll(resolveDependency(dep))); if (!additionalDependencies.isEmpty()) { pluginsWithAdditionalDeps.put(pluginBundleDependency, additionalDependencies); } } return pluginsWithAdditionalDeps; }
Source:
private KafkaStreams startStreams(final StreamsBuilder builder) { final KafkaStreams kafkaStreams = new KafkaStreams(builder.build(streamsConfiguration), streamsConfiguration); kafkaStreams.start(); kafkaStreamsInstances.add(kafkaStreams); return kafkaStreams; }

Target:
private KafkaStreams startStreams(final StreamsBuilder builder) throws InterruptedException { return startStreams(builder, REBALANCING, RUNNING, null); }
Source:
private boolean process( final ReleaseRemovalRequest request, final ReleaseRemovalResult result, final Repository repository, final Target repositoryTarget ) { if ( !repository.getRepositoryContentClass().isCompatible( maven2ContentClass ) ) { getLogger().debug( "Skipping '{}' is not a maven 2 repository", repository.getId() ); return false; } if ( !repository.getLocalStatus().shouldServiceRequest() ) { getLogger().debug( "Skipping '{}' because the repository is out of service", repository.getId() ); return false; } if ( repository.getRepositoryKind().isFacetAvailable( ProxyRepository.class ) ) { getLogger().debug( "Skipping '{}' because it is a proxy repository", repository.getId() ); return false; } if ( repository.getRepositoryKind().isFacetAvailable( GroupRepository.class ) ) { getLogger().debug( "Skipping '{}' because it is a group repository", repository.getId() ); return false; } MavenRepository mavenRepository = repository.adaptToFacet( MavenRepository.class ); if ( !RepositoryPolicy.RELEASE.equals( mavenRepository.getRepositoryPolicy() ) ) { getLogger().debug( "Skipping '{}' because it is a snapshot or mixed repository", repository.getId() ); return false; } removeReleasesFromMavenRepository( mavenRepository, request, result, repositoryTarget ); return true; }

Target:
private boolean process( final ReleaseRemovalRequest request, final ReleaseRemovalResult result, final Repository repository, final Target repositoryTarget ) { if ( !repository.getRepositoryContentClass().isCompatible( maven2ContentClass ) ) { getLogger().debug( "Skipping '{}' is not a maven 2 repository", repository.getId() ); return false; } if ( !repository.getLocalStatus().shouldServiceRequest() ) { getLogger().debug( "Skipping '{}' because the repository is out of service", repository.getId() ); return false; } if ( repository.getRepositoryKind().isFacetAvailable( ProxyRepository.class ) ) { getLogger().debug( "Skipping '{}' because it is a proxy repository", repository.getId() ); return false; } if ( repository.getRepositoryKind().isFacetAvailable( GroupRepository.class ) ) { getLogger().debug( "Skipping '{}' because it is a group repository", repository.getId() ); return false; } MavenRepository mavenRepository = repository.adaptToFacet( MavenRepository.class ); if(mavenRepository == null) { getLogger().debug( "Skipping '{}' because it could not be adapted to MavenRepository", repository.getId() ); return false; } if ( !RepositoryPolicy.RELEASE.equals( mavenRepository.getRepositoryPolicy() ) ) { getLogger().debug( "Skipping '{}' because it is a snapshot or mixed repository", repository.getId() ); return false; } removeReleasesFromMavenRepository( mavenRepository, request, result, repositoryTarget ); return true; }
Source:
public boolean acceptOutboundMessage(final Object message) { return message instanceof RntbdContextRequest; }

Target:
public boolean acceptOutboundMessage(final Object message) { return message.getClass() == RntbdContextRequest.class; }
Source:
public static boolean isRemovableStorageAvailable(@NonNull Context context){ int currentapiVersion = android.os.Build.VERSION.SDK_INT; if (currentapiVersion >= Build.VERSION_CODES.LOLLIPOP) { File[] fileList = context.getExternalFilesDirs("Android"); for (File extFile : fileList){ if (extFile != null && Environment.isExternalStorageRemovable(extFile)){ return true; } } } return false; }

Target:
public static boolean isRemovableStorageAvailable(@NonNull Context context){ return getRemovableStorageAppDir(context) != null; }
Source:
public void testPersistentDiskCacheWithDefaultPersistentMode() { CacheConfiguration<Long, String> cacheConfiguration = CacheConfigurationBuilder.newCacheConfigurationBuilder() .withResourcePools(ResourcePoolsBuilder.newResourcePoolsBuilder().heap(10, EntryUnit.ENTRIES).disk(100, EntryUnit.ENTRIES).build()) .buildConfig(Long.class, String.class); PersistentCacheManager persistentCacheManager = CacheManagerBuilder.newCacheManagerBuilder() .with(new PersistenceConfiguration(new File(System.getProperty("java.io.tmpdir") + "/persistent-cache-data"))) .withCache("persistent-cache", cacheConfiguration) .build(true); Cache<Long, String> cache = persistentCacheManager.getCache("persistent-cache", Long.class, String.class); cache.put(42L, "That's the answer!"); assertThat(cache.get(42L), is("That's the answer!")); persistentCacheManager.close(); }

Target:
public void testPersistentDiskCacheWithDefaultPersistentMode() { CacheConfiguration<Long, String> cacheConfiguration = CacheConfigurationBuilder.newCacheConfigurationBuilder() .withResourcePools(ResourcePoolsBuilder.newResourcePoolsBuilder().heap(10, EntryUnit.ENTRIES).disk(100, EntryUnit.ENTRIES).build()) .buildConfig(Long.class, String.class); PersistentCacheManager persistentCacheManager = CacheManagerBuilder.newCacheManagerBuilder() .with(new PersistenceConfiguration(new File(System.getProperty("java.io.tmpdir") + "/persistent-cache-data"))) .withCache("persistent-cache", cacheConfiguration) .build(true); Cache<Long, String> cache = persistentCacheManager.getCache("persistent-cache", Long.class, String.class); cache.put(42L, "That's the answer!"); assertThat(cache.get(42L), equalTo("That's the answer!")); persistentCacheManager.close(); }
Source:
public Git(Repository repo) { this.repo = repo; }

Target:
public Git(Repository repo) { if (repo == null) throw new NullPointerException(); this.repo = repo; }
Source:
private void createOvertimeRecords(Person person) { LocalDate now = ZonedDateTime.now(UTC).toLocalDate(); LocalDate lastWeek = now.minusWeeks(1); LocalDate weekBeforeLast = now.minusWeeks(2); LocalDate lastYear = now.minusYears(1); overtimeRecordDataProvider.createOvertimeRecord(person, lastWeek.with(MONDAY), lastWeek.with(FRIDAY), new BigDecimal("2.5")); overtimeRecordDataProvider.createOvertimeRecord(person, weekBeforeLast.with(MONDAY), weekBeforeLast.with(FRIDAY), new BigDecimal("3")); overtimeRecordDataProvider.createOvertimeRecord(person, lastYear.with(MONDAY), lastYear.with(FRIDAY), new BigDecimal("4")); }

Target:
private void createOvertimeRecords(Person person) { LocalDate now = LocalDate.now(UTC); LocalDate lastWeek = now.minusWeeks(1); LocalDate weekBeforeLast = now.minusWeeks(2); LocalDate lastYear = now.minusYears(1); overtimeRecordDataProvider.createOvertimeRecord(person, lastWeek.with(MONDAY), lastWeek.with(FRIDAY), new BigDecimal("2.5")); overtimeRecordDataProvider.createOvertimeRecord(person, weekBeforeLast.with(MONDAY), weekBeforeLast.with(FRIDAY), new BigDecimal("3")); overtimeRecordDataProvider.createOvertimeRecord(person, lastYear.with(MONDAY), lastYear.with(FRIDAY), new BigDecimal("4")); }
Source:
public boolean load(@Nonnull IResourceManager manager, @Nonnull ResourceLocation location, @Nonnull Function<ResourceLocation, TextureAtlasSprite> textureGetter) { final TextureAtlasSprite sprite = textureGetter.apply(bucket); final TextureAtlasSprite alphaMask = textureGetter.apply(bucketCoverMask); width = sprite.getIconWidth(); height = sprite.getIconHeight(); final int[][] pixels = new int[Minecraft.getMinecraft().gameSettings.mipmapLevels + 1][]; pixels[0] = new int[width * height]; IResource empty = null; IResource mask = null; try { empty = getResource(new ResourceLocation("textures/items/bucket_empty.png")); mask = getResource(new ResourceLocation(ForgeVersion.MOD_ID, "textures/items/vanilla_bucket_cover_mask.png")); if (empty != null && mask != null && Objects.equals(empty.getResourcePackName(), mask.getResourcePackName()) && alphaMask.getIconWidth() == width && alphaMask.getIconHeight() == height) { final int[][] oldPixels = sprite.getFrameTextureData(0); final int[][] alphaPixels = alphaMask.getFrameTextureData(0); for (int p = 0; p < width * height; p++) { final int alphaMultiplier = alphaPixels[0][p] >>> 24; final int oldPixel = oldPixels[0][p]; final int oldPixelAlpha = oldPixel >>> 24; final int newAlpha = oldPixelAlpha * alphaMultiplier / 0xFF; pixels[0][p] = (oldPixel & 0xFFFFFF) + (newAlpha << 24); } } } finally { IOUtils.closeQuietly(empty); IOUtils.closeQuietly(mask); } this.clearFramesTextureData(); this.framesTextureData.add(pixels); return false; }

Target:
public boolean load(@Nonnull IResourceManager manager, @Nonnull ResourceLocation location, @Nonnull Function<ResourceLocation, TextureAtlasSprite> textureGetter) { final TextureAtlasSprite sprite = textureGetter.apply(bucket); final TextureAtlasSprite alphaMask = textureGetter.apply(bucketCoverMask); width = sprite.getIconWidth(); height = sprite.getIconHeight(); final int[][] pixels = new int[Minecraft.getMinecraft().gameSettings.mipmapLevels + 1][]; pixels[0] = new int[width * height]; try ( IResource empty = getResource(new ResourceLocation("textures/items/bucket_empty.png")); IResource mask = getResource(new ResourceLocation(ForgeVersion.MOD_ID, "textures/items/vanilla_bucket_cover_mask.png")) ) { if (empty != null && mask != null && Objects.equals(empty.getResourcePackName(), mask.getResourcePackName()) && alphaMask.getIconWidth() == width && alphaMask.getIconHeight() == height) { final int[][] oldPixels = sprite.getFrameTextureData(0); final int[][] alphaPixels = alphaMask.getFrameTextureData(0); for (int p = 0; p < width * height; p++) { final int alphaMultiplier = alphaPixels[0][p] >>> 24; final int oldPixel = oldPixels[0][p]; final int oldPixelAlpha = oldPixel >>> 24; final int newAlpha = oldPixelAlpha * alphaMultiplier / 0xFF; pixels[0][p] = (oldPixel & 0xFFFFFF) + (newAlpha << 24); } } } catch (IOException e) { FMLLog.log.error("Failed to close resource", e); } this.clearFramesTextureData(); this.framesTextureData.add(pixels); return false; }
Source:
public void postDrawEvent(ITimeEvent event, Rectangle bounds, GC gc) { if (fAverageCharWidth == null) { fAverageCharWidth = gc.getFontMetrics().getAverageCharWidth(); } if (bounds.width <= fAverageCharWidth * 4) { return; } if (!(event instanceof CallStackEvent)) { return; } String name = nullToEmptyString(fTimeEventNames.getUnchecked((CallStackEvent) event)); if (name.isEmpty()) { return; } int textWidth = gc.stringExtent(name).x; String displayText = name; while (textWidth > bounds.width) { name = name.substring(0, name.length() - 1); displayText = name + ELLIPSIS; textWidth = gc.stringExtent(displayText).x; } gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_WHITE)); Utils.drawText(gc, displayText, bounds.x, bounds.y, bounds.width, bounds.height, true, true); }

Target:
public void postDrawEvent(ITimeEvent event, Rectangle bounds, GC gc) { if (fMinimumBarWidth == null) { fMinimumBarWidth = gc.getFontMetrics().getAverageCharWidth() + gc.stringExtent(ELLIPSIS).x; } if (bounds.width <= fMinimumBarWidth) { return; } if (!(event instanceof CallStackEvent)) { return; } String name = fTimeEventNames.getUnchecked((CallStackEvent) event).orElse(""); if (name.isEmpty()) { return; } int textWidth = gc.stringExtent(name).x; String displayText = name; while (textWidth > bounds.width) { name = name.substring(0, name.length() - 1); displayText = name + ELLIPSIS; textWidth = gc.stringExtent(displayText).x; } gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_WHITE)); Utils.drawText(gc, displayText, bounds.x, bounds.y, bounds.width, bounds.height, true, true); }
Source:
public void onDrawerOpened(View drawerView) { super.onDrawerOpened(drawerView); if (isSearching()) { searchFragment.closeSearch(); } }

Target:
public void onDrawerOpened(View drawerView) { super.onDrawerOpened(drawerView); if (isSearching()) { searchFragment.closeSearch(); } if (currentActionMode != null) { currentActionMode.finish(); } }
Source:
public void initialize(ClassWhiteList classWhiteList) { baseCfg.setClassResolver(new CheckedClassResolver(classWhiteList, this.getClass().getClassLoader())); }

Target:
public void initialize(ClassWhiteList classWhiteList) { ClassLoader classLoader = ((DefaultContextClassResolver) baseCfg.getClassResolver()).getClassLoader(); baseCfg.setClassResolver(new CheckedClassResolver(classWhiteList, classLoader)); }
Source:
private boolean runVmAsStateless(VM vmToRunAsStateless) { log.infoFormat("Running Vm {0} as stateless", vmToRunAsStateless); RunVmParams runVmParams = new RunVmParams(vmToRunAsStateless.getId()); runVmParams.setEntityInfo(new EntityInfo(VdcObjectType.VM, vmToRunAsStateless.getId())); runVmParams.setRunAsStateless(true); VdcReturnValueBase vdcReturnValue = Backend.getInstance().runInternalAction(VdcActionType.RunVm, runVmParams, ExecutionHandler.createInternalJobContext()); boolean prestartingVmSucceeded = vdcReturnValue.getSucceeded(); if (!prestartingVmSucceeded) { AuditLogableBase log = new AuditLogableBase(); log.setVmId(vmToRunAsStateless.getId()); log.addCustomValue("VmName", vmToRunAsStateless.getName()); AuditLogDirector.log(log, AuditLogType.VM_CANNOT_BE_PRESTARTED_NOT_ENOUGH_RESOURCES); } log.infoFormat("Running Vm {0} as stateless {1}", vmToRunAsStateless, prestartingVmSucceeded ? "succeeded" : "failed"); return prestartingVmSucceeded; }

Target:
private boolean runVmAsStateless(VM vmToRunAsStateless) { log.infoFormat("Running Vm {0} as stateless", vmToRunAsStateless); RunVmParams runVmParams = new RunVmParams(vmToRunAsStateless.getId()); runVmParams.setEntityInfo(new EntityInfo(VdcObjectType.VM, vmToRunAsStateless.getId())); runVmParams.setRunAsStateless(true); VdcReturnValueBase vdcReturnValue = Backend.getInstance().runInternalAction(VdcActionType.RunVm, runVmParams, ExecutionHandler.createInternalJobContext()); boolean prestartingVmSucceeded = vdcReturnValue.getSucceeded(); if (!prestartingVmSucceeded) { AuditLogableBase log = new AuditLogableBase(); log.setVmId(vmToRunAsStateless.getId()); log.addCustomValue("VmName", vmToRunAsStateless.getName()); log.addCustomValue("VmPoolName", vmToRunAsStateless.getVmPoolName()); AuditLogDirector.log(log, AuditLogType.VM_FAILED_TO_PRESTART_IN_POOL); } log.infoFormat("Running Vm {0} as stateless {1}", vmToRunAsStateless, prestartingVmSucceeded ? "succeeded" : "failed"); return prestartingVmSucceeded; }
Source:
public void refreshRoutingData(String namespace) { if (!_routingZkAddressMap.containsKey(namespace)) { LOG.error( "Failed to refresh internally-cached routing data! Namespace not found: " + namespace); return; } Map<String, List<String>> rawRoutingData; try { rawRoutingData = _routingDataReaderMap.get(namespace).getRoutingData(); } catch (InvalidRoutingDataException e) { LOG.error("Failed to refresh cached routing data for namespace {}", namespace, e); _realmToShardingKeysMap.remove(namespace); _routingDataMap.remove(namespace); return; } TrieRoutingData trieRoutingData; try { trieRoutingData = new TrieRoutingData(rawRoutingData); } catch (InvalidRoutingDataException e) { LOG.warn("TrieRoutingData is not created for namespace {}", namespace, e); _realmToShardingKeysMap.remove(namespace); _routingDataMap.remove(namespace); return; } _realmToShardingKeysMap.put(namespace, rawRoutingData); _routingDataMap.put(namespace, trieRoutingData); }

Target:
public void refreshRoutingData(String namespace) { if (!_routingZkAddressMap.containsKey(namespace)) { LOG.error( "Failed to refresh internally-cached routing data! Namespace not found: " + namespace); return; } Map<String, List<String>> rawRoutingData; try { rawRoutingData = _routingDataReaderMap.get(namespace).getRoutingData(); } catch (InvalidRoutingDataException e) { LOG.error("Failed to refresh cached routing data for namespace {}", namespace, e); _realmToShardingKeysMap.put(namespace, Collections.emptyMap()); _routingDataMap.remove(namespace); return; } _realmToShardingKeysMap.put(namespace, rawRoutingData); TrieRoutingData trieRoutingData; try { trieRoutingData = new TrieRoutingData(rawRoutingData); } catch (InvalidRoutingDataException e) { LOG.warn("TrieRoutingData is not created for namespace {}", namespace, e); _routingDataMap.remove(namespace); return; } _routingDataMap.put(namespace, trieRoutingData); }
Source:
public Optional<HostAddress> getAddress() { return address; }

Target:
public HostAddress getAddress() { return address.isPresent() ? address.get() : null; }
Source:
public void testGetMemoryInBytes() throws Exception { assertEquals(42l, AccumuloConfiguration.getFixedMemoryAsBytes("42")); assertEquals(42l, AccumuloConfiguration.getFixedMemoryAsBytes("42b")); assertEquals(42l, AccumuloConfiguration.getFixedMemoryAsBytes("42B")); assertEquals(42l * 1024l, AccumuloConfiguration.getFixedMemoryAsBytes("42K")); assertEquals(42l * 1024l, AccumuloConfiguration.getFixedMemoryAsBytes("42k")); assertEquals(42l * 1024l * 1024l, AccumuloConfiguration.getFixedMemoryAsBytes("42M")); assertEquals(42l * 1024l * 1024l, AccumuloConfiguration.getFixedMemoryAsBytes("42m")); assertEquals(42l * 1024l * 1024l * 1024l, AccumuloConfiguration.getFixedMemoryAsBytes("42G")); assertEquals(42l * 1024l * 1024l * 1024l, AccumuloConfiguration.getFixedMemoryAsBytes("42g")); assertEquals(Runtime.getRuntime().maxMemory() / 10, AccumuloConfiguration.getMemoryAsBytes("10%")); assertEquals(Runtime.getRuntime().maxMemory() / 5, AccumuloConfiguration.getMemoryAsBytes("20%")); }

Target:
public void testGetMemoryInBytes() throws Exception { List<Function<String,Long>> funcs = Arrays.asList(AccumuloConfiguration::getFixedMemoryAsBytes, AccumuloConfiguration::getMemoryAsBytes); for(Function<String,Long> memFunc : funcs) { assertEquals(42l, memFunc.apply("42").longValue()); assertEquals(42l, memFunc.apply("42b").longValue()); assertEquals(42l, memFunc.apply("42B").longValue()); assertEquals(42l * 1024l, memFunc.apply("42K").longValue()); assertEquals(42l * 1024l, memFunc.apply("42k").longValue()); assertEquals(42l * 1024l * 1024l, memFunc.apply("42M").longValue()); assertEquals(42l * 1024l * 1024l, memFunc.apply("42m").longValue()); assertEquals(42l * 1024l * 1024l * 1024l, memFunc.apply("42G").longValue()); assertEquals(42l * 1024l * 1024l * 1024l, memFunc.apply("42g").longValue()); } assertEquals(Runtime.getRuntime().maxMemory() / 10, AccumuloConfiguration.getMemoryAsBytes("10%")); assertEquals(Runtime.getRuntime().maxMemory() / 5, AccumuloConfiguration.getMemoryAsBytes("20%")); }
Source:
protected boolean isSourceNatAvailableForNetwork(Account owner, IPAddressVO ipToAssoc, Network network) { NetworkOffering offering = _networkOfferingDao.findById(network.getNetworkOfferingId()); boolean sharedSourceNat = offering.isSharedSourceNat(); boolean isSourceNat = false; if (!sharedSourceNat) { if (getExistingSourceNatInNetwork(owner.getId(), network.getId()) == null) { if (network.getGuestType() == GuestType.Isolated && network.getVpcId() == null && !ipToAssoc.isPortable()) { if (network.getState() == Network.State.Allocated) { throw new InvalidParameterValueException("Network is in allocated state, implement network first before acquiring an IP address"); } isSourceNat = true; } } } return isSourceNat; }

Target:
protected boolean isSourceNatAvailableForNetwork(Account owner, IPAddressVO ipToAssoc, Network network) { NetworkOffering offering = _networkOfferingDao.findById(network.getNetworkOfferingId()); boolean sharedSourceNat = offering.isSharedSourceNat(); boolean isSourceNat = false; if (!sharedSourceNat) { if (getExistingSourceNatInNetwork(owner.getId(), network.getId()) == null) { if (network.getGuestType() == GuestType.Isolated && network.getVpcId() == null && !ipToAssoc.isPortable()) { if (network.getState() == Network.State.Allocated) { String msg = String.format("Network with UUID:%s is in allocated and needs to be implemented first before acquiring an IP address", network.getUuid()); throw new InvalidParameterValueException(msg); } isSourceNat = true; } } } return isSourceNat; }
Source:
void checkForMemoryLeaks(Supplier<List<QueryInfo>> queryInfoSupplier, Map<QueryId, Long> queryMemoryReservations) { requireNonNull(queryInfoSupplier); requireNonNull(queryMemoryReservations); Map<QueryId, Long> leakedQueryReservations = queryMemoryReservations.entrySet() .stream() .filter(Objects::nonNull) .filter(entry -> entry.getValue() > 0) .filter(entry -> isLeaked(queryInfoSupplier, entry.getKey())) .collect(toImmutableMap(Entry::getKey, Entry::getValue)); if (!leakedQueryReservations.isEmpty()) { log.warn("Memory leak detected. The following queries are already finished, " + "but they have memory reservations on some worker node(s): %s", leakedQueryReservations); } synchronized (this) { numberOfLeakedQueries.set(leakedQueryReservations.size()); leakedQueries.update(leakedQueryReservations.keySet()); } }

Target:
void checkForMemoryLeaks(Supplier<List<QueryInfo>> queryInfoSupplier, Map<QueryId, Long> queryMemoryReservations) { requireNonNull(queryInfoSupplier); requireNonNull(queryMemoryReservations); Map<QueryId, QueryInfo> queryIdToInfo = Maps.uniqueIndex(queryInfoSupplier.get(), QueryInfo::getQueryId); Map<QueryId, Long> leakedQueryReservations = queryMemoryReservations.entrySet() .stream() .filter(entry -> entry.getValue() > 0) .filter(entry -> isLeaked(queryIdToInfo, entry.getKey())) .collect(toImmutableMap(Entry::getKey, Entry::getValue)); if (!leakedQueryReservations.isEmpty()) { log.warn("Memory leak detected. The following queries are already finished, " + "but they have memory reservations on some worker node(s): %s", leakedQueryReservations); } synchronized (this) { leakedQueries = ImmutableSet.copyOf(leakedQueryReservations.keySet()); } }
Source:
public void initializeState(FunctionInitializationContext context) throws Exception { Preconditions.checkArgument(this.restoredBucketStates == null, "The operator has already been initialized."); try { initFileSystem(); } catch (IOException e) { LOG.error("Error while creating FileSystem when initializing the state of the BucketingSink.", e); throw new RuntimeException("Error while creating FileSystem when initializing the state of the BucketingSink.", e); } if (this.refTruncate == null) { this.refTruncate = reflectTruncate(fs); } OperatorStateStore stateStore = context.getOperatorStateStore(); this.restoredBucketStates = stateStore.getListState(new ListStateDescriptor("bucket-states", State.class)); int subtaskIndex = getRuntimeContext().getIndexOfThisSubtask(); if (context.isRestored()) { LOG.info("Restoring state for the (taskIdx={}).", getClass().getSimpleName(), subtaskIndex); for (State<T> recoveredState : restoredBucketStates.get()) { handleRestoredBucketState(recoveredState); if (LOG.isDebugEnabled()) { LOG.debug("{} idx restored {}", getClass().getSimpleName(), subtaskIndex, recoveredState); } } } else { LOG.info("No state to restore for the (taskIdx={}).", getClass().getSimpleName(), subtaskIndex); } }

Target:
public void initializeState(FunctionInitializationContext context) throws Exception { Preconditions.checkArgument(this.restoredBucketStates == null, "The operator has already been initialized."); try { initFileSystem(); } catch (IOException e) { LOG.error("Error while creating FileSystem when initializing the state of the BucketingSink.", e); throw new RuntimeException("Error while creating FileSystem when initializing the state of the BucketingSink.", e); } if (this.refTruncate == null) { this.refTruncate = reflectTruncate(fs); } OperatorStateStore stateStore = context.getOperatorStateStore(); this.restoredBucketStates = stateStore.getListState(new ListStateDescriptor<>("bucket-states", new JavaSerializer<>())); int subtaskIndex = getRuntimeContext().getIndexOfThisSubtask(); if (context.isRestored()) { LOG.info("Restoring state for the (taskIdx={}).", getClass().getSimpleName(), subtaskIndex); for (State<T> recoveredState : restoredBucketStates.get()) { handleRestoredBucketState(recoveredState); if (LOG.isDebugEnabled()) { LOG.debug("{} idx restored {}", getClass().getSimpleName(), subtaskIndex, recoveredState); } } } else { LOG.info("No state to restore for the (taskIdx={}).", getClass().getSimpleName(), subtaskIndex); } }
Source:
public void createDraft() throws Exception { PushOneCommit.Result r = createChange(); String changeId = r.getChangeId(); String revId = r.getCommit().getName(); ReviewInput.CommentInput comment = newCommentInfo( "file1", Comment.Side.REVISION, 1, "comment 1"); addDraft(changeId, revId, comment); Map<String, List<CommentInfo>> result = getDraftComments(changeId, revId); assertThat(result.size()).isEqualTo(1); CommentInfo actual = Iterables.getOnlyElement(result.get(comment.path)); assertCommentInfo(comment, actual); }

Target:
public void createDraft() throws Exception { PushOneCommit.Result r = createChange(); String changeId = r.getChangeId(); String revId = r.getCommit().getName(); ReviewInput.CommentInput comment = newCommentInfo( "file1", Comment.Side.REVISION, 1, "comment 1"); addDraft(changeId, revId, comment); Map<String, List<CommentInfo>> result = getDraftComments(changeId, revId); assertThat(result).hasSize(1); CommentInfo actual = Iterables.getOnlyElement(result.get(comment.path)); assertCommentInfo(comment, actual); }
Source:
public void setDiscarded(boolean discarded) { if (discarded) volume = new BigDecimal("0.0"); this.discarded = discarded; }

Target:
public void setDiscarded(boolean discarded) { if (discarded) volume = BigDecimal.ZERO; this.discarded = discarded; }
Source:
String getRefreshRateItemKey() { return GRID_REFRESH_RATE_PREFIX; }

Target:
String getRefreshRateItemKey() { return GRID_REFRESH_RATE_KEY; }
Source:
public static Row createRow(Map<String, Object> sourceMap, String documentId, DataSetHeader header) { final Object[] values = new Object[header.size()]; for (int i = 0; i < values.length; i++) { final SelectItem selectItem = header.getSelectItem(i); final Column column = selectItem.getColumn(); assert column != null; assert selectItem.getFunction() == null; if (column.isPrimaryKey()) { values[i] = documentId; } else { Object value = sourceMap.get(column.getName()); if (column.getType() == ColumnType.DATE) { Date valueToDate = TimeComparator.toDate(value); if (valueToDate == null) { values[i] = value; } else { values[i] = valueToDate; } } else { values[i] = value; } } } return new DefaultRow(header, values); }

Target:
public static Row createRow(Map<String, Object> sourceMap, String documentId, DataSetHeader header) { final Object[] values = new Object[header.size()]; for (int i = 0; i < values.length; i++) { final SelectItem selectItem = header.getSelectItem(i); final Column column = selectItem.getColumn(); assert column != null; assert selectItem.getFunction() == null; if (column.isPrimaryKey()) { values[i] = documentId; } else { Object value = sourceMap.get(column.getName()); if (column.getType() == ColumnType.DATE) { Date valueToDate = ElasticSearchDateConverter.tryToConvert((String) value); if (valueToDate == null) { values[i] = value; } else { values[i] = valueToDate; } } else { values[i] = value; } } } return new DefaultRow(header, values); }
Source:
protected boolean recreateDataSource() { return true; }

Target:
protected boolean recreateDataSource() { boolean recreate = previousProducerTimeZone != null && previousClientTimeZone != null && (!producerTimeZone.equals(previousProducerTimeZone) || !clientTimeZone.equals(previousClientTimeZone)); previousProducerTimeZone = producerTimeZone; previousClientTimeZone = clientTimeZone; return recreate; }
Source:
private List<AXLPDFAIdentification> getIdentification() { VeraPDFMeta xmpMetadata = this.getXmpMetadata(); if (xmpMetadata != null) { for (VeraPDFXMPNode node : xmpMetadata.getProperties()) { if (XMPSchemaRegistryImpl.NS_PDFA_ID.equals(node.getNamespaceURI())) { List<AXLPDFAIdentification> res = new ArrayList<>(1); res.add(new AXLPDFAIdentification(xmpMetadata)); return res; } } } return new ArrayList<>(0); }

Target:
private List<AXLPDFAIdentification> getIdentification() { VeraPDFMeta xmpMetadata = this.getXmpMetadata(); if (xmpMetadata != null) { for (VeraPDFXMPNode node : xmpMetadata.getProperties()) { if (XMPSchemaRegistryImpl.NS_PDFA_ID.equals(node.getNamespaceURI())) { List<AXLPDFAIdentification> res = new ArrayList<>(1); res.add(new AXLPDFAIdentification(xmpMetadata)); return res; } } } return Collections.emptyList(); }
Source:
private boolean shouldRetry(IOException exception, Optional<Duration> backoff) { if (retryOnSocketException == ClientConfiguration.RetryOnSocketException.DANGEROUS_DISABLED) { return false; } switch (retryOnTimeout) { case DISABLED: if (exception instanceof SocketTimeoutException) { SocketTimeoutException socketTimeout = (SocketTimeoutException) exception; if (socketTimeout.getMessage() == null || !socketTimeout .getMessage() .toLowerCase(Locale.ENGLISH) .contains("connect timed out")) { return false; } } return backoff.isPresent(); case DANGEROUS_ENABLE_AT_RISK_OF_RETRY_STORMS: return backoff.isPresent(); } throw new SafeIllegalStateException( "Encountered unknown retry on timeout configuration", SafeArg.of("retryOnTimeout", retryOnTimeout)); }

Target:
private boolean shouldRetry(IOException exception, Optional<Duration> backoff) { if (retryOnSocketException == ClientConfiguration.RetryOnSocketException.DANGEROUS_DISABLED) { return false; } switch (retryOnTimeout) { case DISABLED: if (exception instanceof SocketTimeoutException) { SocketTimeoutException socketTimeout = (SocketTimeoutException) exception; if (socketTimeout.getMessage() == null || !socketTimeout.getMessage().contains("connect timed out") && !socketTimeout.getMessage().contains("Connect timed out")) { return false; } } return backoff.isPresent(); case DANGEROUS_ENABLE_AT_RISK_OF_RETRY_STORMS: return backoff.isPresent(); } throw new SafeIllegalStateException( "Encountered unknown retry on timeout configuration", SafeArg.of("retryOnTimeout", retryOnTimeout)); }
Source:
void scheduleMessageWithTransaction() { long sequenceNumberReturned = 10; Instant instant = mock(Instant.class); ArgumentCaptor<Instant> instantCapture = ArgumentCaptor.forClass(Instant.class); ArgumentCaptor<Integer> lengthCapture = ArgumentCaptor.forClass(Integer.class); ArgumentCaptor<String> linkNameCapture = ArgumentCaptor.forClass(String.class); ArgumentCaptor<ServiceBusTransactionContext> transactionCapture = ArgumentCaptor.forClass(ServiceBusTransactionContext.class); when(connection.createSendLink(eq(ENTITY_NAME), eq(ENTITY_NAME), any(AmqpRetryOptions.class))) .thenReturn(Mono.just(sendLink)); when(sendLink.getLinkSize()).thenReturn(Mono.just(MAX_MESSAGE_LENGTH_BYTES)); when(managementNode.schedule(eq(message), eq(instant), any(Integer.class), any(), any(ServiceBusTransactionContext.class))) .thenReturn(just(sequenceNumberReturned)); StepVerifier.create(sender.scheduleMessage(message, instant, transactionContext)) .expectNext(sequenceNumberReturned) .verifyComplete(); verify(managementNode).schedule(singleSBMessageCaptor.capture(), instantCapture.capture(), lengthCapture.capture(), linkNameCapture.capture(), transactionCapture.capture()); Assertions.assertEquals(message, singleSBMessageCaptor.getValue()); Assertions.assertEquals(instant, instantCapture.getValue()); Assertions.assertEquals(MAX_MESSAGE_LENGTH_BYTES, lengthCapture.getValue()); Assertions.assertEquals(LINK_NAME, linkNameCapture.getValue()); Assertions.assertSame(transactionContext, transactionCapture.getValue()); }

Target:
void scheduleMessageWithTransaction() { final long sequenceNumberReturned = 10; final Instant instant = mock(Instant.class); when(connection.createSendLink(eq(ENTITY_NAME), eq(ENTITY_NAME), any(AmqpRetryOptions.class))) .thenReturn(Mono.just(sendLink)); when(sendLink.getLinkSize()).thenReturn(Mono.just(MAX_MESSAGE_LENGTH_BYTES)); when(managementNode.schedule(eq(message), eq(instant), eq(MAX_MESSAGE_LENGTH_BYTES), eq(LINK_NAME), argThat(e -> e.getTransactionId().equals(transactionContext.getTransactionId())))) .thenReturn(just(sequenceNumberReturned)); StepVerifier.create(sender.scheduleMessage(message, instant, transactionContext)) .expectNext(sequenceNumberReturned) .verifyComplete(); verify(managementNode).schedule(eq(message), eq(instant), eq(MAX_MESSAGE_LENGTH_BYTES), eq(LINK_NAME), argThat(e -> e.getTransactionId().equals(transactionContext.getTransactionId()))); }
Source:
RestartInformation getRestartInformationForStreamPos(long streamPos) { RestartInformation restartInfo = new RestartInformation(); for (int i = 0; i < streamPosOfFetches.size(); i++) { int index = streamPosOfFetches.size() - (i+1); Long fetchStreamPos = streamPosOfFetches.get(index); if (fetchStreamPos <= streamPos) { restartInfo.streamPos = fetchStreamPos; restartInfo.tokenBin = tokenBinOfFetches.get(index); break; } } return restartInfo; }

Target:
RestartInformation getRestartInformationForStreamPos(long streamPos) { RestartInformation restartInfo = new RestartInformation(); for (int i = streamPosOfFetches.size()-1; i >= 0; i--) { Long fetchStreamPos = streamPosOfFetches.get(i); if (fetchStreamPos <= streamPos) { restartInfo.streamPos = fetchStreamPos; restartInfo.tokenBin = tokenBinOfFetches.get(i); break; } } return restartInfo; }
Source:
private static BiConsumer<LoggingFunction, Stopwatch> logCellsAndSize(String method, TableReference tableRef, int numCells, long sizeInBytes) { return (logger, stopwatch) -> logger.log("Call to KVS.{} on table for cells of overall size bytes took ms.", SafeArg.of("method", method), UnsafeArg.of("tableRef", tableRef), SafeArg.of("numCells", numCells), SafeArg.of("sizeInBytes", sizeInBytes), stopwatch.elapsed(TimeUnit.MILLISECONDS)); }

Target:
private static BiConsumer<LoggingFunction, Stopwatch> logCellsAndSize(String method, TableReference tableRef, int numCells, long sizeInBytes) { return (logger, stopwatch) -> logger.log("Call to KVS.{} on table for cells of overall size bytes took ms.", LoggingArgs.method(method), LoggingArgs.tableRef(tableRef), LoggingArgs.cellCount(numCells), LoggingArgs.sizeInBytes(sizeInBytes), LoggingArgs.durationMillis(stopwatch)); }
Source:
private Boolean isValidEntry(JarEntry entry) { if (entry != null && entry.getSize() > 0) { return true; } return false; }

Target:
private boolean isValidEntry(JarEntry entry) { return entry != null && entry.getSize() > 0; }
Source:
public void cleanIndexingDataSet(@Suspended final AsyncResponse asyncResponse, @PathParam("topologyName") final String topologyName, @PathParam("taskId") final String taskId, final DataSetCleanerParameters cleanerParameters ) throws AccessDeniedOrTopologyDoesNotExistException, AccessDeniedOrObjectDoesNotExistException { assertContainTopology(topologyName); reportService.checkIfTaskExists(taskId, topologyName); new Thread(new Runnable() { @Override public void run() { try { asyncResponse.resume("The request was received successfully"); if (cleanerParameters != null) { LOGGER.info("cleaning dataset based on date: {}", cleanerParameters.getDataSetId(), cleanerParameters.getCleaningDate()); DatasetCleaner datasetCleaner = new DatasetCleaner(cleanerParameters); datasetCleaner.execute(); LOGGER.info("dataset{} cleaned successfully", cleanerParameters.getDataSetId()); taskDAO.setTaskStatus(Long.parseLong(taskId), TaskState.PROCESSED.toString()); } else { taskDAO.dropTask(Long.parseLong(taskId), "cleaner parameters can not be null", TaskState.DROPPED.toString()); } } catch (ParseException e) { LOGGER.error("Dataset was not removed correctly. ", e); taskDAO.dropTask(Long.parseLong(taskId), e.getMessage(), TaskState.DROPPED.toString()); } catch (DatasetCleaningException e) { LOGGER.error("Dataset was not removed correctly. ", e); taskDAO.dropTask(Long.parseLong(taskId), e.getMessage(), TaskState.DROPPED.toString()); } } }).start(); }

Target:
public void cleanIndexingDataSet(@Suspended final AsyncResponse asyncResponse, @PathParam("topologyName") final String topologyName, @PathParam("taskId") final String taskId, final DataSetCleanerParameters cleanerParameters ) throws AccessDeniedOrTopologyDoesNotExistException, AccessDeniedOrObjectDoesNotExistException { assertContainTopology(topologyName); reportService.checkIfTaskExists(taskId, topologyName); new Thread(new Runnable() { @Override public void run() { try { asyncResponse.resume("The request was received successfully"); if (cleanerParameters != null) { LOGGER.info("cleaning dataset based on date: {}", cleanerParameters.getDataSetId(), cleanerParameters.getCleaningDate()); DatasetCleaner datasetCleaner = new DatasetCleaner(cleanerParameters); datasetCleaner.execute(); LOGGER.info("Dataset cleaned successfully", cleanerParameters.getDataSetId()); taskDAO.setTaskStatus(Long.parseLong(taskId), "Completely process", TaskState.PROCESSED.toString()); } else { taskDAO.dropTask(Long.parseLong(taskId), "cleaner parameters can not be null", TaskState.DROPPED.toString()); } } catch (ParseException e) { LOGGER.error("Dataset was not removed correctly. ", e); taskDAO.dropTask(Long.parseLong(taskId), e.getMessage(), TaskState.DROPPED.toString()); } catch (DatasetCleaningException e) { LOGGER.error("Dataset was not removed correctly. ", e); taskDAO.dropTask(Long.parseLong(taskId), e.getMessage(), TaskState.DROPPED.toString()); } } }).start(); }
Source:
protected Type build(String name) { Preconditions.checkState(logicalTypeAnnotation == null, "MAP is already a logical type and can't be changed."); if (keyType == null) { keyType = STRING_KEY; } GroupBuilder<GroupType> builder = buildGroup(repetition).as(mapType()); if (id != null) { builder.id(id.intValue()); } if (valueType != null) { return builder .repeatedGroup().addFields(keyType, valueType).named("key_value") .named(name); } else { return builder .repeatedGroup().addFields(keyType).named("key_value") .named(name); } }

Target:
protected Type build(String name) { Preconditions.checkState(logicalTypeAnnotation == null, "MAP is already a logical type and can't be changed."); if (keyType == null) { keyType = STRING_KEY; } GroupBuilder<GroupType> builder = buildGroup(repetition).as(mapType()); if (id != null) { builder.id(id.intValue()); } if (valueType != null) { return builder .repeatedGroup().addFields(keyType, valueType).named(ConversionPatterns.MAP_REPEATED_NAME) .named(name); } else { return builder .repeatedGroup().addFields(keyType).named(ConversionPatterns.MAP_REPEATED_NAME) .named(name); } }