auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_browser); urls = new ArrayList<>(); try { JSONObject payload = new JSONObject(getIntent().getStringExtra("payload")); String href = payload.getString("href"); urls.add(href); JSONArray alt_hrefs = payload.getJSONArray("alt_hrefs"); for(int i=0; i< alt_hrefs.length(); i++) { urls.add(alt_hrefs.getString(i)); } Log.d(TAG, "Message data urls: " + urls); } catch (JSONException e){ System.out.println("JSONException "+ e); } initViews(); setUpWebView(); reloadButtons(); setListeners(); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_browser); urls = new ArrayList<>(); try { JSONObject payload = new JSONObject(getIntent().getStringExtra("payload")); String href = payload.getString("href"); urls.add(href); JSONArray alt_hrefs = payload.getJSONArray("alt_hrefs"); for(int i=0; i< alt_hrefs.length(); i++) { urls.add(alt_hrefs.getString(i)); } Log.d(TAG, "Message data urls: " + urls); } catch (JSONException e){ System.out.println("JSONException "+ e); finish(); } initViews(); setUpWebView(); reloadButtons(); setListeners(); }
Source:
public String generateLogMessage() { return Const.ActivityLog.TEAMMATESLOG + Const.ActivityLog.FIELD_SEPARATOR + actionName + Const.ActivityLog.FIELD_SEPARATOR + actionResponse + Const.ActivityLog.FIELD_SEPARATOR + logToShow + Const.ActivityLog.FIELD_SEPARATOR + userRole + (isMasqueradeUserRole ? "(M)" : "") + Const.ActivityLog.FIELD_SEPARATOR + userName + Const.ActivityLog.FIELD_SEPARATOR + userGoogleId + Const.ActivityLog.FIELD_SEPARATOR + userEmail + Const.ActivityLog.FIELD_SEPARATOR + logMessage + Const.ActivityLog.FIELD_SEPARATOR + actionUrl + Const.ActivityLog.FIELD_SEPARATOR + logId; }

Target:
public String generateLogMessage() { return Const.ActivityLog.TEAMMATESLOG + Const.ActivityLog.FIELD_SEPARATOR + actionName + Const.ActivityLog.FIELD_SEPARATOR + actionResponse + Const.ActivityLog.FIELD_SEPARATOR + logToShow + Const.ActivityLog.FIELD_SEPARATOR + userRole + (isMasqueradeUserRole ? Const.ActivityLog.ROLE_MASQUERADE_POSTFIX : "") + Const.ActivityLog.FIELD_SEPARATOR + userName + Const.ActivityLog.FIELD_SEPARATOR + userGoogleId + Const.ActivityLog.FIELD_SEPARATOR + userEmail + Const.ActivityLog.FIELD_SEPARATOR + logMessage + Const.ActivityLog.FIELD_SEPARATOR + actionUrl + Const.ActivityLog.FIELD_SEPARATOR + logId; }
Source:
protected void onDoneImpl(Exception e) { if (e != null) Exceptions.propagateIfFatal(e); List<Exception> exceptions = Lists.newArrayList(); if (e != null) { exceptions.add(e); } if (danglingRefFailureMode != RebindFailureMode.CONTINUE) { if (missingEntities.size() > 0) { exceptions.add(new IllegalStateException("Missing referenced entit"+(missingEntities.size() == 1 ? "y" : "ies")+": "+missingEntities)); } if (missingLocations.size() > 0) { exceptions.add(new IllegalStateException("Missing referenced location"+(missingEntities.size() == 1 ? "" : "s")+": "+missingLocations)); } } if (rebindFailureMode != RebindFailureMode.CONTINUE) { exceptions.addAll(loadMementoFailures); exceptions.addAll(createLocationFailures.values()); exceptions.addAll(createEntityFailures.values()); exceptions.addAll(createPolicyFailures.values()); exceptions.addAll(rebindLocationFailures.values()); exceptions.addAll(rebindEntityFailures.values()); exceptions.addAll(rebindPolicyFailures.values()); exceptions.addAll(manageLocationFailures.values()); exceptions.addAll(manageEntityFailures.values()); exceptions.addAll(locationNotFoundFailures.values()); exceptions.addAll(entityNotFoundFailures.values()); exceptions.addAll(policyNotFoundFailures.values()); } if (exceptions.isEmpty()) { return; } else { CompoundRuntimeException compoundException = new CompoundRuntimeException("Problem"+(exceptions.size() == 1 ? "" : "s")+" rebinding", exceptions); LOG.info("RebindManager failed (throwing): "+compoundException.toString()); throw compoundException; } }

Target:
protected void onDoneImpl(Exception e) { if (e != null) Exceptions.propagateIfFatal(e); List<Exception> allExceptions = Lists.newArrayList(); if (e != null) { allExceptions.add(e); } if (danglingRefFailureMode != RebindFailureMode.CONTINUE) { if (missingEntities.size() > 0) { allExceptions.add(new IllegalStateException("Missing referenced entit"+(missingEntities.size() == 1 ? "y" : "ies")+": "+missingEntities)); } if (missingLocations.size() > 0) { allExceptions.add(new IllegalStateException("Missing referenced location"+(missingEntities.size() == 1 ? "" : "s")+": "+missingLocations)); } } if (rebindFailureMode != RebindFailureMode.CONTINUE) { allExceptions.addAll(exceptions); } if (allExceptions.isEmpty()) { return; } else { CompoundRuntimeException compoundException = new CompoundRuntimeException("Problem"+(allExceptions.size() == 1 ? "" : "s")+" rebinding", allExceptions); LOG.info("RebindManager failed (throwing): "+compoundException.toString()); throw compoundException; } }
Source:
private boolean matchesAnyCookieName(String cookieString, String... cookieNames) { if (StringUtils.isEmpty(cookieString) || ArrayUtils.isEmpty(cookieNames)) { return false; } return Arrays.stream(cookieNames).anyMatch(name -> matchesCookieName(cookieString, name)); }

Target:
private boolean matchesAnyCookieName(String cookieString, String... cookieNames) { boolean isEmpty = StringUtils.isEmpty(cookieString) || ArrayUtils.isEmpty(cookieNames); return isEmpty || Arrays.stream(cookieNames) .anyMatch(name -> matchesCookieName(cookieString, name)); }
Source:
public boolean equals(Object other) { return other == this || other instanceof Instance && this.displayName.equals(((Instance) other).displayName) && this.jrFormId.equals(((Instance) other).jrFormId) && this.instanceFilePath.equals(((Instance) other).instanceFilePath); }

