auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testRemoveWebMessageListenerBasicUsage() throws Exception { WebkitUtils.checkFeature(WebViewFeature.WEB_MESSAGE_LISTENER); mWebViewOnUiThread.addWebMessageListener(JS_OBJECT_NAME, new ArrayList<String>() { { add("*"); } }, mListener); loadPage(BASIC_USAGE); TestWebMessageListener.Data data = mListener.waitForOnPostMessage(); Assert.assertEquals("hello", data.mMessage.getData()); mWebViewOnUiThread.removeWebMessageListener(JS_OBJECT_NAME); Assert.assertEquals("\"object\"", mWebViewOnUiThread.evaluateJavascriptSync("typeof " + JS_OBJECT_NAME + ";")); mWebViewOnUiThread.evaluateJavascript(JS_OBJECT_NAME + ".postMessage('hello2')", null); Assert.assertTrue(mListener.hasNoMoreOnPostMessage()); loadPage(BASIC_USAGE); Assert.assertEquals("\"undefined\"", mWebViewOnUiThread.evaluateJavascriptSync("typeof " + JS_OBJECT_NAME + ";")); }

Target:
public void testRemoveWebMessageListenerBasicUsage() throws Exception { mWebViewOnUiThread.addWebMessageListener(JS_OBJECT_NAME, new ArrayList<String>() { { add("*"); } }, mListener); loadPage(BASIC_USAGE); TestWebMessageListener.Data data = mListener.waitForOnPostMessage(); Assert.assertEquals("hello", data.mMessage.getData()); mWebViewOnUiThread.removeWebMessageListener(JS_OBJECT_NAME); Assert.assertEquals("\"object\"", mWebViewOnUiThread.evaluateJavascriptSync("typeof " + JS_OBJECT_NAME + ";")); mWebViewOnUiThread.evaluateJavascriptSync(JS_OBJECT_NAME + ".postMessage('hello2')"); Assert.assertTrue(mListener.hasNoMoreOnPostMessage()); loadPage(BASIC_USAGE); Assert.assertEquals("\"undefined\"", mWebViewOnUiThread.evaluateJavascriptSync("typeof " + JS_OBJECT_NAME + ";")); }
Source:
public void handleChildChange(String parentPath, List<String> currentChildren) { if (currentChildren == null) { LOG.info("Got ZkBarrierChangeHandler handleChildChange with null currentChildren"); return; } LOG.debug("list of children in the barrier = " + parentPath + ":" + Arrays.toString(currentChildren.toArray())); LOG.debug("list of children to compare against = " + parentPath + ":" + Arrays.toString(names.toArray())); if (currentChildren.size() == names.size() && CollectionUtils.containsAll(currentChildren, names)) { String barrierDonePath = keyBuilder.getBarrierStatePath(barrierVersion); LOG.info("Writing BARRIER DONE to " + barrierDonePath); zkUtils.getZkClient().writeData(barrierDonePath, State.DONE); zkUtils.getZkClient().unsubscribeChildChanges(barrierDonePath, this); } }

Target:
public void handleChildChange(String parentPath, List<String> currentChildren) { if (currentChildren == null) { LOG.info("Got ZkBarrierChangeHandler handleChildChange with null currentChildren"); return; } LOG.info("list of children in the barrier = " + parentPath + ":" + Arrays.toString(currentChildren.toArray())); LOG.info("list of children to compare against = " + parentPath + ":" + Arrays.toString(names.toArray())); if (currentChildren.size() == names.size() && CollectionUtils.containsAll(currentChildren, names)) { String barrierDonePath = keyBuilder.getBarrierStatePath(barrierVersion); LOG.info("Writing BARRIER DONE to " + barrierDonePath); zkUtils.getZkClient().writeData(barrierDonePath, State.DONE); zkUtils.getZkClient().unsubscribeChildChanges(barrierDonePath, this); } }
Source:
public static void tearDown() throws IOException { if (socketFile != null && socketFile.exists()) { if (!socketFile.delete()) { String message = "Unable to delete file " + socketFile + "."; throw new IOException(message); } } }

Target:
public static void tearDown() throws IOException { if (testRoot != null) { FileUtils.deleteDirectory(testRoot); } }
Source:
public void onMapReady(@NonNull final MapboxMap mapboxMap) { this.mapboxMap = mapboxMap; mapboxMap.setStyle(Style.DARK, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { VectorSource vectorSource = new VectorSource("population", "mapbox://peterqliu.d0vin3el"); mapboxMap.getStyle().addSource(vectorSource); addFillsLayer(); addExtrusionsLayer(); } }); }

Target:
public void onMapReady(@NonNull final MapboxMap mapboxMap) { this.mapboxMap = mapboxMap; mapboxMap.setStyle(Style.DARK, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { style.addSource( new VectorSource("population", "mapbox://peterqliu.d0vin3el") ); addFillsLayer(style); addExtrusionsLayer(style); } }); }
Source:
public void copy_shouldCopyAllFields() throws Exception { assertThatAllFieldsAreCopied(new Order(), null, "orderGroup", "sortWeight"); assertThatAllFieldsAreCopied(new TestOrder(), null, "orderGroup", "sortWeight"); }

Target:
public void copy_shouldCopyAllFields() throws Exception { assertThatAllFieldsAreCopied(new Order(), null); assertThatAllFieldsAreCopied(new TestOrder(), null); }
Source:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + sessionId.hashCode(); result = prime * result + allowedValues.hashCode(); result = prime * result + super.hashCode(); return result; }

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + sessionId.hashCode(); result = prime * result + super.hashCode(); return result; }
Source:
public void setRelatedAlarms(Set<OnmsAlarm> alarms) { this.m_relatedAlarms = alarms; }

Target:
public void setRelatedAlarms(Set<OnmsAlarm> alarms) { m_relatedAlarms = alarms; }
Source:
private TextPainter buildWikiTextPainter(final Rectangle bounds, final boolean modulateWidth) throws InstantiationException, IllegalAccessException, ClassNotFoundException { final int width = bounds.width; final TextPainter painter = new TextPainter(this) .setTokenizer(TextTokenizerFactory.createTextTokenizer(TextTokenizerType.WIKI)) .setText( "'''Lorem ipsum''' dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut... " + "''Italic Text,'' '''Bold Text,''' and " + "'''''Bold and Italic Text'''''" + " naked url: <LINK_4>" + " wiki url: [<LINK_0> ReadyTalk]" + " url: [<LINK_0>]") .setDrawCalculatedBounds(false) .setClipping(true) .setBounds(bounds) .setDrawBounds(false) .addNavigationListener(new NavigationListener() { @Override public void navigate(NavigationEvent event) { System.out.println("Navigate to: " + event.getUrl()); } }); if (modulateWidth) { timer.scheduleAtFixedRate(new TimerTask() { double counter = 0.0; @Override public void run() { counter += 0.01; int w = (int) (width * Math.sin(counter)) + width * 2; bounds.width = w; painter.setBounds(bounds); Display.getDefault().syncExec(new Runnable() { public void run() { if (!isDisposed()) { redraw(); } } }); } }, 0, 40); } return painter; }

