auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static Asset persistenceXml() { PersistenceDescriptor persistenceXml = Descriptors.create( PersistenceDescriptor.class ) .version( "2.1" ) .createPersistenceUnit() .name( "primary" ) .transactionType( PersistenceUnitTransactionType._JTA ) .jtaDataSource( "java:jboss/datasources/ExampleDS" ) .getOrCreateProperties() .createProperty().name( "jboss.as.jpa.providerModule" ).value( "org.hibernate:" + ORM_MINOR_VERSION ).up() .createProperty().name( "hibernate.hbm2ddl.auto" ).value( "create-drop" ).up() .createProperty().name( "hibernate.allow_update_outside_transaction" ).value( "true" ).up() <START> .createProperty().name( AvailableSettings.BYTECODE_PROVIDER ).name( Environment.BYTECODE_PROVIDER_NAME_JAVASSIST ).up() <END> .up().up(); return new StringAsset( persistenceXml.exportAsString() ); }</code><technical_language>set BYTECODE_PROVIDER this way? This property is read system properties Hibernate ORM classes initialized. noticed below, test is setting in a way. suggest Arquillian capability set JVM properties</technical_language>

Target:
private static Asset persistenceXml() { PersistenceDescriptor persistenceXml = Descriptors.create( PersistenceDescriptor.class ) .version( "2.1" ) .createPersistenceUnit() .name( "primary" ) .transactionType( PersistenceUnitTransactionType._JTA ) .jtaDataSource( "java:jboss/datasources/ExampleDS" ) .getOrCreateProperties() .createProperty().name( "jboss.as.jpa.providerModule" ).value( "org.hibernate:" + ORM_MINOR_VERSION ).up() .createProperty().name( "hibernate.hbm2ddl.auto" ).value( "create-drop" ).up() .createProperty().name( "hibernate.allow_update_outside_transaction" ).value( "true" ).up() .up().up(); return new StringAsset( persistenceXml.exportAsString() ); }
Source:
<code>private void fetchValueBeforeComparisonIfNeeded( JavassistEnhancementContext context, CtClass managedCtClass, CtField currentValue, StringBuilder builder) { if ( PersistentAttributesHelper.isAssignable( managedCtClass, PersistentAttributeInterceptable.class.getName() ) && context.isLazyLoadable( currentValue ) ) { builder.append( String.format( " if( $1 == null " + " && %1$s != null " + " && %1$s instanceof %2$s " + " && !((%2$s) %1$s).isAttributeLoaded(\"%3$s\") ) ", EnhancerConstants.INTERCEPTOR_FIELD_NAME, LazyAttributeLoadingInterceptor.class.getName(), currentValue.getName() ) ); builder.append( String.format( <START> " { get%s(); }", <END> currentValue.getName() .substring( 0, 1 ) .toUpperCase() + currentValue.getName().substring( 1 ) ) ); } }</code><technical_language>I getter logic is extremely robust. For instance, if property is a boolean type, getter follow pattern of 'is%s'. is existing stuff borrowed from, I noticed is similiar in ByteBuddyEnhancementContext#resolveGetter(FieldDescription). HIH</technical_language>

Target:
private void fetchValueBeforeComparisonIfNeeded( JavassistEnhancementContext context, CtClass managedCtClass, CtField currentValue, StringBuilder builder) { if ( PersistentAttributesHelper.isAssignable( managedCtClass, PersistentAttributeInterceptable.class.getName() ) && context.isLazyLoadable( currentValue ) ) { builder.append( String.format( " if( $1 == null " + " && %1$s != null " + " && %1$s instanceof %2$s " + " && !((%2$s) %1$s).isAttributeLoaded(\"%3$s\") ) ", EnhancerConstants.INTERCEPTOR_FIELD_NAME, LazyAttributeLoadingInterceptor.class.getName(), currentValue.getName() ) ); CtMethod getterMethod = PersistentAttributesHelper.findGetterOrNull( managedCtClass, currentValue.getName() ); builder.append( String.format( " { %s(); }", getterMethod.getName() ) ); } }
Source:
<code>public static StreamDefinition constructStreamDefinition(String syncId, org.wso2.carbon.databridge.commons.StreamDefinition inStreamDefinition){ org.wso2.siddhi.query.api.definition.StreamDefinition streamDefinition = new org.wso2.siddhi.query.api.definition.StreamDefinition(); streamDefinition.setId(syncId); List<Attribute> attributes = new ArrayList<Attribute>(); if (inStreamDefinition.getMetaData() != null) { for (Attribute attr : inStreamDefinition.getMetaData()) { <START> attributes.add(new Attribute("meta_" + attr.getName(), attr.getType())); <END> } } if (inStreamDefinition.getCorrelationData() != null) { for (Attribute attr : inStreamDefinition.getCorrelationData()) { attributes.add(new Attribute("correlation_" + attr.getName(), attr.getType())); } } if (inStreamDefinition.getPayloadData() != null) { attributes.addAll(inStreamDefinition.getPayloadData()); } for (Attribute attr : attributes) { streamDefinition.attribute(attr.getName(), org.wso2.siddhi.query.api.definition.Attribute.Type.valueOf(attr.getType().toString())); } return streamDefinition; }</code><technical_language>@grainier change string constants refer constant here? exist some of constants in components</technical_language>

Target:
public static StreamDefinition constructStreamDefinition(String syncId, org.wso2.carbon.databridge.commons.StreamDefinition inStreamDefinition) { org.wso2.siddhi.query.api.definition.StreamDefinition streamDefinition = new org.wso2.siddhi.query.api.definition.StreamDefinition(); streamDefinition.setId(syncId); List<Attribute> attributes = new ArrayList<Attribute>(); if (inStreamDefinition.getMetaData() != null) { for (Attribute attr : inStreamDefinition.getMetaData()) { attributes.add(new Attribute(ConfigurationConstants.PROPERTY_META_PREFIX + attr.getName(), attr.getType())); } } if (inStreamDefinition.getCorrelationData() != null) { for (Attribute attr : inStreamDefinition.getCorrelationData()) { attributes.add(new Attribute(ConfigurationConstants.PROPERTY_CORRELATION_PREFIX + attr.getName(), attr.getType())); } } if (inStreamDefinition.getPayloadData() != null) { attributes.addAll(inStreamDefinition.getPayloadData()); } for (Attribute attr : attributes) { streamDefinition.attribute(attr.getName(), org.wso2.siddhi.query.api.definition.Attribute.Type.valueOf(attr.getType().toString())); } return streamDefinition; }
Source:
<code>public ActivityController<T> visible() { shadowMainLooper.runPaused(new Runnable() { @Override public void run() { ReflectionHelpers.setField(component, "mDecor", component.getWindow().getDecorView()); ReflectionHelpers.callInstanceMethod(component, "makeVisible"); } }); ViewRootImpl root = component.getWindow().getDecorView().getViewRootImpl(); ShadowViewRootImpl shadow = (ShadowViewRootImpl) ShadowExtractor.extract(root); Display display = Shadow.newInstanceOf(Display.class); ShadowDisplay shadowDisplay = Shadows.shadowOf(display); Rect frame = new Rect(0, 0, shadowDisplay.getWidth(), shadowDisplay.getHeight()); Rect insets = new Rect(0, 0, 0, 0); <START> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { <END> shadow.dispatchResized(frame, insets, insets, insets, insets, true, null); } else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN_MR2){ shadow.dispatchResized(frame, insets, insets, insets, true, null); } else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN_MR1) { shadow.dispatchResized(frame, insets, insets, true, null); } else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN) { shadow.dispatchResized(frame.width(), frame.height(), insets, insets, true, null); } return this; }</code><technical_language>pattern in place is:- <LINK_0> add a method callViewRootImplDispatchResized - @erd - thoughts</technical_language>

