auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void createTableAsync(final HTableDescriptor desc, byte[][] splitKeys) throws IOException { LOG.warn("Creating the table synchronously"); CreateTableRequest createTableRequest = TableAdapter.adapt(desc, splitKeys).toProto(instanceName); createTableAsync(createTableRequest, desc.getTableName()); }

Target:
public void createTableAsync(final HTableDescriptor desc, byte[][] splitKeys) throws IOException { LOG.warn("Creating the table synchronously"); CreateTableRequest request = TableAdapter.adapt(desc, splitKeys) .toProto(bigtableInstanceName.toAdminInstanceName()); createTableAsync(request, desc.getTableName()); }
Source:
public void is_0xff() { ExpressionTree tree = getReturnExpression("int foo() { return 0xFF; }"); assertThat(LiteralUtils.is0xff(tree)).isTrue(); tree = getReturnExpression("int foo() { return 0x01; }"); assertThat(LiteralUtils.is0xff(tree)).isFalse(); tree = getReturnExpression("char foo() { return '0'; }"); assertThat(LiteralUtils.is0xff(tree)).isFalse(); }

Target:
public void is_0xff() { ExpressionTree tree = getReturnExpression("int foo() { return 0xFF; }"); assertThat(LiteralUtils.is0xff(tree)).isTrue(); tree = getReturnExpression("int foo() { return 0x01; }"); assertThat(LiteralUtils.is0xff(tree)).isFalse(); tree = getReturnExpression("int foo() { return 0Xff; }"); assertThat(LiteralUtils.is0xff(tree)).isTrue(); tree = getReturnExpression("char foo() { return '0'; }"); assertThat(LiteralUtils.is0xff(tree)).isFalse(); }
Source:
protected void initFileSystem() { URI uri = spacesAPI.resolveFileSystemURI(SpacesAPI.Scheme.DEFAULT, SpacesAPI.DASHBUILDER_SPACE, "datasets"); HashMap<String, Object> env = new HashMap<String, Object>() {{ put("init", Boolean.TRUE); put("internal", Boolean.TRUE); }}; fileSystem = ioService.getOrNewFileSystem(uri, env); root = fileSystem.getRootDirectories().iterator().next(); }

Target:
protected void initFileSystem() { root = fileSystem.getRootDirectories().iterator().next(); }
Source:
public String getUuid() { return null; }

Target:
public String getUuid() { return "100892"; }
Source:
public void sendMessagesToPushNetwork(@Observes @Dequeue MessageHolderWithTokens msg) { final Variant variant = msg.getVariant(); final UnifiedPushMessage unifiedPushMessage = msg.getUnifiedPushMessage(); final Collection<String> deviceTokens = msg.getDeviceTokens(); logger.info("Received UnifiedPushMessage from JMS queue, will now trigger the Push Notification delivery for the variant {}", variant.getType().getTypeName(), variant.getVariantID()); senders.select(new SenderTypeLiteral(variant.getType())).get() .sendPushMessage(variant, deviceTokens, unifiedPushMessage, msg.getPushMessageInformation().getId(), new SenderServiceCallback( variant, deviceTokens.size(), msg.getPushMessageInformation() ) ); }

Target:
public void sendMessagesToPushNetwork(@Observes @Dequeue MessageHolderWithTokens msg) { final Variant variant = msg.getVariant(); final UnifiedPushMessage unifiedPushMessage = msg.getUnifiedPushMessage(); final Collection<String> deviceTokens = msg.getDeviceTokens(); logger.info("UnifiedPushMessage was successfully received. Push Notification delivery for the variant ({}) will now be triggered.", variant.getType().getTypeName(), variant.getVariantID()); senders.select(new SenderTypeLiteral(variant.getType())).get() .sendPushMessage(variant, deviceTokens, unifiedPushMessage, msg.getPushMessageInformation().getId(), new SenderServiceCallback( variant, deviceTokens.size(), msg.getPushMessageInformation() ) ); }
Source:
public synchronized void configure(final DolphinLoggerConfiguration configuration) { Assert.requireNonNull(configuration, "configuration"); bridges.clear(); Iterator<DolphinLoggerBridgeFactory> iterator = ServiceLoader.load(DolphinLoggerBridgeFactory.class).iterator(); while (iterator.hasNext()) { DolphinLoggerBridge bridge = iterator.next().create(configuration); if(bridge != null) { bridges.add(bridge); } } markers.clear(); for(DolphinLogger logger : loggerMap.values()) { logger.updateBridges(Collections.unmodifiableList(bridges)); final Level level = configuration.getLevelFor(logger.getName()); logger.setLevel(level); } this.configuration = configuration; configured.set(true); }

Target:
public synchronized void configure(final DolphinLoggerConfiguration configuration) { Assert.requireNonNull(configuration, "configuration"); bridges.clear(); final Iterator<DolphinLoggerBridgeFactory> iterator = ServiceLoader.load(DolphinLoggerBridgeFactory.class).iterator(); while (iterator.hasNext()) { final DolphinLoggerBridge bridge = iterator.next().create(configuration); if(bridge != null) { bridges.add(bridge); } } markers.clear(); for(final DolphinLogger logger : loggerMap.values()) { logger.updateBridges(Collections.unmodifiableList(bridges)); final Level level = configuration.getLevelFor(logger.getName()); logger.setLevel(level); } this.configuration = configuration; configured.set(true); }
Source:
public Token getUserIdentityFromJWT() { Token token = new Token(); Map<String, Object> jsonData = getJsonData(); if (jsonData == null) { return null; } AuthToken authToken= authTokenDao.getTokenByKey(getJWT()); String tokenId = (String)ApiContext.getContext().getIdFormatter().formatId(objectManager.getType(Account.class), authToken.getId()); token.setId(tokenId); Object idObject = jsonData.get(USER_IDENTITY); if (idObject != null) { Map<String, Object> idMap = CollectionUtils.toMap(idObject); Identity userIdentity = jsonToIdentity(idMap); String userType = ObjectUtils.toString(jsonData.get(USER_TYPE), null); token.setUserIdentity(userIdentity); token.setUserType(userType); } return token; }