Target:
private TextPainter buildWikiTextPainter(final Rectangle bounds, final boolean modulateWidth) throws InstantiationException, IllegalAccessException, ClassNotFoundException { final int width = bounds.width; final TextPainter painter = new TextPainter(this) .setTokenizer(TextTokenizerFactory.createTextTokenizer(TextTokenizerType.WIKI)) .setText( "''Williamsburg biodiesel cornhole tote bag. Butcher mlkshk Tumblr, Pinterest sweater'' " + "'''pickled pop-up. Deep v tattooed forage pickled tofu.''' " + "'''''Gastropub post-ironic Banksy, Vice swag Tumblr gentrify street''''' " + "drinking. Skateboard, [<LINK_1> Austin] Helvetica hoodie " + "distillery Cray. Meh scenester <LINK_5> mixtape " + "Etsy McSweeney's slow-carb [<LINK_3> Shoreditch]. Gluten-free pickled pug.") .setDrawCalculatedBounds(false) .setClipping(true) .setBounds(bounds) .setDrawBounds(false) .addNavigationListener(new NavigationListener() { @Override public void navigate(NavigationEvent event) { System.out.println("Navigate to: " + event.getUrl()); } }); if (modulateWidth) { timer.scheduleAtFixedRate(new TimerTask() { double counter = 0.0; @Override public void run() { counter += 0.01; int w = (int) (width * Math.sin(counter)) + width * 2; bounds.width = w; painter.setBounds(bounds); Display.getDefault().syncExec(new Runnable() { public void run() { if (!isDisposed()) { redraw(); } } }); } }, 0, 40); } return painter; }
Source:
public void test_xor() throws Exception { int[] opcodes = new int[] {Opcodes.IXOR, Opcodes.LXOR}; long start = System.currentTimeMillis(); assertBinarySymbolicValue(opcodes, SymbolicValue.XorSymbolicValue.class); long end1 = System.currentTimeMillis(); System.out.println("test_xor = "+(end1-start)); assertThrowWhenInvalidStack(opcodes, " needs 2 values on stack"); long end2 = System.currentTimeMillis(); System.out.println("test_xor2 = "+(end2-end1)); }

Target:
public void test_xor() throws Exception { int[] opcodes = new int[] {Opcodes.IXOR, Opcodes.LXOR}; assertBinarySymbolicValue(opcodes, SymbolicValue.XorSymbolicValue.class); assertThrowWhenInvalidStack(opcodes, " needs 2 values on stack"); }
Source:
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing facing) { if (capability == CapabilityEnergy.ENERGY) { return true; } if (capability != null && (capability == MJ_CONN || capability == MJ_RECV)) { return true; } return super.hasCapability(capability, facing); }

Target:
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing facing) { if (capability == CapabilityEnergy.ENERGY) { return true; } if (capability == MJ_CONN || capability == MJ_RECV) { return true; } return super.hasCapability(capability, facing); }
Source:
private boolean addImageTicketToDaemon(Guid imagedTicketId, String imagePath) { if (getParameters().getTransferType() == TransferType.Upload && !setVolumeLegalityInStorage(ILLEGAL_IMAGE)) { return false; } int timeout = getClientTicketLifetime(); String[] transferOps = new String[] {getParameters().getTransferType().getAllowedOperation()}; AddImageTicketVDSCommandParameters transferCommandParams = new AddImageTicketVDSCommandParameters(getVdsId(), imagedTicketId, getParameters().getCommandId(), transferOps, timeout, getParameters().getTransferSize(), imagePath, getParameters().getDownloadFilename(), isSparseImage(), isDirtyExtents()); VDSReturnValue vdsRetVal; try { vdsRetVal = vdsBroker.runVdsCommand(VDSCommandType.AddImageTicket, transferCommandParams); } catch (RuntimeException e) { log.error("Failed to start image transfer session: {}", e.getMessage(), e); return false; } if (!vdsRetVal.getSucceeded()) { log.error("Failed to start image transfer session"); return false; } log.info("Started transfer session with ticket id {}, timeout seconds", imagedTicketId.toString(), timeout); return true; }

Target:
private boolean addImageTicketToDaemon(Guid imagedTicketId, String imagePath) { if (getParameters().getTransferType() == TransferType.Upload && !setVolumeLegalityInStorage(ILLEGAL_IMAGE)) { return false; } int timeout = getClientTicketLifetime(); String[] transferOps = new String[] {getParameters().getTransferType().getAllowedOperation()}; AddImageTicketVDSCommandParameters transferCommandParams = new AddImageTicketVDSCommandParameters(getVdsId(), imagedTicketId, getParameters().getCommandId(), transferOps, timeout, getParameters().getTransferSize(), imagePath, getParameters().getDownloadFilename(), isSparseImage(), isSupportsDirtyExtents()); VDSReturnValue vdsRetVal; try { vdsRetVal = vdsBroker.runVdsCommand(VDSCommandType.AddImageTicket, transferCommandParams); } catch (RuntimeException e) { log.error("Failed to start image transfer session: {}", e.getMessage(), e); return false; } if (!vdsRetVal.getSucceeded()) { log.error("Failed to start image transfer session"); return false; } log.info("Started transfer session with ticket id {}, timeout seconds", imagedTicketId.toString(), timeout); return true; }
Source:
public ClusterCachesInfo(GridKernalContext ctx) { this.ctx = ctx; ctx.metric().list(CACHES_MON_LIST, CACHES_MON_LIST_DESC, CacheView.class, l -> cachesMonList = l, l -> cachesMonList = null); ctx.metric().list(CACHE_GRPS_MON_LIST, CACHE_GRPS_MON_LIST_DESC, CacheGroupView.class, l -> cachesGrpMonList = l, l -> cachesGrpMonList = null); log = ctx.log(getClass()); }

