auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Object create(SimpleObject post, RequestContext context) throws ResponseException { TaskAction action = newDelegate(); setConvertedProperties(action, post, getCreatableProperties(), true); Collection<TaskDefinition> taskDefinitions; if (action.isAllTasks() != null && action.isAllTasks()) { taskDefinitions = taskFactoryWrapper.getRegisteredTasks(); action.setTasks(new ArrayList<TaskDefinition>(taskDefinitions)); } else { taskDefinitions = action.getTasks(); } ServletContext servletContext = getServletContext(context); if (action.getAction().equals("SCHEDULETASK") || action.getAction().equals("RESCHEDULETASK") || action.getAction().equals("DELETE") || action.getAction().equals("SHUTDOWNTASK")) { if (taskDefinitions == null || taskDefinitions.isEmpty()) { throw new IllegalRequestException("Cannot execute action " + action.getAction() + " on empty set of task definitions."); } } <START> if (action.isAllTasks() == null || !action.isAllTasks()) { <END> for (TaskDefinition taskDef : taskDefinitions) { if (taskDef == null) { throw new IllegalRequestException( "One or more of the modules you specified are not loaded on this server"); } } } switch (action.getAction()) { case SCHEDULETASK: scheduleTask(taskDefinitions); break; case RESCHEDULETASK: reScheduleTask(taskDefinitions); break; case DELETE: deleteTask(taskDefinitions); break; case SHUTDOWNTASK: shutDownTask(taskDefinitions); break; case RESCHEDULEALLTASK: reScheduleAllTask(); break; case ONSTARTUP: onStartUpTask(); break; case ONSHUTDOWN: onShutDownUpTask(); break; } return ConversionUtil.convertToRepresentation(action, Representation.DEFAULT); }</code><technical_language>taskDefinitions a collection of nulls</technical_language>

Target:
public Object create(SimpleObject post, RequestContext context) throws ResponseException { TaskAction action = newDelegate(); setConvertedProperties(action, post, getCreatableProperties(), true); Collection<TaskDefinition> taskDefinitions; if (action.isAllTasks()) { taskDefinitions = taskServiceWrapper.getRegisteredTasks(); action.setTasks(new ArrayList<TaskDefinition>(taskDefinitions)); } else { taskDefinitions = action.getTasks(); } TaskAction.Action actionType = action.getAction(); if (actionType != TaskAction.Action.RESCHEDULEALLTASKS) { if (taskDefinitions == null || taskDefinitions.isEmpty()) { throw new IllegalRequestException("Cannot execute action " + actionType + " on empty set of task definitions."); } } switch (action.getAction()) { case SCHEDULETASK: scheduleTasks(taskDefinitions); break; case RESCHEDULETASK: reScheduleTasks(taskDefinitions); break; case DELETE: deleteTasks(taskDefinitions); break; case SHUTDOWNTASK: shutDownTasks(taskDefinitions); break; case RESCHEDULEALLTASKS: reScheduleAllTasks(); break; } return ConversionUtil.convertToRepresentation(action, Representation.DEFAULT); }
Source:
<code>public void emptyCheckPoint() throws Exception { final String streamA = "streamA"; final String streamB = "streamB"; Map<String, Long> mA = instantiateMap(streamA); Map<String, Long> mB = instantiateMap(streamB); final String author = "CPWriter"; final int iter = 1000; for (int x = 0; x < iter; x++) { mA.put(Integer.toString(x), (long) x); mB.put(Integer.toString(x), (long) x); } for (String key : mA.keySet()) { mA.remove(key); } MultiCheckpointWriter mcw1 = new MultiCheckpointWriter(); mcw1.addMap((SMRMap) mA); mcw1.addMap((SMRMap) mB); Token trimAddress = mcw1.appendCheckpoints(r, author); r.getAddressSpaceView().prefixTrim(trimAddress); r.getAddressSpaceView().gc(); r.getAddressSpaceView().invalidateServerCaches(); r.getAddressSpaceView().invalidateClientCache(); CorfuRuntime rt2 = getNewRuntime(getDefaultNode()).connect(); Map<String, Long> mA2 = rt2.getObjectsView() .build() <START> .setStreamName(streamB) <END> .setTypeToken(new TypeToken<SMRMap<String, Long>>() { }) .setSerializer(serializer) .open(); rt2.getObjectsView().TXBegin(); mA2.put("a", 2l); rt2.getObjectsView().TXEnd(); }</code><technical_language><LINK_0> streamA</technical_language>

Target:
public void emptyCheckPoint() throws Exception { final String streamA = "streamA"; final String streamB = "streamB"; Map<String, Long> mA = instantiateMap(streamA); Map<String, Long> mB = instantiateMap(streamB); final String author = "CPWriter"; final int iter = 1000; for (int x = 0; x < iter; x++) { mA.put(Integer.toString(x), (long) x); mB.put(Integer.toString(x), (long) x); } for (String key : mA.keySet()) { mA.remove(key); } MultiCheckpointWriter mcw1 = new MultiCheckpointWriter(); mcw1.addMap((CorfuTable) mA); mcw1.addMap((CorfuTable) mB); Token trimAddress = mcw1.appendCheckpoints(r, author); r.getAddressSpaceView().prefixTrim(trimAddress); r.getAddressSpaceView().gc(); r.getAddressSpaceView().invalidateServerCaches(); r.getAddressSpaceView().invalidateClientCache(); CorfuRuntime rt2 = getNewRuntime(getDefaultNode()).connect(); Map<String, Long> mA2 = rt2.getObjectsView() .build() .setStreamName(streamA) .setTypeToken(new TypeToken<CorfuTable<String, Long>>() { }) .setSerializer(serializer) .open(); rt2.getObjectsView().TXBegin(); mA2.put("a", 2l); rt2.getObjectsView().TXEnd(); }
Source:
<code>public boolean tryAdd(final EventData eventData) { if (eventData == null) { throw logger.logWarningAndThrow(new IllegalArgumentException("eventData cannot be null")); } final int size; try { size = getSize(eventData, events.isEmpty()); <START> } catch (java.nio.BufferOverflowException exception) { <END> throw logger.logWarningAndThrow(new AmqpException(false, ErrorCondition.LINK_PAYLOAD_SIZE_EXCEEDED, String.format(Locale.US, "Size of the payload exceeded maximum message size: %s kb", maxMessageSize / 1024), contextProvider.getErrorContext())); } synchronized (lock) { if (this.sizeInBytes + size > this.maxMessageSize) { return false; } this.sizeInBytes += size; } this.events.add(eventData); return true; }</code><technical_language>This is out of scope of this PR while modifying this file, instead import package remove this fully-qualified class name</technical_language>