Target:
public boolean equals(Object other) { return other == this || other instanceof Instance && this.instanceFilePath.equals(((Instance) other).instanceFilePath); }
Source:
public void testSetPropertiesAndGroups() throws AccumuloSecurityException, AccumuloException, TableExistsException, TableNotFoundException { Connector conn = getConnector(); String tableName = getUniqueNames(2)[0]; NewTableConfiguration ntc = new NewTableConfiguration(); Map<String,String> props = new HashMap<>(); props.put("prop1", "val1"); props.put("prop2", "val2"); ntc.setProperties(props); Map<String,Set<Text>> lgroups = new HashMap<>(); lgroups.put("lg1", ImmutableSet.of(new Text("dog"))); ntc.setLocalityGroups(lgroups); conn.tableOperations().create(tableName, ntc); Map<String,String> ntcProps = ntc.getProperties(); assertEquals(ntcProps.get("prop1"), "val1"); assertEquals(ntcProps.get("prop2"), "val2"); assertEquals(ntcProps.get("table.group.lg1"), "dog"); assertEquals(ntcProps.get("table.groups.enabled"), "lg1"); Map<String,Set<Text>> createdLocalityGroups = conn.tableOperations().getLocalityGroups(tableName); assertEquals(1, createdLocalityGroups.size()); assertEquals(createdLocalityGroups.get("lg1"), ImmutableSet.of(new Text("dog"))); }

Target:
public void testSetPropertiesAndGroups() throws AccumuloSecurityException, AccumuloException, TableExistsException, TableNotFoundException { Connector conn = getConnector(); String tableName = getUniqueNames(2)[0]; NewTableConfiguration ntc = new NewTableConfiguration(); Map<String,String> props = new HashMap<>(); props.put(Property.TABLE_ARBITRARY_PROP_PREFIX.getKey() + "prop1", "val1"); props.put(Property.TABLE_ARBITRARY_PROP_PREFIX.getKey() + "prop2", "val2"); ntc.setProperties(props); Map<String,Set<Text>> lgroups = new HashMap<>(); lgroups.put("lg1", ImmutableSet.of(new Text("dog"))); ntc.setLocalityGroups(lgroups); conn.tableOperations().create(tableName, ntc); int count = 0; for (Entry<String,String> property : conn.tableOperations().getProperties(tableName)) { if (property.getKey().equals("table.group.lg1")) { assertEquals(property.getValue(), "dog"); count++; } if (property.getKey().equals("table.groups.enabled")) { assertEquals(property.getValue(), "lg1"); count++; } if (property.getKey().equals(Property.TABLE_ARBITRARY_PROP_PREFIX.getKey() + "prop1")) { assertEquals(property.getValue(), "val1"); count++; } if (property.getKey().equals(Property.TABLE_ARBITRARY_PROP_PREFIX.getKey() + "prop2")) { assertEquals(property.getValue(), "val2"); count++; } } assertEquals(4, count); Map<String,Set<Text>> createdLocalityGroups = conn.tableOperations().getLocalityGroups(tableName); assertEquals(1, createdLocalityGroups.size()); assertEquals(createdLocalityGroups.get("lg1"), ImmutableSet.of(new Text("dog"))); }
Source:
public void testCanDoAction() { expectGetStoragePool(STORAGE_POOL_ID); expectGetStorageDomain(STORAGE_DOMAIN_ID, STORAGE_POOL_ID, StorageDomainType.Data, StorageType.NFS); expectGetVds(VDS_ID); expectGetIsoMap(STORAGE_DOMAIN_ID); expectBusinessEntitySnapshotDAO(); RemoveStorageDomainCommand<RemoveStorageDomainParameters> cmd = createCommand(true); assertTrue(cmd.canDoAction()); checkSucceeded(cmd, false); cmd.setActionMessageParameters(); checkMessages(cmd, VdcBllMessages.VAR__TYPE__STORAGE__DOMAIN, VdcBllMessages.VAR__ACTION__REMOVE); }

Target:
public void testCanDoAction() { expectGetStoragePool(STORAGE_POOL_ID); expectGetStorageDomain(STORAGE_DOMAIN_ID, STORAGE_POOL_ID, StorageDomainType.Data, StorageType.NFS); expectGetVds(VDS_ID); expectGetIsoMap(STORAGE_DOMAIN_ID); expectBusinessEntitySnapshotDAO(); RemoveStorageDomainCommand<RemoveStorageDomainParameters> cmd = createCommand(true); assertTrue(cmd.canDoAction()); checkSucceeded(cmd, false); assertEquals("Wrong number of messages", 0, cmd.getReturnValue().getCanDoActionMessages().size()); }
Source:
RuntimeException map(ProcessingException e) { if (e.getCause() instanceof SSLException) { String sslExceptionMessage = e.getCause().getMessage(); if (sslExceptionMessage != null && sslExceptionMessage.contains("protocol_version")) { return new ConfigurationException( "Invalid TLS protocol version. This will typically happen if you're running on an older Java version, which doesn't support TLS 1.2. " + "Java 7 needs to be explicitly configured to support TLS 1.2. See 'JSSE tuning parameters' at " + "<LINK_0>", e); } } if (e.getCause() instanceof SSLHandshakeException) { return new SignatureException( "Unable to perform SSL handshake with remote server. Some possible causes (could be others, see underlying error): \n" + "* A certification with the wrong KeyUsage was used. Verify that the certificate's KeyUsage is compliant with the requirements for 2-way TLS. (E.g. KeyUsage should not be 'nonRepudiation')" + "* Erroneous configuration of the trust store\n" + "* Intermediate network devices interfering with traffic (e.g. proxies)\n" + "* An attacker impersonating the server (man in the middle)\n" + "* Wrong TLS version. For Java 7, see 'JSSE tuning parameters' at <LINK_1> for information about enabling the latest TLS versions", e); } return e; }

Target:
RuntimeException map(ProcessingException e) { if (e.getCause() instanceof SSLException) { String sslExceptionMessage = e.getCause().getMessage(); if (sslExceptionMessage != null && sslExceptionMessage.contains("protocol_version")) { return new ConfigurationException( "Invalid TLS protocol version. This will typically happen if you're running on an older Java version, which doesn't support TLS 1.2. " + "Java 7 needs to be explicitly configured to support TLS 1.2. See 'JSSE tuning parameters' at " + "<LINK_0>", e); } } if (e.getCause() instanceof SSLHandshakeException) { return new SignatureException( "Unable to perform SSL handshake with remote server. Some possible causes (could be others, see underlying error): \n" + "* A certificate with the wrong KeyUsage was used. Verify that the certificate's KeyUsage is compliant with the requirements for 2-way TLS. (E.g. KeyUsage should not be 'nonRepudiation')" + "* Erroneous configuration of the trust store\n" + "* Intermediate network devices interfering with traffic (e.g. proxies)\n" + "* An attacker impersonating the server (man in the middle)\n" + "* Wrong TLS version. For Java 7, see 'JSSE tuning parameters' at <LINK_1> for information about enabling the latest TLS versions", e); } return e; }
Source:
public static <T extends Oaf> JavaPairRDD<Text, Text> mapActionToText(JavaRDD<AtomicAction<T>> actions) { ObjectMapper objectMapper = new ObjectMapper(); return actions.mapToPair(action -> new Tuple2<>(new Text(""), new Text(serializeAction(action, objectMapper)))); }