Target:
public ClusterCachesInfo(GridKernalContext ctx) { this.ctx = ctx; ctx.systemView().registerView(CACHES_VIEW, CACHES_VIEW_DESC, CacheView.class, registeredCaches.values(), CacheView::new); ctx.systemView().registerView(CACHE_GRPS_VIEW, CACHE_GRPS_VIEW_DESC, CacheGroupView.class, registeredCacheGrps.values(), CacheGroupView::new); log = ctx.log(getClass()); }
Source:
public void authorize(Table table, Privilege[] readRequiredPriv, Privilege[] writeRequiredPriv) throws HiveException, AuthorizationException { try { initWh(); } catch (MetaException ex) { throw hiveException(ex); } DropPrivilegeExtractor privExtractor = new DropPrivilegeExtractor(readRequiredPriv, writeRequiredPriv); readRequiredPriv = privExtractor.getReadReqPriv(); writeRequiredPriv = privExtractor.getWriteReqPriv(); if (privExtractor.hasDropPrivilege || requireCreatePrivilege(readRequiredPriv) || requireCreatePrivilege(writeRequiredPriv)) { authorize(hive_db.getDatabase(table.getCatName(), table.getDbName()), new Privilege[] {}, new Privilege[] { Privilege.ALTER_DATA }); } Path path = table.getDataLocation(); if (privExtractor.hasDropPrivilege() && (table.getTableType() != TableType.EXTERNAL_TABLE || getConf().getBoolean(HiveConf.ConfVars.METASTORE_AUTHORIZATION_EXTERNALTABLE_DROP_CHECK.varname, HiveConf.ConfVars.METASTORE_AUTHORIZATION_EXTERNALTABLE_DROP_CHECK.defaultBoolVal))) { checkDeletePermission(path, getConf(), authenticator.getUserName()); } try { String user = SecurityUtils.getUGI().getShortUserName(); if (MetaStoreServerUtils.checkUserHasHostProxyPrivileges(user, getConf(), HiveMetaStore.HMSHandler.getIPAddress())) { LOG.info("Path authentication is skipped for user with host proxy privilege." + user); } } catch (Exception ex) { LOG.error("Cannot obtain username to check for host proxy privilege", ex); } if (path != null) { authorize(path, readRequiredPriv, writeRequiredPriv); } }

Target:
public void authorize(Table table, Privilege[] readRequiredPriv, Privilege[] writeRequiredPriv) throws HiveException, AuthorizationException { try { initWh(); } catch (MetaException ex) { throw hiveException(ex); } DropPrivilegeExtractor privExtractor = new DropPrivilegeExtractor(readRequiredPriv, writeRequiredPriv); readRequiredPriv = privExtractor.getReadReqPriv(); writeRequiredPriv = privExtractor.getWriteReqPriv(); if (privExtractor.hasDropPrivilege || requireCreatePrivilege(readRequiredPriv) || requireCreatePrivilege(writeRequiredPriv)) { authorize(hive_db.getDatabase(table.getCatName(), table.getDbName()), new Privilege[] {}, new Privilege[] { Privilege.ALTER_DATA }); } Path path = table.getDataLocation(); if (privExtractor.hasDropPrivilege() && (table.getTableType() != TableType.EXTERNAL_TABLE || getConf().getBoolean(HiveConf.ConfVars.METASTORE_AUTHORIZATION_EXTERNALTABLE_DROP_CHECK.varname, HiveConf.ConfVars.METASTORE_AUTHORIZATION_EXTERNALTABLE_DROP_CHECK.defaultBoolVal))) { checkDeletePermission(path, getConf(), authenticator.getUserName()); } if (path != null) { authorize(path, readRequiredPriv, writeRequiredPriv); } }
Source:
public TurboLabel(String repoId, String name) { this.actualName = name; this.colour = "ffffff"; this.repoId = repoId; this.isInExclusiveGroup = checkIfInExclusiveGroup(); }

Target:
public TurboLabel(String repoId, String name) { this(repoId, DEFAULT_COLOR, name); }
Source:
public ModelAndView index(Request request, Response response) { boolean isSecurityEnabled = this.securityService.isSecurityEnabled(); JsonObject showBanner = new JsonObject(); showBanner.addProperty("showBanner", isSecurityEnabled); Map<Object, Object> object = new HashMap<Object, Object>() {{ put("viewTitle", "User Summary"); put("meta", showBanner); }}; return new ModelAndView(object, null); }

Target:
public ModelAndView index(Request request, Response response) { JsonObject noAdminsConfigured = new JsonObject(); noAdminsConfigured.addProperty("noAdminsConfigured", this.securityService.noAdminsConfigured()); Map<Object, Object> object = new HashMap<Object, Object>() {{ put("viewTitle", "User Summary"); put("meta", noAdminsConfigured); }}; return new ModelAndView(object, null); }
Source:
protected void createCacheManagers() throws Throwable { ConfigurationBuilder cfgBuilder = hotRodCacheConfiguration(getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, false)); cfgBuilder.encoding().key().mediaType(MediaType.APPLICATION_PROTOSTREAM_TYPE); cfgBuilder.encoding().value().mediaType(MediaType.APPLICATION_PROTOSTREAM_TYPE); createHotRodServers(NUM_NODES, cfgBuilder); waitForClusterToForm(); RemoteCache<String, String> metadataCache = client(0).getCache(ProtobufMetadataManagerConstants.PROTOBUF_METADATA_CACHE_NAME); metadataCache.put("sample_bank_account/bank.proto", Util.getResourceAsString("/sample_bank_account/bank.proto", getClass().getClassLoader())); assertFalse(metadataCache.containsKey(ProtobufMetadataManagerConstants.ERRORS_KEY_SUFFIX)); cacheManagers.forEach(cm -> { ProtobufMetadataManager metadataManager = cm.getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class); metadataManager.registerMarshaller(new UserMarshaller()); metadataManager.registerMarshaller(new GenderMarshaller()); metadataManager.registerMarshaller(new AddressMarshaller()); metadataManager.registerMarshaller(new AccountMarshaller()); metadataManager.registerMarshaller(new TransactionMarshaller()); }); MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext(client(0))); }