Target:
public boolean tryAdd(final EventData eventData) { if (eventData == null) { throw logger.logExceptionAsWarning(new IllegalArgumentException("eventData cannot be null")); } final int size; try { size = getSize(eventData, events.isEmpty()); } catch (BufferOverflowException exception) { throw logger.logExceptionAsWarning(new AmqpException(false, ErrorCondition.LINK_PAYLOAD_SIZE_EXCEEDED, String.format(Locale.US, "Size of the payload exceeded maximum message size: %s kb", maxMessageSize / 1024), contextProvider.getErrorContext())); } synchronized (lock) { if (this.sizeInBytes + size > this.maxMessageSize) { return false; } this.sizeInBytes += size; } this.events.add(eventData); return true; }
Source:
<code>private void showInstallationDetails(InstallationDTO installationDTO) { <START> installationDetailsPanel.setInstallation(installationDTO); <END> showDetailsView(installationDetailsPanel); }</code><technical_language>this</technical_language>

Target:
private void showInstallationDetails(InstallationDTO installationDTO) { this.installationDetailsPanel.setInstallation(installationDTO); showDetailsView(this.installationDetailsPanel); }
Source:
<code>public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } IndexEntryUpdate that = (IndexEntryUpdate) o; if ( entityId != that.entityId ) { return false; } if ( updateMode != that.updateMode ) { return false; } if ( !Arrays.equals( before, that.before ) ) { return false; } if ( !Arrays.equals( values, that.values ) ) { return false; <START> } <END> return descriptor != null ? descriptor.equals( that.descriptor ) : that.descriptor == null; }</code><technical_language>incorrect</technical_language>

Target:
public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } IndexEntryUpdate that = (IndexEntryUpdate) o; if ( entityId != that.entityId ) { return false; } if ( updateMode != that.updateMode ) { return false; } if ( !Arrays.deepEquals( before, that.before ) ) { return false; } if ( !Arrays.deepEquals( values, that.values ) ) { return false; } return descriptor != null ? descriptor.equals( that.descriptor ) : that.descriptor == null; }
Source:
<code>protected void onActivityResult(int requestCode, int resultCode, Intent intent) { <START> if (requestCode == SEAT_APP_ACTIVITY && resultCode == RESULT_OK) { <END> uiController.refreshForNewApp(); } }</code><technical_language>call super: <LINK_0></technical_language>