Target:
public Token getUserIdentityFromJWT() { Token token = new Token(); Map<String, Object> jsonData = getJsonData(); if (jsonData == null) { return null; } Object idObject = jsonData.get(USER_IDENTITY); if (idObject != null) { Map<String, Object> idMap = CollectionUtils.toMap(idObject); Identity userIdentity = jsonToIdentity(idMap); String userType = ObjectUtils.toString(jsonData.get(USER_TYPE), null); token.setUserIdentity(userIdentity); token.setUserType(userType); } return token; }
Source:
public WorkDefinitionMatch getWorkDefinition(String id) { if (!workDefIdToWorkDefintion.containsKey(id)) { WorkDefinitionMatch match = new WorkDefinitionMatch(); if (!match.isMatched()) { try { XResultData resultData = new XResultData(false); if (workDefinitionService == null) { throw new IllegalStateException("ATS Work Definition Service is not found."); } IAtsWorkDefinition workDef = workDefinitionService.getWorkDef(id, resultData); if (workDef != null) { match.setWorkDefinition(workDef); if (!resultData.isEmpty()) { match.addTrace((String.format("from DSL provider loaded id [%s] [%s]", id, resultData.toString()))); } else { match.addTrace((String.format("from DSL provider loaded id [%s]", id))); } } if (match.isMatched()) { workDefIdToWorkDefintion.put(id, match); } else { System.out.println(String.format("Unable to load Work Definition [%s]", id)); } } catch (Exception ex) { return new WorkDefinitionMatch(null, ex.getLocalizedMessage()); } } } WorkDefinitionMatch match = workDefIdToWorkDefintion.get(id); if (match == null) { match = new WorkDefinitionMatch(); } return match; }

Target:
public WorkDefinitionMatch getWorkDefinition(String id) { WorkDefinitionMatch workDefinitionMatch = workDefIdToWorkDefintion.get(id); if (workDefinitionMatch != null) { return workDefinitionMatch; } WorkDefinitionMatch match = new WorkDefinitionMatch(); try { XResultData resultData = new XResultData(false); if (workDefinitionService == null) { throw new OseeStateException("ATS Work Definition Service is not found."); } IAtsWorkDefinition workDef = workDefinitionService.getWorkDef(id, resultData); if (workDef != null) { match.setWorkDefinition(workDef); if (!resultData.isEmpty()) { match.addTrace((String.format("from DSL provider loaded id [%s] [%s]", id, resultData.toString()))); } else { match.addTrace((String.format("from DSL provider loaded id [%s]", id))); } } if (match.isMatched()) { workDefIdToWorkDefintion.put(id, match); } else { System.out.println(String.format("Unable to load Work Definition [%s]", id)); } } catch (OseeCoreException ex) { return new WorkDefinitionMatch(null, ex.getLocalizedMessage()); } return match; }
Source:
public void testQueryBuilder() { CanonicalPath cp1 = CanonicalPath.fromString("/t;tenant1"); CanonicalPath cp2 = CanonicalPath.fromString("/t;tenant2"); Query qMetricsRelationships = Query.path().with( With.path(cp1), SwitchElementType.incomingRelationships(), RelationWith.name("name")).get(); Query qTypesRelationships = Query.path().with( With.path(cp2), SwitchElementType.incomingRelationships(), RelationWith.name("name")).get(); Query oldQuery = new Query.Builder().with(new PathFragment(new NoopFilter())) .branch().with(qMetricsRelationships).done() .branch().with(qTypesRelationships).done().build(); Query.Builder builder = new Query.Builder().path().with(new NoopFilter()).builder() .branch().path().with(With.path(cp1), SwitchElementType.incomingRelationships(), RelationWith.name("name")).builder().done() .branch().path().with(With.path(cp2), SwitchElementType.incomingRelationships(), RelationWith.name("name")).builder().done(); Query newQuery = builder.build(); Assert.assertTrue(newQuery.equals(oldQuery)); }

Target:
public void testQueryBuilder() { CanonicalPath cp1 = CanonicalPath.fromString("/t;tenant1"); CanonicalPath cp2 = CanonicalPath.fromString("/t;tenant2"); Query qMetricsRelationships = Query.path().with( With.path(cp1), SwitchElementType.incomingRelationships(), RelationWith.name("name")).get(); Query qTypesRelationships = Query.path().with( With.path(cp2), SwitchElementType.incomingRelationships(), RelationWith.name("name")).get(); Query oldQuery = new Query.Builder().with(new PathFragment(new NoopFilter())) .branch().with(qMetricsRelationships).done() .branch().with(qTypesRelationships).done().build(); Query.Builder builder = new Query.Builder() .branch().path().with(With.path(cp1), SwitchElementType.incomingRelationships(), RelationWith.name("name")).done() .branch().path().with(With.path(cp2), SwitchElementType.incomingRelationships(), RelationWith.name("name")).done(); Query newQuery = builder.build(); Assert.assertTrue(newQuery.equals(oldQuery)); }
Source:
public int[] transformToIntValuesSV(ProjectionBlock projectionBlock) { if (_intResult == null) { _intResult = new int[DocIdSetPlanNode.MAX_DOC_PER_CALL]; Arrays.fill(_intResult, Double.valueOf(_literal).intValue()); } return _intResult; }

Target:
public int[] transformToIntValuesSV(ProjectionBlock projectionBlock) { if (_intResult == null) { _intResult = new int[DocIdSetPlanNode.MAX_DOC_PER_CALL]; Arrays.fill(_intResult, Integer.parseInt(_literal)); } return _intResult; }
Source:
public Config unset(String name) throws GitException { ConfigKey key = parseName(name); repository.getConfig().unset(key.section, key.subsection, key.name); try { this.repository.getConfig().save(); } catch (IOException e) { throw new GitException("Failed to save to config file"); } return this; }

Target:
public Config unset(String name) throws GitException { ConfigKey key = parseName(name); repository.getConfig().unset(key.section, key.subsection, key.name); try { this.repository.getConfig().save(); } catch (IOException e) { throw new GitException(e.getMessage(), e); } return this; }
Source:
private static <T> T logIfNull(@Nullable T value) { if (value == null) { log.warn("Detected a null value, null values are not allowed by Conjure", new IllegalArgumentException()); } assert value != null : "Null values are not allowed by Conjure"; return value; }

Target:
private static <T> T logIfNull(@Nullable T value) { if (value == null) { onNull(); } return value; }
Source:
public ModernSplitCardRenderer(CardView view, boolean isTransformed) { super(view, isTransformed); rightHalf.manaCostString = ManaSymbols.getStringManaCost(cardView.getRightSplitCosts().getSymbols()); leftHalf.manaCostString = ManaSymbols.getStringManaCost(cardView.getLeftSplitCosts().getSymbols()); rightHalf.color = getColorFromManaCostHack(cardView.getRightSplitCosts()); leftHalf.color = getColorFromManaCostHack(cardView.getLeftSplitCosts()); parseRules(view.getRightSplitRules(), rightHalf.keywords, rightHalf.rules); parseRules(view.getLeftSplitRules(), leftHalf.keywords, leftHalf.rules); rightHalf.name = cardView.getRightSplitName(); leftHalf.name = cardView.getLeftSplitName(); for (String rule: view.getRules()) { if (rule.contains("Fuse")) { isFuse = true; break; } } for (String rule: view.getRightSplitRules()) { if (rule.contains("Aftermath")) { isAftermath = true; break; } } if (!isAftermath()) { HalfCardProps tmp = leftHalf; leftHalf = rightHalf; rightHalf = tmp; } }