Target:
public static <T extends Oaf> JavaPairRDD<Text, Text> mapActionToText(JavaRDD<AtomicAction<T>> actions) { return actions.mapToPair(action -> new Tuple2<>(emptyText, new Text(serializeAction(action, objectMapper)))); }
Source:
private boolean shouldCutPattern(int patternWidth, boolean isLeft) { return isLeft ? patternWidth > articleLeftSideX : patternWidth > viewPortWidth - articleRightSideX; }

Target:
private boolean shouldCutPattern(int patternWidth, boolean isLeft) { if (isLeft) { return patternWidth > articleLeftSideX; } else { return patternWidth > viewPortWidth - articleRightSideX; } }
Source:
public boolean remove(String id) { return this.id2descriptors.removeAll(id) != null; }

Target:
public boolean remove(String id) { return !this.id2descriptors.removeAll(id).isEmpty(); }
Source:
private void clickEditInstructorButton(int instrNum) { click(getEditInstructorButton(instrNum)); waitForPageToLoad(true); }

Target:
private void clickEditInstructorButton(int instrNum) { click(getEditInstructorButton(instrNum)); }
Source:
public void setNL(String nl) { incrementSequenceNumber(); fNL = nl; if (fRoot != null && nl != null && nl.length() > 0) { Element nlNode = TargetDefinitionDocumentTools.getChildElement(fRoot, TargetDefinitionPersistenceHelper.ENVIRONMENT, TargetDefinitionPersistenceHelper.NL); nlNode.setTextContent(nl); } else { removeElement(TargetDefinitionPersistenceHelper.ENVIRONMENT, TargetDefinitionPersistenceHelper.NL); } }

Target:
public void setNL(String nl) { incrementSequenceNumber(); fNL = nl; if (fRoot != null && nl != null && !nl.isEmpty()) { Element nlNode = TargetDefinitionDocumentTools.getChildElement(fRoot, TargetDefinitionPersistenceHelper.ENVIRONMENT, TargetDefinitionPersistenceHelper.NL); nlNode.setTextContent(nl); } else { removeElement(TargetDefinitionPersistenceHelper.ENVIRONMENT, TargetDefinitionPersistenceHelper.NL); } }
Source:
private Object ensureNoUnderflow(Object val) { if (val instanceof Double) { if (Math.abs((Double) val) <= 1.0e-131) { return ZERO; } } return val; }

Target:
private Object ensureNoUnderflow(Object val) { if (val instanceof Double && Math.abs((Double) val) <= 1.0e-131) { return ZERO; } return val; }
Source:
public void close() { long totalTimeMillis = currentTimeMillis() - startTime; String additionalInformation = getState( DataStatistics.class ).toString(); executionMonitor.done( totalTimeMillis, format( "%n%s%nPeak memory usage: %s", additionalInformation, bytes( peakMemoryUsage ) ) ); log.info( "Import completed successfully, took " + duration( totalTimeMillis ) + ". " + additionalInformation ); if ( nodeRelationshipCache != null ) { nodeRelationshipCache.close(); } if ( nodeLabelsCache != null ) { nodeLabelsCache.close(); } if ( idMapper != null ) { idMapper.close(); } inputCache.close(); }

Target:
public void close() throws IOException { long totalTimeMillis = currentTimeMillis() - startTime; String additionalInformation = getState( DataStatistics.class ).toString(); executionMonitor.done( totalTimeMillis, format( "%n%s%nPeak memory usage: %s", additionalInformation, bytes( peakMemoryUsage ) ) ); log.info( "Import completed successfully, took " + duration( totalTimeMillis ) + ". " + additionalInformation ); closeAll( nodeRelationshipCache, nodeLabelsCache, idMapper, inputCache ); }
Source:
protected static boolean compareLT(Object l, Object r) { if (l == null) { return false; } else if (!(l instanceof String || l instanceof Number && !(l instanceof Float))) { String msg = String.format("Value in document not a Number or String: %s", l); logger.log(Level.WARNING, msg); return false; } else if (l instanceof String) { if (r instanceof Number) { return false; } String lStr = (String) l; String rStr = (String) r; return lStr.compareTo(rStr) < 0; } else if (r instanceof String) { return true; } else { Number lNum = (Number) l; Number rNum = (Number) r; return lNum.longValue() < rNum.longValue(); } }

Target:
protected static boolean compareLT(Object l, Object r) { if (l == null || r == null) { return false; } else if (!(l instanceof String || l instanceof Number)) { String msg = String.format("Value in document not a Number or String: %s", l); logger.log(Level.WARNING, msg); return false; } else if (l instanceof String) { if (r instanceof Number) { return false; } String lStr = (String) l; String rStr = (String) r; return lStr.compareTo(rStr) < 0; } else if (r instanceof String) { return true; } else { Number lNum = (Number) l; Number rNum = (Number) r; if (l instanceof Float || r instanceof Float) { String msg = String.format("Value in comparison is a Float: %s, %s", l, r); logger.log(Level.WARNING, msg); return false; } else { return lNum.doubleValue() < rNum.doubleValue(); } } }
Source:
public void setEnableAcl(Boolean enableAcl) { this.enableAcl = enableAcl; }

Target:
public void setEnableAcl(Boolean enableAcl) { Preconditions.checkNotNull(enableAcl, "enableAcl"); this.enableAcl = enableAcl; }
Source:
public List<InputRow> parseInputRows(String line) throws IOException, ParseException { final Map<String, Object> zipped = parseLine(line); return Collections.singletonList( MapInputRowParser.parse( getInputRowSchema().getTimestampSpec(), getInputRowSchema().getDimensionsSpec(), zipped ) ); }

