auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static String getUsernameAsString(CloudTrailEvent cloudTrailEvent) { if (cloudTrailEvent == null || cloudTrailEvent.getEventData() == null) { return null; } <START> return cloudTrailEvent.getEventData().getUserIdentity().getARN(); <END> }</code><technical_language>is this present? NullPointerExceptions occur. I recommend java 8 optionals: Optional.ofNullable(cloudTrailEvent).map(CloudTrailEvent::getEventData).map(EventData::getUserIdentity).map(UserIdentity::getARN).orElseReturn(null)</technical_language>

Target:
public static String getUsernameAsString(CloudTrailEvent cloudTrailEvent) { return ofNullable(cloudTrailEvent) .map(CloudTrailEvent::getEventData) .map(CloudTrailEventData::getUserIdentity) .map(UserIdentity::getARN) .orElse(null); }
Source:
<code>protected void onStart() { super.onStart(); getFirebaseRef().addAuthStateListener(new Firebase.AuthStateListener() { @Override public void onAuthStateChanged(AuthData authData) { if (authData != null) { mChosenProvider = SocialProvider.valueOf(authData.getProvider()); <START> if (mDialog != null) mDialog.dismiss(); <END> onFirebaseLogin(authData); } else { onFirebaseLogout(); } } }); }</code><technical_language>Do follow "if a code block, a code block" rule? I do, prefer follow too</technical_language>

Target:
protected void onStart() { super.onStart(); mHandler = new TokenAuthHandler() { @Override public void onSuccess(AuthData data) { } @Override public void onUserError(FirebaseError err) { onFirebaseLoginUserError(err); } @Override public void onProviderError(FirebaseError err) { onFirebaseLoginProviderError(err); } }; mFacebookAuthHelper = new FacebookAuthHelper(this, getFirebaseRef(), mHandler); mGoogleAuthHelper = new GoogleAuthHelper(this, getFirebaseRef(), mHandler); mTwitterAuthHelper = new TwitterAuthHelper(this, getFirebaseRef(), mHandler); mPasswordAuthHelper = new PasswordAuthHelper(this, getFirebaseRef(), mHandler); mDialog = new FirebaseLoginDialog(); mDialog .setContext(this) .setRef(getFirebaseRef()) .setHandler(mHandler); mDialog .setProviderEnabled(SocialProvider.facebook) .setProviderEnabled(SocialProvider.google) .setProviderEnabled(SocialProvider.twitter) .setProviderEnabled(SocialProvider.password); getFirebaseRef().addAuthStateListener(new Firebase.AuthStateListener() { @Override public void onAuthStateChanged(AuthData authData) { if (authData != null) { mChosenProvider = SocialProvider.valueOf(authData.getProvider()); onFirebaseLoginSuccess(authData); Log.d(TAG, "Auth data changed"); } else { onFirebaseLogout(); } } }); }
Source:
<code>public String toString() { return "NamedKey{" + "namespace='" + namespace + '\'' + <START> ", key=" + new String(key) + <END> '}'; }</code><technical_language>want convert key string, arbitrary binary data. end gibberish in logs. If need a toString() method, size of byte array, print out data</technical_language>

Target:
public String toString() { return "NamedKey{" + "namespace='" + namespace + '\'' + ", key size=" + key.length + '}'; }
Source:
<code>public void setUpBeforeEveryMethod() throws Exception { this.perun = (PerunBlImpl)super.perun; extSourceManagerBlBackup = perun.getExtSourcesManagerBl(); groupsManagerBl = perun.getGroupsManagerBl(); extSourceManagerBl = perun.getExtSourcesManagerBl(); attributesManagerBl = perun.getAttributesManagerBl(); vo = setUpVo(); setUpBaseGroup(vo); MockitoAnnotations.initMocks(this); doReturn(essa).when(extSourceManagerBl).getExtSourceByName(any(PerunSession.class), any(String.class)); <START> doNothing().when(extSourceManagerBl).addExtSource(any(PerunSession.class), any(Group.class), any(ExtSource.class)); <END> }</code><technical_language>This doReturn(EXT_SOURCE_NAME).when(((ExtSourceLdap)essa).getName());</technical_language>