Target:
public ModernSplitCardRenderer(CardView view, boolean isTransformed) { super(view, isTransformed); rightHalf.manaCostString = ManaSymbols.getStringManaCost(cardView.getRightSplitCosts().getSymbols()); leftHalf.manaCostString = ManaSymbols.getStringManaCost(cardView.getLeftSplitCosts().getSymbols()); rightHalf.color = getColorFromManaCostHack(cardView.getRightSplitCosts()); leftHalf.color = getColorFromManaCostHack(cardView.getLeftSplitCosts()); parseRules(view.getRightSplitRules(), rightHalf.keywords, rightHalf.rules); parseRules(view.getLeftSplitRules(), leftHalf.keywords, leftHalf.rules); rightHalf.name = cardView.getRightSplitName(); leftHalf.name = cardView.getLeftSplitName(); isFuse = view.getRules().stream().anyMatch(rule -> rule.contains("Fuse")); isAftermath = view.getRightSplitRules().stream().anyMatch(rule -> rule.contains("Aftermath")); if (!isAftermath()) { HalfCardProps tmp = leftHalf; leftHalf = rightHalf; rightHalf = tmp; } }
Source:
public void testCreateSymlink() throws IOException { FS fs = FS.DETECTED; Assume.assumeTrue(fs.supportsSymlinks()); fs.createSymLink(new File(trash, "x"), "y"); assertTrue(fs.supportsSymlinks()); String target = fs.readSymLink(new File(trash, "x")); assertEquals("y", target); }

Target:
public void testCreateSymlink() throws IOException { FS fs = FS.DETECTED; Assume.assumeTrue(fs.supportsSymlinks()); fs.createSymLink(new File(trash, "x"), "y"); String target = fs.readSymLink(new File(trash, "x")); assertEquals("y", target); }
Source:
public CreateAlgorithmCommand(final BasicFBType fbType) { this.fbType = fbType; this.index = fbType.getAlgorithm().size() - 1; this.name = DEFAULT_ALGORITHM_NAME; }

Target:
public CreateAlgorithmCommand(final BasicFBType fbType) { this(fbType, fbType.getAlgorithm().size() - 1, null); }
Source:
public void testPvaluefromZscorePostAggregator() throws Exception { zscore = new ConstantPostAggregator("zscore", -1783.8762354220219); pvaluefromZscorePostAggregator = new PvaluefromZscorePostAggregator("pvalue", zscore); System.out.print("zscore = " + zscore + "\n"); double pvalue = ((Number) pvaluefromZscorePostAggregator.compute(ImmutableMap.of( "zscore", -1783.8762354220219 ))).doubleValue(); System.out.print("pvalue = " + pvalue + "\n"); Assert.assertTrue(pvalue >= 0 && pvalue < 0.00001); System.out.print(pvaluefromZscorePostAggregator.toString()); }

Target:
public void testPvaluefromZscorePostAggregator() throws Exception { zscore = new ConstantPostAggregator("zscore", -1783.8762354220219); pvaluefromZscorePostAggregator = new PvaluefromZscorePostAggregator("pvalue", zscore); double pvalue = ((Number) pvaluefromZscorePostAggregator.compute(ImmutableMap.of( "zscore", -1783.8762354220219 ))).doubleValue(); Assert.assertTrue(pvalue >= 0 && pvalue < 0.00001); }
Source:
public void test_git_ssh_executable_found_on_windows() { if (!gitImplName.equals("git")) { return; } cliGitAPIImplTest.setTimeoutVisibleInCurrentTest(false); if (!SystemUtils.IS_OS_WINDOWS) { return; } CliGitAPIImpl git = new CliGitAPIImpl("git", new File("."), cliGitAPIImplTest.listener, cliGitAPIImplTest.env); assertTrue("ssh.exe not found", git.getSSHExecutable().exists()); }

Target:
public void test_git_ssh_executable_found_on_windows() { assumeThat(gitImplName, is("git")); cliGitAPIImplTest.setTimeoutVisibleInCurrentTest(false); if (!SystemUtils.IS_OS_WINDOWS) { return; } CliGitAPIImpl git = new CliGitAPIImpl("git", new File("."), cliGitAPIImplTest.listener, cliGitAPIImplTest.env); assertTrue("ssh.exe not found", git.getSSHExecutable().exists()); }
Source:
public void pulse() { super.pulse(); if (getTicksLived() >= ticksToLive) { remove(); } if (getTicksLived() == 1) { GlowWorld world = (GlowWorld) location.getWorld(); if (!isSilent) { world.playSound(location, Sound.ENTITY_LIGHTNING_THUNDER, 10000, 0.8F + ThreadLocalRandom.current().nextFloat() * 0.2F); world.playSound(location, Sound.ENTITY_GENERIC_EXPLODE, 2, 0.5F + ThreadLocalRandom.current().nextFloat() * 0.2F); } if (!effect) { if (world.getGameRuleMap().getBoolean("doFireTick")) { GlowBlock block = world.getBlockAt(location); setBlockOnFire(block); for (int i = 0; i < 4; i++) { int x = location.getBlockX() - 1 + ThreadLocalRandom.current().nextInt(3); int z = location.getBlockZ() - 1 + ThreadLocalRandom.current().nextInt(3); int y = location.getBlockY() - 1 + ThreadLocalRandom.current().nextInt(3); block = world.getBlockAt(x, y, z); setBlockOnFire(block); } } for (Entity entity : getNearbyEntities(3, 6, 3)) { if (entity.isDead()) { continue; } if (entity instanceof Damageable) { ((Damageable) entity) .damage(5, this, EntityDamageEvent.DamageCause.LIGHTNING); } if (entity instanceof Pig) { GlowPig pig = (GlowPig) entity; GlowPigZombie zombie = EntityStorage.create(GlowPigZombie.class, location); PigZapEvent event = new PigZapEvent(pig, this, zombie); if (EventFactory.getInstance().callEvent(event).isCancelled()) { zombie.remove(); } pig.remove(); world.spawn(location, zombie, CreatureSpawnEvent.SpawnReason.LIGHTNING); } entity.setFireTicks(entity.getMaxFireTicks()); } } } }