Target:
protected void createCacheManagers() throws Throwable { ConfigurationBuilder cfgBuilder = hotRodCacheConfiguration(getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, false)); cfgBuilder.encoding().key().mediaType(MediaType.APPLICATION_PROTOSTREAM_TYPE); cfgBuilder.encoding().value().mediaType(MediaType.APPLICATION_PROTOSTREAM_TYPE); createHotRodServers(NUM_NODES, cfgBuilder); waitForClusterToForm(); RemoteCache<String, String> metadataCache = client(0).getCache(ProtobufMetadataManagerConstants.PROTOBUF_METADATA_CACHE_NAME); metadataCache.put("sample_bank_account/bank.proto", Util.getResourceAsString("/sample_bank_account/bank.proto", getClass().getClassLoader())); assertFalse(metadataCache.containsKey(ProtobufMetadataManagerConstants.ERRORS_KEY_SUFFIX)); for (EmbeddedCacheManager cm : cacheManagers) { MarshallerRegistration.registerMarshallers(ProtobufMetadataManagerImpl.getSerializationContextInternal(cm)); } MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext(client(0))); }
Source:
public Stddev(String fieldName, Schema fieldSchema) { Schema.Type fieldType = fieldSchema.isNullable() ? fieldSchema.getNonNullable().getType() : fieldSchema.getType(); if (!AggregationUtils.isNumericType(fieldType)) { throw new IllegalArgumentException(String.format( "Cannot compute standard devisation on field %s because its type %s is not numeric", fieldName, fieldType)); } this.variance = new Variance(fieldName, fieldSchema); }

Target:
public Stddev(String fieldName, Schema fieldSchema) { Schema.Type fieldType = fieldSchema.isNullable() ? fieldSchema.getNonNullable().getType() : fieldSchema.getType(); if (!AggregationUtils.isNumericType(fieldType)) { throw new IllegalArgumentException(String.format( "Cannot compute standard deviation on field %s because its type %s is not numeric", fieldName, fieldType)); } this.variance = new Variance(fieldName, fieldSchema); }
Source:
private static Pair<PackingPlan, Resource> doScalingTest(TopologyAPI.Topology topology, Map<String, Integer> componentChanges, long boltRam, int boltParallelism, long spoutRam, int spoutParallelism, int numContainersBeforeRepack, int totalInstancesExpected) { Pair<PackingPlan, Resource> packingInfo; PackingPlan packingPlan = getFirstFitDecreasingPackingPlan(topology); Assert.assertEquals(numContainersBeforeRepack, packingPlan.getContainers().size()); Assert.assertEquals(totalInstancesExpected, (int) packingPlan.getInstanceCount()); AssertPacking.assertContainers(packingPlan.getContainers(), BOLT_NAME, SPOUT_NAME, boltRam, spoutRam, null); AssertPacking.assertNumInstances(packingPlan.getContainers(), BOLT_NAME, boltParallelism); AssertPacking.assertNumInstances(packingPlan.getContainers(), SPOUT_NAME, spoutParallelism); PackingPlan newPackingPlan = getFirstFitDecreasingPackingPlanRepack(topology, packingPlan, componentChanges); packingInfo = new Pair<PackingPlan, Resource>( newPackingPlan, packingPlan.getMaxContainerResources()); return packingInfo; }

Target:
private static PackingPlan doScalingTest(TopologyAPI.Topology topology, Map<String, Integer> componentChanges, long boltRam, int boltParallelism, long spoutRam, int spoutParallelism, int numContainersBeforeRepack, int totalInstancesExpected) { PackingPlan packingPlan = getFirstFitDecreasingPackingPlan(topology); Assert.assertEquals(numContainersBeforeRepack, packingPlan.getContainers().size()); Assert.assertEquals(totalInstancesExpected, (int) packingPlan.getInstanceCount()); AssertPacking.assertContainers(packingPlan.getContainers(), BOLT_NAME, SPOUT_NAME, boltRam, spoutRam, null); AssertPacking.assertNumInstances(packingPlan.getContainers(), BOLT_NAME, boltParallelism); AssertPacking.assertNumInstances(packingPlan.getContainers(), SPOUT_NAME, spoutParallelism); PackingPlan newPackingPlan = getFirstFitDecreasingPackingPlanRepack(topology, packingPlan, componentChanges); AssertPacking.assertContainerRam(newPackingPlan.getContainers(), packingPlan.getMaxContainerResources().getRam()); return newPackingPlan; }
Source:
public static String buildLink(String parentObjectId, String objectId, PORTLET_INFO portletInfo) { return buildLink(parentObjectId, objectId, portletInfo, Util.getPortalRequestContext().getSiteName()); }

Target:
public static String buildLink(String parentObjectId, String objectId, PORTLET_INFO portletInfo) { return buildLink(parentObjectId, objectId, portletInfo, CommonsUtils.getCurrentSite().getName()); }
Source:
public void startContainer(ContainerModel containerModel, Config config, int maxChangelogStreamPartitions) { LocalityManager localityManager = null; if (new ClusterManagerConfig(config).getHostAffinityEnabled()) { localityManager = SamzaContainer$.MODULE$.getLocalityManager(containerModel.getContainerId(), config); } log.info("About to create container: " + containerModel.getContainerId()); container = SamzaContainer$.MODULE$.apply( containerModel.getContainerId(), containerModel, config, maxChangelogStreamPartitions, localityManager, new JmxServer(), Util.<String, MetricsReporter>javaMapAsScalaMap(metricsReporterMap), taskFactory, ApplicationRunner.getLocalRunner(config)); log.info("About to start container: " + containerModel.getContainerId()); containerFuture = executorService.submit(() -> container.run()); }

Target:
public void startContainer(ContainerModel containerModel, Config config, int maxChangelogStreamPartitions) { LocalityManager localityManager = null; if (new ClusterManagerConfig(config).getHostAffinityEnabled()) { localityManager = SamzaContainer$.MODULE$.getLocalityManager(containerModel.getContainerId(), config); } log.info("About to create container: " + containerModel.getContainerId()); container = SamzaContainer$.MODULE$.apply( containerModel.getContainerId(), containerModel, config, maxChangelogStreamPartitions, localityManager, new JmxServer(), Util.<String, MetricsReporter>javaMapAsScalaMap(metricsReporterMap), taskFactory, null); log.info("About to start container: " + containerModel.getContainerId()); containerFuture = executorService.submit(() -> container.run()); }
Source:
private MutateRowsRequest.Entry toEntry(RowMutation rowMutation) { return rowMutation.toBulkProto(RequestContext.create("p", "i", "a")).getEntries(0); }

Target:
private MutateRowsRequest.Entry toEntry(RowMutation rowMutation) { return rowMutation.toBulkProto(requestContext).getEntries(0); }
Source:
public void write(JsonWriter out, Layer value) throws IOException { out.beginObject(); out.name("fromY"); out.value(value.fromY); out.name("toY"); out.value(value.toY); out.name("blockState"); out.value(GameData.getBlockStateIDMap().get(value.blockState)); out.endObject(); }