Target:
public List<InputRow> parseInputRows(String line) throws IOException, ParseException { final Map<String, Object> zipped = parseLine(line); return Collections.singletonList(MapInputRowParser.parse(getInputRowSchema(), zipped)); }
Source:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((getHost() == null) ? 0 : getHost().hashCode()); result = prime * result + ((getPort() == null) ? 0 : getPort().hashCode()); result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode()); result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode()); result = prime * result + (isUseAuthentication() ? 1231 : 1237); result = prime * result + (isUseSmtps() ? 1231 : 1237); result = prime * result + (isUseStartTls() ? 1231 : 1237); result = prime * result + ((getSslProtocols() == null) ? 0 : getSslProtocols().hashCode()); result = prime * result + ((getAdditionalSessionProperties() == null) ? 0 : getAdditionalSessionProperties().hashCode()); result = prime * result + m_poolSize; return result; }

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((m_additionalSessionProperties == null) ? 0 : m_additionalSessionProperties.hashCode()); result = prime * result + ((m_host == null) ? 0 : m_host.hashCode()); result = prime * result + ((m_password == null) ? 0 : m_password.hashCode()); result = prime * result + m_poolSize; result = prime * result + ((m_port == null) ? 0 : m_port.hashCode()); result = prime * result + ((m_sslProtocols == null) ? 0 : m_sslProtocols.hashCode()); result = prime * result + (m_useAuthentication ? 1231 : 1237); result = prime * result + (m_useSmtps ? 1231 : 1237); result = prime * result + (m_useStartTls ? 1231 : 1237); result = prime * result + ((m_username == null) ? 0 : m_username.hashCode()); return result; }
Source:
private static void registerClusteredLockManager(GlobalComponentRegistry registry, CompletableFuture<CacheHolder> future) { synchronized (registry) { ClusteredLockManager counterManager = registry.getComponent(ClusteredLockManager.class); if (counterManager == null || !(counterManager instanceof EmbeddedClusteredLockManager)) { counterManager = new EmbeddedClusteredLockManager(future); registry.registerComponent(counterManager, ClusteredLockManager.class); registry.getComponent(CacheManagerJmxRegistration.class).start(); } } }

Target:
private static void registerClusteredLockManager(GlobalComponentRegistry registry, CompletableFuture<CacheHolder> future) { synchronized (registry) { ClusteredLockManager clusteredLockManager = registry.getComponent(ClusteredLockManager.class); if (clusteredLockManager == null || !(clusteredLockManager instanceof EmbeddedClusteredLockManager)) { clusteredLockManager = new EmbeddedClusteredLockManager(future); registry.registerComponent(clusteredLockManager, ClusteredLockManager.class); registry.getComponent(CacheManagerJmxRegistration.class).start(); } } }
Source:
public static Type resolveType(Type type, Type contextType) { return resolveType((TypeVariable<? extends Class<?>>) type, contextType); }

Target:
public static Type resolveType(Type type, Type contextType) { return GenericTypeReflector.resolveType(type, contextType); }
Source:
private boolean cullCrop(ICrop crop, IFarmLogic provider) { for (IFarmListener listener : farmListeners) { if (listener.beforeCropHarvest(crop)) { return true; } } final int fertilizerConsumption = (int)(provider.getFertilizerConsumption() * Config.fertilizerModifier); IErrorLogic errorLogic = getErrorLogic(); Boolean hasFertilizer = fertilizerManager.hasFertilizer(inventory, fertilizerConsumption); if (errorLogic.setCondition(!hasFertilizer, EnumErrorCode.NO_FERTILIZER)) { return false; } float hydrationModifier = hydrationManager.getHydrationModifier(); int waterConsumption = provider.getWaterConsumption(hydrationModifier); FluidStack requiredLiquid = new FluidStack(FluidRegistry.WATER, waterConsumption); boolean hasLiquid = requiredLiquid.amount == 0 || hasLiquid(requiredLiquid); if (errorLogic.setCondition(!hasLiquid, EnumErrorCode.NO_LIQUID_FARM)) { return false; } NonNullList<ItemStack> harvested = crop.harvest(); if (harvested != null) { fertilizerManager.removeFertilizer(inventory, fertilizerConsumption); removeLiquid(requiredLiquid); for (IFarmListener listener : farmListeners) { listener.afterCropHarvest(harvested, crop); } inventory.stowHarvest(harvested, pendingProduce); } return true; }

Target:
private boolean cullCrop(ICrop crop, IFarmLogic provider) { for (IFarmListener listener : farmListeners) { if (listener.beforeCropHarvest(crop)) { return true; } } final int fertilizerConsumption = Math.round(provider.getFertilizerConsumption() * Config.fertilizerModifier); IErrorLogic errorLogic = getErrorLogic(); Boolean hasFertilizer = fertilizerManager.hasFertilizer(inventory, fertilizerConsumption); if (errorLogic.setCondition(!hasFertilizer, EnumErrorCode.NO_FERTILIZER)) { return false; } float hydrationModifier = hydrationManager.getHydrationModifier(); int waterConsumption = provider.getWaterConsumption(hydrationModifier); FluidStack requiredLiquid = new FluidStack(FluidRegistry.WATER, waterConsumption); boolean hasLiquid = requiredLiquid.amount == 0 || hasLiquid(requiredLiquid); if (errorLogic.setCondition(!hasLiquid, EnumErrorCode.NO_LIQUID_FARM)) { return false; } NonNullList<ItemStack> harvested = crop.harvest(); if (harvested != null) { fertilizerManager.removeFertilizer(inventory, fertilizerConsumption); removeLiquid(requiredLiquid); for (IFarmListener listener : farmListeners) { listener.afterCropHarvest(harvested, crop); } inventory.stowHarvest(harvested, pendingProduce); } return true; }
Source:
public Object visit(PropertyIsEqualTo filter, Object data) { LOGGER.trace("ENTERING: PropertyIsEqualTo filter"); OpenSearchFilterVisitorObject openSearchFilterVisitorObject = getOpenSearchFilterVisitorObjectFromData(data); if (openSearchFilterVisitorObject == null) { return data; } if (openSearchFilterVisitorObject.getCurrentNest() != NestedTypes.NOT) { final Expression expression1 = filter.getExpression1(); if (expression1 instanceof PropertyName) { final String propertyName = ((PropertyName) expression1).getPropertyName(); final String expectedPropertyIsEqualToTerm = Metacard.ID; if (StringUtils.equals(expectedPropertyIsEqualToTerm, propertyName)) { final Expression expression2 = filter.getExpression2(); if (expression2 instanceof Literal) { openSearchFilterVisitorObject.setId((String) ((Literal) expression2).getValue()); } } else { LOGGER.debug( "The OpenSearch Source only supports PropertyIsEqualTo criteria on the term \"{}\", but the property name is \"{}\". Ignoring filter.", expectedPropertyIsEqualToTerm, propertyName); } } } LOGGER.trace("EXITING: PropertyIsEqualTo filter"); return super.visit(filter, data); }