Target:
public void pulse() { super.pulse(); if (getTicksLived() >= ticksToLive) { remove(); } if (getTicksLived() == 1) { GlowWorld world = (GlowWorld) location.getWorld(); if (!isSilent) { world.playSound(location, Sound.ENTITY_LIGHTNING_THUNDER, 10000, 0.8F + ThreadLocalRandom.current().nextFloat() * 0.2F); world.playSound(location, Sound.ENTITY_GENERIC_EXPLODE, 2, 0.5F + ThreadLocalRandom.current().nextFloat() * 0.2F); } if (!effect) { if (world.getGameRuleMap().getBoolean("doFireTick")) { GlowBlock block = world.getBlockAt(location); setBlockOnFire(block); for (int i = 0; i < 4; i++) { int x = location.getBlockX() - 1 + ThreadLocalRandom.current().nextInt(3); int z = location.getBlockZ() - 1 + ThreadLocalRandom.current().nextInt(3); int y = location.getBlockY() - 1 + ThreadLocalRandom.current().nextInt(3); block = world.getBlockAt(x, y, z); setBlockOnFire(block); } } for (Entity entity : getNearbyEntities(3, 6, 3)) { if (entity.isDead()) { continue; } if (entity instanceof Damageable) { ((Damageable) entity) .damage(5, this, EntityDamageEvent.DamageCause.LIGHTNING); } if (entity instanceof Pig) { GlowPig pig = (GlowPig) entity; GlowPigZombie zombie = EntityStorage.create(GlowPigZombie.class, location); PigZapEvent event = new PigZapEvent(pig, this, zombie); if (EventFactory.getInstance().callEvent(event).isCancelled()) { zombie.remove(); } else { zombie.setCustomName(pig.getCustomName()); pig.remove(); world.spawn(location, zombie, CreatureSpawnEvent.SpawnReason.LIGHTNING); } } entity.setFireTicks(entity.getMaxFireTicks()); } } } }
Source:
public void shouldHandOutNonOverLappingTimestampRanges() { TimestampRange first = timestamp.incrementBy(10); TimestampRange second = timestamp.incrementBy(10); assertThat(first.getUpperBound(), is(lessThan(second.getUpperBound()))); }

Target:
public void shouldHandOutNonOverLappingTimestampRanges() { TimestampRange first = timestamp.incrementBy(10); TimestampRange second = timestamp.incrementBy(10); assertThat(first.getUpperBound(), is(lessThan(second.getLowerBound()))); }
Source:
public void invalidate(Object obj, PageMode mode) { Contentlet asset = (Contentlet) obj; CacheLocator.getContentletCache() .remove(asset.getInode()); String folderPath = mode.name() + java.io.File.separator; String velocityRootPath = VelocityUtil.getVelocityRootPath(); velocityRootPath += java.io.File.separator; Set<Long> langs = new HashSet<Long>(); langs.add(asset.getLanguageId()); if (LanguageWebAPI.canApplyToAllLanguages(asset)) { for (Language ll : APILocator.getLanguageAPI() .getLanguages()) { langs.add(ll.getId()); } } for (Long langId : langs) { String filePath = folderPath + asset.getIdentifier() + "_" + langId + "." + VelocityType.CONTENT.fileExtension; java.io.File f = new java.io.File(velocityRootPath + filePath); f.delete(); DotResourceCache vc = CacheLocator.getVeloctyResourceCache(); vc.remove(ResourceManager.RESOURCE_TEMPLATE + filePath); } List<Field> fields; try { fields = asset.getContentType() .fields(); for (Field field : fields) { new FieldLoader().invalidate(field, mode); } } catch (DotDataException | DotSecurityException e) { throw new DotStateException(e); } try { if (asset.getContentType() .baseType() == BaseContentType.HTMLPAGE) { new PageLoader().invalidate(asset, mode); } if (asset != null && asset.isVanityUrl()) { VanityUrlServices.getInstance() .invalidateVanityUrl(asset); } if (asset != null && asset.isKeyValue()) { CacheLocator.getKeyValueCache() .remove(asset); } } catch (DotDataException | DotSecurityException e) { throw new DotStateException(e); } }

Target:
public void invalidate(Object obj, PageMode mode) { Contentlet asset = (Contentlet) obj; CacheLocator.getContentletCache() .remove(asset.getInode()); String folderPath = mode.name() + java.io.File.separator; String velocityRootPath = VelocityUtil.getVelocityRootPath(); velocityRootPath += java.io.File.separator; Set<Long> langs = new HashSet<Long>(); langs.add(asset.getLanguageId()); if (LanguageWebAPI.canApplyToAllLanguages(asset)) { for (Language ll : APILocator.getLanguageAPI() .getLanguages()) { langs.add(ll.getId()); } } for (Long langId : langs) { String filePath = folderPath + asset.getIdentifier() + "_" + langId + "." + VelocityType.CONTENT.fileExtension; java.io.File f = new java.io.File(velocityRootPath + filePath); f.delete(); DotResourceCache vc = CacheLocator.getVeloctyResourceCache(); vc.remove(ResourceManager.RESOURCE_TEMPLATE + filePath); } List<Field> fields; try { fields = asset.getContentType() .fields(); for (Field field : fields) { new FieldLoader().invalidate(field, asset, mode); } } catch (DotDataException | DotSecurityException e) { throw new DotStateException(e); } try { if (asset.getContentType() .baseType() == BaseContentType.HTMLPAGE) { new PageLoader().invalidate(asset, mode); } if (asset != null && asset.isVanityUrl()) { VanityUrlServices.getInstance() .invalidateVanityUrl(asset); } if (asset != null && asset.isKeyValue()) { CacheLocator.getKeyValueCache() .remove(asset); } } catch (DotDataException | DotSecurityException e) { throw new DotStateException(e); } }
Source:
private void threadIsStarting() { synchronized (active) { int actualCount = active.incrementAndGet(); reporter.reportConsumerThreadsActual(actualCount); } }

Target:
private void threadIsStarting() { active.incrementAndGet(); reporter.reportConsumerThreadsIncrement(); }
Source:
protected void verifyProfile(final UserProfile userProfile) { final Google2Profile profile = (Google2Profile) userProfile; logger.debug("userProfile : {}", profile); assertEquals("113675986756217860428", profile.getId()); assertEquals(Google2Profile.class.getSimpleName() + UserProfile.SEPARATOR + "113675986756217860428", profile.getTypedId()); assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), Google2Profile.class)); assertTrue(StringUtils.isNotBlank(profile.getAccessToken())); assertCommonProfile(userProfile, "testscribeup@gmail.com", "Jérôme", "ScribeUP", "Jérôme ScribeUP", null, Gender.MALE, Locale.ENGLISH, "<LINK_0>", "<LINK_1>", null); assertNull(profile.getBirthday()); assertEquals(10, profile.getAttributes().size()); }