Target:
public ActivityController<T> visible() { shadowMainLooper.runPaused(new Runnable() { @Override public void run() { ReflectionHelpers.setField(component, "mDecor", component.getWindow().getDecorView()); ReflectionHelpers.callInstanceMethod(component, "makeVisible"); } }); ViewRootImpl root = component.getWindow().getDecorView().getViewRootImpl(); Display display = Shadow.newInstanceOf(Display.class); Rect frame = new Rect(); display.getRectSize(frame); Rect insets = new Rect(0, 0, 0, 0); final RuntimeAdapter runtimeAdapter = RuntimeAdapterFactory.getInstance(); runtimeAdapter.callViewRootImplDispatchResized( root, frame, insets, insets, insets, insets, insets, true, null); return this; }
Source:
<code>public ReviewerResult call() throws Exception { ReviewerResult result = new ReviewerResult(); <START> List<Account.Id> accounts = Lists.newArrayList(); <END> Iterable<PatchSetApproval> patchSets = db.patchSetApprovals().byChange(changeId); List<PatchSetApproval> toDelete = Lists.newArrayList(); for (PatchSetApproval psa : patchSets) { if (psa.getAccountId().equals(reviewerId)) { toDelete.add(psa); } } try { db.patchSetApprovals().delete(toDelete); } catch(OrmException ex) { result.addError(new ReviewerResult.Error( ReviewerResult.Error.Type.COULD_NOT_REMOVE, "Could not remove reviewer " + reviewerId)); } result.setChange(changeDetailFactory.create(changeId).call()); return result; }</code><technical_language>Please internal common library Guice. need new ArrayList here</technical_language>

Target:
public ReviewerResult call() throws Exception { ReviewerResult result = new ReviewerResult(); List<Account.Id> accounts = new ArrayList<Account.Id>(); ChangeControl ctl = changeControlFactory.validateFor(changeId); if (ctl.canRemoveReviewer(reviewerId)) { Iterable<PatchSetApproval> patchSets = db.patchSetApprovals().byChange(changeId); List<PatchSetApproval> toDelete = new ArrayList<PatchSetApproval>(); for (PatchSetApproval psa : patchSets) { if (psa.getAccountId().equals(reviewerId)) { toDelete.add(psa); } } try { db.patchSetApprovals().delete(toDelete); } catch(OrmException ex) { result.addError(new ReviewerResult.Error( ReviewerResult.Error.Type.COULD_NOT_REMOVE, "Could not remove reviewer " + reviewerId)); } } else { result.addError(new ReviewerResult.Error( ReviewerResult.Error.Type.COULD_NOT_REMOVE, "Not allowed to remove reviewer " + reviewerId)); } result.setChange(changeDetailFactory.create(changeId).call()); return result; }
Source:
<code>protected Map<String, String> processMetaData(Metadata meta) { <START> Map<String, String> map = new HashMap<>(); <END> String[] ignoreKeys = null; ResourceInterface resourcePrototype = this.getResourceManager().createResourceType(this.getResourceType()); String ignoreKeysConf = resourcePrototype.getMetadataIgnoreKeys(); if (null != ignoreKeysConf) { ignoreKeys = ignoreKeysConf.split(","); logger.debug("Metadata ignoreKeys: {}", ignoreKeys); } else { logger.debug("Metadata ignoreKeys not configured"); } List<String> ignoreKeysList = new ArrayList<String>(); if (null != ignoreKeys) { ignoreKeysList = Arrays.asList(ignoreKeys); } for (Directory directory : meta.getDirectories()) { for (Tag tag : directory.getTags()) { if (!ignoreKeysList.contains(tag.getTagName())) { logger.debug("Add Metadata with key: {}", tag.getTagName()); map.put(tag.getTagName(), tag.getDescription()); } else { logger.debug("Skip Metadata key {}", tag.getTagName()); } } } return map; }</code><technical_language>Fix variable declaration</technical_language>