Target:
public Object visit(PropertyIsEqualTo filter, Object data) { LOGGER.trace("ENTERING: PropertyIsEqualTo filter"); OpenSearchFilterVisitorObject openSearchFilterVisitorObject = getOpenSearchFilterVisitorObjectFromData(data); if (openSearchFilterVisitorObject == null) { return data; } if (openSearchFilterVisitorObject.getCurrentNest() != NestedTypes.NOT) { final Expression expression1 = filter.getExpression1(); if (expression1 instanceof PropertyName) { final String propertyName = ((PropertyName) expression1).getPropertyName(); final String expectedPropertyIsEqualToTerm = Metacard.ID; if (expectedPropertyIsEqualToTerm.equals(propertyName)) { final Expression expression2 = filter.getExpression2(); if (expression2 instanceof Literal) { openSearchFilterVisitorObject.setId((String) ((Literal) expression2).getValue()); } } else { LOGGER.debug( "The OpenSearch Source only supports PropertyIsEqualTo criteria on the term \"{}\", but the property name is \"{}\". Ignoring filter.", expectedPropertyIsEqualToTerm, propertyName); } } } LOGGER.trace("EXITING: PropertyIsEqualTo filter"); return super.visit(filter, data); }
Source:
public static Archive createDeplyoment() { final EnterpriseArchive ear = create(EnterpriseArchive.class, "ear-with-rar.ear") .addAsModule(create(JavaArchive.class, "telnet-ra.rar") .addAsManifestResource(TelnetResourceAdapter.class.getPackage(), "ra.xml", "ra.xml") .addPackages(true, TelnetResourceAdapter.class.getPackage(), TelnetListener.class.getPackage(), TelnetServer.class.getPackage())) .addAsModule(create(JavaArchive.class, "mdb.jar") .addClasses(MyMdb.class)); ear.addAsManifestResource(createPermissionsXmlAsset( new PropertyPermission("*", "read,write"), new RuntimePermission("accessDeclaredMembers"), new RuntimePermission("defineClassInPackage." + MyMdb.class.getPackage().getName()), new RuntimePermission("getClassLoader"), new SocketPermission(Utils.getDefaultHost(true), "accept,listen"), new SocketPermission("localhost", "listen")), "permissions.xml"); return ear; }

Target:
public static Archive createDeplyoment() { final EnterpriseArchive ear = create(EnterpriseArchive.class, "ear-with-rar.ear") .addAsModule(create(JavaArchive.class, "telnet-ra.rar") .addAsManifestResource(TelnetResourceAdapter.class.getPackage(), "ra.xml", "ra.xml") .addPackages(true, TelnetResourceAdapter.class.getPackage(), TelnetListener.class.getPackage(), TelnetServer.class.getPackage())) .addAsModule(create(JavaArchive.class, "mdb.jar") .addClasses(MyMdb.class)); ear.addAsManifestResource(createPermissionsXmlAsset( new PropertyPermission("*", "read,write"), new RuntimePermission("accessDeclaredMembers"), new RuntimePermission("defineClassInPackage." + MyMdb.class.getPackage().getName()), new RuntimePermission("getClassLoader"), new SocketPermission("*", "accept,listen")), "permissions.xml"); return ear; }
Source:
public void validate(Object object, Errors errors) { ReportData data = (ReportData)object; if (data.getLocalDate() != null && data.getDateTime() != null) { errors.reject("must include a localDate or dateTime, but not both"); } else if (data.getLocalDate() == null && data.getDateTime() == null) { errors.reject("must include a localDate or dateTime"); } if (data.getData() == null) { errors.rejectValue("data", "is required"); } if (existingSubstudies != null && data.getSubstudyIds() != null) { Set<String> diff = Sets.symmetricDifference(existingSubstudies, data.getSubstudyIds()); if (!diff.isEmpty()) { errors.rejectValue("substudyIds", "cannot be changed once created for a report"); } } ReportDataKey key = data.getReportDataKey(); if (key == null) { errors.rejectValue("key", "is required"); } else { ReportDataKeyValidator.INSTANCE.validate(key, errors); } }

Target:
public void validate(Object object, Errors errors) { ReportData data = (ReportData)object; if (data.getLocalDate() != null && data.getDateTime() != null) { errors.reject("must include a localDate or dateTime, but not both"); } else if (data.getLocalDate() == null && data.getDateTime() == null) { errors.reject("must include a localDate or dateTime"); } if (data.getData() == null) { errors.rejectValue("data", "is required"); } if (existingSubstudies != null && data.getSubstudyIds() != null) { if (!existingSubstudies.equals(data.getSubstudyIds())) { errors.rejectValue("substudyIds", "cannot be changed once created for a report"); } } ReportDataKey key = data.getReportDataKey(); if (key == null) { errors.rejectValue("key", "is required"); } else { ReportDataKeyValidator.INSTANCE.validate(key, errors); } }
Source:
public boolean canPlaceAt(GlowBlock block, BlockFace against) { return !block.getRelative(BlockFace.DOWN).isEmpty(); }

Target:
public boolean canPlaceAt(GlowBlock block, BlockFace against) { return block.getWorld().getBlockTypeIdAt(block.getX(), block.getY() - 1, block.getZ()) != Material.AIR.getId(); }
Source:
public void expectRedWhenReadingValueIs210WithNoPreferredRange() { reading = 410; assertEquals(glucoseRanges.colorFromReading(reading), "red"); }

Target:
public void expectRedWhenReadingValueIs210WithNoPreferredRange() { assertEquals(glucoseRanges.colorFromReading(410), "red"); }
Source:
@Override public void run() { try { Thread.currentThread().setName(Utils.THREAD_PREFIX + data.getName()); result = hunt(); if (result == null) { dispatcher.dispatchFailed(this); } else { dispatcher.dispatchComplete(this); } } catch (OutOfMemoryError e) { result = null; dispatcher.dispatchFailed(this); throw(e); } catch (IOException e) { exception = e; dispatcher.dispatchRetry(this); } finally { Thread.currentThread().setName(Utils.THREAD_IDLE_NAME); } }