Target:
protected void onActivityResult(int requestCode, int resultCode, Intent intent) { if (requestCode == SEAT_APP_ACTIVITY && resultCode == RESULT_OK) { uiController.refreshForNewApp(); } super.onActivityResult(requestCode, resultCode, intent); }
Source:
<code>public void validationErrorsRequiredMetadataTest() throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context) .withName("Parent Community") .build(); Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1") .withWorkflowGroup(1, admin).build(); EPerson submitter = EPersonBuilder.createEPerson(context) .withEmail("submitter@example.com") .withPassword("dspace") .build(); context.setCurrentUser(submitter); XmlWorkflowItem witem = WorkflowItemBuilder.createWorkflowItem(context, col1) .withTitle("Workflow Item 1") .withIssueDate("2017-10-17") .build(); XmlWorkflowItem witemMissingFields = WorkflowItemBuilder.createWorkflowItem(context, col1) .withTitle("Workflow Item 1") <START> .build(); <END> String authToken = getAuthToken(admin.getEmail(), password); getClient(authToken).perform(get("/api/workflow/worfklowitems/" + witem.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$.status", is(true))) .andExpect(jsonPath("$.errors").doesNotExist()) ; getClient(authToken).perform(get("/api/workflow/worfklowitems/" + witemMissingFields.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$.status", is(false))) .andExpect(jsonPath("$.errors[?(@.message=='error.validation.required')]", Matchers.contains( hasJsonPath("$.paths", Matchers.contains( hasJsonPath("$", Matchers.is("/sections/traditionalpageone/dc.date.issued")) ))))) ; }</code><technical_language>Missing a context.restoreAuthSystemState();</technical_language>

Target:
public void validationErrorsRequiredMetadataTest() throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context) .withName("Parent Community") .build(); Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1") .withWorkflowGroup(1, eperson).build(); EPerson submitter = EPersonBuilder.createEPerson(context) .withEmail("submitter@example.com") .withPassword("dspace") .build(); context.setCurrentUser(submitter); XmlWorkflowItem witem = WorkflowItemBuilder.createWorkflowItem(context, col1) .withTitle("Workflow Item 1") .withIssueDate("2017-10-17") .build(); XmlWorkflowItem witemMissingFields = WorkflowItemBuilder.createWorkflowItem(context, col1) .withTitle("Workflow Item 1") .build(); context.restoreAuthSystemState(); String authToken = getAuthToken(eperson.getEmail(), password); getClient(authToken).perform(get("/api/workflow/worfklowitems/" + witem.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$.errors").doesNotExist()) ; getClient(authToken).perform(get("/api/workflow/worfklowitems/" + witemMissingFields.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$.errors[?(@.message=='error.validation.required')]", Matchers.contains( hasJsonPath("$.paths", Matchers.contains( hasJsonPath("$", Matchers.is("/sections/traditionalpageone/dc.date.issued")) ))))) ; }
Source:
<code>private void handleMissingResponse(Response response) { if (response instanceof UnsureResponse) { remoteGetAllHandler.onUnsureResponse(); } GlobalTransaction gtx = ctx.isInTxScope() ? ((TxInvocationContext) ctx).getGlobalTransaction() : null; Map<Object, Collection<Address>> contactedNodes = this.contactedNodes == null ? new HashMap<>() : this.contactedNodes; Map<Address, List<Object>> requestedKeys; synchronized (contactedNodes) { for (Object key : keys) { contactedNodes.computeIfAbsent(key, k -> new ArrayList<>(4)).add(target); } requestedKeys = getKeysByOwner(ctx, keys, checkTopologyId(command), null, contactedNodes); } synchronized (allFuture) { allFuture.counter += requestedKeys.size(); } for (Map.Entry<Address, List<Object>> pair : requestedKeys.entrySet()) { ClusteredGetAllCommand clusteredGetAllCommand = cf.buildClusteredGetAllCommand(pair.getValue(), command.getFlagsBitSet(), gtx); clusteredGetAllCommand.setTopologyId(command.getTopologyId()); keys.removeAll(pair.getValue()); Address target = pair.getKey(); <START> rpcManager.invokeCommand(target, clusteredGetAllCommand, new MapResponseCollector(true, 1), <END> rpcManager.getSyncRpcOptions()) .whenComplete(new ClusteredGetAllHandler(target, allFuture, ctx, command, pair.getValue(), contactedNodes, remoteGetAllHandler)); } if (!keys.isEmpty()) { synchronized (allFuture) { try { remoteGetAllHandler.onKeysLost(keys); } catch (Throwable t) { allFuture.completeExceptionally(t); } } } synchronized (allFuture) { if (--allFuture.counter == 0) { allFuture.complete(null); } } }</code><technical_language>SingleResponseCollector</technical_language>

Target:
private void handleMissingResponse(Response response) { if (response instanceof UnsureResponse) { remoteGetAllHandler.onUnsureResponse(); } GlobalTransaction gtx = ctx.isInTxScope() ? ((TxInvocationContext) ctx).getGlobalTransaction() : null; Map<Object, Collection<Address>> contactedNodes = this.contactedNodes == null ? new HashMap<>() : this.contactedNodes; Map<Address, List<Object>> requestedKeys; synchronized (contactedNodes) { for (Object key : keys) { contactedNodes.computeIfAbsent(key, k -> new ArrayList<>(4)).add(target); } requestedKeys = getKeysByOwner(ctx, keys, checkTopologyId(command), null, contactedNodes); } synchronized (allFuture) { allFuture.counter += requestedKeys.size(); } for (Map.Entry<Address, List<Object>> pair : requestedKeys.entrySet()) { ClusteredGetAllCommand clusteredGetAllCommand = cf.buildClusteredGetAllCommand(pair.getValue(), command.getFlagsBitSet(), gtx); clusteredGetAllCommand.setTopologyId(command.getTopologyId()); keys.removeAll(pair.getValue()); Address target = pair.getKey(); rpcManager.invokeCommand(target, clusteredGetAllCommand, SingletonMapResponseCollector.ignoreLeavers(), rpcManager.getSyncRpcOptions()) .whenComplete(new ClusteredGetAllHandler(target, allFuture, ctx, command, pair.getValue(), contactedNodes, remoteGetAllHandler)); } if (!keys.isEmpty()) { synchronized (allFuture) { try { remoteGetAllHandler.onKeysLost(keys); } catch (Throwable t) { allFuture.completeExceptionally(t); } } } synchronized (allFuture) { if (--allFuture.counter == 0) { allFuture.complete(null); } } }
Source:
<code>public Object getAdapter(Class adapter) { if (adapter.equals(ITerminateHandler.class)) return getSession().getModelAdapter(adapter); if (adapter.equals(IConnectHandler.class)) return getSession().getModelAdapter(adapter); if (adapter.equals(IDisconnectHandler.class)) <START> return getSession().getModelAdapter(adapter); <END> if (adapter.equals(IDebugNewExecutableHandler.class)) return getSession().getModelAdapter(adapter); Platform.getAdapterManager().loadAdapter(this, adapter.getName()); return super.getAdapter(adapter); }</code><technical_language>need get GdbLaunch#disconnect() do want proper thing, right terminates. This is situation faced for GdbLaunch#terminate() fixed in bug 434645. is done, choose retarget IDisconnectHandler getAdapter return platform adapter DisconnectCommand simply calls GdbLaunch#disconnect(). changing adapter is good too. is better. choice</technical_language>

Target:
public Object getAdapter(Class adapter) { if (adapter.equals(ITerminateHandler.class)) return getSession().getModelAdapter(adapter); if (adapter.equals(IDisconnectHandler.class)) return getSession().getModelAdapter(adapter); if (adapter.equals(IConnectHandler.class)) return getSession().getModelAdapter(adapter); if (adapter.equals(IDebugNewExecutableHandler.class)) return getSession().getModelAdapter(adapter); Platform.getAdapterManager().loadAdapter(this, adapter.getName()); return super.getAdapter(adapter); }
Source:
<code>public ImmutableSpongeBodyPartRotationalData(Map<BodyPart, Vector3d> rotations) { super(ImmutableBodyPartRotationalData.class); this.rotations = ImmutableMap.copyOf(checkNotNull(rotations)); this.rotationsValue = new ImmutableSpongeMapValue<>(Keys.BODY_ROTATIONS, this.rotations); <START> this.headRotationValue = new ImmutableSpongeValue<>(Keys.HEAD_ROTATION, this.rotations.get(BodyParts.HEAD)); <END> this.chestRotationValue = new ImmutableSpongeValue<>(Keys.CHEST_ROTATION, this.rotations.get(BodyParts.CHEST)); this.leftArmRotationValue = new ImmutableSpongeValue<>(Keys.LEFT_ARM_ROTATION, this.rotations.get(BodyParts.LEFT_ARM)); this.rightArmRotationValue = new ImmutableSpongeValue<>(Keys.RIGHT_ARM_ROTATION, this.rotations.get(BodyParts.RIGHT_ARM)); this.leftLegRotationValue = new ImmutableSpongeValue<>(Keys.LEFT_LEG_ROTATION, this.rotations.get(BodyParts.LEFT_LEG)); this.rightLegRotationValue = new ImmutableSpongeValue<>(Keys.RIGHT_LEG_ROTATION, this.rotations.get(BodyParts.RIGHT_LEG)); registerGetters(); }</code><technical_language>a good idea check BodyPart exists in map first, fall default if</technical_language>

Target:
public ImmutableSpongeBodyPartRotationalData(Map<BodyPart, Vector3d> rotations) { super(ImmutableBodyPartRotationalData.class); this.rotations = ImmutableMap.copyOf(checkNotNull(rotations, "rotations")); this.rotationsValue = new ImmutableSpongeMapValue<>(Keys.BODY_ROTATIONS, this.rotations); this.headRotationValue = new ImmutableSpongeValue<>(Keys.HEAD_ROTATION, Optional.ofNullable(this.rotations.get(BodyParts.HEAD)).orElse(DataConstants.DEFAULT_HEAD_ROTATION)); this.chestRotationValue = new ImmutableSpongeValue<>(Keys.CHEST_ROTATION, Optional.ofNullable(this.rotations.get(BodyParts.CHEST)).orElse(DataConstants.DEFAULT_CHEST_ROTATION)); this.leftArmRotationValue = new ImmutableSpongeValue<>(Keys.LEFT_ARM_ROTATION, Optional.ofNullable(this.rotations.get(BodyParts.LEFT_ARM)).orElse(DataConstants.DEFAULT_LEFT_ARM_ROTATION)); this.rightArmRotationValue = new ImmutableSpongeValue<>(Keys.RIGHT_ARM_ROTATION, Optional.ofNullable(this.rotations.get(BodyParts.RIGHT_ARM)).orElse(DataConstants.DEFAULT_RIGHT_ARM_ROTATION)); this.leftLegRotationValue = new ImmutableSpongeValue<>(Keys.LEFT_LEG_ROTATION, Optional.ofNullable(this.rotations.get(BodyParts.LEFT_LEG)).orElse(DataConstants.DEFAULT_LEFT_LEG_ROTATION)); this.rightLegRotationValue = new ImmutableSpongeValue<>(Keys.RIGHT_LEG_ROTATION, Optional.ofNullable(this.rotations.get(BodyParts.RIGHT_LEG)).orElse(DataConstants.DEFAULT_RIGHT_LEG_ROTATION)); registerGetters(); }
Source:
<code>protected void processEvent(EventObject event) { Assert.notNull(event, "event must not be null"); if (getCacheEventTypeSet().contains(((ItemEvent<E>) event).getEventType().toString())) { sendMessage(event, ((ItemEvent<E>) event).getMember().getSocketAddress(), getCacheListeningPolicy()); <START> } <END> }</code><technical_language>DEBUG concern is here, too, for</technical_language>

Target:
protected void processEvent(EventObject event) { Assert.notNull(event, "event must not be null"); if (getCacheEvents().contains(((ItemEvent<E>) event).getEventType().toString())) { sendMessage(event, ((ItemEvent<E>) event).getMember().getSocketAddress(), getCacheListeningPolicy()); } if (logger.isDebugEnabled()){ logger.debug("Received ItemEvent : " + event); } }
Source:
<code><START> private static boolean isList(Type type) { <END> if (type instanceof ParameterizedType) { Type rawType = ((ParameterizedType) type).getRawType(); return List.class.isAssignableFrom((Class<?>) rawType); } return false; }</code><technical_language>this check Collection is super type for List capture Set, Queue, etc</technical_language>

Target:
private static boolean isList(Type type) { if (!(type instanceof ParameterizedType)) { return false; } Type rawType = ((ParameterizedType) type).getRawType(); return List.class.isAssignableFrom((Class<?>) rawType); }
Source:
<code>protected final void initialize(final WishlistViewModel viewModel, final ShoppingList wishlist) { if (wishlist != null) { fillTitle(viewModel, wishlist); final List<LineItem> lineItems = wishlist.getLineItems(); fillQuantity(viewModel, lineItems); fillLineItems(viewModel, lineItems); <START> } <END> }</code><technical_language>this null check in initialize method ;)</technical_language>

Target:
protected final void initialize(final WishlistViewModel viewModel, final ShoppingList wishlist) { fillTitle(viewModel, wishlist); fillQuantity(viewModel, wishlist); fillLineItems(viewModel, wishlist); }
Source:
<code>public void waitForServiceToBeAvailable(long maxWaitTime, String servicePid) throws SynchronizedInstallerException, InterruptedException { ServiceTracker st = getServiceTracker(bundleContext, getServiceIdFilter(servicePid)); st.open(true); Callable<Boolean> isServiceAvailable = () -> { <START> LOGGER.debug("Waiting for service with pid to be registered", servicePid); <END> return st.getService() != null; }; try { wait( isServiceAvailable, maxWaitTime, DEFAULT_POLLING_INTERVAL, "Managed service failed to appear after [" + maxWaitTime + "] ms."); } finally { st.close(); } }</code><technical_language>do trace level called in a loop</technical_language>

Target:
public void waitForServiceToBeAvailable(long maxWaitTime, String servicePid) throws InterruptedException { ServiceTracker st = getServiceTracker(bundleContext, getServiceIdFilter(servicePid)); st.open(true); Callable<Boolean> isServiceAvailable = () -> { LOGGER.trace("Waiting for service with pid to be registered", servicePid); return st.getService() != null; }; try { wait( isServiceAvailable, maxWaitTime, DEFAULT_POLLING_INTERVAL, "Managed service failed to appear after [" + maxWaitTime + "] ms."); } finally { st.close(); } }
Source:
<code>private void notify(Context context, Bundle bundle) { NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); String message = bundle.getString(UnifiedPushMessage.ALERT_KEY); String pushMessageId = bundle.getString(UnifiedPushMessage.PUSH_MESSAGE_ID); @SuppressLint("WrongConstant") Intent intent = new Intent(context, MessagesActivity.class) <START> .addFlags(PendingIntent.FLAG_UPDATE_CURRENT) <END> .putExtra(UnifiedPushMessage.ALERT_KEY, message) .putExtra(UnifiedPushMessage.PUSH_MESSAGE_ID, pushMessageId) .putExtra(HelloWorldApplication.PUSH_MESSAGE_FROM_BACKGROUND, true); PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intent, FLAG_UPDATE_CURRENT); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, CHANNEL_ID) .setAutoCancel(true) .setSmallIcon(R.mipmap.ic_launcher) .setContentTitle(context.getString(R.string.app_name)) .setStyle(new NotificationCompat.BigTextStyle().bigText(message)) .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)) .setContentText(message); mBuilder.setContentIntent(contentIntent); mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build()); }</code><technical_language>I a soon-ish</technical_language>