Target:
protected void verifyProfile(final UserProfile userProfile) { final Google2Profile profile = (Google2Profile) userProfile; logger.debug("userProfile : {}", profile); assertEquals("113675986756217860428", profile.getId()); assertEquals(Google2Profile.class.getSimpleName() + UserProfile.SEPARATOR + "113675986756217860428", profile.getTypedId()); assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), Google2Profile.class)); assertTrue(StringUtils.isNotBlank(profile.getAccessToken())); assertCommonProfile(userProfile, "testscribeup@gmail.com", "Jérôme", "ScribeUP", "Jérôme ScribeUP", null, Gender.MALE, Locale.ENGLISH, "<LINK_0>", "<LINK_1>", null); assertNull(profile.getBirthday()); assertTrue(profile.getEmails() != null && profile.getEmails().size() == 1); assertEquals(9, profile.getAttributes().size()); }
Source:
public void insertData() { try { dataStoreOut = DataStoreFactory.getDataStore(Long.class, ResultPageView.class, new Configuration()); } catch (GoraException e) { e.printStackTrace(); } ResultPageView resultPageView = new ResultPageView(); resultPageView.setIp("123"); resultPageView.setTimestamp(123L); resultPageView.setUrl("I am the the one"); ResultPageView resultPageView1 = new ResultPageView(); resultPageView1.setIp("123"); resultPageView1.setTimestamp(123L); resultPageView1.setUrl("How are you"); try { dataStoreOut.put(1L,resultPageView); dataStoreOut.put(2L,resultPageView1); dataStoreOut.flush(); } catch (GoraException e) { e.printStackTrace(); } }

Target:
public static void insertData() throws Exception { utility = new HBaseTestingUtility(); utility.startMiniCluster(); dataStoreOut = DataStoreFactory.getDataStore(Long.class, ResultPageView.class, utility.getConfiguration()); ResultPageView resultPageView = new ResultPageView(); resultPageView.setIp("88.240.129.183"); resultPageView.setTimestamp(123L); resultPageView.setUrl("I am the the one"); ResultPageView resultPageView1 = new ResultPageView(); resultPageView1.setIp("87.240.129.170"); resultPageView1.setTimestamp(124L); resultPageView1.setUrl("How are you"); ResultPageView resultPageView2 = new ResultPageView(); resultPageView1.setIp("88.240.129.183"); resultPageView1.setTimestamp(124L); resultPageView1.setUrl("This is the jet engine"); dataStoreOut.put(1L,resultPageView); dataStoreOut.put(2L,resultPageView1); dataStoreOut.put(3L,resultPageView2); dataStoreOut.flush(); }
Source:
public void spec312_cancelMustMakeThePublisherToEventuallyStopSignaling() throws Throwable { final int elementsCount = 20; activePublisherTest(elementsCount, new PublisherTestRun<T>() { @Override @SuppressWarnings("ThrowableResultOfMethodCallIgnored") public void run(Publisher<T> pub) throws Throwable { final ManualSubscriber<T> sub = env.newManualSubscriber(pub); int demand1 = 10; int demand2 = 5; sub.request(demand1); sub.request(demand2); final int totalDemand = demand1 + demand2; sub.nextElement(); sub.cancel(); int onNextsSignalled = 1; boolean stillBeingSignalled; do { sub.expectNone(); Throwable error = env.dropAsyncError(); if (error == null) { stillBeingSignalled = false; } else { onNextsSignalled += 1; stillBeingSignalled = true; } assertTrue(onNextsSignalled <= totalDemand, String.format("Publisher signalled [%d] elements, which is more than the signalled demand: %d", onNextsSignalled, totalDemand)); } while (stillBeingSignalled); } }); env.verifyNoAsyncErrors(); }

Target:
public void spec312_cancelMustMakeThePublisherToEventuallyStopSignaling() throws Throwable { final int publisherElements = 20; final int demand1 = 10; final int demand2 = 5; final int totalDemand = demand1 + demand2; activePublisherTest(publisherElements, new PublisherTestRun<T>() { @Override @SuppressWarnings("ThrowableResultOfMethodCallIgnored") public void run(Publisher<T> pub) throws Throwable { final ManualSubscriber<T> sub = env.newManualSubscriber(pub); sub.request(demand1); sub.request(demand2); sub.nextElement(); sub.cancel(); int onNextsSignalled = 1; boolean stillBeingSignalled; do { sub.expectNone(); Throwable error = env.dropAsyncError(); if (error == null) { stillBeingSignalled = false; } else { onNextsSignalled += 1; stillBeingSignalled = true; } assertTrue(onNextsSignalled <= totalDemand, String.format("Publisher signalled [%d] elements, which is more than the signalled demand: %d", onNextsSignalled, totalDemand)); } while (stillBeingSignalled); } }); env.verifyNoAsyncErrors(); }
Source:
private String getTriggerGuard(Trigger trigger) { UMLRTTrigger rtTrigger = UMLRTTrigger.getInstance(trigger); UMLRTGuard guard = rtTrigger.getGuard(); if (guard != null) { try { IDefaultLanguageService service; service = ServiceUtilsForEObject.getInstance().getService(IDefaultLanguageService.class, trigger); IDefaultLanguage language = service.getActiveDefaultLanguage(trigger); if (guard.getBodies().containsKey(language.getName())) { return guard.getBodies().get(language.getName()); } } catch (ServiceException e) { Activator.log.error(e); } } return ""; }

Target:
private String getTriggerGuard(Trigger trigger) { UMLRTTrigger rtTrigger = UMLRTTrigger.getInstance(trigger); UMLRTGuard guard = rtTrigger.getGuard(); if (guard != null) { IDefaultLanguage language = ModelUtils.getDefaultLanguage(trigger); if (language != null && guard.getBodies().containsKey(language.getName())) { return guard.getBodies().get(language.getName()); } } return ""; }
Source:
protected void onCreate(Bundle savedInstance) { super.onCreate(savedInstance); mAuthHelper = new AuthHelper(getFlowParams()); mProgressDialogHolder = new ProgressDialogHolder(this); getFlowHolder().getIntentStarter().observe(this, new Observer<Pair<Intent, Integer>>() { @Override public void onChanged(@Nullable Pair<Intent, Integer> request) { if (request == null) { throw new IllegalStateException("Cannot start null request"); } startActivityForResult(request.first, request.second); } }); getFlowHolder().getPendingIntentStarter() .observe(this, new Observer<Pair<PendingIntent, Integer>>() { @Override public void onChanged(@Nullable Pair<PendingIntent, Integer> request) { if (request == null) { throw new IllegalStateException("Cannot start null request"); } try { startIntentSenderForResult( request.first.getIntentSender(), request.second, null, 0, 0, 0); } catch (IntentSender.SendIntentException e) { Log.e("PendingIntentStarter", "Unable to start pending intent", e); onActivityResult(request.second, Activity.RESULT_CANCELED, null); } } }); }