Target:
@Override public void run() { try { Thread.currentThread().setName(Utils.THREAD_PREFIX + data.getName()); result = hunt(); if (result == null) { dispatcher.dispatchFailed(this); } else { dispatcher.dispatchComplete(this); } } catch (OutOfMemoryError e) { result = null; dispatcher.dispatchFailed(this); throw e; } catch (IOException e) { exception = e; dispatcher.dispatchRetry(this); } finally { Thread.currentThread().setName(Utils.THREAD_IDLE_NAME); } }
Source:
private VmPropertiesUtils mockVmPropertiesUtils() throws InitializationException { VmPropertiesUtils utils = spy(new VmPropertiesUtils()); doReturn("sap_agent=^(true|false)$;sndbuf=^[0-9]+$;" + "vhost=^(([a-zA-Z0-9_]*):(true|false))(,(([a-zA-Z0-9_]*):(true|false)))*$;" + "viodiskcache=^(none|writeback|writethrough)$;" + "mdev_type=^.*$;hugepages=^(true|false)|([0-9]+)$;hugepagesz=^[0-9]+$"). when(utils) .getPredefinedVMProperties(any(Version.class)); doReturn(""). when(utils) .getUserdefinedVMProperties(any(Version.class)); doReturn(new HashSet<>(Arrays.asList(Version.v3_6, Version.v4_0))). when(utils) .getSupportedClusterLevels(); doReturn(utils).when(runVmValidator).getVmPropertiesUtils(); utils.init(); return utils; }

Target:
private VmPropertiesUtils mockVmPropertiesUtils() throws InitializationException { VmPropertiesUtils utils = spy(new VmPropertiesUtils()); doReturn("sap_agent=^(true|false)$;sndbuf=^[0-9]+$;" + "vhost=^(([a-zA-Z0-9_]*):(true|false))(,(([a-zA-Z0-9_]*):(true|false)))*$;" + "viodiskcache=^(none|writeback|writethrough)$;" + "mdev_type=^.*$;hugepages=^[0-9]+$"). when(utils) .getPredefinedVMProperties(any(Version.class)); doReturn(""). when(utils) .getUserdefinedVMProperties(any(Version.class)); doReturn(new HashSet<>(Arrays.asList(Version.v3_6, Version.v4_0))). when(utils) .getSupportedClusterLevels(); doReturn(utils).when(runVmValidator).getVmPropertiesUtils(); utils.init(); return utils; }
Source:
public int run(String[] args) { initJCommander(); try { parseParams(jc, args); if (help) { printUsage(null); return EXIT_CODE_OK; } if (debug) { initializeDebugLogging(); } if (jc.getParsedCommand() == null) { return handleNoCommand(); } if (!commands.containsKey(jc.getParsedCommand())) { LOGGER.error("Unknown command: " + jc.getParsedCommand()); return EXIT_CODE_ERR; } Command parsedCommand = commands.get(jc.getParsedCommand()); if (CommandHelp.CLINAME.equals(parsedCommand.getName())) { printUsage(null); } else { if (parsedCommand.validateParameters()) { parsedCommand.execute(); } else { printUsage(jc.getParsedCommand()); return EXIT_CODE_ERR; } } return EXIT_CODE_OK; } catch (Exception ex) { return EXIT_CODE_ERR; } }

Target:
public int run(String[] args) { initJCommander(); try { parseParams(jc, args); if (help) { printUsage(null); return EXIT_CODE_OK; } if (debug) { initializeDebugLogging(); } if (jc.getParsedCommand() == null) { return handleNoCommand(); } if (!commands.containsKey(jc.getParsedCommand())) { LOGGER.error("Unknown command: " + jc.getParsedCommand()); return EXIT_CODE_ERR; } Command parsedCommand = commands.get(jc.getParsedCommand()); if (CommandHelp.CLINAME.equals(parsedCommand.getName())) { printUsage(null); } else { if (parsedCommand.validateParameters()) { parsedCommand.execute(); } else { printUsage(jc.getParsedCommand()); return EXIT_CODE_ERR; } } return EXIT_CODE_OK; } catch (Exception ex) { LOGGER.debug("Exception while processing", ex); return EXIT_CODE_ERR; } }
Source:
private Intent getSortType() { Spinner sort_type_spinner = (Spinner) findViewById(R.id.sort_type_spinner); String sort_type = sort_type_spinner.getSelectedItem().toString(); Spinner sort_time_spinner = (Spinner) findViewById(R.id.sort_time_spinner); String sort_time = sort_time_spinner.getSelectedItem().toString(); adapter = ExpenseClaimListActivity.getAdapter(); claims = ExpenseClaimListActivity.getClaims(); String type1 = "Date of Travel"; String type2 = "Order of Entry"; String time1 = "Ascending"; if (type1.equals(sort_type)) { if (time1.equals(sort_time)) { Collections.sort(claims, new StartDateAscendingComparator()); commitClaimsMutation(); } else { Collections.sort(claims, new StartDateDescendingComparator()); commitClaimsMutation(); } } else if (type2.equals(sort_type)) { if (time1.equals(sort_time)) { Collections.sort(claims, new CreationDateAscendingComparator()); commitClaimsMutation(); } else { Collections.sort(claims, new CreationDateDescendingComparator()); commitClaimsMutation(); } } Intent intent = new Intent(); return intent; }

Target:
private Intent getSortType() { Spinner sortTypeSpinner = (Spinner)findViewById(R.id.sort_type_spinner); String sortType = sortTypeSpinner.getSelectedItem().toString(); Spinner sortOrderSpinner = (Spinner) findViewById(R.id.sort_order_spinner); String sortOrder = sortOrderSpinner.getSelectedItem().toString(); String type1 = "Date of Travel"; String type2 = "Order of Entry"; String time1 = "Ascending"; Intent intent = new Intent(); if (type1.equals(sortType)) { if (time1.equals(sortOrder)) { intent.putExtra(EXPENSE_CLAIM_SORT, new StartDateAscendingComparator()); } else { intent.putExtra(EXPENSE_CLAIM_SORT, new StartDateDescendingComparator()); } } else if (type2.equals(sortType)) { if (time1.equals(sortOrder)) { intent.putExtra(EXPENSE_CLAIM_SORT, new CreationDateAscendingComparator()); } else { intent.putExtra(EXPENSE_CLAIM_SORT, new CreationDateDescendingComparator()); } } return intent; }
Source:
public String getPrintString(IAdaptable element, int flags) { StereotypeDisplayHelper helper = StereotypeDisplayHelper.getInstance(); if (element instanceof IAdaptable) { final Property property = ((Property) (EMFHelper.getEObject(element))); final View view = ((View) element.getAdapter(View.class)); StereotypeLocationEnum location; if (helper.isInStereotypeComment((Node) view)) { location = StereotypeLocationEnum.IN_COMMENT_COMPARTMENT; } else { location = StereotypeLocationEnum.IN_COMPARTMENT; } if (view != null && property != null) { return helper.getStereotypePropertyToDisplay(view, property, location); } } return "<UNDEFINED>"; }