Target:
private void notify(Context context, Bundle bundle) { NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); String message = bundle.getString(UnifiedPushMessage.ALERT_KEY); String pushMessageId = bundle.getString(UnifiedPushMessage.PUSH_MESSAGE_ID); Intent intent = new Intent(context, MessagesActivity.class) .putExtra(UnifiedPushMessage.ALERT_KEY, message) .putExtra(UnifiedPushMessage.PUSH_MESSAGE_ID, pushMessageId) .putExtra(HelloWorldApplication.PUSH_MESSAGE_FROM_BACKGROUND, true); PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intent, FLAG_UPDATE_CURRENT); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, CHANNEL_ID) .setAutoCancel(true) .setSmallIcon(R.mipmap.ic_launcher) .setContentTitle(context.getString(R.string.app_name)) .setStyle(new NotificationCompat.BigTextStyle().bigText(message)) .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)) .setContentText(message); mBuilder.setContentIntent(contentIntent); mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build()); }
Source:
<code>public SqlStatements setTimingCollector(TimingCollector timingCollector) { <START> this.timingCollector = timingCollector == null ? TimingCollector.NOP_TIMING_COLLECTOR : timingCollector; <END> return this; }</code><technical_language>get rid of timingCollector field altogether if wrapped collector passed this method in a SqlLogger adapter, passed setSqlLogger()</technical_language>