Target:
protected void onCreate(Bundle savedInstance) { super.onCreate(savedInstance); mAuthHelper = new AuthHelper(getFlowParams()); mProgressDialogHolder = new ProgressDialogHolder(this); }
Source:
private void applyBinaryPatch(File f, FileHeader fh) throws PatchApplyException { if (fh.getChangeType() != ChangeType.ADD) { throw new PatchApplyException( "Only addition of new binary files is implemented"); } BinaryHunk forwardBinaryHunk = fh.getForwardBinaryHunk(); byte[] buf = forwardBinaryHunk.getBuffer(); int bufPos = forwardBinaryHunk.getStartOffset(); int totalDecodedSize = calcTotalBinaryDecodedLength(buf, bufPos); byte[] allDecodedBytes = new byte[totalDecodedSize]; int decPos = 0; bufPos = nextLF(buf, bufPos); while (buf[bufPos] != '\n') { int decodedLineLength = resolveDecodedLength(buf[bufPos++]); int nextLF = nextLF(buf, bufPos); byte[] decodedLine = decode85(buf, bufPos, nextLF - bufPos - 1, decodedLineLength); System.arraycopy(decodedLine, 0, allDecodedBytes, decPos, decodedLineLength); decPos += decodedLineLength; bufPos = nextLF; } byte[] inflated = new byte[0]; try { inflated = inflate(allDecodedBytes, forwardBinaryHunk.getSize()); } catch (DataFormatException dfe) { throw new PatchApplyException("Unable to inflate compressed data", dfe); } try (FileOutputStream fos = new FileOutputStream(f)) { fos.write(inflated); } catch (IOException ioe) { throw new PatchApplyException("Unable to write data to file", ioe); } }

Target:
private void applyBinaryPatch(File f, FileHeader fh) throws PatchApplyException { if (fh.getChangeType() != ChangeType.ADD) { throw new PatchApplyException( JGitText.get().onlyBinaryAddSupported); } BinaryHunk forwardBinaryHunk = fh.getForwardBinaryHunk(); byte[] buf = forwardBinaryHunk.getBuffer(); int bufPos = forwardBinaryHunk.getStartOffset(); int totalDecodedSize = calcTotalBinaryDecodedLength(buf, bufPos); byte[] allDecodedBytes = new byte[totalDecodedSize]; int decPos = 0; bufPos = nextLF(buf, bufPos); while (buf[bufPos] != '\n') { int decodedLineLength = resolveDecodedLength(buf[bufPos++]); int nextLF = nextLF(buf, bufPos); byte[] decodedLine = decode85(buf, bufPos, nextLF - bufPos - 1, decodedLineLength); System.arraycopy(decodedLine, 0, allDecodedBytes, decPos, decodedLineLength); decPos += decodedLineLength; bufPos = nextLF; } byte[] inflated; try { inflated = inflate(allDecodedBytes, forwardBinaryHunk.getSize()); } catch (DataFormatException dfe) { throw new PatchApplyException( JGitText.get().unableToInflateCompressedData, dfe); } try (FileOutputStream fos = new FileOutputStream(f)) { fos.write(inflated); } catch (IOException ioe) { throw new PatchApplyException( String.format(JGitText.get().unableToWrite, f.getName()), ioe); } }
Source:
public ASTNode transform(InnerRHSRewrite innerRHSRewrite) { Term[] theNewRHS = new Term[innerRHSRewrite.theRHS.length]; for (int i = 0; i < theNewRHS.length; i++) { if (innerRHSRewrite.theRHS[i] != null) theNewRHS[i] = (Term) innerRHSRewrite.theRHS[i].accept(this); } return new InnerRHSRewrite(theNewRHS); }

Target:
public ASTNode transform(InnerRHSRewrite innerRHSRewrite) { Term[] theNewRHS = new Term[innerRHSRewrite.theRHS.length]; for (int i = 0; i < theNewRHS.length; i++) { if (innerRHSRewrite.theRHS[i] != null) theNewRHS[i] = (Term) innerRHSRewrite.theRHS[i].accept(this); } if(Arrays.equals(theNewRHS, innerRHSRewrite.theRHS)) { return innerRHSRewrite; } else { return new InnerRHSRewrite(theNewRHS); } }
Source:
private void addUserToCache(User user){ cache.put(StringUtils.lowerCase(user.getUserId()), user); if (this.eventService != null) { this.eventService.fireEvent(new EventUserUpdate(user)); } }

Target:
private void addUserToCache(User user){ cache.put(user.getUserId().toLowerCase(Locale.ENGLISH), user); if (this.eventService != null) { this.eventService.fireEvent(new EventUserUpdate(user)); } }
Source:
private static double getVersionValue(String version) { if(version.contains("-")) { version = version.substring(0, version.indexOf('-')); } version = version.replace('_', '.'); String[] versionParts = version.split("\\."); double versionValue = 0; for(int i = 0; i < versionParts.length; i++) { int part = Integer.valueOf(versionParts[i]); versionValue += part * Math.pow(10, versionParts.length - (i - 1) * 3); } return versionValue; }

Target:
private static double getVersionValue(String version) { if(version.contains("-")) { version = version.substring(0, version.indexOf('-')); } version = version.replace('_', '.'); String[] versionParts = version.split("\\."); double versionValue = 0; for(int i = 0; i < versionParts.length; i++) { try { int part = Integer.valueOf(versionParts[i]); versionValue += part * Math.pow(10, versionParts.length - (i - 1) * 3); } catch(NumberFormatException e) { continue; } } return versionValue; }
Source:
public Storable fromMap (Map<String, Object> map) { id = (Long) map.get(ID); name = (String) map.get(NAME); timestamp = (Long) map.get(TIMESTAMP); ObjectMapper mapper = new ObjectMapper(); try { serviceUISpecification = mapper.readValue((String) map.get(UI_SPECIFICATION), TopologyComponentUISpecification.class); } catch (IOException e) { throw new RuntimeException(e); } registerClass = (String) map.get(REGISTER_CLASS); return this; }

Target:
public Storable fromMap (Map<String, Object> map) { id = (Long) map.get(ID); name = (String) map.get(NAME); timestamp = (Long) map.get(TIMESTAMP); try { serviceUISpecification = mapper.readValue((String) map.get(UI_SPECIFICATION), TopologyComponentUISpecification.class); } catch (IOException e) { throw new RuntimeException(e); } registerClass = (String) map.get(REGISTER_CLASS); return this; }
Source:
public void createEcKey(HttpClient httpClient, KeyServiceVersion keyServiceVersion) { createKeyAsyncClient(httpClient, keyServiceVersion); createEcKeyRunner((expected) -> client.createEcKey(expected)); }