Target:
public String getPrintString(IAdaptable element, int flags) { StereotypeDisplayHelper helper = StereotypeDisplayHelper.getInstance(); if (element instanceof IAdaptable) { final Property property = ((Property) (EMFHelper.getEObject(element))); final View view = ((View) element.getAdapter(View.class)); StereotypeLocationEnum location; if (helper.isInStereotypeComment((Node) view)) { location = StereotypeLocationEnum.IN_COMMENT_COMPARTMENT; } else { location = StereotypeLocationEnum.IN_COMPARTMENT; } if (view != null && property != null) { return helper.getStereotypePropertyToDisplay(view, property, location); } } return DEFAULT_VALUE; }
Source:
public Object parse(final StaplerRequest request, final StringBodyParameter a, final Class type, final String parameterName) throws ServletException { final String contentType = request.getContentType(); if ("application/json".equals(contentType)) { try { return IOUtils.toString(request.getInputStream(), Charsets.UTF_8); } catch (final IOException e) { LOGGER.log(Level.SEVERE, "Unable to obtain request body: {}", e.getMessage()); } } else if ("application/x-www-form-urlencoded".equals(contentType)) { return request.getParameter(parameterName); } return null; }

Target:
public Object parse(final StaplerRequest request, final StringBodyParameter a, final Class type, final String parameterName) throws ServletException { final String rawContentType = request.getContentType(); final String contentType = StringHelper.determineContentTypeWithoutCharset(rawContentType); if (MediaType.APPLICATION_JSON.equals(contentType)) { final String characterEncoding = request.getCharacterEncoding(); try { return IOUtils.toString(request.getInputStream(), characterEncoding); } catch (final IOException e) { LOGGER.log(Level.SEVERE, "Unable to obtain request body: {}", e.getMessage()); } } else if (MediaType.APPLICATION_FORM_URLENCODED.equals(contentType)) { return request.getParameter(parameterName); } return null; }
Source:
public ReplicaSetConfig member(String hostname, Integer port, Integer id) { if (members.size() == MAXIMUM_REPLICA_SET_SIZE) { throw new IllegalStateException(String.format( "Replica set exceeds maximum size of with addition of member at {}:{}", new Object[]{name, MAXIMUM_REPLICA_SET_SIZE, hostname, port})); } BasicBSONObject member = new BasicBSONObject(); member.put("_id", id); member.put("host", String.format("%s:%s", hostname, port)); if (members.contains(member)) { LOG.warn("Ignoring attempt to add entity to a set of which it is already a member"); return this; } members.add(member); return this; }

Target:
public ReplicaSetConfig member(String hostname, Integer port, Integer id) { if (members.size() == MAXIMUM_REPLICA_SET_SIZE) { throw new IllegalStateException(String.format( "Replica set exceeds maximum size of with addition of member at {}:{}", new Object[]{name, MAXIMUM_REPLICA_SET_SIZE, hostname, port})); } BasicBSONObject member = new BasicBSONObject(); member.put("_id", id); member.put("host", String.format("%s:%s", hostname, port)); members.add(member); return this; }
Source:
public ConnectionConfiguration(SSLContextFactory sslContextFactory) { this.sslContextFactory = sslContextFactory; brokerHosts = new ArrayList<>(); username = "guest"; password = "guest"; this.connectTimeout = DEFAULT_CONNECT_TIMEOUT_IN_MS; this.requestedConnectionHeartbeatTimeout = DEFAULT_CONNECTION_HEARTBEAT_TIMEOUT_IN_SEC; this.connectRetryWaitTime = DEFAULT_WAIT_TIME_RETRY_CONNECT_IN_MS; this.failedConsumerActivationRetryTime = DEFAULT_WAIT_TIME_RETRY_ACTIVATE_CONSUMER_IN_MS; }

Target:
ConnectionConfiguration(SSLContextFactory sslContextFactory) { this.sslContextFactory = sslContextFactory; brokerHosts = new ArrayList<>(); username = "guest"; password = "guest"; this.connectTimeout = DEFAULT_CONNECT_TIMEOUT_IN_MS; this.requestedConnectionHeartbeatTimeout = DEFAULT_CONNECTION_HEARTBEAT_TIMEOUT_IN_SEC; this.connectRetryWaitTime = DEFAULT_WAIT_TIME_RETRY_CONNECT_IN_MS; this.failedConsumerActivationRetryTime = DEFAULT_WAIT_TIME_RETRY_ACTIVATE_CONSUMER_IN_MS; }
Source:
public static int execute(List<String> command) throws Exception { logger.info(command.toString()); ProcessBuilder builder = new ProcessBuilder(command); builder.redirectErrorStream(true); final Process process = builder.start(); StringBuilder bashLog = new StringBuilder(); try ( InputStream is = process.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr) ) { String line; while ((line = br.readLine()) != null) { logger.info(line); bashLog.append(line); } process.waitFor(); if (process.exitValue() != 0) { bashLog.append(command.toString()); throw new NetCdfProcessingException(bashLog.toString()); } return process.exitValue(); } catch (InterruptedException e) { logger.error(String.format("Interrupted: '%s'", e.getMessage())); throw e; } catch (NetCdfProcessingException e) { logger.error(String.format("NetCdf Tool Error: '%s'", e.getMessage())); throw e; } }

Target:
public static int execute(List<String> command) throws Exception { logger.info(command.toString()); ProcessBuilder builder = new ProcessBuilder(command); builder.redirectErrorStream(true); final Process process = builder.start(); StringBuilder bashLog = new StringBuilder(); try ( InputStream is = process.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr) ) { String line; while ((line = br.readLine()) != null) { logger.info(line); bashLog.append(line); } process.waitFor(); if (process.exitValue() != 0) { bashLog.append(command.toString()); throw new NetCdfProcessingException(bashLog.toString()); } return process.exitValue(); } catch (InterruptedException e) { logger.error(String.format("Interrupted: '%s'", e.getMessage()), e); throw e; } catch (NetCdfProcessingException e) { logger.error(String.format("NetCdf Tool Error: '%s'", e.getMessage()), e); throw e; } }
Source:
public void uploadFile(AbstractBackupPath path, InputStream in, long chunkSize) throws BackupRestoreException { if (path.getSize() < chunkSize) { if (logger.isDebugEnabled()) logger.debug("Uploading file using put: {}", path.getRemotePath()); try { byte[] chunk = compress.compress(in); rateLimiter.acquire(chunk.length); ObjectMetadata objectMetadata = new ObjectMetadata(); objectMetadata.setContentLength(chunk.length); PutObjectRequest putObjectRequest = new PutObjectRequest(config.getBackupPrefix(), path.getRemotePath(), new ByteArrayInputStream(chunk), objectMetadata); PutObjectResult upload = new BoundedExponentialRetryCallable<PutObjectResult>() { @Override public PutObjectResult retriableCall() throws Exception { return s3Client.putObject(putObjectRequest); } }.retriableCall(); bytesUploaded.addAndGet(chunk.length); if (logger.isDebugEnabled()) logger.debug("Successfully uploaded file with putObject: and etag: {}", path.getRemotePath(), upload.getETag()); }catch (Exception e) { throw encounterError(path, e); } finally { IOUtils.closeQuietly(in); } }else uploadMultipart(path, in, chunkSize); }