Target:
public void write(JsonWriter out, Layer value) throws IOException { out.beginObject(); out.name("fromY"); out.value(value.fromY); out.name("toY"); out.value(value.toY); out.name("blockRegistryName"); String blockRegistryName = Block.REGISTRY.getNameForObject(value.blockState.getBlock()).toString(); out.value(blockRegistryName); value.blockState.getProperties().forEach((p, v) -> { try { out.name(p.getName()); out.value(getValueName(p, v)); } catch (IOException e) { throw new UncheckedIOException("Input error while converting to Json a BlockState instance of block " + blockRegistryName + " for config of flat cube type world.", e); } }); out.endObject(); }
Source:
static Pair<Float, Float> fill(@NonNull final View container, @NonNull final View view, @NonNull final Size bufferSize) { if (container.getWidth() == 0 || container.getHeight() == 0 || view.getWidth() == 0 || view.getHeight() == 0 || bufferSize.getWidth() == 0 || bufferSize.getHeight() == 0) { return new Pair<>(1F, 1F); } final int viewRotationDegrees = (int) RotationTransform.getRotation(view); final boolean isNaturalPortrait = isNaturalPortrait(view.getContext(), viewRotationDegrees); final int bufferWidth; final int bufferHeight; if (isNaturalPortrait) { bufferWidth = bufferSize.getHeight(); bufferHeight = bufferSize.getWidth(); } else { bufferWidth = bufferSize.getWidth(); bufferHeight = bufferSize.getHeight(); } float scaleX = bufferWidth / (float) view.getWidth(); float scaleY = bufferHeight / (float) view.getHeight(); int bufferRotatedWidth; int bufferRotatedHeight; if (viewRotationDegrees == 0 || viewRotationDegrees == 180) { bufferRotatedWidth = bufferWidth; bufferRotatedHeight = bufferHeight; } else { bufferRotatedWidth = bufferHeight; bufferRotatedHeight = bufferWidth; } final float scale = Math.max(container.getWidth() / (float) bufferRotatedWidth, container.getHeight() / (float) bufferRotatedHeight); scaleX *= scale; scaleY *= scale; return new Pair<>(scaleX, scaleY); }

Target:
static Pair<Float, Float> fill(@NonNull final View container, @NonNull final View view, @NonNull final Size bufferSize) { if (container.getWidth() == 0 || container.getHeight() == 0 || view.getWidth() == 0 || view.getHeight() == 0 || bufferSize.getWidth() == 0 || bufferSize.getHeight() == 0) { return new Pair<>(1F, 1F); } final int viewRotationDegrees = (int) RotationTransform.getRotationDegrees(view); final boolean isNaturalPortrait = isNaturalPortrait(view.getContext(), viewRotationDegrees); final int bufferWidth; final int bufferHeight; if (isNaturalPortrait) { bufferWidth = bufferSize.getHeight(); bufferHeight = bufferSize.getWidth(); } else { bufferWidth = bufferSize.getWidth(); bufferHeight = bufferSize.getHeight(); } float scaleX = bufferWidth / (float) view.getWidth(); float scaleY = bufferHeight / (float) view.getHeight(); int bufferRotatedWidth; int bufferRotatedHeight; if (viewRotationDegrees == 0 || viewRotationDegrees == 180) { bufferRotatedWidth = bufferWidth; bufferRotatedHeight = bufferHeight; } else { bufferRotatedWidth = bufferHeight; bufferRotatedHeight = bufferWidth; } final float scale = Math.max(container.getWidth() / (float) bufferRotatedWidth, container.getHeight() / (float) bufferRotatedHeight); scaleX *= scale; scaleY *= scale; return new Pair<>(scaleX, scaleY); }
Source:
public void testSupportHandlerManager() { SupportHandlerManager handlerManager = new SupportHandlerManager(); SupportProviderManager providerManager = new SupportProviderManager(); SupportProduct product = providerManager.getProduct("org.eclipse.mylyn.tasks.tests.productnormal"); IStatus status = new ProductStatus(product); SupportRequest request = new SupportRequest(providerManager, status, product); handlerManager.preProcess(request); assertTrue(((AttributeTaskMapper) request.getDefaultContribution()).isMappingComplete()); IProgressMonitor monitor = new NullOperationMonitor(); handlerManager.process(request.getDefaultContribution(), monitor); assertNotNull(request.getDefaultContribution()); AttributeTaskMapper mapper = ((AttributeTaskMapper) request.getDefaultContribution()); assertTrue(!mapper.isHandled()); TaskData taskData = null; try { taskData = mapper.createTaskData(monitor); } catch (CoreException e) { fail("unexpected CoreException " + e.getMessage()); } assertNotNull(taskData); mapper.setTaskData(taskData); handlerManager.postProcess(mapper, monitor); @SuppressWarnings("null") TaskAttribute serv = taskData.getRoot().getMappedAttribute(TaskAttribute.SEVERITY); assertEquals("enhancement", serv.getValue()); }

Target:
public void testSupportHandlerManager() throws CoreException { SupportHandlerManager handlerManager = new SupportHandlerManager(); SupportProviderManager providerManager = new SupportProviderManager(); SupportProduct product = providerManager.getProduct("org.eclipse.mylyn.tasks.tests.productnormal"); IStatus status = new ProductStatus(product); SupportRequest request = new SupportRequest(providerManager, status, product); handlerManager.preProcess(request); assertTrue(((AttributeTaskMapper) request.getDefaultContribution()).isMappingComplete()); IProgressMonitor monitor = new NullOperationMonitor(); handlerManager.process(request.getDefaultContribution(), monitor); assertNotNull(request.getDefaultContribution()); AttributeTaskMapper mapper = ((AttributeTaskMapper) request.getDefaultContribution()); assertTrue(!mapper.isHandled()); TaskData taskData = null; taskData = mapper.createTaskData(monitor); assertNotNull(taskData); mapper.setTaskData(taskData); handlerManager.postProcess(mapper, monitor); TaskAttribute serv = taskData.getRoot().getMappedAttribute(TaskAttribute.SEVERITY); assertEquals("enhancement", serv.getValue()); }
Source:
private boolean isDiscardedValueExpression(IASTExpression expr) { IASTNode parent = expr.getParent(); if (expr.getParent() instanceof IASTExpressionStatement) return true; if (checkNestedLeftSide(expr)) { return true; } if (expr.getPropertyInParent() != IASTExpressionList.NESTED_EXPRESSION) { while (parent instanceof IASTUnaryExpression) { int operator = ((IASTUnaryExpression) parent).getOperator(); if (operator != IASTUnaryExpression.op_bracketedPrimary) { return false; } parent = parent.getParent(); } if (parent instanceof IASTExpressionStatement) { return true; } } return false; }