Target:
public SqlStatements setTimingCollector(TimingCollector timingCollector) { this.sqlLogger = timingCollector == null ? SqlLogger.NOP_SQL_LOGGER : new SqlLogger() { @Override public void logAfterExecution(StatementContext context) { timingCollector.collect(context.getElapsedTime(ChronoUnit.NANOS), context); } }; return this; }
Source:
<code>public void test_services_config_port_increment_false() { Microservices node = Microservices.builder() .serviceTransport(TransportConfig.builder() .port(3000) .portAutoIncrement(false) .build()) .clusterConfig(ClusterConfig.builder() .transportConfig(TransportConfig.builder() <START> .port(4000) <END> .portAutoIncrement(false) .build())) .build(); assertEquals(node.transport().address().port(), 3000); assertEquals(node.cluster().address().port(), 4000); node.cluster().shutdown(); }</code><technical_language>fyi, ClusterConfig shortcut methods for port portAutoIncrement call thm</technical_language>

Target:
public void test_services_config_port_increment_false() { Microservices node = Microservices.builder() .serviceTransport(TransportConfig.builder() .port(3000) .portAutoIncrement(false) .build()) .clusterConfig(ClusterConfig.builder() .port(4000) .portAutoIncrement(false)) .build(); assertEquals(node.sender().address().port(), 3000); assertEquals(node.cluster().address().port(), 4000); node.cluster().shutdown(); }
Source:
<code>public void autoValue() { Auto a = Auto.create("foo"); <START> assertEquals("foo", a.val()); <END> assertEquals("Auto{val=foo}", a.toString()); }</code><technical_language>assertThat(a.val()).isEqualTo("foo");</technical_language>

Target:
public void autoValue() { Auto a = Auto.create("foo"); assertThat(a.val()).isEqualTo("foo"); assertThat(a.toString()).isEqualTo("Auto{val=foo}"); }
Source:
<code>public Map<String, ?> getRawCapabilities() { DesiredCapabilities headlessChrome = DesiredCapabilities.chrome(); <START> headlessChrome.setBrowserName("chromeHeadless"); <END> return headlessChrome.asMap(); }</code><technical_language>Do want set browserName property chromeHeadless? chromeHeadless is internal feature - Selenium webdrivers it..</technical_language>

Target:
public Map<String, ?> getRawCapabilities() { return DesiredCapabilities.chrome().asMap(); }
Source:
<code>private IMergeViewerItem.Container getParent(NotLoadedFragmentMatch nlfm) { IMergeViewerItem.Container parent = null; final Collection<? extends Match> children = nlfm.getChildren(); for (Match match : children) { URI uri = ResourceUIUtil.getDataURI(match, getSide()); if (uri != null) { ReadOnlyGraph<URI> graph = ResourceUIUtil.getResourcesURIGraph(); URI parentData = graph.getParentData(uri); ResourceSet rs = ResourceUIUtil.getDataResourceSet(match, getSide()); Resource resourceParent = ResourceUIUtil.getParent(rs, uri); boolean _continue = true; while (resourceParent == null && _continue == true) { if (parentData != null) { resourceParent = ResourceUIUtil.getParent(rs, parentData.trimFragment()); parentData = graph.getParentData(parentData.trimFragment()); } else { _continue = false; } } if (resourceParent != null && parentData != null) { EObject eObjectParent = resourceParent.getEObject(parentData.fragment()); if (eObjectParent != null) { parent = createBasicContainer(eObjectParent); break; } <START> } else { <END> URI rootURI = ResourceUIUtil.getRootResource(uri); if (rootURI != null) { Collection<Match> notLoadedFragmentMatches = Lists.newArrayList(); Collection<Match> rootMatches = getComparison().getMatches(); Collection<URI> uris = ResourceUIUtil.getDataURIs(rootMatches, getSide()); for (Match rootMatch : rootMatches) { URI rootMatchDataURI = ResourceUIUtil.getDataURI(rootMatch, getSide()); if (!rootURI.equals(rootMatchDataURI) && !ResourceUIUtil.isChildOf(rootMatchDataURI, uris)) { notLoadedFragmentMatches.add(new NotLoadedFragmentMatch(rootMatch)); } } if (notLoadedFragmentMatches.size() > 1) { final NotLoadedFragmentMatch notLoadedFragmentMatch = new NotLoadedFragmentMatch( notLoadedFragmentMatches); parent = new MergeViewerItem.Container(getComparison(), getDiff(), notLoadedFragmentMatch, notLoadedFragmentMatch, notLoadedFragmentMatch, getSide(), getAdapterFactory()); break; } } } } } return parent; }</code><technical_language>content of this "else" extracted in a private method, for instance. loop more readable</technical_language>