Target:
public void uploadFile(AbstractBackupPath path, InputStream in, long chunkSize) throws BackupRestoreException { if (path.getSize() < chunkSize) { if (logger.isDebugEnabled()) logger.debug("Uploading file using put: {}", path.getRemotePath()); try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) { Iterator<byte[]> chunkedStream = compress.compress(in, chunkSize); while (chunkedStream.hasNext()) { byteArrayOutputStream.write(chunkedStream.next()); } byte[] chunk = byteArrayOutputStream.toByteArray(); rateLimiter.acquire(chunk.length); ObjectMetadata objectMetadata = new ObjectMetadata(); objectMetadata.setContentLength(chunk.length); PutObjectRequest putObjectRequest = new PutObjectRequest(config.getBackupPrefix(), path.getRemotePath(), new ByteArrayInputStream(chunk), objectMetadata); PutObjectResult upload = new BoundedExponentialRetryCallable<PutObjectResult>() { @Override public PutObjectResult retriableCall() throws Exception { return s3Client.putObject(putObjectRequest); } }.retriableCall(); bytesUploaded.addAndGet(chunk.length); if (logger.isDebugEnabled()) logger.debug("Successfully uploaded file with putObject: and etag: {}", path.getRemotePath(), upload.getETag()); } catch (Exception e) { throw encounterError(path, e); } finally { IOUtils.closeQuietly(in); } } else uploadMultipart(path, in, chunkSize); }
Source:
public void addOrder(Order order, Integer position) { if (order == null || getOrders().contains(order)) return; position = position == null ? getOrders().size() : position - 1; getOrders().add(position, order); if (order.getSortWeight() == null) order.setSortWeight(findSortWeight(position)); }

Target:
public void addOrder(Order order, Integer position) { if (order == null || getOrders().contains(order)) { return; } Integer listIndex = findListIndexForGivenPosition(position); getOrders().add(listIndex, order); if (order.getSortWeight() == null) { order.setSortWeight(findSortWeight(listIndex)); } }
Source:
protected void setClampHeight(float value) throws AutonomousModeOverException, InterruptedException { Clamp.heightOrSpeed.set(value); waitUntil(FloatMixing.floatIsInRange(Clamp.heightReadout, value - clampHeightPadding.get(), value + clampHeightPadding.get())); }

Target:
protected void setClampHeight(float value) throws AutonomousModeOverException, InterruptedException { Clamp.mode.set(false); Clamp.heightOrSpeed.set(value); waitUntil(FloatMixing.floatIsInRange(Clamp.heightReadout, value - clampHeightPadding.get(), value + clampHeightPadding.get())); }
Source:
protected @NonNull List<@NonNull TmfTreeDataModel> getTree(@NonNull ITmfStateSystem ss, @NonNull TimeQueryFilter filter, @Nullable IProgressMonitor monitor) throws StateSystemDisposedException { List<@NonNull Integer> attribs = ss.getSubAttributes(ITmfStateSystem.ROOT_ATTRIBUTE, false); List<@NonNull TmfTreeDataModel> retVal = new ArrayList<>(); for (Integer attrib : attribs) { String[] strings = fCache.computeIfAbsent(attrib, t -> ss.getFullAttributePathArray(t)); retVal.add(new TmfTreeDataModel(getId(attrib), getId(ITmfStateSystem.ROOT_ATTRIBUTE), strings[0])); } return retVal; }

Target:
protected @NonNull List<@NonNull TimeGraphEntryModel> getTree(@NonNull ITmfStateSystem ss, @NonNull TimeQueryFilter filter, @Nullable IProgressMonitor monitor) throws StateSystemDisposedException { long rootId = getId(ITmfStateSystem.ROOT_ATTRIBUTE); List<@NonNull Integer> attribs = ss.getSubAttributes(ITmfStateSystem.ROOT_ATTRIBUTE, false); List<@NonNull TimeGraphEntryModel> retVal = new ArrayList<>(); for (Integer attrib : attribs) { String[] strings = ss.getFullAttributePathArray(attrib); retVal.add(new TimeGraphEntryModel(getId(attrib), rootId, strings[0], ss.getStartTime(), ss.getCurrentEndTime())); } return retVal; }
Source:
public List<VDS> filter(List<VDS> hosts, VM vm, Map<String, String> parameters, List<String> messages) { if (vm.isHostedEngine()) { List<VDS> hostsToRunOn = new ArrayList<VDS>(); for (VDS host : hosts) { if (host.getDynamicData().getHighlyAvailableScore() != 0 ) { hostsToRunOn.add(host); log.debugFormat("Host {0} wasn't filtered out as it has a score of {1}", host.getName(), host.getDynamicData().getHighlyAvailableScore()); } else { log.debugFormat("Host {0} was filtered out as it doesn't have a positive score", host.getName()); } } if (hostsToRunOn.isEmpty()) { messages.add(VdcBllMessages.ACTION_TYPE_FAILED_NO_HA_VDS.toString()); } return hostsToRunOn; } else { return hosts; } }

Target:
public List<VDS> filter(List<VDS> hosts, VM vm, Map<String, String> parameters, List<String> messages) { if (vm.isHostedEngine()) { List<VDS> hostsToRunOn = new ArrayList<VDS>(); for (VDS host : hosts) { int haScore = host.getDynamicData().getHighlyAvailableScore(); if (haScore > 0) { hostsToRunOn.add(host); log.debugFormat("Host {0} wasn't filtered out as it has a score of {1}", host.getName(), haScore); } else { log.debugFormat("Host {0} was filtered out as it doesn't have a positive score (the score is {1})", host.getName(), haScore); } } if (hostsToRunOn.isEmpty()) { messages.add(VdcBllMessages.ACTION_TYPE_FAILED_NO_HA_VDS.name()); } return hostsToRunOn; } else { return hosts; } }