Target:
private boolean isDiscardedValueExpression(IASTExpression expr) { IASTNode parent = expr.getParent(); IASTNode child = expr; while (parent instanceof IASTUnaryExpression) { int operator = ((IASTUnaryExpression) parent).getOperator(); if (operator != IASTUnaryExpression.op_bracketedPrimary) { return false; } child = parent; parent = parent.getParent(); } if (parent instanceof IASTExpressionStatement) { return true; } if (child instanceof IASTExpression && checkNestedLeftSide((IASTExpression) child)) { return true; } return false; }
Source:
public void flush(final int writeOffset) { size = VarInt.read(last.data, processingOffset, writeOffset, nextOffset); if (nextOffset.integer > -5 && nextOffset.integer < 1) { if (writeOffset == last.data.length) { nextOffset.integer = 0; processingOffset = 0; last.writingOffset = writeOffset; return; } } else if (nextOffset.integer == -5) { throw new RuntimeException("problemo!"); } if (size == 0) { nextOffset.integer = 0; processingOffset = 0; last.writingOffset = writeOffset; return; } processingOffset = nextOffset.integer; if (processingOffset + size <= writeOffset) { switch (last.data[processingOffset]) { case MessageType.BEGIN_WINDOW_VALUE: Tuple bwt = Tuple.getTuple(last.data, processingOffset, size); if (last.starting_window == -1) { last.starting_window = baseSeconds | bwt.getWindowId(); last.ending_window = last.starting_window; } else { last.ending_window = baseSeconds | bwt.getWindowId(); } break; case MessageType.RESET_WINDOW_VALUE: Tuple rwt = Tuple.getTuple(last.data, processingOffset, size); baseSeconds = (long)rwt.getBaseSeconds() << 32; break; default: break; } processingOffset += size; size = 0; } else { if (writeOffset == last.data.length) { nextOffset.integer = 0; processingOffset = 0; size = 0; } } last.writingOffset = writeOffset; notifyListeners(); }

Target:
public void flush(final int writeOffset) { if (dataFromSocket) { flushFromSocket(writeOffset); } else { flushInMemoryQueue(writeOffset); } last.writingOffset = writeOffset; notifyListeners(); }
Source:
private static boolean isThriftSupported(boolean dse, VersionNumber version) { return (!dse && version.compareTo(VersionNumber.parse("3.10")) < 0) || (dse && version.compareTo(VersionNumber.parse("5.1")) < 0); }

Target:
private static boolean isThriftSupported(boolean dse, VersionNumber version) { return dse || version.compareTo(VersionNumber.parse("4.0")) < 0; }
Source:
private String enableCapabilities() throws TransportException { final StringBuilder line = new StringBuilder(); if (noProgress) wantCapability(line, OPTION_NO_PROGRESS); if (includeTags) includeTags = wantCapability(line, OPTION_INCLUDE_TAG); if (allowOfsDelta) wantCapability(line, OPTION_OFS_DELTA); if (wantCapability(line, OPTION_MULTI_ACK_DETAILED)) { multiAck = MultiAck.DETAILED; if (statelessRPC) noDone = wantCapability(line, OPTION_NO_DONE); } else if (wantCapability(line, OPTION_MULTI_ACK)) multiAck = MultiAck.CONTINUE; else multiAck = MultiAck.OFF; if (thinPack) thinPack = wantCapability(line, OPTION_THIN_PACK); if (wantCapability(line, OPTION_SIDE_BAND_64K)) sideband = true; else if (wantCapability(line, OPTION_SIDE_BAND)) sideband = true; if (statelessRPC && multiAck != MultiAck.DETAILED) { throw new PackProtocolException(uri, MessageFormat.format( JGitText.get().statelessRPCRequiresOptionToBeEnabled, OPTION_MULTI_ACK_DETAILED)); } if (filterBlobLimit >= 0) { if (!wantCapability(line, OPTION_FILTER)) { throw new PackProtocolException(uri, JGitText.get().filterRequiresCapability); } } addUserAgentCapability(line); return line.toString(); }

Target:
private String enableCapabilities() throws TransportException { final StringBuilder line = new StringBuilder(); if (noProgress) wantCapability(line, OPTION_NO_PROGRESS); if (includeTags) includeTags = wantCapability(line, OPTION_INCLUDE_TAG); if (allowOfsDelta) wantCapability(line, OPTION_OFS_DELTA); if (wantCapability(line, OPTION_MULTI_ACK_DETAILED)) { multiAck = MultiAck.DETAILED; if (statelessRPC) noDone = wantCapability(line, OPTION_NO_DONE); } else if (wantCapability(line, OPTION_MULTI_ACK)) multiAck = MultiAck.CONTINUE; else multiAck = MultiAck.OFF; if (thinPack) thinPack = wantCapability(line, OPTION_THIN_PACK); if (wantCapability(line, OPTION_SIDE_BAND_64K)) sideband = true; else if (wantCapability(line, OPTION_SIDE_BAND)) sideband = true; if (statelessRPC && multiAck != MultiAck.DETAILED) { throw new PackProtocolException(uri, MessageFormat.format( JGitText.get().statelessRPCRequiresOptionToBeEnabled, OPTION_MULTI_ACK_DETAILED)); } if (filterBlobLimit >= 0 && !wantCapability(line, OPTION_FILTER)) { throw new PackProtocolException(uri, JGitText.get().filterRequiresCapability); } addUserAgentCapability(line); return line.toString(); }
Source:
@Override public void onResume() { super.onResume(); if (mGoogleApiClient != null && mGoogleApiClient.isConnected() && !mIsResolvingError && !mShouldResolveError) { startSignInProcess(); } }

Target:
public void onResume() { super.onResume(); if (mGoogleApiClient != null && mGoogleApiClient.isConnected() && !mIsResolvingError && !mShouldResolveError) { startFlow(); } }
Source:
void initializeRow(List<Patch> patches, int row) { Patch patch = patches.get(row - 1); PatchSetKeys psk = new PatchSetKeys(patchesToKeys(patches), row - 1, PatchTable.this.psid.getParentKey()); setRowItem(row, patch); Widget nameCol; if (patch.getPatchType() == Patch.PatchType.UNIFIED) { nameCol = new PatchLink.SideBySide(patch.getFileName(), psk); } else { nameCol = new PatchLink.Unified(patch.getFileName(), psk); } if (patch.getSourceFileName() != null) { final String text; if (patch.getChangeType() == Patch.ChangeType.RENAMED) { text = Util.M.renamedFrom(patch.getSourceFileName()); } else if (patch.getChangeType() == Patch.ChangeType.COPIED) { text = Util.M.copiedFrom(patch.getSourceFileName()); } else { text = Util.M.otherFrom(patch.getSourceFileName()); } final Label line = new Label(text); line.setStyleName("SourceFilePath"); final FlowPanel cell = new FlowPanel(); cell.add(nameCol); cell.add(line); nameCol = cell; } table.setWidget(row, C_PATH, nameCol); int C_UNIFIED = C_SIDEBYSIDE + 1; if (patch.getPatchType() == Patch.PatchType.UNIFIED) { table.setWidget(row, C_SIDEBYSIDE, new PatchLink.SideBySide(Util.C .patchTableDiffSideBySide(), psk)); } else if (patch.getPatchType() == Patch.PatchType.BINARY) { C_UNIFIED = C_SIDEBYSIDE + 2; } table.setWidget(row, C_UNIFIED, new PatchLink.Unified(Util.C .patchTableDiffUnified(), psk)); }