Target:
protected Map<String, String> processMetaData(Metadata meta) { Map<String, String> metadataMap = new HashMap<>(); String[] ignoreKeys = null; ResourceInterface resourcePrototype = this.getResourceManager().createResourceType(this.getResourceType()); String ignoreKeysConf = resourcePrototype.getMetadataIgnoreKeys(); if (null != ignoreKeysConf) { ignoreKeys = ignoreKeysConf.split(","); logger.debug("Metadata ignoreKeys: {}", ignoreKeys); } else { logger.debug("Metadata ignoreKeys not configured"); } List<String> ignoreKeysList = new ArrayList<String>(); if (null != ignoreKeys) { ignoreKeysList = Arrays.asList(ignoreKeys); } for (Directory directory : meta.getDirectories()) { for (Tag tag : directory.getTags()) { if (!ignoreKeysList.contains(tag.getTagName())) { logger.debug("Add Metadata with key: {}", tag.getTagName()); metadataMap.put(tag.getTagName(), tag.getDescription()); } else { logger.debug("Skip Metadata key {}", tag.getTagName()); } } } return metadataMap; }
Source:
<code><START> public boolean equals(Object o) { <END> if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SyncNuageVspCmsIdCommand that = (SyncNuageVspCmsIdCommand) o; if (_nuageVspCmsId != null ? !_nuageVspCmsId.equals(that._nuageVspCmsId) : that._nuageVspCmsId != null) return false; if (_syncType != that._syncType) return false; return true; }</code><technical_language>This equals implementation include attributes Command super class</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SyncNuageVspCmsIdCommand)) return false; if (!super.equals(o)) return false; SyncNuageVspCmsIdCommand that = (SyncNuageVspCmsIdCommand) o; if (_nuageVspCmsId != null ? !_nuageVspCmsId.equals(that._nuageVspCmsId) : that._nuageVspCmsId != null) return false; if (_syncType != that._syncType) return false; return true; }
Source:
<code>public void findCallLogs(IngestJobContext context) { blackboard = Case.getCurrentCase().getServices().getBlackboard(); List<AbstractFile> absFiles; try { SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase(); absFiles = skCase.findAllFilesWhere("name ='contacts2.db' OR name ='contacts.db'"); if (absFiles.isEmpty()) { return; } for (AbstractFile AF : absFiles) { try { jFile = new java.io.File(Case.getCurrentCase().getTempDirectory(), AF.getName().replaceAll("[<>%|\"/:*\\\\]", "")); dbPath = jFile.toString(); fileId = AF.getId(); <START> ContentUtils.writeToFile(AF, jFile, context::dataSourceIngestIsCancelled); <END> findCallLogsInDB(dbPath, fileId); } catch (IOException ex) { logger.log(Level.WARNING, String.format("Error writing file content to file '%s' (id=%d).", dbPath, fileId), ex); } catch (Exception e) { logger.log(Level.SEVERE, "Error parsing Call logs", e); } } } catch (TskCoreException e) { logger.log(Level.SEVERE, "Error finding Call logs", e); } }</code><technical_language>While in this code, please a moment change "AF" "file", thanks</technical_language>

Target:
public void findCallLogs(IngestJobContext context) { blackboard = Case.getCurrentCase().getServices().getBlackboard(); List<AbstractFile> absFiles; try { SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase(); absFiles = skCase.findAllFilesWhere("name ='contacts2.db' OR name ='contacts.db'"); if (absFiles.isEmpty()) { return; } for (AbstractFile file : absFiles) { try { jFile = new java.io.File(Case.getCurrentCase().getTempDirectory(), file.getName().replaceAll("[<>%|\"/:*\\\\]", "")); dbPath = jFile.toString(); fileId = file.getId(); ContentUtils.writeToFile(file, jFile, context::dataSourceIngestIsCancelled); findCallLogsInDB(dbPath, fileId); } catch (ReadContentInputStreamException ex) { logger.log(Level.WARNING, String.format("Error reading content from file '%s' (id=%d).", file.getName(), fileId), ex); } catch (Exception ex) { logger.log(Level.SEVERE, String.format("Error writing content from file '%s' (id=%d) to '%s'.", file.getName(), fileId, dbPath), ex); } } } catch (TskCoreException e) { logger.log(Level.SEVERE, "Error finding Call logs", e); } }
Source:
<code>public FillBucketEvent(EntityPlayer player, ItemStack current, World world, MovingObjectPosition target) { super(player, current, world, target); <START> } <END></code><technical_language>Moving fields breaks current mods this event</technical_language>

Target:
public FillBucketEvent(EntityPlayer player, ItemStack current, World world, MovingObjectPosition target) { super(player, current, world, target); this.current = current; this.world = world; this.target = target; }
Source:
<code>public LayerModel getResidualsLayerModel(String residualType) { LayerModel layer = new LayerModel(sortedStackedStarTable); if (residualType.equals(RATIOS)) { layer.setX(SegmentColumn.Column.Spectral_Value.name()); layer.setY(SegmentColumn.Column.Ratios.name()); } else if (residualType.equals(RESIDUALS)) { layer.setX(SegmentColumn.Column.Spectral_Value.name()); layer.setY(SegmentColumn.Column.Residuals.name()); } else { throw new IllegalArgumentException("Unrecognized residual type. " <START> + "Must be \"ratio\" or \"residual\""); <END> } layer.setShowErrorBars(false); layer.setShowMarks(true); layer.setMarkColor("black"); return layer; }</code><technical_language>this is a super minor typo, I forgot change this in #304 PR. error message "Must \"Ratios\" \"Residuals\"" naming scheme here</technical_language>

Target:
public LayerModel getResidualsLayerModel(String residualType) { LayerModel layer = new LayerModel(sortedStackedStarTable); if (residualType.equals(RATIOS)) { layer.setX(SegmentColumn.Column.Spectral_Value.name()); layer.setY(SegmentColumn.Column.Ratios.name()); } else if (residualType.equals(RESIDUALS)) { layer.setX(SegmentColumn.Column.Spectral_Value.name()); layer.setY(SegmentColumn.Column.Residuals.name()); } else { throw new IllegalArgumentException("Unrecognized residual type. " + "Must be \"Ratios\" or \"Residuals\""); } layer.setShowErrorBars(false); layer.setShowMarks(true); layer.setMarkColor("black"); return layer; }
Source:
<code>private void unparseTrim(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec) { <START> assert call.operand(0) instanceof SqlLiteral : call.operand(0); <END> final String operatorName; SqlLiteral trimFlag = call.operand(0); SqlLiteral valueToTrim = call.operand(1); switch (trimFlag.getValueAs(SqlTrimFunction.Flag.class)) { case LEADING: operatorName = "LTRIM"; break; case TRAILING: operatorName = "RTRIM"; break; default: operatorName = call.getOperator().getName(); break; } final SqlWriter.Frame trimFrame = writer.startFunCall(operatorName); call.operand(2).unparse(writer, leftPrec, rightPrec); if (!valueToTrim.toValue().matches("\\s+")) { writer.literal(","); call.operand(1).unparse(writer, leftPrec, rightPrec); } writer.endFunCall(trimFrame); }</code><technical_language>need validate operand</technical_language>