Target:
private IMergeViewerItem.Container getParent(NotLoadedFragmentMatch nlfm) { IMergeViewerItem.Container parent = null; final Collection<? extends Match> children = nlfm.getChildren(); for (Match match : children) { URI uri = ResourceUIUtil.getDataURI(match, getSide()); if (uri != null) { ReadOnlyGraph<URI> graph = ResourceUIUtil.getResourcesURIGraph(); URI parentData = graph.getParentData(uri); ResourceSet rs = ResourceUIUtil.getDataResourceSet(match, getSide()); Resource resourceParent = ResourceUIUtil.getParent(rs, uri); while (resourceParent == null && parentData != null) { resourceParent = ResourceUIUtil.getParent(rs, parentData.trimFragment()); parentData = graph.getParentData(parentData.trimFragment()); } if (resourceParent != null && parentData != null) { EObject eObjectParent = resourceParent.getEObject(parentData.fragment()); if (eObjectParent != null) { parent = createBasicContainer(eObjectParent); break; } } else { parent = createNotLoadedFragmentContainer(uri); if (parent != null) { break; } } } } return parent; }
Source:
<code>protected void appendToURI(StringBuilder restOfURI, String queryParamName, String queryParamvalue) { if (!StringUtils.endsWith(restOfURI.toString(), PATH_SEPARATOR)) { <START> if (!StringUtils.contains(restOfURI.toString(), QUERY_PARAM_NAME_VALUE_SEPERATOR)) { <END> restOfURI.append(QUERY_BEGINNER); restOfURI.append(queryParamName); restOfURI.append(QUERY_PARAM_NAME_VALUE_SEPERATOR); restOfURI.append(queryParamvalue); } else { restOfURI.append(QUERY_SEPARATOR); restOfURI.append(queryParamName); restOfURI.append(QUERY_PARAM_NAME_VALUE_SEPERATOR); restOfURI.append(queryParamvalue); } } }</code><technical_language>simplify this? if/else blocks share lines, if/else include line only</technical_language>

Target:
protected void appendToURI(StringBuilder restOfURI, String queryParamName, String queryParamvalue) { if (!StringUtils.endsWith(restOfURI.toString(), PATH_SEPARATOR)) { if (!StringUtils.contains(restOfURI.toString(), QUERY_PARAM_NAME_VALUE_SEPERATOR)) { restOfURI.append(QUERY_BEGINNER); } else { restOfURI.append(QUERY_SEPARATOR); } restOfURI.append(queryParamName); restOfURI.append(QUERY_PARAM_NAME_VALUE_SEPERATOR); restOfURI.append(queryParamvalue); } }
Source:
<code>public void loadUserWhenUserInfoSuccessResponseThenReturnUser() throws Exception { String userInfoResponse = "{\n" + " \"id\": \"user1\",\n" + " \"first-name\": \"first\",\n" + " \"last-name\": \"last\",\n" + " \"middle-name\": \"middle\",\n" + " \"address\": \"address\",\n" + " \"email\": \"user1@example.com\"\n" + "}\n"; enqueueApplicationJsonBody(userInfoResponse); OAuth2User user = this.userService.loadUser(oauth2UserRequest()).block(); assertThat(user.getName()).isEqualTo("user1"); assertThat(user.getAttributes().size()).isEqualTo(6); <START> assertThat((Object) user.getAttribute("id")).isEqualTo("user1"); <END> assertThat((Object) user.getAttribute("first-name")).isEqualTo("first"); assertThat((Object) user.getAttribute("last-name")).isEqualTo("last"); assertThat((Object) user.getAttribute("middle-name")).isEqualTo("middle"); assertThat((Object) user.getAttribute("address")).isEqualTo("address"); assertThat((Object) user.getAttribute("email")).isEqualTo("user1@example.com"); assertThat(user.getAuthorities().size()).isEqualTo(1); assertThat(user.getAuthorities().iterator().next()).isInstanceOf(OAuth2UserAuthority.class); OAuth2UserAuthority userAuthority = (OAuth2UserAuthority) user.getAuthorities().iterator().next(); assertThat(userAuthority.getAuthority()).isEqualTo("ROLE_USER"); assertThat(userAuthority.getAttributes()).isEqualTo(user.getAttributes()); }</code><technical_language>Change Object String</technical_language>

Target:
public void loadUserWhenUserInfoSuccessResponseThenReturnUser() throws Exception { String userInfoResponse = "{\n" + " \"id\": \"user1\",\n" + " \"first-name\": \"first\",\n" + " \"last-name\": \"last\",\n" + " \"middle-name\": \"middle\",\n" + " \"address\": \"address\",\n" + " \"email\": \"user1@example.com\"\n" + "}\n"; enqueueApplicationJsonBody(userInfoResponse); OAuth2User user = this.userService.loadUser(oauth2UserRequest()).block(); assertThat(user.getName()).isEqualTo("user1"); assertThat(user.getAttributes().size()).isEqualTo(6); assertThat((String) user.getAttribute("id")).isEqualTo("user1"); assertThat((String) user.getAttribute("first-name")).isEqualTo("first"); assertThat((String) user.getAttribute("last-name")).isEqualTo("last"); assertThat((String) user.getAttribute("middle-name")).isEqualTo("middle"); assertThat((String) user.getAttribute("address")).isEqualTo("address"); assertThat((String) user.getAttribute("email")).isEqualTo("user1@example.com"); assertThat(user.getAuthorities().size()).isEqualTo(1); assertThat(user.getAuthorities().iterator().next()).isInstanceOf(OAuth2UserAuthority.class); OAuth2UserAuthority userAuthority = (OAuth2UserAuthority) user.getAuthorities().iterator().next(); assertThat(userAuthority.getAuthority()).isEqualTo("ROLE_USER"); assertThat(userAuthority.getAttributes()).isEqualTo(user.getAttributes()); }
Source:
<code>public static PcapFile getPcapFile(Path filePath) throws IOException, BadPcapFileException { <START> if (filePath.getFileName().toString().endsWith(PCAPNG_EXTENSION)) { <END> return new PcapNgFile(filePath); } return new PcapOldFile(filePath); }</code><technical_language>I pcapNg files a extension. work code expects pcap magic number..</technical_language>

Target:
public static PcapFile getPcapFile(Path filePath) throws IOException, BadPcapFileException { if (Files.notExists(filePath) || !Files.isRegularFile(filePath) || Files.size(filePath) < PcapFileValues.GLOBAL_HEADER_SIZE) { throw new BadPcapFileException("Bad Pcap File."); } if (!Files.isReadable(filePath)) { throw new BadPcapFileException("File is not readable."); } fFileChannel = checkNotNull(Files.newByteChannel(filePath)); FileChannel f = (FileChannel) fFileChannel; if (f.size() == 0) { throw new BadPcapFileException("It is not a FileChannel type."); } ByteBuffer header = ByteBuffer.allocate(PcapFileValues.PCAPNG_HEADER_SIZE); header.clear(); header.order(ByteOrder.LITTLE_ENDIAN); f.read(header); header.flip(); int blockType = header.getInt(); f.close(); if (blockType == PcapFileValues.PCAPNG_SHB) { return new PcapNgFile(filePath); } return new PcapOldFile(filePath); }
Source:
<code>void addAllLogsToSysTable() { if (queueForSysTable == null) { <START> LOG.warn("hbase.regionserver.slowlog.systable.enabled is turned off. Exiting."); <END> return; } if (this.connection == null) { LOG.warn("LogEventHandler has null connection. Exiting."); return; } List<SlowLogPayload> slowLogPayloads = new ArrayList<>(); int i = 0; while (!queueForSysTable.isEmpty()) { slowLogPayloads.add(queueForSysTable.poll()); i++; if (i == 100) { SlowLogTableAccessor.addSlowLogRecords(slowLogPayloads, this.connection); slowLogPayloads = new ArrayList<>(); i = 0; } } if (slowLogPayloads.size() > 0) { SlowLogTableAccessor.addSlowLogRecords(slowLogPayloads, this.connection); } }</code><technical_language>If config is turned off, this log this warn line in 10 mins right? Dont need log all</technical_language>