Target:
public void createEcKey(HttpClient httpClient, KeyServiceVersion keyServiceVersion) { createKeyAsyncClient(httpClient, keyServiceVersion); createEcKeyRunner((expected) -> StepVerifier.create(client.createEcKey(expected)) .assertNext(response -> assertKeyEquals(expected, response)) .verifyComplete()); }
Source:
public void perform(Run<?,?> build, FilePath workspace, EnvVars environment, Launcher launcher, TaskListener listener) throws InterruptedException { try { listener.getLogger().println(Messages.Fingerprinter_Recording()); Map<String,String> record = new HashMap<>(); if(targets.length()!=0) { String expandedTargets = targets; if (build instanceof AbstractBuild) expandedTargets = environment.expand(expandedTargets); record(build, workspace, listener, record, expandedTargets); } FingerprintAction fingerprintAction = build.getAction(FingerprintAction.class); if (fingerprintAction != null) { fingerprintAction.add(record); } else { build.addAction(new FingerprintAction(build,record)); } if (enableFingerprintsInDependencyGraph) { Jenkins.get().rebuildDependencyGraphAsync(); } } catch (IOException e) { Functions.printStackTrace(e, listener.error(Messages.Fingerprinter_Failed())); build.setResult(Result.FAILURE); } }

Target:
public void perform(Run<?,?> build, FilePath workspace, EnvVars environment, Launcher launcher, TaskListener listener) throws InterruptedException { try { listener.getLogger().println(Messages.Fingerprinter_Recording()); Map<String,String> record = new HashMap<>(); if(targets.length()!=0) { String expandedTargets = targets; if (build instanceof AbstractBuild) { expandedTargets = environment.expand(expandedTargets); } record(build, workspace, listener, record, expandedTargets); } FingerprintAction fingerprintAction = build.getAction(FingerprintAction.class); if (fingerprintAction != null) { fingerprintAction.add(record); } else { build.addAction(new FingerprintAction(build,record)); } if (enableFingerprintsInDependencyGraph) { Jenkins.get().rebuildDependencyGraphAsync(); } } catch (IOException e) { Functions.printStackTrace(e, listener.error(Messages.Fingerprinter_Failed())); build.setResult(Result.FAILURE); } }
Source:
public GHPermissionType fetch(String username) throws IOException, InterruptedException { if (repo == null) { listener.getLogger().format("Connecting to %s to check permissions of obtain list of %s for %s/%s%n", apiUri, username, repoOwner, repository); StandardCredentials credentials = Connector.lookupScanCredentials( (Item) getOwner(), apiUri, credentialsId ); github = Connector.connect(apiUri, credentials); String fullName = repoOwner + "/" + removeEnd(repository, ".git"); repo = github.getRepository(fullName); } return repo.getPermission(username); }

Target:
public GHPermissionType fetch(String username) throws IOException, InterruptedException { if (repo == null) { listener.getLogger().format("Connecting to %s to check permissions of obtain list of %s for %s/%s%n", apiUri, username, repoOwner, repository); StandardCredentials credentials = Connector.lookupScanCredentials( (Item) getOwner(), apiUri, credentialsId ); github = Connector.connect(apiUri, credentials); String fullName = repoOwner + "/" + repository; repo = github.getRepository(fullName); } return repo.getPermission(username); }
Source:
public void executeCommand(MinecraftServer server, ICommandSender sender, String[] arguments) { for (String key : BotaniaAPI.brewMap.keySet()) { CraftTweakerAPI.logCommand(key); } if (sender != null) { sender.sendMessage(new TextComponentString("List generated; see crafttweaker.log in your minecraft dir")); } }

Target:
public void executeCommand(MinecraftServer server, ICommandSender sender, String[] arguments) { for (String key : BotaniaAPI.brewMap.keySet()) { CraftTweakerAPI.logCommand(key); } if (sender != null) { sender.sendMessage(SpecialMessagesChat.getLinkToCraftTweakerLog("List generated;", sender)); } }
Source:
public void testSyncCommandFailure() throws Exception { final ZooKeeper zk = createClient(); SyncCommand cmd = new SyncCommand(); cmd.setZk(zk); cmd.parse("sync /dddd".split(" ")); try { runCommandExpect(cmd, new ArrayList<String>()); fail("Path doesn't exist so, command should fail."); } catch (CliWrapperException e) { assertEquals(KeeperException.Code.NONODE, ((KeeperException) e.getCause()).code()); assertEquals("Node does not exist: /dddd", e.getMessage()); } }

Target:
public void testSyncCommandFailure() throws Exception { final ZooKeeper zk = createClient(); final SyncCommand cmd = new SyncCommand(); cmd.setZk(zk); cmd.parse("sync /dddd".split(" ")); try { runCommandExpect(cmd, new ArrayList<String>()); fail("Command did not fail, even the path does not exist."); } catch (CliWrapperException e) { assertEquals(KeeperException.Code.NONODE, ((KeeperException) e.getCause()).code()); assertEquals("Node does not exist: /dddd", e.getMessage()); } }
Source:
private void handleFailure(Throwable t) { if (message.doCallbackOnFailure()) { MessageOut response = new MessageOut(MessagingService.Verb.INTERNAL_RESPONSE) .withParameter(ParameterType.FAILURE_RESPONSE, MessagingService.ONE_BYTE); if (t instanceof TombstoneOverwhelmingException) { response = response.withParameter(ParameterType.FAILURE_REASON.FAILURE_REASON, Shorts.checkedCast(RequestFailureReason.READ_TOO_MANY_TOMBSTONES.code)); } MessagingService.instance().sendReply(response, id, message.from); } }

Target:
private void handleFailure(Throwable t) { if (message.doCallbackOnFailure()) { MessageOut response = new MessageOut(MessagingService.Verb.INTERNAL_RESPONSE) .withParameter(ParameterType.FAILURE_RESPONSE, MessagingService.ONE_BYTE); if (t instanceof TombstoneOverwhelmingException) { response = response.withParameter(ParameterType.FAILURE_REASON, Shorts.checkedCast(RequestFailureReason.READ_TOO_MANY_TOMBSTONES.code)); } MessagingService.instance().sendReply(response, id, message.from); } }
Source:
public void onBackPressed() { if (mDraftNeedsSaving) { if (mEncryptCheckbox.isChecked()) { showDialog(DIALOG_REFUSE_TO_SAVE_DRAFT_MARKED_ENCRYPTED); } else if (isDraftsFolderDisabled()) { showDialog(DIALOG_CONFIRM_DISCARD_ON_BACK); } else { showDialog(DIALOG_SAVE_OR_DISCARD_DRAFT_MESSAGE); } } else { onDiscard(); } }