Target:
private void unparseTrim(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec) { final String operatorName; SqlLiteral trimFlag = call.operand(0); SqlLiteral valueToTrim = call.operand(1); switch (trimFlag.getValueAs(SqlTrimFunction.Flag.class)) { case LEADING: operatorName = "LTRIM"; break; case TRAILING: operatorName = "RTRIM"; break; default: operatorName = call.getOperator().getName(); break; } final SqlWriter.Frame trimFrame = writer.startFunCall(operatorName); call.operand(2).unparse(writer, leftPrec, rightPrec); if (!valueToTrim.toValue().matches("\\s+")) { writer.literal(","); call.operand(1).unparse(writer, leftPrec, rightPrec); } writer.endFunCall(trimFrame); }
Source:
<code><START> public void givenASingleGetRequestWhenResponseThenLog() throws InterruptedException { <END> AtomicInteger completedReqs = new AtomicInteger(0); WSClient ws = play.test.WSTestClient.newClient(port); ws.url(url) .setRequestFilter(new AhcCurlRequestLogger()) .addHeader("key", "value") .addQueryParameter("num", "" + 1) .get() .thenAccept(r -> { log.debug("Thread#" + Thread.currentThread() .getId() + " Request complete: Response code = " + r.getStatus() + " | Response: " + r.getBody() + " | Current Time:" + System.currentTimeMillis()); completedReqs.incrementAndGet(); }); log.debug( "Waiting for requests to be completed. Current Time: " + System.currentTimeMillis()); while (completedReqs.get() != 1) { Thread.sleep(100); } log.debug("All requests have been completed. Exiting test."); }</code><technical_language>Tests throws Exception, a specific one, multiple ones</technical_language>

Target:
public void givenASingleGetRequestWhenResponseThenLog() throws Exception { CountDownLatch latch = new CountDownLatch(1); WSClient ws = play.test.WSTestClient.newClient(port); ws.url(url) .setRequestFilter(new AhcCurlRequestLogger()) .addHeader("key", "value") .addQueryParameter("num", "" + 1) .get() .thenAccept(r -> { log.debug("Thread#" + Thread.currentThread() .getId() + " Request complete: Response code = " + r.getStatus() + " | Response: " + r.getBody() + " | Current Time:" + System.currentTimeMillis()); latch.countDown(); }); log.debug( "Waiting for requests to be completed. Current Time: " + System.currentTimeMillis()); latch.await(5, TimeUnit.SECONDS ); assertEquals(0, latch.getCount()); log.debug("All requests have been completed. Exiting test."); }
Source:
<code>void shouldSetDataIntoBody() { model.setMessage(message); byte[] otherBodyContent = "Other Body".getBytes(DEFAULT_CHARSET); given(body.length()).willReturn(otherBodyContent.length); model.setData(otherBodyContent); verify(body).setBody(otherBodyContent); <START> } <END></code><technical_language>Worth verifying header is changed all</technical_language>

Target:
void shouldSetDataIntoBody() { model.setMessage(message); byte[] otherBodyContent = "Other Body".getBytes(DEFAULT_CHARSET); given(body.length()).willReturn(otherBodyContent.length); model.setData(otherBodyContent); verify(body).setBody(otherBodyContent); verify(header, times(0)).setContentLength(anyInt()); }
Source:
<code>public static boolean hasFailureWithinSuccessPercentage(int returnCode) { <START> return (returnCode >= 4 && returnCode <= 7); <END> }</code><technical_language>java return (returnCode & 4) == 4;</technical_language>