Target:
void addAllLogsToSysTable() { if (queueForSysTable == null) { return; } if (LOCK.isLocked()) { return; } LOCK.lock(); try { List<SlowLogPayload> slowLogPayloads = new ArrayList<>(); int i = 0; while (!queueForSysTable.isEmpty()) { slowLogPayloads.add(queueForSysTable.poll()); i++; if (i == SYSTABLE_PUT_BATCH_SIZE) { SlowLogTableAccessor.addSlowLogRecords(slowLogPayloads, this.configuration); slowLogPayloads.clear(); i = 0; } } if (slowLogPayloads.size() > 0) { SlowLogTableAccessor.addSlowLogRecords(slowLogPayloads, this.configuration); } } finally { LOCK.unlock(); } }
Source:
<code>protected Control createPageControls(Composite parent) { setTitle(Messages.RemoveReviewerDialog_Remove_Reviewer); <START> Label label = new Label(parent, SWT.NONE); <END> label.setText( NLS.bind(Messages.RemoveReviewerDialog_Are_You_Sure_You_Want_To_Remove, userToRemove.getDisplayName())); return parent; }</code><technical_language>If put this in a composite some more padding a bit nicer. SubmitDialog</technical_language>

Target:
protected Control createPageControls(Composite parent) { setTitle(Messages.RemoveReviewerDialog_Remove_Reviewer); Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(1, false)); Label label = new Label(composite, SWT.NONE); label.setText( NLS.bind(Messages.RemoveReviewerDialog_Are_You_Sure_You_Want_To_Remove, userToRemove.getDisplayName())); return parent; }
Source:
<code>public String format(Thread thread, String formatString) { final StringBuilder builder = new StringBuilder(formatString.length() * 5); final ThreadGroup group = thread.getThreadGroup(); final Matcher matcher = searchPattern.matcher(formatString); while (matcher.find()) { if (matcher.group(1) != null) { builder.append(matcher.group()); } else { switch (matcher.group().charAt(1)) { case '%': builder.append('%'); break; case 't': builder.append(perFactoryThreadSequenceNum); break; case 'g': builder.append(globalThreadSequenceNum); break; case 'f': builder.append(factorySequenceNum); break; case 'p': if (group != null) appendGroupPath(group, builder); break; <START> case 'i': builder.append(thread.getId()); <END> case 'G': if (group != null) builder.append(group.getName()); break; case 'n': if (node != null) builder.append(node); break; case 'c': if (component != null) builder.append(component); break; } } } return builder.toString(); }</code><technical_language>break is missing</technical_language>