Target:
void initializeRow(List<Patch> patches, int row) { Patch patch = patches.get(row - 1); setRowItem(row, patch); Widget nameCol; if (patch.getPatchType() == Patch.PatchType.UNIFIED) { nameCol = new PatchLink.SideBySide(patch.getFileName(), patch.getKey(), row - 1, PatchTable.this); } else { nameCol = new PatchLink.Unified(patch.getFileName(), patch.getKey(), row - 1, PatchTable.this); } if (patch.getSourceFileName() != null) { final String text; if (patch.getChangeType() == Patch.ChangeType.RENAMED) { text = Util.M.renamedFrom(patch.getSourceFileName()); } else if (patch.getChangeType() == Patch.ChangeType.COPIED) { text = Util.M.copiedFrom(patch.getSourceFileName()); } else { text = Util.M.otherFrom(patch.getSourceFileName()); } final Label line = new Label(text); line.setStyleName("SourceFilePath"); final FlowPanel cell = new FlowPanel(); cell.add(nameCol); cell.add(line); nameCol = cell; } table.setWidget(row, C_PATH, nameCol); int C_UNIFIED = C_SIDEBYSIDE + 1; if (patch.getPatchType() == Patch.PatchType.UNIFIED) { table.setWidget(row, C_SIDEBYSIDE, new PatchLink.SideBySide(Util.C.patchTableDiffSideBySide(), patch.getKey(), row - 1, PatchTable.this)); } else if (patch.getPatchType() == Patch.PatchType.BINARY) { C_UNIFIED = C_SIDEBYSIDE + 2; } table.setWidget(row, C_UNIFIED, new PatchLink.Unified(Util.C.patchTableDiffUnified(), patch.getKey(), row - 1, PatchTable.this)); }
Source:
private void generateDummyResponse() { DummyTransactionResponseMessage response = new DummyTransactionResponseMessage(this); response.m_sourceHSId = m_initiator.getHSId(); m_initiator.deliver(response); }

Target:
private void generateDummyResponse() { doCommonSPICompleteActions(); DummyTransactionResponseMessage response = new DummyTransactionResponseMessage(this); response.m_sourceHSId = m_initiator.getHSId(); m_initiator.deliver(response); }
Source:
protected void registerTriggerProducers() { registerTriggerProducer(Touch.class, (TriggerProducer) Engine.engine .getEventListener()); registerTriggerProducer(Time.class, new TimeEmitter()); }

Target:
protected void registerTriggerProducers() { registerTriggerSource(Touch.class, (TriggerSource) Engine.engine .getEventListener()); registerTriggerSource(Time.class, new TimeSource()); }
Source:
private FwdPassReturn activateHelper(final boolean training, final INDArray prevOutputActivations, final INDArray prevMemCellState, boolean forBackprop, LayerWorkspaceMgr workspaceMgr) { assertInputSet(false); Preconditions.checkState(input.shape().length == 3, "3D input expected to RNN layer expected, got " + input.shape().length); applyDropOutIfNecessary(training, workspaceMgr); cacheMode = CacheMode.NONE; if (forBackprop && cachedFwdPass != null) { FwdPassReturn ret = cachedFwdPass; cachedFwdPass = null; return ret; } final INDArray recurrentWeights = getParamWithNoise(GravesLSTMParamInitializer.RECURRENT_WEIGHT_KEY, training, workspaceMgr); final INDArray inputWeights = getParamWithNoise(GravesLSTMParamInitializer.INPUT_WEIGHT_KEY, training, workspaceMgr); final INDArray biases = getParamWithNoise(GravesLSTMParamInitializer.BIAS_KEY, training, workspaceMgr); FwdPassReturn fwd = LSTMHelpers.activateHelper(this, this.conf, this.layerConf().getGateActivationFn(), this.input, recurrentWeights, inputWeights, biases, training, prevOutputActivations, prevMemCellState, forBackprop || (cacheMode != CacheMode.NONE && training), true, GravesLSTMParamInitializer.INPUT_WEIGHT_KEY, maskArray, true, null, cacheMode, workspaceMgr); if (training && cacheMode != CacheMode.NONE) { cachedFwdPass = fwd; } return fwd; }

Target:
private FwdPassReturn activateHelper(final boolean training, final INDArray prevOutputActivations, final INDArray prevMemCellState, boolean forBackprop, LayerWorkspaceMgr workspaceMgr) { assertInputSet(false); Preconditions.checkState(input.rank() == 3, "3D input expected to RNN layer expected, got %s", input.rank()); applyDropOutIfNecessary(training, workspaceMgr); cacheMode = CacheMode.NONE; if (forBackprop && cachedFwdPass != null) { FwdPassReturn ret = cachedFwdPass; cachedFwdPass = null; return ret; } final INDArray recurrentWeights = getParamWithNoise(GravesLSTMParamInitializer.RECURRENT_WEIGHT_KEY, training, workspaceMgr); final INDArray inputWeights = getParamWithNoise(GravesLSTMParamInitializer.INPUT_WEIGHT_KEY, training, workspaceMgr); final INDArray biases = getParamWithNoise(GravesLSTMParamInitializer.BIAS_KEY, training, workspaceMgr); FwdPassReturn fwd = LSTMHelpers.activateHelper(this, this.conf, this.layerConf().getGateActivationFn(), this.input, recurrentWeights, inputWeights, biases, training, prevOutputActivations, prevMemCellState, forBackprop || (cacheMode != CacheMode.NONE && training), true, GravesLSTMParamInitializer.INPUT_WEIGHT_KEY, maskArray, true, null, cacheMode, workspaceMgr); if (training && cacheMode != CacheMode.NONE) { cachedFwdPass = fwd; } return fwd; }
Source:
private void printStatusMessage() { StringBuilder msg = new StringBuilder(); msg.append("Nuxeo Platform Started\n"); if (getStatusMessage(msg)) { log.info(msg); } else { log.error(msg); boolean strict = System.getProperty("nuxeo.start.strict") != null; if (strict) { throw new IllegalStateException("Startup aborted due to previous failures (strict mode)"); } } }