Target:
public static boolean hasFailureWithinSuccessPercentage(int returnCode) { return (returnCode & FAILED_WITHIN_SUCCESS) == FAILED_WITHIN_SUCCESS; }
Source:
<code>public synchronized Integer getNewHiResValue(long calculationTime) { if (hasRunningActions()) { BaseAction action = actions.get(0); value = action.getNewValue(this, calculationTime); <START> if (ActionState.completed.equals(action.getState())) { <END> switchToNextAction(); } else if (ActionState.completedfinal.equals(action.getState())) { clearAction(); } } if ((lastStateValue != value) && (calculationTime - lastStateTimestamp > 1000)) { for (Entry<ChannelUID, DmxThingHandler> listener : valueListeners.entrySet()) { PercentType state = Util.toPercentValue(Util.toDmxValue(value >> 8)); (listener.getValue()).updateState(listener.getKey(), state); logger.trace("sending VALUE status update to listener {}", listener.getKey()); } if ((lastStateValue == 0) || (value == 0)) { OnOffType state = (value == 0) ? OnOffType.OFF : OnOffType.ON; for (Entry<ChannelUID, DmxThingHandler> listener : onOffListeners.entrySet()) { (listener.getValue()).updateState(listener.getKey(), state); logger.trace("sending ONOFF status update to listener {}", listener.getKey()); } } lastStateValue = value; lastStateTimestamp = calculationTime; } return value; }</code><technical_language>ActionState enum values this if (action.getState() == ActionState.COMPLETED) {. please check other comparison, too</technical_language>

Target:
public synchronized Integer getNewHiResValue(long calculationTime) { if (hasRunningActions()) { BaseAction action = actions.get(0); value = action.getNewValue(this, calculationTime); if (action.getState() == ActionState.COMPLETED) { switchToNextAction(); } else if (action.getState() == ActionState.COMPLETEDFINAL) { clearAction(); } } if ((lastStateValue != value) && (calculationTime - lastStateTimestamp > 1000)) { for (Entry<ChannelUID, DmxThingHandler> listener : valueListeners.entrySet()) { PercentType state = Util.toPercentValue(Util.toDmxValue(value >> 8)); (listener.getValue()).updateState(listener.getKey(), state); logger.trace("sending VALUE status update to listener {}", listener.getKey()); } if ((lastStateValue == 0) || (value == 0)) { OnOffType state = (value == 0) ? OnOffType.OFF : OnOffType.ON; for (Entry<ChannelUID, DmxThingHandler> listener : onOffListeners.entrySet()) { (listener.getValue()).updateState(listener.getKey(), state); logger.trace("sending ONOFF status update to listener {}", listener.getKey()); } } lastStateValue = value; lastStateTimestamp = calculationTime; } return value; }
Source:
<code>public void testGatherNd() { SameDiff sameDiff = SameDiff.create(); INDArray arr1 = Transforms.sigmoid(Nd4j.linspace(1, 24, 24)).reshape(2, 3, 4); <START> INDArray arr2 = Nd4j.create(new int[]{1, 2, 3, 0, 1, 3, 1, 0, 2}, new int[]{3, 3}); <END> SDVariable x = sameDiff.var("x", arr1); SDVariable idxs = sameDiff.var("idxs", arr2); SDVariable result = sameDiff.gatherNd(x, idxs); INDArray expected = Nd4j.zeros(3); for (int i=0; i<3; i++){ INDArray idx = arr2.get(NDArrayIndex.point(i)); expected.get(NDArrayIndex.point(i)).assign( arr1.get(NDArrayIndex.point(idx.getInt(0)), NDArrayIndex.point(idx.getInt(1)), NDArrayIndex.point(idx.getInt(2)))); } assertEquals(expected, result.eval()); }</code><technical_language>this work. ND4J int array shape info. 0 is allowed. etc</technical_language>

Target:
public void testGatherNd() { SameDiff sameDiff = SameDiff.create(); INDArray arr1 = Transforms.sigmoid(Nd4j.linspace(1, 24, 24)).reshape(2, 3, 4); INDArray arr2 = Nd4j.create(new float[]{1, 2, 3, 0, 1, 3, 1, 0, 2}, new int[]{3, 3}); SDVariable x = sameDiff.var("x", arr1); SDVariable idxs = sameDiff.var("idxs", arr2); SDVariable result = sameDiff.gatherNd(x, idxs); INDArray expected = Nd4j.zeros(3); for (int i=0; i<3; i++){ INDArray idx = arr2.get(NDArrayIndex.point(i)); expected.get(NDArrayIndex.point(i)).assign( arr1.get(NDArrayIndex.point(idx.getInt(0)), NDArrayIndex.point(idx.getInt(1)), NDArrayIndex.point(idx.getInt(2)))); } assertEquals(expected, result.eval()); }
Source:
<code>public void initializeDefaultPreferences() { IPreferenceStore store = WmsPlugin.getDefault().getPreferenceStore(); <START> store.setDefault(WmsPreferencePage.WMS_RESPONSE_TIMEOUT, 30); <END> }</code><technical_language>define a constant a semantic describe "30" means, e.g. DEFAULT_WMS_RESPONSE_TIMEOUT_IN_SECONDS: public static final int DEFAULT_WMS_RESPONSE_TIMEOUT_IN_SECONDS = 30; In addition, is Start uDig another default (overwrite in configuration) how? @nprigour add a screenshout docs improve WMS Preferences page (content of <LINK_1> [Catalog Preferences](<LINK_0></technical_language>

Target:
public void initializeDefaultPreferences() { IPreferenceStore store = WmsPlugin.getDefault().getPreferenceStore(); store.setDefault(WmsPreferenceConstants.WMS_RESPONSE_TIMEOUT, WmsPreferenceConstants.DEFAULT_WMS_RESPONSE_TIMEOUT_IN_SECONDS); }
Source:
<code>public HarvestedCollectionResource(HarvestedCollectionRest data) { super(data); <START> embedResource("metadata_configs", data.getMetadataConfigs()); <END> }</code><technical_language>I this changed "metadata_configs" "harvestermetadata" discussion in REST contract here: <LINK_0></technical_language>

Target:
public HarvestedCollectionResource(HarvestedCollectionRest data) { super(data); embedResource("harvestermetadata", data.getMetadataConfigs()); }
Source:
<code>public void shouldNotifyEventWhenRemoveComment() { Comment comment = createCommentAndAddSubscription("CommentRemoved"); DocumentModel commentDocModel = session.getDocument(new IdRef(comment.getId())); commentDocModel.detach(true); try (CapturingEventListener listener = new CapturingEventListener(COMMENT_REMOVED)) { commentManager.deleteComment(session, comment.getId()); DocumentModel commentParentDocumentModel = session.getDocument( new IdRef((String) commentDocModel.getPropertyValue(COMMENT_PARENT_ID))); transactionalFeature.nextTransaction(); Event expectedEvent = listener.streamCapturedEvents() .findFirst() .orElseThrow(() -> new AssertionError("Event wasn't fired")); checkDocumentEventContext(expectedEvent, commentDocModel, commentParentDocumentModel, commentedDocumentModel); List<MailMessage> mails = emailsResult.getMails(); <START> assertEquals(0, mails.size()); <END> } }</code><technical_language>suggestion assertTrue(mails.isEmpty());</technical_language>

Target:
public void shouldNotifyEventWhenRemoveComment() { Comment comment = createComment(commentedDocumentModel); DocumentModel commentDocModel = session.getDocument(new IdRef(comment.getId())); commentDocModel.detach(true); transactionalFeature.nextTransaction(); assertEquals(1, emailsResult.getMails().size()); try (CapturingEventListener listener = new CapturingEventListener(COMMENT_REMOVED)) { commentManager.deleteComment(session, comment.getId()); DocumentModel commentParentDocumentModel = session.getDocument( new IdRef((String) commentDocModel.getPropertyValue(COMMENT_PARENT_ID_PROPERTY))); transactionalFeature.nextTransaction(); Event expectedEvent = listener.streamCapturedEvents() .findFirst() .orElseThrow(() -> new AssertionError("Event wasn't fired")); checkDocumentEventContext(expectedEvent, commentDocModel, commentParentDocumentModel, commentedDocumentModel); List<MailMessage> mails = emailsResult.getMails(); assertEquals(1, mails.size()); } }
Source:
<code>@Override public Pair<RelTraitSet, List<RelTraitSet>> passThroughTraits( RelTraitSet required) { RelCollation collation = required.getTrait(RelCollationTraitDef.INSTANCE); if (collation == null || collation.getFieldCollations().size() == 0) { return null; } final Mappings.TargetMapping map = RelOptUtil.permutationIgnoreCast( getProjects(), getInput().getRowType()); for (RelFieldCollation fc : collation.getFieldCollations()) { if (map.getTargetOpt(fc.getFieldIndex()) < 0) { return null; } final RexNode node = getProjects().get(fc.getFieldIndex()); if (node.isA(SqlKind.CAST)) { final RexCall cast = (RexCall) node; RelFieldCollation newFc = Objects.requireNonNull(RexUtil.apply(map, fc)); final RexCallBinding binding = RexCallBinding.create(getCluster().getTypeFactory(), cast, ImmutableList.of(RelCollations.of(newFc))); if (cast.getOperator().getMonotonicity(binding) == SqlMonotonicity.NOT_MONOTONIC) { return null; } } } final RelCollation newCollation = <START> getCluster().traitSet().canonize(RexUtil.apply(map, collation)); <END> return Pair.of(required, ImmutableList.of(required.replace(newCollation))); }</code><technical_language>collation.apply(map). need canonize, is canonized get it</technical_language>

Target:
@Override public Pair<RelTraitSet, List<RelTraitSet>> passThroughTraits( RelTraitSet required) { RelCollation collation = required.getCollation(); if (collation == null || required.isDefaultSansConvention()) { return null; } final Mappings.TargetMapping map = RelOptUtil.permutationIgnoreCast( getProjects(), getInput().getRowType()); for (RelFieldCollation rc : collation.getFieldCollations()) { if (!isCollationOnTrivialExpr(map, rc, true)) { return null; } } final RelCollation newCollation = collation.apply(map); return Pair.of(traitSet.replace(collation), ImmutableList.of(traitSet.replace(newCollation))); }
Source:
<code>public void testDiscardIdleSlotIfReleasingFailed() throws Exception { final ManualClock clock = new ManualClock(); try (TestingSlotPoolImpl slotPool = createSlotPoolImpl(clock)) { <START> setupSlotPool(slotPool, resourceManagerGateway, mainThreadExecutor); <END> final AllocationID expiredAllocationId = new AllocationID(); final SlotOffer slotToExpire = new SlotOffer(expiredAllocationId, 0, ResourceProfile.ANY); OneShotLatch freeSlotLatch = new OneShotLatch(); taskManagerGateway.setFreeSlotFunction((AllocationID allocationId, Throwable cause) -> { freeSlotLatch.trigger(); return FutureUtils.completedExceptionally(new TimeoutException("Test failure")); }); assertThat(slotPool.registerTaskManager(taskManagerLocation.getResourceID()), Matchers.is(true)); assertThat(slotPool.offerSlot(taskManagerLocation, taskManagerGateway, slotToExpire), Matchers.is(true)); clock.advanceTime(timeout.toMilliseconds() + 1, TimeUnit.MILLISECONDS); slotPool.triggerCheckIdleSlot(); freeSlotLatch.await(); CompletableFuture<PhysicalSlot> future = requestNewAllocatedSlot( slotPool, new SlotRequestId() ); try { future.get(10L, TimeUnit.MILLISECONDS); fail("Expected to fail with a timeout."); } catch (TimeoutException ignored) { assertEquals(0, slotPool.getAvailableSlots().size()); } } }</code><technical_language>replace createAndSetUpSlotPool ? for test case testCheckIdleSlot</technical_language>

Target:
public void testDiscardIdleSlotIfReleasingFailed() throws Exception { final ManualClock clock = new ManualClock(); try (TestingSlotPoolImpl slotPool = createAndSetUpSlotPool(resourceManagerGateway, clock, TIMEOUT)) { final AllocationID expiredAllocationId = new AllocationID(); final SlotOffer slotToExpire = new SlotOffer(expiredAllocationId, 0, ResourceProfile.ANY); OneShotLatch freeSlotLatch = new OneShotLatch(); taskManagerGateway.setFreeSlotFunction((AllocationID allocationId, Throwable cause) -> { freeSlotLatch.trigger(); return FutureUtils.completedExceptionally(new TimeoutException("Test failure")); }); assertThat(slotPool.registerTaskManager(taskManagerLocation.getResourceID()), Matchers.is(true)); assertThat(slotPool.offerSlot(taskManagerLocation, taskManagerGateway, slotToExpire), Matchers.is(true)); clock.advanceTime(TIMEOUT.toMilliseconds() + 1, TimeUnit.MILLISECONDS); slotPool.triggerCheckIdleSlot(); freeSlotLatch.await(); final CompletableFuture<PhysicalSlot> allocatedSlotFuture = requestNewAllocatedSlot( slotPool, new SlotRequestId()); try { allocatedSlotFuture.get(10L, TimeUnit.MILLISECONDS); fail("Expected to fail with a timeout."); } catch (TimeoutException ignored) { assertEquals(0, slotPool.getAvailableSlots().size()); } } }
Source:
<code>private BufferedImage scaleToMaxWidth(final BufferedImage image, final double scaleFactor) { final double factor = this.maxWidth / scaleFactor / image.getWidth(); final BufferedImage result = new BufferedImage( (int) Math.round(image.getWidth() * factor), (int) Math.round(image.getHeight() * factor), <START> BufferedImage.TYPE_4BYTE_ABGR <END> ); AffineTransform at = new AffineTransform(); at.scale(factor, factor); AffineTransformOp scaleOp = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR); return scaleOp.filter(image, result); }</code><technical_language>want transparent legends</technical_language>

Target:
private BufferedImage scaleToMaxWidth(final BufferedImage image, final double scaleFactor) { final double factor = this.maxWidth / scaleFactor / image.getWidth(); final BufferedImage result = new BufferedImage( (int) Math.round(image.getWidth() * factor), (int) Math.round(image.getHeight() * factor), (image.getType() == BufferedImage.TYPE_BYTE_INDEXED || image.getType() == BufferedImage.TYPE_BYTE_BINARY) ? BufferedImage.TYPE_4BYTE_ABGR : image.getType() ); AffineTransform at = new AffineTransform(); at.scale(factor, factor); AffineTransformOp scaleOp = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR); return scaleOp.filter(image, result); }
Source:
<code>private String sendForkliftWrappedMessage(String message, Map<String, String> messageProperties) throws ProducerException { GenericRecord avroRecord = new GenericData.Record(forkliftSchema); avroRecord.put(SCHEMA_FIELD_NAME_VALUE, message); <START> messageProperties = messageProperties == null ? new HashMap<>() : new HashMap<>(messageProperties); <END> for (Map.Entry<String, String> entry : this.properties.entrySet()) { messageProperties.putIfAbsent(entry.getKey(), entry.getValue()); } avroRecord.put(SCHEMA_FIELD_NAME_PROPERTIES, this.formatMap(messageProperties)); ProducerRecord record = new ProducerRecord<>(topic, null, avroRecord); try { RecordMetadata result = (RecordMetadata)kafkaProducer.send(record).get(); return result.topic() + "-" + result.partition() + "-" + result.offset(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new ProducerException("Error sending Kafka Message", e); } catch (ExecutionException e) { throw new ProducerException("Error sending Kafka Message", e); } }</code><technical_language>logic me. I start a copy of properties putAll messageProperties top of it. do like: Map<String, String> appliedProperties = new HashMap<>(properties); if (messageProperties == null) messageProperties = Collections.emptyMap(); appliedProperties.putAll(messageProperties);</technical_language>

Target:
private String sendForkliftWrappedMessage(String message, Map<String, String> messageProperties) throws ProducerException { GenericRecord avroRecord = new GenericData.Record(forkliftSchema); avroRecord.put(SCHEMA_FIELD_NAME_VALUE, message); Map<String, String> appliedProperties = new HashMap<>(properties); if (messageProperties == null) { messageProperties = Collections.emptyMap(); } appliedProperties.putAll(messageProperties); avroRecord.put(SCHEMA_FIELD_NAME_PROPERTIES, this.formatMap(appliedProperties)); ProducerRecord record = new ProducerRecord<>(topic, null, avroRecord); try { RecordMetadata result = (RecordMetadata)kafkaProducer.send(record).get(); return result.topic() + "-" + result.partition() + "-" + result.offset(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new ProducerException("Error sending Kafka Message", e); } catch (ExecutionException e) { throw new ProducerException("Error sending Kafka Message", e); } }
Source:
<code>public void streamsClosed() { if (streamsClosed) { String msg = "Streams are already closed."; <START> log(IStatus.WARNING, msg, new Exception(msg)); <END> return; } streamsClosed = true; checkFinished(); }</code><technical_language>exception's class printed, IllegalStateException (or IOException)</technical_language>

Target:
public void streamsClosed() { if (streamsClosed) { String msg = "Streams are already closed."; log(IStatus.ERROR, msg, new IllegalStateException(msg)); return; } streamsClosed = true; checkFinished(); }
Source:
<code>public void setup() throws Throwable { <START> super.initializeComponentRegistryAndService(); <END> deleteAllAccountTestRows(); }</code><technical_language>do call this method of superclass? I this method is annotated @Before itself. need call again</technical_language>

Target:
public void setup() throws Throwable { deleteAllAccountTestRows(); }
Source:
<code>public void dispose() { mCm.unSetOnNewSMS(this); mCm.unSetOnSmsStatus(this); mCm.unSetOnIccSmsFull(this); <START> mCm.unSetOnSmsStatus(this); <END> mCm.unSetOnIccSmsFull(this); mPhone = null; mContext = null; mResolver = null; mCm = null; mSTracker = null; mCounter = null; }</code><technical_language>Remove, present line 225</technical_language>

Target:
public void dispose() { mCm.unSetOnNewSMS(this); mCm.unSetOnSmsStatus(this); mCm.unSetOnIccSmsFull(this); }
Source:
<code>public boolean hasCoverageAvailable() { <START> if (currentCoverage == null) { <END> return false; } Ratio lineCoverage = currentCoverage.getCoverage(CoverageMetric.LINE); return lineCoverage != null; }</code><technical_language>simplify this to: return currentCoverage != null && currentCoverage.getCoverage(CoverageMetric.LINE) != null;</technical_language>

Target:
public boolean hasCoverageAvailable() { return currentCoverage != null && currentCoverage.getCoverage(CoverageMetric.LINE) != null; }
Source:
<code>public NotifyingFuture<Void> clearAsync() { <START> authzManager.checkPermission(CachePermission.WRITE); <END> return delegate.clearAsync(); }</code><technical_language>this bulk instead of write</technical_language>

Target:
public NotifyingFuture<Void> clearAsync() { authzManager.checkPermission(AuthorizationPermission.BULK_WRITE); return delegate.clearAsync(); }
Source:
<code>public void onCreate(Bundle savedInstanceState) { Log.d(TAG, "TEST - onCreate"); super.onCreate(savedInstanceState); Thread.setDefaultUncaughtExceptionHandler(onUncaughtException); try { setContentView(R.layout.player_set_embed_code_layout); } catch (Exception e) { DebugMode.logE( TAG, "Caught!", e ); } setEmbed = (Button) findViewById(R.id.setEmbed); setEmbed.setOnClickListener(this); PlayerDomain domain = null; try { domain = new PlayerDomain(PLAYERDOMAIN); } catch (Exception e) { DebugMode.logE(TAG, "Caught!", e); } final FCCTVRatingConfiguration tvRatingConfiguration = new FCCTVRatingConfiguration.Builder().setDurationSeconds(5).build(); player = new OoyalaPlayer(PCODE, domain, this, new Options.Builder().setTVRatingConfiguration( tvRatingConfiguration ).setBypassPCodeMatching(true).setUseExoPlayer(true).build()); OptimizedOoyalaPlayerLayoutController layoutController = new OptimizedOoyalaPlayerLayoutController( (OoyalaPlayerLayout) findViewById(R.id.player), player, DefaultControlStyle.AUTO ); <START> player.setAdsSeekable(true); END> player.addObserver(this); player.setVolume(.05f); int r = player.beginFetchingAdvertisingId(this, this); Log.d( TAG, "initAdvertisingId: " + r ); }</code><technical_language>this manually skip ad</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { Log.d(TAG, "TEST - onCreate"); super.onCreate(savedInstanceState); Thread.setDefaultUncaughtExceptionHandler(onUncaughtException); try { setContentView(R.layout.player_set_embed_code_layout); } catch (Exception e) { DebugMode.logE( TAG, "Caught!", e ); } setEmbed = (Button) findViewById(R.id.setEmbed); setEmbed.setOnClickListener(this); PlayerDomain domain = null; try { domain = new PlayerDomain(PLAYERDOMAIN); } catch (Exception e) { DebugMode.logE(TAG, "Caught!", e); } final FCCTVRatingConfiguration tvRatingConfiguration = new FCCTVRatingConfiguration.Builder().setDurationSeconds(5).build(); player = new OoyalaPlayer(PCODE, domain, this, new Options.Builder().setTVRatingConfiguration( tvRatingConfiguration ).setBypassPCodeMatching(true).setUseExoPlayer(true).build()); OptimizedOoyalaPlayerLayoutController layoutController = new OptimizedOoyalaPlayerLayoutController( (OoyalaPlayerLayout) findViewById(R.id.player), player, DefaultControlStyle.AUTO ); player.addObserver(this); player.setVolume(.05f); }
Source:
<code>SideBandOutputStream(final int chan, final int sz, final OutputStream os) { if (chan <= 0 || 255 < chan) throw new IllegalArgumentException("channel " + chan <START> + " must be in range [0, 255]"); <END> if (sz <= HDR_SIZE) throw new IllegalArgumentException("packet size " + sz + " must be >= " + HDR_SIZE); else if (MAX_BUF < sz) throw new IllegalArgumentException("packet size " + sz + " must be <= " + MAX_BUF); out = os; buffer = new byte[sz]; buffer[4] = (byte) chan; cnt = HDR_SIZE; }</code><technical_language>255 is allowed reverting order of operands this is unnatural easy read wrong way. is condition condition expresses a condition is easier read correctly, min < v < max style. Howevery I prefer variable op constant pattern always, aligns pronounce expression. this is easier grasp if (chan <=0 || chan > 255) throw... valid range is [1..255], I think, condition if (!( 0 < chan && chan <= 255)) readable too, top parenthese for some people</technical_language>

Target:
SideBandOutputStream(final int chan, final int sz, final OutputStream os) { if (chan <= 0 || chan > 255) throw new IllegalArgumentException("channel " + chan + " must be in range [0, 255]"); if (sz <= HDR_SIZE) throw new IllegalArgumentException("packet size " + sz + " must be >= " + HDR_SIZE); else if (MAX_BUF < sz) throw new IllegalArgumentException("packet size " + sz + " must be <= " + MAX_BUF); out = os; buffer = new byte[sz]; buffer[4] = (byte) chan; cnt = HDR_SIZE; }
Source:
<code>public int getTopY() { try { <START> return (int) Math.round(Double.parseDouble(getPropertyValue(PROPERTY_NAME_Y))); <END> } catch (NumberFormatException e) { return 0; } }</code><technical_language>Return y instead of re-parsing</technical_language>

Target:
public int getTopY() { return y; }
Source:
<code>protected void createButtonsForButtonBar(Composite parent) { super.createButtonsForButtonBar(parent); Button okButton = getButton(IDialogConstants.OK_ID); <START> okButton.setText(JFaceResources.getString("PreferencesDialog.okButtonLabel")); END> setButtonLayoutData(okButton); }</code><technical_language>avoid reusing labels else. Create a constant translation here. for example limitButton.setText(MarkerMessages.MarkerPreferences_MarkerLimits);</technical_language>

Target:
protected void createButtonsForButtonBar(Composite parent) { super.createButtonsForButtonBar(parent); Button okButton = getButton(IDialogConstants.OK_ID); okButton.setText(MarkerMessages.filtersDialog_applyAndCloseButton); setButtonLayoutData(okButton); }
Source:
<code>public int hashCode() { int hash = 3; hash = 47 * hash + (int) (Double.doubleToLongBits(this.latitude) ^ (Double.doubleToLongBits(this.latitude) >>> 32)); hash = 47 * hash + (int) (Double.doubleToLongBits(this.longitude) ^ (Double.doubleToLongBits(this.longitude) >>> 32)); hash = 47 * hash + (this.altitude != null ? this.altitude.hashCode() : 0); <START> hash = this.accuracy != null ? (47 * hash + this.accuracy.hashCode()) : 0; <END> return hash; }</code><technical_language>This a typo. If accuracy is provided, hash 0</technical_language>

Target:
public int hashCode() { int hash = 3; hash = 47 * hash + (int) (Double.doubleToLongBits(this.latitude) ^ (Double.doubleToLongBits(this.latitude) >>> 32)); hash = 47 * hash + (int) (Double.doubleToLongBits(this.longitude) ^ (Double.doubleToLongBits(this.longitude) >>> 32)); hash = 47 * hash + (this.altitude != null ? this.altitude.hashCode() : 0); hash = 47 * hash + (this.accuracy != null ? this.accuracy.hashCode() : 0); return hash; }
Source:
<code>private void deleteRepositoryFolder() { try { if (repository.getDirectory().exists()) { <START> FileUtils.delete(repository.getDirectory(), FileUtils.RECURSIVE | FileUtils.IGNORE_ERRORS | FileUtils.IGNORE_ERRORS); <END> } } catch (Exception e1) { LOG.error("Could not remove .git folder in path " + repository.getDirectory().getPath(), e1); } }</code><technical_language>do FileUtils.IGNORE_ERRORS twice</technical_language>

Target:
private void deleteRepositoryFolder() { try { if (repository.getDirectory().exists()) { FileUtils.delete(repository.getDirectory(), FileUtils.RECURSIVE | FileUtils.IGNORE_ERRORS); } } catch (Exception e1) { LOG.error("Could not remove .git folder in path " + repository.getDirectory().getPath(), e1); } }
Source:
<code>private PluggableSCMMaterialConfig toPluggableScmMaterialConfig(CRPluggableScmMaterial crPluggableScmMaterial) { String id = crPluggableScmMaterial.getScmId(); <START> CRPluginConfiguration pluginConfig = crPluggableScmMaterial.getPluginConfiguration(); <END> SCM scmConfig; if (pluginConfig == null) { scmConfig = getSCMs().find(id); } else { scmConfig = new SCM(id, toPluginConfiguration(pluginConfig), toConfiguration(crPluggableScmMaterial.getConfiguration())); scmConfig.setName(crPluggableScmMaterial.getName()); newSCMs.add(scmConfig); } if (scmConfig == null) throw new ConfigConvertionException( String.format("Failed to find referenced scm '%s'", id)); return new PluggableSCMMaterialConfig(toMaterialName(crPluggableScmMaterial.getName()), scmConfig, crPluggableScmMaterial.getDirectory(), toFilter(crPluggableScmMaterial.getFilterList())); }</code><technical_language>id null now, right? is scm_id, in [this example](<LINK_0> skipped</technical_language>

Target:
private PluggableSCMMaterialConfig toPluggableScmMaterialConfig(CRPluggableScmMaterial crPluggableScmMaterial) { String id = crPluggableScmMaterial.getScmId(); CRPluginConfiguration pluginConfig = crPluggableScmMaterial.getPluginConfiguration(); SCM scmConfig; if (pluginConfig == null) { scmConfig = getSCMs().find(id); } else { scmConfig = new SCM(id, toPluginConfiguration(pluginConfig), toConfiguration(crPluggableScmMaterial.getConfiguration())); scmConfig.ensureIdExists(); scmConfig.setName(crPluggableScmMaterial.getName()); if (getSCMs().findDuplicate(scmConfig) == null) { SCM duplicate = newSCMs.findDuplicate(scmConfig); if (duplicate == null) { newSCMs.add(scmConfig); } else { scmConfig = duplicate; } } else { scmConfig = getSCMs().findDuplicate(scmConfig); } } if (scmConfig == null) throw new ConfigConvertionException( String.format("Failed to find referenced scm '%s'", id)); return new PluggableSCMMaterialConfig(toMaterialName(crPluggableScmMaterial.getName()), scmConfig, crPluggableScmMaterial.getDirectory(), toFilter(crPluggableScmMaterial.getFilterList())); }
Source:
<code>boolean isFull( int x, int y ) { Block b = world.getBlockAt( x, y ); if ( BehaviourTools.s_isFlat( b ) ) { return true; } WaterRegionRenderer wrr = dynamics.lookupRenderer.getItemAt( x, y ); if ( null == wrr ) { return false; } <START> return 32 == wrr.height && 32 == wrr.targetWaterHeight; <END> }</code><technical_language>I misunderstanding, this blocks slopes full? wrr.targetWaterHeight 32</technical_language>

Target:
boolean isFull( int x, int y ) { Block b = world.getBlockAt( x, y ); if ( BehaviourTools.s_isFlat( b ) ) { return true; } WaterRegionRenderer wrr = waterAnimation.lookupRenderer.getItemAt( x, y ); if ( null == wrr ) { return false; } return 32 == wrr.height && 32 == wrr.targetWaterHeight; }