Target:
public void setUpBeforeEveryMethod() throws Exception { this.perun = (PerunBlImpl)super.perun; extSourceManagerBlBackup = perun.getExtSourcesManagerBl(); groupsManagerBl = perun.getGroupsManagerBl(); extSourceManagerBl = perun.getExtSourcesManagerBl(); attributesManagerBl = perun.getAttributesManagerBl(); vo = setUpVo(); setUpBaseGroup(vo); MockitoAnnotations.initMocks(this); doReturn(essa).when(extSourceManagerBl).getExtSourceByName(any(PerunSession.class), any(String.class)); doReturn(EXT_SOURCE_NAME).when((ExtSourceLdap)essa).getName(); doNothing().when(extSourceManagerBl).addExtSource(any(PerunSession.class), any(Group.class), any(ExtSource.class)); }
Source:
<code>protected Object findRootObject(ActionInvocation invocation) { ValueStack stack = invocation.getStack(); Object rootObject; if (this.root != null) { LOG.debug("Root was defined as [{}], searching stack for it", this.root); rootObject = stack.findValue(root); } else { LOG.debug("Root was not defined, searching for #action"); rootObject = stack.findValue("#action"); if (rootObject instanceof ModelDriven) { LOG.debug("Action is an instance of ModelDriven, assuming model is on the top of the stack and using it"); rootObject = stack.peek(); } <START> if (rootObject == null) { <END> LOG.debug("Neither #action nor ModelDriven, peeking up object from top of the stack"); rootObject = stack.peek(); } } return rootObject; }</code><technical_language>2nd if check changed to: else if (rootObject == null) { if rootObject is a ModelDriven stack.peek() returnsnull, PR's logic attempt operation (along extra debug output)</technical_language>

Target:
protected Object findRootObject(ActionInvocation invocation) { ValueStack stack = invocation.getStack(); Object rootObject; if (this.root != null) { LOG.debug("Root was defined as [{}], searching stack for it", this.root); rootObject = stack.findValue(root); } else { LOG.debug("Root was not defined, searching for #action"); rootObject = stack.findValue("#action"); if (rootObject instanceof ModelDriven) { LOG.debug("Action is an instance of ModelDriven, assuming model is on the top of the stack and using it"); rootObject = stack.peek(); } else if (rootObject == null) { LOG.debug("Neither #action nor ModelDriven, peeking up object from the top of the stack"); rootObject = stack.peek(); } } return rootObject; }
Source:
<code>public String getPasswordValue(Object o) { if (o==null) return null; if (o instanceof Secret) { StaplerRequest req = Stapler.getCurrentRequest(); if (req != null) { Item item = req.findAncestorObject(Item.class); if (item != null && !item.hasPermission(Item.CONFIGURE)) { return "********"; } Computer computer = req.findAncestorObject(Computer.class); if (computer != null && !computer.hasPermission(Computer.CONFIGURE)) { <START> return "********"; <END> } } return ((Secret) o).getEncryptedValue(); } if (getIsUnitTest() && !o.equals(PasswordParameterDefinition.DEFAULT_VALUE)) { throw new SecurityException("attempted to render plaintext ‘" + o + "’ in password field; use a getter of type Secret instead"); } return o.toString(); }</code><technical_language>I do a plugin wrongly affected that. I imagine a Computer action a form credentials, is more for Jobs added 4 years</technical_language>

Target:
public String getPasswordValue(Object o) { if (o == null) { return null; } if (o.equals(PasswordParameterDefinition.DEFAULT_VALUE)) { return o.toString(); } StaplerRequest req = Stapler.getCurrentRequest(); if (o instanceof Secret || Secret.BLANK_NONSECRET_PASSWORD_FIELDS_WITHOUT_ITEM_CONFIGURE) { if (req != null) { Item item = req.findAncestorObject(Item.class); if (item != null && !item.hasPermission(Item.CONFIGURE)) { return "********"; } Computer computer = req.findAncestorObject(Computer.class); if (computer != null && !computer.hasPermission(Computer.CONFIGURE)) { return "********"; } } } if (o instanceof Secret) { return ((Secret) o).getEncryptedValue(); } if (req != null && (Boolean.getBoolean("hudson.hpi.run") || Boolean.getBoolean("hudson.Main.development"))) { LOGGER.log(Level.WARNING, () -> "<f:password/> form control in " + getJellyViewsInformationForCurrentRequest() + " is not backed by hudson.util.Secret. Learn more: <LINK_0>"); } if (!Secret.AUTO_ENCRYPT_PASSWORD_CONTROL) { return o.toString(); } return Secret.fromString(o.toString()).getEncryptedValue(); }
Source:
<code>public List<ClientModel> searchClientsByClientId(String clientId, Integer firstResult, Integer maxResults, RealmModel realm) { TypedQuery<String> query = em.createNamedQuery("searchClientsByClientId", String.class); if (firstResult != null && firstResult > 0) { query.setFirstResult(firstResult); } if (maxResults != null && maxResults > 0) { query.setMaxResults(maxResults); } query.setParameter("clientId", clientId); query.setParameter("realm", realm.getId()); List<String> results = query.getResultList(); <START> if (results.isEmpty()) return null; <END> return results.stream().map(id -> session.realms().getClientById(id, realm)).collect(Collectors.toList()); }</code><technical_language>This return empty list null</technical_language>

Target:
public List<ClientModel> searchClientsByClientId(String clientId, Integer firstResult, Integer maxResults, RealmModel realm) { TypedQuery<String> query = em.createNamedQuery("searchClientsByClientId", String.class); if (firstResult != null && firstResult > 0) { query.setFirstResult(firstResult); } if (maxResults != null && maxResults > 0) { query.setMaxResults(maxResults); } query.setParameter("clientId", clientId); query.setParameter("realm", realm.getId()); List<String> results = query.getResultList(); if (results.isEmpty()) return Collections.EMPTY_LIST; return results.stream().map(id -> session.realms().getClientById(id, realm)).collect(Collectors.toList()); }
Source:
<code>private OffsetDateTime getExpirationTime(String sharedAccessSignature) { String[] parts = sharedAccessSignature.split("&"); return Arrays.stream(parts) .map(part -> part.split("=")) .filter(pair -> pair.length == 2 && pair[0].equalsIgnoreCase("se")) .findFirst() .map(pair -> pair[1]) .map(expirationTimeStr -> { try { long epochSeconds = Long.parseLong(expirationTimeStr); <START> return new Date(epochSeconds * 1000).toInstant().atOffset(ZoneOffset.UTC); <END> } catch (NumberFormatException exception) { return OffsetDateTime.MAX; } }) .orElse(OffsetDateTime.MAX); }</code><technical_language>I a method, Instant.ofEpochSecond leverage</technical_language>

Target:
private OffsetDateTime getExpirationTime(String sharedAccessSignature) { String[] parts = sharedAccessSignature.split("&"); return Arrays.stream(parts) .map(part -> part.split("=")) .filter(pair -> pair.length == 2 && pair[0].equalsIgnoreCase("se")) .findFirst() .map(pair -> pair[1]) .map(expirationTimeStr -> { try { long epochSeconds = Long.parseLong(expirationTimeStr); return Instant.ofEpochSecond(epochSeconds).atOffset(ZoneOffset.UTC); } catch (NumberFormatException exception) { logger.verbose("Invalid expiration time format in the SAS token: {}. Falling back to max " + "expiration time.", expirationTimeStr); return OffsetDateTime.MAX; } }) .orElse(OffsetDateTime.MAX); }
Source:
<code>public void testFloatingUpwardsEnemyCollision() { Bubble bubble = new Bubble(new Point(0, 0), new Point(0, 0), null); ArrayList<Player> playerList = new ArrayList<Player>(); ArrayList<Unit> unitList = new ArrayList<Unit>(); List<Cell> items = new ArrayList<Cell>(); items.add(Cell.EMPTY); Grid<Cell> cells = new Grid<Cell>(items, 1, 1); Level level = new Level(playerList, unitList, cells); <START> final int TIME_FLOAT_UPWARDS = 50; <END> final Point FLOAT_UP_MOTION = new Point(0, -2); for(int i = 0; i < TIME_FLOAT_UPWARDS; i++) { bubble.tick(level); } assertTrue(bubble.isHit()); assertEquals(bubble.getMotion(), FLOAT_UP_MOTION); Enemy enemy = mock(Enemy.class); enemy.setLocation(bubble.getLocation()); assertEquals(bubble.getContains(), null); }</code><technical_language>Name 'TIME_FLOAT_UPWARDS' match pattern '^[a-z][a-zA-Z0-9]*$'. [CheckStyle] <naming</technical_language>

Target:
public void testFloatingUpwardsEnemyCollision() { Bubble bubble = new Bubble(new Point(0, 0), new Point(0, 0), null); ArrayList<Player> playerList = new ArrayList<Player>(); ArrayList<Unit> unitList = new ArrayList<Unit>(); List<Cell> items = new ArrayList<Cell>(); items.add(Cell.EMPTY); Grid<Cell> cells = new Grid<Cell>(items, 1, 1); Level level = new Level(playerList, unitList, cells); for(int i = 0; i < TIME_FLOAT_UPWARDS; i++) { bubble.tick(level); } assertTrue(bubble.isHit()); assertEquals(bubble.getMotion(), FLOAT_UP_MOTION); Enemy enemy = mock(Enemy.class); enemy.setLocation(bubble.getLocation()); assertEquals(bubble.getContains(), null); }
Source:
<code>public void triggerBlockReport(BlockReportOptions options) throws IOException { checkSuperuserPrivilege(); InetSocketAddress namenodeAddr = options.getNamenodeAddr(); for (BPOfferService bpos : blockPoolManager.getAllNamenodeThreads()) { if (bpos != null) { for (BPServiceActor actor : bpos.getBPServiceActors()) { <START> if (namenodeAddr == null || namenodeAddr.equals(actor.nnAddr)) { <END> actor.triggerBlockReport(options); } } } } }</code><technical_language>this condition more readable? create a boolean shouldTriggerBlockReportForAllNameNodes = (namenodeAddr == null)</technical_language>

Target:
public void triggerBlockReport(BlockReportOptions options) throws IOException { checkSuperuserPrivilege(); InetSocketAddress namenodeAddr = options.getNamenodeAddr(); boolean shouldTriggerToAllNn = (namenodeAddr == null); for (BPOfferService bpos : blockPoolManager.getAllNamenodeThreads()) { if (bpos != null) { for (BPServiceActor actor : bpos.getBPServiceActors()) { if (shouldTriggerToAllNn || namenodeAddr.equals(actor.nnAddr)) { actor.triggerBlockReport(options); } } } } }
Source:
<code><START> public CompletableFuture<Iterable<LedgerEntry>> read(long firstEntry, long lastEntry) { <END> CompletableFuture<Enumeration<LedgerEntry>> counter = new CompletableFuture<>(); asyncReadEntries(firstEntry, lastEntry, new SyncReadCallback(), counter); return counter.thenApply(en-> { return () -> Iterators.forEnumeration(en); }); }</code><technical_language>is a weird pattern do handle callback completablefuture: context object for passing completable future. clear pass a completable future a completable future SyncReadCallback? callback is triggered, completable future is set. transformation Enumeration Iterable done SyncReadCallback, attach a new apply function. also, counter renamed ctx least. name left introducing CompletableFuture</technical_language>

Target:
public CompletableFuture<Iterable<org.apache.bookkeeper.client.api.LedgerEntry>> read(long firstEntry, long lastEntry) { FutureReadResult result = new FutureReadResult(); asyncReadEntries(firstEntry, lastEntry, result, null); return result; }
Source:
<code>public List<KeySlice> get_range_slices(TableReference tableRef, SlicePredicate predicate, KeyRange range, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException { <START> ColumnParent colFam = new ColumnParent(AbstractKeyValueService.internalTableName(tableRef)); <END> return client.get_range_slices(colFam, predicate, range, consistency_level); }</code><technical_language>nit: refactor this line a method</technical_language>

Target:
public List<KeySlice> get_range_slices(TableReference tableRef, SlicePredicate predicate, KeyRange range, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException { ColumnParent colFam = getColumnParent(tableRef); return client.get_range_slices(colFam, predicate, range, consistency_level); }
Source:
<code>public void onInit(FMLInitializationEvent event) { BiomeType biomeType = null; try { biomeType = BiomeType.getType("FAKE"); } catch (NullPointerException npe) { LOGGER.warn("EnumHelper in BiomeType is working incorrectly!", npe); } finally { if (biomeType == null || !biomeType.name().equals("FAKE")) { LOGGER.warn("EnumHelper in BiomeType is working incorrectly!"); } } EnumPlantType plantType = null; if (plantType == null || !plantType.name().equals("FAKE")) { ; <START> } <END> try { plantType = EnumPlantType.getPlantType("FAKE"); } catch (NullPointerException npe) { LOGGER.warn("EnumHelper in EnumPlantType is working incorrectly!", npe); } finally { if (plantType == null || !plantType.name().equals("FAKE")) { LOGGER.warn("EnumHelper in EnumPlantType is working incorrectly!"); } } }</code><technical_language>do this block else statement after</technical_language>

Target:
public void onInit(FMLInitializationEvent event) { BiomeType biomeType = null; try { biomeType = BiomeType.getType("FAKE"); } catch (NullPointerException npe) { logger.warn("EnumHelper in BiomeType is working incorrectly!", npe); } finally { if (biomeType == null || !biomeType.name().equals("FAKE")) { logger.warn("EnumHelper in BiomeType is working incorrectly!"); } } EnumPlantType plantType = null; try { plantType = EnumPlantType.getPlantType("FAKE"); } catch (NullPointerException npe) { logger.warn("EnumHelper in EnumPlantType is working incorrectly!", npe); } finally { if (plantType == null || !plantType.name().equals("FAKE")) { logger.warn("EnumHelper in EnumPlantType is working incorrectly!"); } } }
Source:
<code>public void testJNDIBindingsNoAppName() throws Exception { <START> boolean passed = false; <END> Context ctx = getInitialContext(HOST, PORT); Hello ejb = (Hello) ctx.lookup("ejb:/ejb-jndi/Hello!org.jboss.as.test.integration.ejb.jndi.logging.Hello"); Assert.assertNotNull("Null object returned for local business interface lookup in the ejb namespace", ejb); Assert.assertTrue("Expected JNDI binding message not found", LoggingUtil.hasLogMessage(managementClient, TEST_HANDLER_NAME, "ejb:/ejb-jndi/Hello!org.jboss.as.test.integration.ejb.jndi.logging.Hello")); }</code><technical_language>Cruft, matter, this is unused variable</technical_language>

Target:
public void testJNDIBindingsNoAppName() throws Exception { Context ctx = getInitialContext(HOST, PORT); Hello ejb = (Hello) ctx.lookup("ejb:/ejb-jndi/Hello!org.jboss.as.test.integration.ejb.jndi.logging.Hello"); Assert.assertNotNull("Null object returned for local business interface lookup in the ejb namespace", ejb); Assert.assertTrue("Expected JNDI binding message not found", LoggingUtil.hasLogMessage(managementClient, TEST_HANDLER_NAME, "ejb:/ejb-jndi/Hello!org.jboss.as.test.integration.ejb.jndi.logging.Hello")); }
Source:
<code>public boolean attack(EntityDamageEvent source) { if (invulnerable) { return false; } else { performHurtAnimation((int) source.getFinalDamage()); if(source instanceof EntityDamageByEntityEvent) { Entity damager = ((EntityDamageByEntityEvent) source).getDamager(); boolean instantKill = damager instanceof Player && ((Player) damager).isCreative(); if (instantKill || getDamage() > 40) { if (linkedEntity != null) { <START> mountEntity(linkedEntity); <END> } if (instantKill && (!hasCustomName())) { kill(); } else { if (level.getGameRules().getBoolean("doEntityDrops")) { this.level.dropItem(this, new ItemBoat()); } close(); } } }else{ if (level.getGameRules().getBoolean("doEntityDrops")) { this.level.dropItem(this, new ItemBoat()); } close(); } } return true; }</code><technical_language>this.</technical_language>

Target:
public boolean attack(EntityDamageEvent source) { if (invulnerable) { return false; } else { performHurtAnimation((int) source.getFinalDamage()); if(source instanceof EntityDamageByEntityEvent) { Entity damager = ((EntityDamageByEntityEvent) source).getDamager(); boolean instantKill = damager instanceof Player && ((Player) damager).isCreative(); if (instantKill || getDamage() > 40) { if (linkedEntity != null) { this.mountEntity(linkedEntity); } if (instantKill && (!hasCustomName())) { kill(); } else { if (level.getGameRules().getBoolean("doEntityDrops")) { this.level.dropItem(this, new ItemBoat()); } close(); } } }else{ if (level.getGameRules().getBoolean("doEntityDrops")) { this.level.dropItem(this, new ItemBoat()); } close(); } } return true; }
Source:
<code>public Builder addModifiers(Modifier... modifiers) { <START> this.modifiers.addAll(Arrays.asList(modifiers)); <END> return this; }</code><technical_language>Collections.addAll saves wrapper object... need full-on picky allocations in a library</technical_language>

Target:
public Builder addModifiers(Modifier... modifiers) { Collections.addAll(this.modifiers, modifiers); return this; }
Source:
<code>public ExchangeClientByteArrayAllocator(ArrayPool<byte[]> pool) { <START> this.pool = pool; <END> }</code><technical_language>this.pool = requireNonNull(pool, "pool is null");</technical_language>

Target:
public ExchangeClientByteArrayAllocator(ArrayPool<byte[]> pool) { this.pool = requireNonNull(pool, "pool is null"); }
Source:
<code>private File getConnectionSettingsDetectionScript( final String scriptName) { final File script = Activator.getDefault().getBundle() .getDataFile(scriptName); if (script != null && !script.exists()) { try (final FileOutputStream output = new FileOutputStream( <START> scriptName); <END> final InputStream is = DockerConnection.class .getResourceAsStream( "/resources/" + scriptName)) { byte[] buff = new byte[1024]; int n; while ((n = is.read(buff)) > 0) { output.write(buff, 0, n); } script.setExecutable(true); } catch (IOException e) { Activator.logErrorMessage(e.getMessage()); } } return script; }</code><technical_language>I meant open FileOutputStream script scriptName. create a file in some random location (either $HOME working-dir)</technical_language>

Target:
private File getConnectionSettingsDetectionScript( final String scriptName) { final File script = Activator.getDefault().getBundle() .getDataFile(scriptName); if (script != null && !script.exists()) { try (final FileOutputStream output = new FileOutputStream( script); final InputStream is = DockerConnection.class .getResourceAsStream( "/resources/" + scriptName)) { byte[] buff = new byte[1024]; int n; while ((n = is.read(buff)) > 0) { output.write(buff, 0, n); } script.setExecutable(true); } catch (IOException e) { Activator.logErrorMessage(e.getMessage()); } } return script; }
Source:
<code><START> public void compile() throws Exception { <END> for (Map.Entry<String, String> tablePojo : tableClasses.entrySet()) { log.debug("key: " + tablePojo.getKey() + ", value: " + tablePojo.getValue()); compiler.addSource(PACKAGE_NAME + tablePojo.getKey(), tablePojo.getValue()); } for (Map.Entry<String, String> secPojo : securityClasses.entrySet()) { log.debug("key: " + secPojo.getKey() + ", value: " + secPojo.getValue()); compiler.addSource(PACKAGE_NAME + secPojo.getKey(), secPojo.getValue()); } try { compiledObjects = compiler.compileAll(); } catch (Exception e) { log.error("Unable to compile dynamic classes in memory "); } }</code><technical_language>Is reason compile in constructor compiledObjects is fully initialized</technical_language>

Target:
private void compile() throws Exception { for (Map.Entry<String, String> tablePojo : tableClasses.entrySet()) { log.debug("key: " + tablePojo.getKey() + ", value: " + tablePojo.getValue()); compiler.addSource(PACKAGE_NAME + tablePojo.getKey(), tablePojo.getValue()); } for (Map.Entry<String, String> secPojo : securityClasses.entrySet()) { log.debug("key: " + secPojo.getKey() + ", value: " + secPojo.getValue()); compiler.addSource(PACKAGE_NAME + secPojo.getKey(), secPojo.getValue()); } compiledObjects = compiler.compileAll(); }
Source:
<code>public FutureAssertion<T> hasValue(T value) throws ExecutionException, InterruptedException { <START> assertEquals(actual.get(), value); <END> return this; }</code><technical_language>I calling Future.get() a timeout is a good idea hang test if interruptions received. timed</technical_language>

Target:
public FutureAssertion<T> hasValue(T value) throws ExecutionException, InterruptedException, TimeoutException { assertEquals(actual.get(futureGetTimeoutMs, TimeUnit.MILLISECONDS), value); return this; }
Source:
<code>public void testGroupByStringOutputAsLong() { ExtractionFn strlenFn = StrlenExtractionFn.instance(); GroupByQuery query = GroupByQuery .builder() .setDataSource(QueryRunnerTestHelper.dataSource) .setQuerySegmentSpec(QueryRunnerTestHelper.firstToThird) .setDimensions(Lists.<DimensionSpec>newArrayList(new ExtractionDimensionSpec( QueryRunnerTestHelper.qualityDimension, "alias", ValueType.LONG, strlenFn ))) .setDimFilter(new SelectorDimFilter(QueryRunnerTestHelper.qualityDimension, "entertainment", null)) .setAggregatorSpecs( Arrays.asList( QueryRunnerTestHelper.rowsCount, new LongSumAggregatorFactory("idx", "index") ) ) .setGranularity(QueryRunnerTestHelper.dayGran) .build(); List<Row> expectedResults; if (config.getDefaultStrategy().equals(GroupByStrategySelector.STRATEGY_V1)) { <START> expectedResults = Arrays.asList( <END> GroupByQueryRunnerTestHelper.createExpectedRow( "2011-04-01", "alias", "13", "rows", 1L, "idx", 158L ), GroupByQueryRunnerTestHelper.createExpectedRow( "2011-04-02", "alias", "13", "rows", 1L, "idx", 166L ) ); } else { expectedResults = Arrays.asList( GroupByQueryRunnerTestHelper.createExpectedRow( "2011-04-01", "alias", 13L, "rows", 1L, "idx", 158L ), GroupByQueryRunnerTestHelper.createExpectedRow( "2011-04-02", "alias", 13L, "rows", 1L, "idx", 166L ) ); } Iterable<Row> results = GroupByQueryRunnerTestHelper.runQuery(factory, runner, query); TestHelper.assertExpectedObjects(expectedResults, results, ""); }</code><technical_language>This throw exception. In general, groupBy v1 (which support outputType other STRING) throw exception if outputType is other STRING. message "groupBy v1 supports outputType STRING" give people a push groupBy v2</technical_language>

Target:
public void testGroupByStringOutputAsLong() { if (config.getDefaultStrategy().equals(GroupByStrategySelector.STRATEGY_V1)) { expectedException.expect(UnsupportedOperationException.class); expectedException.expectMessage("GroupBy v1 only supports dimensions with an outputType of STRING."); } ExtractionFn strlenFn = StrlenExtractionFn.instance(); GroupByQuery query = GroupByQuery .builder() .setDataSource(QueryRunnerTestHelper.dataSource) .setQuerySegmentSpec(QueryRunnerTestHelper.firstToThird) .setDimensions(Lists.<DimensionSpec>newArrayList(new ExtractionDimensionSpec( QueryRunnerTestHelper.qualityDimension, "alias", ValueType.LONG, strlenFn ))) .setDimFilter(new SelectorDimFilter(QueryRunnerTestHelper.qualityDimension, "entertainment", null)) .setAggregatorSpecs( Arrays.asList( QueryRunnerTestHelper.rowsCount, new LongSumAggregatorFactory("idx", "index") ) ) .setGranularity(QueryRunnerTestHelper.dayGran) .build(); List<Row> expectedResults = Arrays.asList( GroupByQueryRunnerTestHelper.createExpectedRow( "2011-04-01", "alias", 13L, "rows", 1L, "idx", 158L ), GroupByQueryRunnerTestHelper.createExpectedRow( "2011-04-02", "alias", 13L, "rows", 1L, "idx", 166L ) ); Iterable<Row> results = GroupByQueryRunnerTestHelper.runQuery(factory, runner, query); TestHelper.assertExpectedObjects(expectedResults, results, ""); }
Source:
<code>private void updateSnapshotConfigWithoutImage(Guid imageGroupToRemove) { List<DiskImage> snapshotDisks = getDiskImageDao().getAllSnapshotsForImageGroup(imageGroupToRemove); for (DiskImage snapshotDisk : snapshotDisks) { NGuid vmSnapshotId = snapshotDisk.getvm_snapshot_id(); if (vmSnapshotId != null && !Guid.Empty.equals(vmSnapshotId.getValue())) { lockSnapshotWithWait(vmSnapshotId.getValue()); final Snapshot updated = prepareSnapshotConfigWithoutImageSingleImage(vmSnapshotId.getValue(), snapshotDisk.getImageId()); if (updated != null) { TransactionSupport.executeInScope(TransactionScopeOption.RequiresNew, new TransactionMethod<Object>() { @Override public Object runInTransaction() { getSnapshotDao().update(updated); return null; } }); } <START> freeSnapshotLock(); <END> } } }</code><technical_language>free lock in a finally block</technical_language>

Target:
private void updateSnapshotConfigWithoutImage(Guid imageGroupToRemove) { List<DiskImage> snapshotDisks = getDiskImageDao().getAllSnapshotsForImageGroup(imageGroupToRemove); for (DiskImage snapshotDisk : snapshotDisks) { NGuid vmSnapshotId = snapshotDisk.getvm_snapshot_id(); if (vmSnapshotId != null && !Guid.Empty.equals(vmSnapshotId.getValue())) { try { lockSnapshotWithWait(vmSnapshotId.getValue()); final Snapshot updated = prepareSnapshotConfigWithoutImageSingleImage(vmSnapshotId.getValue(), snapshotDisk.getImageId()); if (updated != null) { TransactionSupport.executeInScope(TransactionScopeOption.RequiresNew, new TransactionMethod<Object>() { @Override public Object runInTransaction() { getSnapshotDao().update(updated); return null; } }); } } finally { freeSnapshotLock(); } } } }
Source:
<code>public PlanWithProperties visitMarkDistinct(MarkDistinctNode node, PreferredProperties preferredProperties) { PreferredProperties preferredChildProperties = PreferredProperties.partitionedWithLocal(ImmutableSet.copyOf(node.getDistinctVariables()), grouped(node.getDistinctVariables())) .mergeWithParent(preferredProperties, !isExactPartitioningPreferred(session)); PlanWithProperties child = node.getSource().accept(this, preferredChildProperties); if (child.getProperties().isSingleNode() || !isStreamPartitionedOn(child.getProperties(), node.getDistinctVariables())) { boolean useStreamingExchangeWithMarkDistinct = <START> SystemSessionProperties.isStreamMarkDistinctWithMaterializedExchangeEnabled(session); <END> Scope exchangeScope = useStreamingExchangeWithMarkDistinct ? REMOTE_STREAMING : selectExchangeScopeForPartitionedRemoteExchange(child.getNode(), false); child = withDerivedProperties( partitionedExchange( idAllocator.getNextId(), exchangeScope, child.getNode(), createPartitioning(node.getDistinctVariables()), node.getHashVariable()), child.getProperties()); } return rebaseAndDeriveProperties(node, child); }</code><technical_language>nit: fine inline static import is applied</technical_language>

Target:
public PlanWithProperties visitMarkDistinct(MarkDistinctNode node, PreferredProperties preferredProperties) { PreferredProperties preferredChildProperties = PreferredProperties.partitionedWithLocal(ImmutableSet.copyOf(node.getDistinctVariables()), grouped(node.getDistinctVariables())) .mergeWithParent(preferredProperties, !isExactPartitioningPreferred(session)); PlanWithProperties child = node.getSource().accept(this, preferredChildProperties); if (child.getProperties().isSingleNode() || !isStreamPartitionedOn(child.getProperties(), node.getDistinctVariables())) { child = withDerivedProperties( partitionedExchange( idAllocator.getNextId(), isUseStreamingExchangeForMarkDistinctEnabled(session) ? REMOTE_STREAMING : selectExchangeScopeForPartitionedRemoteExchange(child.getNode(), false), child.getNode(), createPartitioning(node.getDistinctVariables()), node.getHashVariable()), child.getProperties()); } return rebaseAndDeriveProperties(node, child); }
Source:
<code>public CloseableIterator<byte[]> keys() { final RocksIterator iterator = db.newIterator(optionCache); iterator.seekToFirst(); return new CloseableIterator<byte[]>() { @Override public boolean hasNext() { return iterator.isValid(); } @Override public byte[] next() { <START> checkArgument(iterator.isValid()); <END> byte[] key = iterator.key(); iterator.next(); return key; } @Override public void close() { iterator.close(); } }; }</code><technical_language>checkState</technical_language>

Target:
public CloseableIterator<byte[]> keys() { final RocksIterator iterator = db.newIterator(optionCache); iterator.seekToFirst(); return new CloseableIterator<byte[]>() { @Override public boolean hasNext() { return iterator.isValid(); } @Override public byte[] next() { checkState(iterator.isValid()); byte[] key = iterator.key(); iterator.next(); return key; } @Override public void close() { iterator.close(); } }; }
Source:
<code>public String toJsonWithLengthLimit(T instance, int lengthLimit) throws JsonLengthLimitExceededException { try (StringWriter stringWriter = new StringWriter(); LengthLimitedWriter lengthLimitedWriter = new LengthLimitedWriter(stringWriter, lengthLimit)) { mapper.writeValue(lengthLimitedWriter, instance); return stringWriter.getBuffer().toString(); } catch (LengthLimitedWriter.LengthLimitExceededException e) { <START> throw new JsonLengthLimitExceededException(String.format("%s could not be converted to json string with length limit %d", instance.getClass().getName(), lengthLimit), e); <END> } catch (IOException e) { throw new IllegalArgumentException(String.format("%s could not be converted to json", instance.getClass().getName()), e); } }</code><technical_language>need e here</technical_language>

Target:
public Optional<String> toJsonWithLengthLimit(T instance, int lengthLimit) { try (StringWriter stringWriter = new StringWriter(); LengthLimitedWriter lengthLimitedWriter = new LengthLimitedWriter(stringWriter, lengthLimit)) { mapper.writeValue(lengthLimitedWriter, instance); return Optional.of(stringWriter.getBuffer().toString()); } catch (LengthLimitExceededException e) { return Optional.empty(); } catch (IOException e) { throw new IllegalArgumentException(String.format("%s could not be converted to json", instance.getClass().getName()), e); } }
Source:
<code>public Map<TopicPartition, Errors> errors() { <START> Map<TopicPartition, Errors> errorsMap = new HashMap<>(); <END> for (AddPartitionsToTxnTopicResult topicResult : this.data.results()) { for (AddPartitionsToTxnPartitionResult partitionResult : topicResult.results()) { errorsMap.put(new TopicPartition( topicResult.name(), partitionResult.partitionIndex()), Errors.forCode(partitionResult.errorCode())); } } return errorsMap; }</code><technical_language>Similar here, cache result in case reused</technical_language>

Target:
public Map<TopicPartition, Errors> errors() { if (cachedErrorsMap != null) { return cachedErrorsMap; } cachedErrorsMap = new HashMap<>(); for (AddPartitionsToTxnTopicResult topicResult : this.data.results()) { for (AddPartitionsToTxnPartitionResult partitionResult : topicResult.results()) { cachedErrorsMap.put(new TopicPartition( topicResult.name(), partitionResult.partitionIndex()), Errors.forCode(partitionResult.errorCode())); } } return cachedErrorsMap; }
Source:
<code><START> public boolean restoreTargetFields(SshMachineTarget target) { <END> if (target == null) { return false; } final RecipeDescriptor targetRecipe = target.getRecipe(); if (targetRecipe == null) { return false; } try { final JSONObject json = JSONParser.parseStrict(targetRecipe.getScript()).isObject(); String name = targetRecipe.getName(); target.setName(name); if (json.get("host") != null) { String host = json.get("host").isString().stringValue(); target.setHost(host); } if (json.get("port") != null) { String port = json.get("port").isString().stringValue(); target.setPort(port); } if (json.get("username") != null) { String username = json.get("username").isString().stringValue(); target.setUserName(username); } if (json.get("password") != null) { String password = json.get("password").isString().stringValue(); target.setPassword(password); } } catch (Exception e) { Log.error(this.getClass(), "Unable to parse recipe JSON. " + e.getMessage()); return false; } return true; }</code><technical_language>code wants in presenter</technical_language>

Target:
public boolean restoreTargetFields(SshMachineTarget target) { if (target == null) { return false; } final RecipeDescriptor targetRecipe = target.getRecipe(); if (targetRecipe == null) { return false; } try { final JSONObject json = JSONParser.parseStrict(targetRecipe.getScript()).isObject(); String name = targetRecipe.getName(); target.setName(name); if (json.get("host") != null) { String host = json.get("host").isString().stringValue(); target.setHost(host); } if (json.get("port") != null) { String port = json.get("port").isString().stringValue(); target.setPort(port); } if (json.get("username") != null) { String username = json.get("username").isString().stringValue(); target.setUserName(username); } if (json.get("password") != null) { String password = json.get("password").isString().stringValue(); target.setPassword(password); } target.setDirty(false); } catch (Exception e) { Log.error(this.getClass(), "Unable to parse recipe JSON. " + e.getMessage()); return false; } return true; }
Source:
<code>public Map<String, List<Message>> validateProjectOntology(final Workbook workbook, final String programUUID) { final Map<String, List<Message>> errors = new HashMap<String, List<Message>>(); <START> final OntologyDataManagerImpl ontology = new OntologyDataManagerImpl(this.getSessionProvider()); <END> if (!this.isTermExists(TermId.ENTRY_NO.getId(), workbook.getFactors(), ontology)) { this.initializeIfNull(errors, Constants.MISSING_ENTRY); errors.get(Constants.MISSING_ENTRY).add(new Message("error.entry.doesnt.exist.wizard")); } if (!this.isTermExists(TermId.GID.getId(), workbook.getFactors(), ontology)) { this.initializeIfNull(errors, Constants.MISSING_GID); errors.get(Constants.MISSING_GID).add(new Message("error.gid.doesnt.exist.wizard")); } if ((workbook.getImportType() == null || workbook.getImportType() == DataSetType.PLOT_DATA.getId()) && (!this .isTermExists(TermId.PLOT_NO.getId(), workbook.getFactors(), ontology) && !this .isTermExists(TermId.PLOT_NNO.getId(), workbook.getFactors(), ontology) )) { this.initializeIfNull(errors, Constants.MISSING_PLOT); errors.get(Constants.MISSING_PLOT).add(new Message("error.plot.doesnt.exist.wizard")); } if (!workbook.isNursery() && !this.isTermExists(TermId.TRIAL_INSTANCE_FACTOR.getId(), workbook.getTrialVariables(), ontology)) { this.initializeIfNull(errors, Constants.MISSING_TRIAL); errors.get(Constants.MISSING_TRIAL).add(new Message(DataImportServiceImpl.ERROR_MISSING_TRIAL_CONDITION)); } this.checkForDuplicatePSMCombo(workbook, errors); return errors; }</code><technical_language>Remove manual creation of service dependencies. spring auto wiring</technical_language>

Target:
public Map<String, List<Message>> validateProjectOntology(final Workbook workbook, final String programUUID) { final Map<String, List<Message>> errors = new HashMap<String, List<Message>>(); final Set<Integer> factorsTermIds = getTermIdsOfMeasurementVariables(workbook.getFactors()); final Set<Integer> trialVariablesTermIds = getTermIdsOfMeasurementVariables(workbook.getTrialVariables()); if (!factorsTermIds.contains(TermId.ENTRY_NO.getId())) { this.initializeIfNull(errors, Constants.MISSING_ENTRY); errors.get(Constants.MISSING_ENTRY).add(new Message("error.entry.doesnt.exist.wizard")); } if (!factorsTermIds.contains(TermId.GID.getId())) { this.initializeIfNull(errors, Constants.MISSING_GID); errors.get(Constants.MISSING_GID).add(new Message("error.gid.doesnt.exist.wizard")); } if ((workbook.getImportType() == null || workbook.getImportType() == DataSetType.PLOT_DATA.getId()) && ( !factorsTermIds.contains(TermId.PLOT_NO.getId()) && !factorsTermIds.contains(TermId.PLOT_NNO.getId()))) { this.initializeIfNull(errors, Constants.MISSING_PLOT); errors.get(Constants.MISSING_PLOT).add(new Message("error.plot.doesnt.exist.wizard")); } if (!workbook.isNursery() && !trialVariablesTermIds.contains(TermId.TRIAL_INSTANCE_FACTOR.getId())) { this.initializeIfNull(errors, Constants.MISSING_TRIAL); errors.get(Constants.MISSING_TRIAL).add(new Message(DataImportServiceImpl.ERROR_MISSING_TRIAL_CONDITION)); } this.checkForDuplicatePSMCombo(workbook, errors); return errors; }
Source:
<code>public NodeDetails processOneToOne(String tenantId, Span item) throws RetryAttemptException { NodeDetails nd = new NodeDetails(); nd.setId(item.getId()); URL url = item.url(); if (url != null) { nd.setUri(url.getPath()); } if (item.clientSpan()) { nd.setId(SpanUniqueIdGenerator.toUnique(item)); nd.setType(NodeType.Producer); nd.setComponentType("Producer"); nd.getCorrelationIds().add(new CorrelationIdentifier(Scope.Interaction, item.getId())); } else if (item.serverSpan()) { nd.setType(NodeType.Consumer); nd.setComponentType("Consumer"); nd.getCorrelationIds().add(new CorrelationIdentifier(Scope.Interaction, item.getId())); } else { nd.setType(NodeType.Component); nd.setComponentType(item.componentType()); } nd.setElapsed(item.getDuration()); nd.setActual(item.getDuration()); List<Property> spanProperties = item.properties(); nd.setTimestamp(item.getTimestamp() / 1000); nd.getProperties().addAll(spanProperties); <START> nd.setHostName(Span.ipv4Address(spanProperties)); <END> if (log.isLoggable(Level.FINEST)) { log.finest("NodeDetailsDeriver ret=" + nd); } return nd; }</code><technical_language>CompletionTime - add a hostAddress property NodeDetails class set this instead of hostName</technical_language>

Target:
public NodeDetails processOneToOne(String tenantId, Span item) throws RetryAttemptException { NodeDetails nd = new NodeDetails(); nd.setId(item.getId()); URL url = item.url(); if (url != null) { nd.setUri(url.getPath()); } if (item.clientSpan()) { nd.setId(SpanUniqueIdGenerator.toUnique(item)); nd.setType(NodeType.Producer); nd.setComponentType("Producer"); nd.getCorrelationIds().add(new CorrelationIdentifier(Scope.Interaction, item.getId())); } else if (item.serverSpan()) { nd.setType(NodeType.Consumer); nd.setComponentType("Consumer"); nd.getCorrelationIds().add(new CorrelationIdentifier(Scope.Interaction, item.getId())); } else { nd.setType(NodeType.Component); nd.setComponentType(item.componentType()); } nd.setElapsed(item.getDuration()); nd.setActual(item.getDuration()); List<Property> spanProperties = item.properties(); nd.setTimestamp(item.getTimestamp() / 1000); nd.getProperties().addAll(spanProperties); nd.setHostAddress(Span.ipv4Address(spanProperties)); if (log.isLoggable(Level.FINEST)) { log.finest("NodeDetailsDeriver ret=" + nd); } return nd; }
Source:
<code>public void elementTextShouldBe(String locator, String text, String...params) { String message = robot.getParamsValue(params, 0, ""); Boolean ignoreCase = robot.getParamsValue(params, 1, Boolean.FALSE); List<WebElement> elements = elementFind(locator, true, true); String actual = elements.get(0).getText(); String textToCompare = text; if (ignoreCase) { actual = actual.toLowerCase(); <START> textToCompare = textToCompare.toLowerCase(); <END> } if (!textToCompare.equals(actual)) { if (StringUtils.isBlank(message)) { message = String.format("The text of element '%s' should have been '%s', but it was '%s'.", locator, text, actual); } throw new SeleniumLibraryNonFatalException(message); } }</code><technical_language>String class StringUtils methods for case insensitive comparison, perhaps, them. WDYT? * <LINK_0> * <LINK_1></technical_language>

Target:
public void elementTextShouldBe(String locator, String text, String...params) { String message = robot.getParamsValue(params, 0, ""); Boolean ignoreCase = robot.getParamsValue(params, 1, Boolean.FALSE); List<WebElement> elements = elementFind(locator, true, true); String actual = elements.get(0).getText(); if (!textIs(actual, text, ignoreCase)) { if (StringUtils.isEmpty(message)) { message = String.format("The text of element '%s' should have been '%s', but it was '%s'.", locator, text, actual); } throw new SeleniumLibraryNonFatalException(message); } }
Source:
<code>public static void main(String[] args) { Options options = prepareOptions(); try { CommandLine cli = new DefaultParser().parse(options, args); if (cli.hasOption("help")) { printHelp(options); System.exit(0); } if (!cli.hasOption("configDir")) { printHelp(options); System.err.println("Missing required option"); System.exit(1); } String configDir = cli.getOptionValue("configDir"); DynamicConfigValidator dynamicConfigValidator = new DynamicConfigValidator(configDir); dynamicConfigValidator.readAndValidateConfigs(); System.out.println("Configs Validation Passed!"); if (cli.hasOption("nocompile")) { System.out.println("Skipped compilation for both Model and DB configs"); System.exit(0); } if (cli.hasOption("nomodelcompile")) { System.out.println("Skipped compilation for Model configs"); } else { System.out.println("Compiling Model configs (Use '--nomodelcompile' to skip this step)."); dynamicConfigValidator.hydrateAndCompileModelConfigs(); System.out.println("Model Configs Compilation Passed!"); } <START> if (cli.hasOption("nodbcompile")) { <END> System.out.println("Skipped compilation for DB configs"); } else { System.out.println("Compiling DB configs (Use '--nodbcompile' to skip this step)."); dynamicConfigValidator.compileDBConfigs(); System.out.println("DB Configs Compilation Passed!"); } System.exit(0); } catch (Exception e) { String msg = isNullOrEmpty(e.getMessage()) ? "Process Failed!" : e.getMessage(); System.err.println(msg); System.exit(2); } }</code><technical_language>is case for compiling models compiling db configs</technical_language>

Target:
public static void main(String[] args) { Options options = prepareOptions(); try { CommandLine cli = new DefaultParser().parse(options, args); if (cli.hasOption("help")) { printHelp(options); System.exit(0); } if (!cli.hasOption("configDir")) { printHelp(options); System.err.println("Missing required option"); System.exit(1); } String configDir = cli.getOptionValue("configDir"); DynamicConfigValidator dynamicConfigValidator = new DynamicConfigValidator(configDir); dynamicConfigValidator.readAndValidateConfigs(); System.out.println("Configs Validation Passed!"); if (cli.hasOption("nocompile")) { System.out.println("Skipped compilation for Model configs"); System.exit(0); } System.out.println("Compiling Model configs (Use '--nocompile' to skip this step)."); dynamicConfigValidator.hydrateAndCompileModelConfigs(new ElideDynamicInMemoryCompiler().ignoreWarnings() .useParentClassLoader(DynamicConfigValidator.class.getClassLoader())); System.out.println("Model Configs Compilation Passed!"); System.exit(0); } catch (Exception e) { String msg = isNullOrEmpty(e.getMessage()) ? "Process Failed!" : e.getMessage(); System.err.println(msg); System.exit(2); } }
Source:
<code>public UnavailableImplementationException(final Class klass) { super(String.format(DEFAULT_NOT_FOUND_MESSAGE, klass)); <START> } <END></code><technical_language>a notNull assertion klass</technical_language>

Target:
UnavailableImplementationException(final Class klass) { super(String.format(DEFAULT_NOT_FOUND_MESSAGE, klass)); }
Source:
<code>public String toString() { String awsRegions = ""; for (String awsRegiono : this.awsRegions) { <START> awsRegions += awsRegions + ", "; <END> } return "AwsSettings{" + "productTypeIsEc2=" + productTypeIsEc2 + ", isEc2Instance=" + isEc2Instance + ", productTypeIsJrsAmi=" + productTypeIsJrsAmi + ", awsRegions=" + awsRegions + ", productTypeIsMpAmi=" + productTypeIsMpAmi + ", suppressEc2CredentialsWarnings=" + suppressEc2CredentialsWarnings + '}'; }</code><technical_language>this.awsRegions.toString() do for you, please check awsRegions for null</technical_language>

Target:
public String toString() { return "AwsSettings{" + "productTypeIsEc2=" + productTypeIsEc2 + ", isEc2Instance=" + isEc2Instance + ", productTypeIsJrsAmi=" + productTypeIsJrsAmi + ", awsRegions=" + awsRegions + ", productTypeIsMpAmi=" + productTypeIsMpAmi + ", suppressEc2CredentialsWarnings=" + suppressEc2CredentialsWarnings + '}'; }
Source:
<code>private void addFernFlowerInvokerDeps() { DependencyHandler deps = project.getDependencies(); Configuration buildscriptClasspath = project.getBuildscript().getConfigurations().getByName("classpath"); final Dependency fgDep = Iterables.getFirst(buildscriptClasspath.getDependencies().matching(new Spec<Dependency>() { @Override public boolean isSatisfiedBy(Dependency element) { return element.getName().equals(GROUP_FG); } }), null); if (fgDep == null) { <START> return; <END> } deps.add(CONFIG_FFI_DEPS, project.files(buildscriptClasspath.getResolvedConfiguration().getFiles(new Spec<Dependency>() { @Override public boolean isSatisfiedBy(Dependency element) { return element.contentEquals(fgDep); } }))); deps.add(CONFIG_FFI_DEPS, deps.localGroovy()); }</code><technical_language>Atleast log it, needs this</technical_language>

Target:
private void addFernFlowerInvokerDeps() { DependencyHandler deps = project.getDependencies(); Configuration buildscriptClasspath = project.getBuildscript().getConfigurations().getByName("classpath"); final Dependency fgDep = Iterables.getFirst(buildscriptClasspath.getDependencies().matching(new Spec<Dependency>() { @Override public boolean isSatisfiedBy(Dependency element) { return element.getName().equals(GROUP_FG); } }), null); if (fgDep == null) { throw new StopExecutionException("Missing FG dep in buildscript classpath"); } deps.add(CONFIG_FFI_DEPS, project.files(buildscriptClasspath.getResolvedConfiguration().getFiles(new Spec<Dependency>() { @Override public boolean isSatisfiedBy(Dependency element) { return element.contentEquals(fgDep); } }))); deps.add(CONFIG_FFI_DEPS, deps.localGroovy()); }
Source:
<code>public String getProvider() { <START> return "artemis"; END> }</code><technical_language>TODO later</technical_language>

Target:
public String getProvider() { return ArtemisUtil.PROVIDER; }