Target:
public String format(Thread thread, String formatString) { final StringBuilder builder = new StringBuilder(formatString.length() * 5); final ThreadGroup group = thread.getThreadGroup(); final Matcher matcher = searchPattern.matcher(formatString); while (matcher.find()) { if (matcher.group(1) != null) { builder.append(matcher.group()); } else { switch (matcher.group().charAt(1)) { case '%': builder.append('%'); break; case 't': builder.append(perFactoryThreadSequenceNum); break; case 'g': builder.append(globalThreadSequenceNum); break; case 'f': builder.append(factorySequenceNum); break; case 'p': if (group != null) appendGroupPath(group, builder); break; case 'i': builder.append(thread.getId()); break; case 'G': if (group != null) builder.append(group.getName()); break; case 'n': if (node != null) builder.append(node); break; case 'c': if (component != null) builder.append(component); break; } } } return builder.toString(); }
Source:
<code>public void testDecisionExpressionContextSimple() throws Exception { final String expected = loadResource("decision-expression-context-simple.xml"); setContent(expected); <START> <END> final String actual = getContent(); assertThat(actual).isNotBlank(); final Predicate<Node> nodeFilter = node -> { final String localName = node.getLocalName(); final String namespaceURI = node.getNamespaceURI(); if (Objects.equals(namespaceURI, KIE.getUri())) { if (Objects.equals(localName, "ComponentWidths")) { return false; } } return true; }; final Predicate<Attr> attributeFilter = attr -> { final String localName = attr.getLocalName(); final String namespaceURI = Objects.nonNull(attr.getNamespaceURI()) ? attr.getNamespaceURI() : attr.getOwnerElement().getNamespaceURI(); if (Objects.equals(namespaceURI, DMN.getUri())) { if (Objects.equals(attr.getOwnerElement().getLocalName(), "literalExpression")) { if (Objects.equals(localName, "id")) { return false; } } } return true; }; XmlAssert.assertThat(actual) .and(expected) .ignoreComments() .ignoreWhitespace() .withNodeFilter(nodeFilter) .withAttributeFilter(attributeFilter) .areIdentical(); final Map<String, String> prefix2Uri = new Maps.Builder<String, String>() .put(DMN.getPrefix(), DMN.getUri()) .build(); XmlAssert.assertThat(actual) .withNamespaceContext(prefix2Uri) .hasXPath("/dmn:definitions" + "/dmn:decision[@id='_4FEA7589-823B-4880-BCFA-AF2F9B145785']" + "/dmn:context[@id='_23253C3F-352C-4A00-8548-174EDC272929']" + "/dmn:contextEntry" + "/dmn:literalExpression" + "/dmn:text[text()='null }</code><technical_language>Please ignore new tests due issues running jenkins</technical_language>

Target:
public void testDecisionExpressionContextSimple() throws Exception { final String expected = loadResource("decision-expression-context-simple.xml"); setContent(expected); final String actual = getContent(); assertThat(actual).isNotBlank(); final Predicate<Node> nodeFilter = node -> { final String localName = node.getLocalName(); final String namespaceURI = node.getNamespaceURI(); if (Objects.equals(namespaceURI, KIE.getUri())) { if (Objects.equals(localName, "ComponentWidths")) { return false; } } return true; }; final Predicate<Attr> attributeFilter = attr -> { final String localName = attr.getLocalName(); final String namespaceURI = Objects.nonNull(attr.getNamespaceURI()) ? attr.getNamespaceURI() : attr.getOwnerElement().getNamespaceURI(); if (Objects.equals(namespaceURI, DMN.getUri())) { if (Objects.equals(attr.getOwnerElement().getLocalName(), "literalExpression")) { if (Objects.equals(localName, "id")) { return false; } } } return true; }; XmlAssert.assertThat(actual) .and(expected) .ignoreComments() .ignoreWhitespace() .withNodeFilter(nodeFilter) .withAttributeFilter(attributeFilter) .areIdentical(); XmlAssert.assertThat(actual) .withNamespaceContext(NAMESPACES) .hasXPath("/dmn:definitions" + "/dmn:decision[@id='_4FEA7589-823B-4880-BCFA-AF2F9B145785']" + "/dmn:context[@id='_23253C3F-352C-4A00-8548-174EDC272929']" + "/dmn:contextEntry" + "/dmn:literalExpression" + "/dmn:text[text()='null }
Source:
<code>default MBeanServer getMBeanServer() { <START> return getPlatformMBeanServer(); <END> }</code><technical_language>this throw new UnsupportedOperationException() returning wrong</technical_language>

Target:
default MBeanServer getMBeanServer() { throw new UnsupportedOperationException(); }
Source:
<code>public void vmsMonitoring() { if (isMonitoringNeeded()) { VmsListFetcher fetcher = getRefreshStatistics() ? new VmsStatisticsFetcher(this) : new VmsListFetcher(this); fetcher.fetch(); new VmsMonitoring(this, fetcher.getChangedVms(), fetcher.getVmsWithChangedDevices(), auditLogDirector, <START> fetcher.getFetchTime() <END> ).perform(); } }</code><technical_language>prefer time calling 'fetch' method instead of in fetcher</technical_language>

Target:
public void vmsMonitoring() { if (isMonitoringNeeded()) { VmsListFetcher fetcher = getRefreshStatistics() ? new VmsStatisticsFetcher(this) : new VmsListFetcher(this); long fetchTime = System.nanoTime(); fetcher.fetch(); new VmsMonitoring(this, fetcher.getChangedVms(), fetcher.getVmsWithChangedDevices(), auditLogDirector, fetchTime ).perform(); } }
Source:
<code>public InitCommand setBare(boolean bare) { this.bare = bare; <START> validateDirs(); <END> return this; }</code><technical_language>I validate set member if validation succeeded</technical_language>

Target:
public InitCommand setBare(boolean bare) { validateDirs(directory, gitDir, bare); this.bare = bare; return this; }
Source:
<code>public String toString() { <START> Map<String, Object> display = new ConcurrentHashMap<String, Object>(this.values); <END> display.remove(VALUES_KEY); return display.toString(); }</code><technical_language>HashMap is enough, here</technical_language>

Target:
public String toString() { Map<String, Object> display = new HashMap<String, Object>(this.values); display.remove(VALUES_KEY); return display.toString(); }
Source:
<code>public void detectLanguageForListInputTextsWithResponse() { final List<String> textInputs = Arrays.asList( "This is written in English", "Este es un document escrito en Español."); <START> final DocumentResultCollection<DetectLanguageResult> detectLanguageResults = <END> textAnalyticsClient.detectLanguagesWithResponse(textInputs, "US", Context.NONE).getValue(); final TextDocumentBatchStatistics batchStatistics = detectLanguageResults.getStatistics(); System.out.printf( "A batch of document statistics, document count: %s, transaction count: %s, valid document count: %s.%n", batchStatistics.getDocumentCount(), batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount()); for (DetectLanguageResult detectLanguageResult : detectLanguageResults) { System.out.printf("Document ID: %s%n", detectLanguageResult.getId()); for (DetectedLanguage detectedLanguage : detectLanguageResult.getDetectedLanguages()) { System.out.printf("Detected language: %s, ISO 6391 name: %s, score: %s.%n", detectedLanguage.getName(), detectedLanguage.getIso6391Name(), detectedLanguage.getScore()); } } END: com.azure.ai.textanalytics.TextAnalyticsClient.detectLanguagesWithResponse#List-String-Context }</code><technical_language>nit: remove final other examples</technical_language>

Target:
public void detectLanguageForListInputTextsWithResponse() { final List<String> textInputs = Arrays.asList( "This is written in English", "Este es un document escrito en Español."); final DocumentResultCollection<DetectLanguageResult> detectLanguageResults = textAnalyticsClient.detectLanguagesWithResponse(textInputs, "US", Context.NONE).getValue(); final TextDocumentBatchStatistics batchStatistics = detectLanguageResults.getStatistics(); System.out.printf( "A batch of document statistics, transaction count: %s, valid document count: %s.%n", batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount()); for (DetectLanguageResult detectLanguageResult : detectLanguageResults) { System.out.printf("Document ID: %s%n", detectLanguageResult.getId()); for (DetectedLanguage detectedLanguage : detectLanguageResult.getDetectedLanguages()) { System.out.printf("Detected language: %s, ISO 6391 name: %s, score: %s.%n", detectedLanguage.getName(), detectedLanguage.getIso6391Name(), detectedLanguage.getScore()); } } END: com.azure.ai.textanalytics.TextAnalyticsClient.detectLanguagesWithResponse#List-String-Context }
Source:
<code>public InputStream getObject(String bucketName, String objectName) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException, InvalidArgumentException { if ((bucketName == null) || (bucketName.isEmpty())) { throw new InvalidArgumentException("bucket name cannot be empty"); } if ((objectName == null) || (objectName.isEmpty())) { throw new InvalidArgumentException("object name cannot be empty"); <START> } <END> return getObject(bucketName, objectName, 0, null); }</code><technical_language>Add this check line #1849 #1581</technical_language>

Target:
public InputStream getObject(String bucketName, String objectName) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException, InvalidArgumentException { return getObject(bucketName, objectName, 0, null); }