Target:
private void printStatusMessage() { StringBuilder msg = new StringBuilder(); msg.append("Nuxeo Platform Started\n"); if (getStatusMessage(msg)) { log.info(msg); } else { log.error(msg); if (Boolean.getBoolean("nuxeo.start.strict")) { throw new IllegalStateException("Startup aborted due to previous failures (strict mode)"); } } }
Source:
private void checkNetworkAndShowScreen(){ ConnectivityManager cm = (ConnectivityManager)this.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); boolean isConnected = activeNetwork != null && activeNetwork.isConnectedOrConnecting(); if (isConnected) { setContentView(R.layout.activity_category); setSupportActionBar(findViewById(R.id.toolbar)); setTitle(R.string.category_drawer); getSupportActionBar().setDisplayHomeAsUpEnabled(true); } else{ setContentView(R.layout.offline_cloud_layout); findViewById(R.id.buttonToRefresh).setOnClickListener(view -> checkNetworkAndShowScreen()); } }

Target:
private void checkNetworkAndShowScreen(){ if (Utils.isNetworkConnected(this)) { onlineView.setVisibility(View.VISIBLE); offlineView.setVisibility(View.GONE); } else{ offlineView.setVisibility(View.VISIBLE); onlineView.setVisibility(View.GONE); } }
Source:
public void validateDiskInBackupDomain() { initializeCommand(new DiskImage(), VmEntityType.VM); initSrcStorageDomain(); initDestStorageDomain(StorageType.NFS); command.getStorageDomain().isBackup(); ValidateTestUtils.runAndAssertValidateFailure(command, EngineMessage.ACTION_TYPE_FAILED_RUNNING_VM_DISK_CANNOT_COPY_OR_MOVE_TO_BACKUP_DOMAIN); }

Target:
public void validateDiskInBackupDomain() { initializeCommand(new DiskImage(), VmEntityType.VM); initSrcStorageDomain(); StorageDomain destDomain = new StorageDomain(); destDomain.setStorageType(StorageType.NFS); destDomain.setStatus(StorageDomainStatus.Active); destDomain.setBackup(true); doReturn(destDomain).when(command).getStorageDomain(); ValidateTestUtils.runAndAssertValidateFailure(command, EngineMessage.ACTION_TYPE_FAILED_RUNNING_VM_DISK_CANNOT_COPY_OR_MOVE_TO_BACKUP_DOMAIN); }
Source:
public String toCodeStringPostStatement() { StringBuilder b = new StringBuilder(); String exceptionClassName = getExceptionName(); if (exceptionClassName == null) { exceptionClassName = "Exception"; } appendTryBehavior(b, exceptionClassName); if (Modifier.isPublic(exception.getClass().getModifiers())) { b.append("} catch (" + exceptionClassName + " e) {" + Globals.lineSep); b.append(" b.append("}" + Globals.lineSep); } else { Class<?> publicSuperClass = nearestVisibleSuperclass(exception.getClass()); String publicSuperClassName = publicSuperClass.getCanonicalName(); b.append("} catch (" + publicSuperClassName + " e) {" + Globals.lineSep); b.append(" appendCatchBehavior(b, exceptionClassName); b.append("}" + Globals.lineSep); } return b.toString(); }

Target:
public final String toCodeStringPostStatement() { StringBuilder b = new StringBuilder(); if (catchClassName == null) { catchClassName = "Exception"; } String exceptionClassName = getExceptionName(); appendTryBehavior(b, exceptionClassName); b.append("} catch (" + catchClassName + " e) {" + Globals.lineSep); b.append(" appendCatchBehavior(b, exceptionClassName); b.append("}" + Globals.lineSep); return b.toString(); }
Source:
private Long countInternal(final Bson filter, @Nullable final CountOptions options) { AtomicReference<Long> success = new AtomicReference<>(null); AtomicReference<ObjectServerError> error = new AtomicReference<>(null); OsJNIResultCallback<Long> callback = new OsJNIResultCallback<Long>(success, error) { @Override protected Long mapSuccess(Object result) { return (Long) result; } }; String filterString = JniBsonProtocol.encode(filter, codecRegistry); int limit = (options == null) ? 0 : options.getLimit(); nativeCount(nativePtr, filterString, limit, callback); return ResultHandler.handleResult(success, error); }

Target:
private Long countInternal(final Bson filter, @Nullable final CountOptions options) { AtomicReference<Long> success = new AtomicReference<>(null); AtomicReference<ObjectServerError> error = new AtomicReference<>(null); OsJNIResultCallback<Long> callback = new OsJNIResultCallback<Long>(success, error) { @Override protected Long mapSuccess(Object result) { return (Long) result; } }; final String filterString = JniBsonProtocol.encode(filter, codecRegistry); final int limit = (options == null) ? 0 : options.getLimit(); nativeCount(nativePtr, filterString, limit, callback); return ResultHandler.handleResult(success, error); }
Source:
public void unregister(String serviceName) { log.info("Unregistering EventReceiverFirehoseMetric for service [%s]", serviceName); metrics.remove(serviceName); }

Target:
public void unregister(String serviceName) { log.info("Unregistering EventReceiverFirehoseMetric for service [%s]", serviceName); if (metrics.remove(serviceName) == null) { log.warn("Unregistering a non-exist service. Service [%s] never exists."); } }
Source:
public DecorationOverlayIcon(Image baseImage, ImageDescriptor[] overlaysArray, Point sizeValue) { this.baseImage = baseImage; this.overlays = overlaysArray; this.size = sizeValue; }

Target:
public DecorationOverlayIcon(Image baseImage, ImageDescriptor[] overlaysArray, Point sizeValue) { this.referenceImageOrDescriptor = baseImage; this.overlays = overlaysArray; this.baseImageData = new Supplier<ImageData>() { private ImageData value; @Override public ImageData get() { if (value == null) { value = baseImage.getImageData(); } return value; } }; this.size = new Supplier<Point>() { @Override public Point get() { return sizeValue; } }; }
Source:
private void errorEncountered(Exception e) throws UserStoreException { String msg = "Exception while creating multi tenant builder "; throw new UserStoreException(msg, e); }

Target:
private void errorEncountered(Exception e) throws UserStoreException { throw new UserStoreException("Exception while creating multi tenant builder", e); }