auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Response execute() throws IOException { if (method == null) throw new IOException(app.getString(R.string.method_null)); Request.Builder requestBuilder = new Request.Builder(); String url = app.getServerURI() + path; requestBuilder.addHeader("client", "Android"); switch (method) { case "GET": requestBuilder.url(generateURL(url, properties)).get(); break; case "DELETE": FormBody.Builder formDeleteBody = new FormBody.Builder(); for (Map.Entry<String, String> map : properties.entrySet()) { formDeleteBody.addEncoded(map.getKey(), map.getValue()); } requestBuilder.url(url).delete(formDeleteBody.build()); break; case "POST": FormBody.Builder formBody = new FormBody.Builder(); for (Map.Entry<String, String> map : properties.entrySet()) { formBody.addEncoded(map.getKey(), map.getValue()); } requestBuilder.url(url).post(formBody.build()); break; case "PUT": FormBody.Builder builder = new FormBody.Builder(); for (Map.Entry<String, String> map : properties.entrySet()) { builder.addEncoded(map.getKey(), map.getValue()); } requestBuilder.url(url).put(builder.build()); break; default: throw new IOException(app.getString(R.string.method_error)); } if (this.app.getApiKey() != null) { String authstr = this.app.getEmail() + ":" + this.app.getApiKey(); requestBuilder.addHeader("Authorization", "Basic " + Base64.encodeToString(authstr.getBytes(), Base64.NO_WRAP)); } request = requestBuilder.build(); Log.i("OkHTTP.request", method + " " + request.url().toString()); response = okHttpClient.newCall(request).execute(); return response; }

Target:
public Response execute() throws IOException { if (method == null) throw new IOException(app.getString(R.string.method_null)); Request.Builder requestBuilder = new Request.Builder(); String url = app.getServerURI() + path; requestBuilder.addHeader("client", "Android"); switch (method) { case "GET": requestBuilder.url(generateURL(url, properties)).get(); break; case "DELETE": FormBody.Builder formDeleteBody = new FormBody.Builder(); for (Map.Entry<String, String> map : properties.entrySet()) { formDeleteBody.add(map.getKey(), map.getValue()); } requestBuilder.url(url).delete(formDeleteBody.build()); break; case "POST": FormBody.Builder formBody = new FormBody.Builder(); for (Map.Entry<String, String> map : properties.entrySet()) { formBody.add(map.getKey(), map.getValue()); } requestBuilder.url(url).post(formBody.build()); break; case "PUT": FormBody.Builder builder = new FormBody.Builder(); for (Map.Entry<String, String> map : properties.entrySet()) { builder.add(map.getKey(), map.getValue()); } requestBuilder.url(url).put(builder.build()); break; default: throw new IOException(app.getString(R.string.method_error)); } if (this.app.getApiKey() != null) { String authstr = this.app.getEmail() + ":" + this.app.getApiKey(); requestBuilder.addHeader("Authorization", "Basic " + Base64.encodeToString(authstr.getBytes(), Base64.NO_WRAP)); } Request request = requestBuilder.build(); Log.i("OkHTTP.request", method + " " + request.url().toString()); response = okHttpClient.newCall(request).execute(); return response; }
Source:
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() .createProperty().name( AvailableSettings.BYTECODE_PROVIDER ).name( Environment.BYTECODE_PROVIDER_NAME_JAVASSIST ).up() .up().up(); return new StringAsset( persistenceXml.exportAsString() ); }

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:
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( " { get%s(); }", currentValue.getName() .substring( 0, 1 ) .toUpperCase() + currentValue.getName().substring( 1 ) ) ); } }

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:
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("meta_" + attr.getName(), attr.getType())); } } 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; }

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:
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); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 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; }

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:
public ReviewerResult call() throws Exception { ReviewerResult result = new ReviewerResult(); List<Account.Id> accounts = Lists.newArrayList(); 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; }

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:
protected Map<String, String> processMetaData(Metadata meta) { Map<String, String> map = 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()); map.put(tag.getTagName(), tag.getDescription()); } else { logger.debug("Skip Metadata key {}", tag.getTagName()); } } } return map; }

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:
public boolean equals(Object o) { 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; }

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:
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(); ContentUtils.writeToFile(AF, jFile, context::dataSourceIngestIsCancelled); 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); } }

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:
public FillBucketEvent(EntityPlayer player, ItemStack current, World world, MovingObjectPosition target) { super(player, current, world, target); }

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:
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 \"ratio\" or \"residual\""); } layer.setShowErrorBars(false); layer.setShowMarks(true); layer.setMarkColor("black"); return layer; }

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:
private void unparseTrim(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec) { assert call.operand(0) instanceof SqlLiteral : call.operand(0); 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); }

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:
public void givenASingleGetRequestWhenResponseThenLog() throws InterruptedException { 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."); }

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:
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); }

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:
public static boolean hasFailureWithinSuccessPercentage(int returnCode) { return (returnCode >= 4 && returnCode <= 7); }