Target:
public void onBackPressed() { if (mDraftNeedsSaving) { if (mEncryptCheckbox.isChecked()) { showDialog(DIALOG_REFUSE_TO_SAVE_DRAFT_MARKED_ENCRYPTED); } else if (isDraftsFolderDisabled()) { showDialog(DIALOG_CONFIRM_DISCARD_ON_BACK); } else { showDialog(DIALOG_SAVE_OR_DISCARD_DRAFT_MESSAGE); } } else { if (mDraftId == INVALID_DRAFT_ID) { onDiscard(); } else { super.onBackPressed(); } } }
Source:
private IASTInitializerClause initClause(boolean allowSkipping) throws EndOfFileException, BacktrackException { if (LT(1) == IToken.tLBRACE) { return bracedInitList(allowSkipping); } TemplateIdStrategy strat= fTemplateParameterListStrategy; final BinaryExprCtx ctx= strat != null ? BinaryExprCtx.eInTemplateID : BinaryExprCtx.eNotInTemplateID; IASTExpression assignmentExpression = expression(ExprKind.eAssignment, ctx, null, strat); if (allowSkipping && skipTrivialExpressionsInAggregateInitializers) { if (!ASTQueries.canContainName(assignmentExpression)) { translationUnit.setSkippedNodes(true); return null; } } return assignmentExpression; }

Target:
private IASTInitializerClause initClause(boolean allowSkipping) throws EndOfFileException, BacktrackException { if (LT(1) == IToken.tLBRACE) { return bracedInitList(allowSkipping); } TemplateIdStrategy strat= fTemplateParameterListStrategy; final BinaryExprCtx ctx= strat != null ? BinaryExprCtx.eInTemplateID : BinaryExprCtx.eNotInTemplateID; return expression(ExprKind.eAssignment, ctx, null, strat); }
Source:
public void setup(Context.OperatorContext context) { operatorName = Preconditions.checkNotNull(context.getName(), "operator name"); foundOperatorName = true; }

Target:
public void setup(Context.OperatorContext context) { operatorName = Preconditions.checkNotNull(context.getName(), "operator name"); }
Source:
static ByteBuf encodeFollowsFragment( ByteBufAllocator allocator, int mtu, int streamId, ByteBuf metadata, ByteBuf data) { int remaining = mtu - FrameHeaderFlyweight.size(); ByteBuf metadataFragment = null; if (metadata.isReadable()) { remaining -= 3; int r = Math.min(remaining, metadata.readableBytes()); remaining -= r; metadataFragment = metadata.readRetainedSlice(r); } ByteBuf dataFragment = Unpooled.EMPTY_BUFFER; if (remaining > 0 && data.isReadable()) { int r = Math.min(remaining, data.readableBytes()); dataFragment = data.readRetainedSlice(r); } boolean follows = metadata == Unpooled.EMPTY_BUFFER ? data.isReadable() : data.isReadable() || metadata.isReadable(); return PayloadFrameFlyweight.encode( allocator, streamId, follows, false, true, metadataFragment, dataFragment); }

Target:
static ByteBuf encodeFollowsFragment( ByteBufAllocator allocator, int mtu, int streamId, ByteBuf metadata, ByteBuf data) { int remaining = mtu - FrameHeaderFlyweight.size(); ByteBuf metadataFragment = null; if (metadata.isReadable()) { remaining -= 3; int r = Math.min(remaining, metadata.readableBytes()); remaining -= r; metadataFragment = metadata.readRetainedSlice(r); } ByteBuf dataFragment = Unpooled.EMPTY_BUFFER; if (remaining > 0 && data.isReadable()) { int r = Math.min(remaining, data.readableBytes()); dataFragment = data.readRetainedSlice(r); } boolean follows = data.isReadable() || metadata.isReadable(); return PayloadFrameFlyweight.encode( allocator, streamId, follows, false, true, metadataFragment, dataFragment); }
Source:
public XMLFileResourceProvider(final String configFileName, final WebApplicationContext appCtx, final String configFileDirectory, final DefaultStorageFinder storageDirFinder) throws ConfigurationException { if(configFileDirectory==null && storageDirFinder==null) { throw new NullPointerException("At least one of configFileDirectory or storageDirFinder must not be null"); } this.context = appCtx; this.configFileName = configFileName; if(configFileDirectory!=null) { if (configFileDirectory.startsWith("/") || configFileDirectory.contains(":\\") || configFileDirectory.startsWith("\\\\")) { log.info("Provided configuration directory as absolute path '" + configFileDirectory + "'"); this.configDirectory = new File(configFileDirectory); } else { String baseDir = context.getServletContext().getRealPath(""); log.info("Provided configuration directory relative to servlet context '" + baseDir + "': " + configFileDirectory); this.configDirectory = new File(baseDir, configFileDirectory); } } else { this.configDirectory = new File(storageDirFinder.getDefaultPath()); } log.info("Will look for " + configFileName + " in '" + configDirectory + "'"); }

Target:
public XMLFileResourceProvider(final String configFileName, final WebApplicationContext appCtx, final String configFileDirectory, final DefaultStorageFinder storageDirFinder) throws ConfigurationException { if(configFileDirectory==null && storageDirFinder==null) { throw new NullPointerException("At least one of configFileDirectory or storageDirFinder must not be null"); } this.context = appCtx; this.configFileName = configFileName; if(configFileDirectory!=null) { if (new File(configFileDirectory).isAbsolute()) { log.info("Provided configuration directory as absolute path '" + configFileDirectory + "'"); this.configDirectory = new File(configFileDirectory); } else { String baseDir = context.getServletContext().getRealPath(""); log.info("Provided configuration directory relative to servlet context '" + baseDir + "': " + configFileDirectory); this.configDirectory = new File(baseDir, configFileDirectory); } } else { this.configDirectory = new File(storageDirFinder.getDefaultPath()); } log.info("Will look for " + configFileName + " in '" + configDirectory + "'"); }
Source:
private void updateAllDatabases() { dbOpenHelper.getReadableDatabase().close(); SQLiteDatabase db = dbOpenHelper.getWritableDatabase(); CategoryDao.Table.onDelete(db); appDatabase.getContributionDao().deleteAll(); BookmarkPicturesDao.Table.onDelete(db); BookmarkLocationsDao.Table.onDelete(db); }

Target:
private void updateAllDatabases() { dbOpenHelper.getReadableDatabase().close(); SQLiteDatabase db = dbOpenHelper.getWritableDatabase(); CategoryDao.Table.onDelete(db); dbOpenHelper.deleteTable(db,CONTRIBUTIONS_TABLE); appDatabase.getContributionDao().deleteAll(); BookmarkPicturesDao.Table.onDelete(db); BookmarkLocationsDao.Table.onDelete(db); }