Target:
public static boolean hasFailureWithinSuccessPercentage(int returnCode) { return (returnCode & FAILED_WITHIN_SUCCESS) == FAILED_WITHIN_SUCCESS; }
Source:
public synchronized Integer getNewHiResValue(long calculationTime) { if (hasRunningActions()) { BaseAction action = actions.get(0); value = action.getNewValue(this, calculationTime); if (ActionState.completed.equals(action.getState())) { 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; }

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:
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 int[]{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()); }

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:
public void initializeDefaultPreferences() { IPreferenceStore store = WmsPlugin.getDefault().getPreferenceStore(); store.setDefault(WmsPreferencePage.WMS_RESPONSE_TIMEOUT, 30); }

Target:
public void initializeDefaultPreferences() { IPreferenceStore store = WmsPlugin.getDefault().getPreferenceStore(); store.setDefault(WmsPreferenceConstants.WMS_RESPONSE_TIMEOUT, WmsPreferenceConstants.DEFAULT_WMS_RESPONSE_TIMEOUT_IN_SECONDS); }
Source:
public HarvestedCollectionResource(HarvestedCollectionRest data) { super(data); embedResource("metadata_configs", data.getMetadataConfigs()); }

Target:
public HarvestedCollectionResource(HarvestedCollectionRest data) { super(data); embedResource("harvestermetadata", data.getMetadataConfigs()); }
Source:
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(); assertEquals(0, mails.size()); } }

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:
@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 = getCluster().traitSet().canonize(RexUtil.apply(map, collation)); return Pair.of(required, ImmutableList.of(required.replace(newCollation))); }

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:
public void testDiscardIdleSlotIfReleasingFailed() throws Exception { final ManualClock clock = new ManualClock(); try (TestingSlotPoolImpl slotPool = createSlotPoolImpl(clock)) { setupSlotPool(slotPool, resourceManagerGateway, mainThreadExecutor); 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()); } } }

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:
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), BufferedImage.TYPE_4BYTE_ABGR ); AffineTransform at = new AffineTransform(); at.scale(factor, factor); AffineTransformOp scaleOp = new AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR); return scaleOp.filter(image, result); }

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:
private String sendForkliftWrappedMessage(String message, Map<String, String> messageProperties) throws ProducerException { GenericRecord avroRecord = new GenericData.Record(forkliftSchema); avroRecord.put(SCHEMA_FIELD_NAME_VALUE, message); messageProperties = messageProperties == null ? new HashMap<>() : new HashMap<>(messageProperties); 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); } }

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:
public void streamsClosed() { if (streamsClosed) { String msg = "Streams are already closed."; log(IStatus.WARNING, msg, new Exception(msg)); return; } streamsClosed = true; checkFinished(); }

Target:
public void streamsClosed() { if (streamsClosed) { String msg = "Streams are already closed."; log(IStatus.ERROR, msg, new IllegalStateException(msg)); return; } streamsClosed = true; checkFinished(); }
Source:
public void setup() throws Throwable { super.initializeComponentRegistryAndService(); deleteAllAccountTestRows(); }

Target:
public void setup() throws Throwable { deleteAllAccountTestRows(); }
Source:
public void dispose() { mCm.unSetOnNewSMS(this); mCm.unSetOnSmsStatus(this); mCm.unSetOnIccSmsFull(this); mCm.unSetOnSmsStatus(this); mCm.unSetOnIccSmsFull(this); mPhone = null; mContext = null; mResolver = null; mCm = null; mSTracker = null; mCounter = null; }

Target:
public void dispose() { mCm.unSetOnNewSMS(this); mCm.unSetOnSmsStatus(this); mCm.unSetOnIccSmsFull(this); }
Source:
public boolean hasCoverageAvailable() { if (currentCoverage == null) { return false; } Ratio lineCoverage = currentCoverage.getCoverage(CoverageMetric.LINE); return lineCoverage != null; }

Target:
public boolean hasCoverageAvailable() { return currentCoverage != null && currentCoverage.getCoverage(CoverageMetric.LINE) != null; }
Source:
public NotifyingFuture<Void> clearAsync() { authzManager.checkPermission(CachePermission.WRITE); return delegate.clearAsync(); }

Target:
public NotifyingFuture<Void> clearAsync() { authzManager.checkPermission(AuthorizationPermission.BULK_WRITE); return delegate.clearAsync(); }
Source:
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.setAdsSeekable(true); player.addObserver(this); player.setVolume(.05f); int r = player.beginFetchingAdvertisingId(this, this); Log.d( TAG, "initAdvertisingId: " + r ); }

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:
SideBandOutputStream(final int chan, final int sz, final OutputStream os) { if (chan <= 0 || 255 < chan) 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; }

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:
public int getTopY() { try { return (int) Math.round(Double.parseDouble(getPropertyValue(PROPERTY_NAME_Y))); } catch (NumberFormatException e) { return 0; } }

Target:
public int getTopY() { return y; }
Source:
protected void createButtonsForButtonBar(Composite parent) { super.createButtonsForButtonBar(parent); Button okButton = getButton(IDialogConstants.OK_ID); okButton.setText(JFaceResources.getString("PreferencesDialog.okButtonLabel")); setButtonLayoutData(okButton); }

Target:
protected void createButtonsForButtonBar(Composite parent) { super.createButtonsForButtonBar(parent); Button okButton = getButton(IDialogConstants.OK_ID); okButton.setText(MarkerMessages.filtersDialog_applyAndCloseButton); setButtonLayoutData(okButton); }
Source:
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 = this.accuracy != null ? (47 * hash + this.accuracy.hashCode()) : 0; return hash; }

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:
private void deleteRepositoryFolder() { try { if (repository.getDirectory().exists()) { FileUtils.delete(repository.getDirectory(), FileUtils.RECURSIVE | FileUtils.IGNORE_ERRORS | FileUtils.IGNORE_ERRORS); } } catch (Exception e1) { LOG.error("Could not remove .git folder in path " + repository.getDirectory().getPath(), e1); } }

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:
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.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())); }

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:
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; } return 32 == wrr.height && 32 == wrr.targetWaterHeight; }

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; }
Source:
public List<InsightCard> getInsights(@Scope(OAuthScope.INSIGHTS_READ) final AccessToken accessToken) { LOGGER.debug("Returning list of insights for account id = {}", accessToken.accountId); final Boolean chronological = false; final DateTime queryDate = DateTime.now(DateTimeZone.UTC).plusDays(1); final ImmutableList<InsightCard> cards = insightsDAODynamoDB.getInsightsByDate(accessToken.accountId, queryDate, chronological, MAX_INSIGHTS_NUM); if (cards.size() == 0) { final List<InsightCard> introCards = Lists.newArrayList(IntroductionInsights.getIntroductionCard(accessToken.accountId)); this.insightsDAODynamoDB.insertListOfInsights(introCards); return insightCardsWithInfoPreview(introCards); } else { return insightCardsWithInfoPreview(cards); } }

Target:
public List<InsightCard> getInsights(@Scope(OAuthScope.INSIGHTS_READ) final AccessToken accessToken) { LOGGER.debug("Returning list of insights for account id = {}", accessToken.accountId); final Boolean chronological = false; final DateTime queryDate = DateTime.now(DateTimeZone.UTC).plusDays(1); final ImmutableList<InsightCard> cards = insightsDAODynamoDB.getInsightsByDate(accessToken.accountId, queryDate, chronological, MAX_INSIGHTS_NUM); if (cards.size() == 0) { final List<InsightCard> introCards = IntroductionInsights.getIntroCards(accessToken.accountId); this.insightsDAODynamoDB.insertListOfInsights(introCards); return insightCardsWithInfoPreview(introCards); } else { return insightCardsWithInfoPreview(cards); } }
Source:
public ImageIcon getImageIcon() { Image image = getImage(); return (image == null) ? null : new ImageIcon(image); }

Target:
public @Nullable ImageIcon getImageIcon() { Image image = getImage(); return (image == null) ? null : new ImageIcon(image); }
Source:
public void signup() throws Exception { HudsonPrivateSecurityRealm securityRealm = new HudsonPrivateSecurityRealm(true, false, null); rule.jenkins.setSecurityRealm(securityRealm); JenkinsRule.WebClient wc = rule.createWebClient(); SignupPage signup = new SignupPage(wc.goTo("signup")); signup.enterUsername("alice"); signup.enterPassword("alice"); signup.enterFullName("Alice User"); signup.enterEmail("alice@nowhere.com"); HtmlPage success = signup.submit(rule); assertThat(success.getElementById("main-panel").getTextContent(), containsString("Success")); assertThat(success.getAnchorByHref("/jenkins/user/me").getTextContent(), containsString("Alice User")); assertEquals("Alice User", securityRealm.getUser("alice").getDisplayName()); }

Target:
public void signup() throws Exception { HudsonPrivateSecurityRealm securityRealm = new HudsonPrivateSecurityRealm(true, false, null); rule.jenkins.setSecurityRealm(securityRealm); JenkinsRule.WebClient wc = rule.createWebClient(); SignupPage signup = new SignupPage(wc.goTo("signup")); signup.enterUsername("alice"); signup.enterPassword("alice"); signup.enterFullName("Alice User"); signup.enterEmail("alice@nowhere.com"); HtmlPage success = signup.submit(rule); assertThat(success.getElementById("main-panel").getTextContent(), containsString("Success")); assertThat(success.getAnchorByHref("/jenkins/me").getTextContent(), containsString("Alice User")); assertEquals("Alice User", securityRealm.getUser("alice").getDisplayName()); }