auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void initialise() { playerCamera = worldRenderer.getActiveCamera(); wireframeStateChange = new SetWireframe(true); renderingDebugConfig = config.getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); requiresCondition(() -> !renderingDebugConfig.isFirstPersonElementsHidden()); renderingDebugConfig.subscribe(RenderingDebugConfig.FIRST_PERSON_ELEMENTS_HIDDEN, this); <START> addDesiredStateChange(new SetViewportToSizeOf(new ResourceUrn("engine:sceneOpaque"), displayResolutionDependentFBOs)); <END> addDesiredStateChange(new SetDepthFunction(GL_ALWAYS)); }</code><technical_language>ResourceUrn static final field please</technical_language>

Target:
public void initialise() { playerCamera = worldRenderer.getActiveCamera(); wireframeStateChange = new SetWireframe(true); renderingDebugConfig = config.getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); requiresCondition(() -> !renderingDebugConfig.isFirstPersonElementsHidden()); renderingDebugConfig.subscribe(RenderingDebugConfig.FIRST_PERSON_ELEMENTS_HIDDEN, this); addDesiredStateChange(new SetViewportToSizeOf(READONLY_GBUFFER, displayResolutionDependentFBOs)); sceneOpaqueFbo = displayResolutionDependentFBOs.get(READONLY_GBUFFER); addDesiredStateChange(new SetDepthFunction(GL_ALWAYS)); }
Source:
<code>public void start() throws IOException { myServerSocket = new ServerSocket(); myServerSocket.bind((hostname != null) ? new InetSocketAddress(hostname, myPort) : new InetSocketAddress(myPort)); myThread = new Thread(new Runnable() { @Override public void run() { do { try { <START> f final Socket finalAccept = myServerSocket.accept(); <END> registerConnection(finalAccept); finalAccept.setSoTimeout(SOCKET_READ_TIMEOUT); final InputStream inputStream = finalAccept.getInputStream(); asyncRunner.exec(new Runnable() { @Override public void run() { OutputStream outputStream = null; try { outputStream = finalAccept.getOutputStream(); TempFileManager tempFileManager = tempFileManagerFactory.create(); HTTPSession session = new HTTPSession(tempFileManager, inputStream, outputStream, finalAccept.getInetAddress()); while (!finalAccept.isClosed()) { session.execute(); } } catch (Exception e) { if (!(e instanceof SocketException && "NanoHttpd Shutdown".equals(e.getMessage()))) { e.printStackTrace(); } } finally { safeClose(outputStream); safeClose(inputStream); safeClose(finalAccept); unRegisterConnection(finalAccept); } } }); } catch (IOException e) { } } while (!myServerSocket.isClosed()); } }); myThread.setDaemon(true); myThread.setName("NanoHttpd Main Listener"); myThread.start(); }</code><technical_language>Code isnt compiling right - extra "f" start is throwing off</technical_language>

Target:
public void start() throws IOException { myServerSocket = new ServerSocket(); myServerSocket.bind((hostname != null) ? new InetSocketAddress(hostname, myPort) : new InetSocketAddress(myPort)); myThread = new Thread(new Runnable() { @Override public void run() { do { try { final Socket finalAccept = myServerSocket.accept(); registerConnection(finalAccept); finalAccept.setSoTimeout(SOCKET_READ_TIMEOUT); final InputStream inputStream = finalAccept.getInputStream(); asyncRunner.exec(new Runnable() { @Override public void run() { OutputStream outputStream = null; try { outputStream = finalAccept.getOutputStream(); TempFileManager tempFileManager = tempFileManagerFactory.create(); HTTPSession session = new HTTPSession(tempFileManager, inputStream, outputStream, finalAccept.getInetAddress()); while (!finalAccept.isClosed()) { session.execute(); } } catch (Exception e) { if (!(e instanceof SocketException && "NanoHttpd Shutdown".equals(e.getMessage()))) { e.printStackTrace(); } } finally { safeClose(outputStream); safeClose(inputStream); safeClose(finalAccept); unRegisterConnection(finalAccept); } } }); } catch (IOException e) { } } while (!myServerSocket.isClosed()); } }); myThread.setDaemon(true); myThread.setName("NanoHttpd Main Listener"); myThread.start(); }
Source:
<code>public static BitSet indexesOf(final Object[] array, final Object objectToFind, int startIndex) { <START> BitSet ret = new BitSet(); <END> if (array == null) { return ret; } while (startIndex < array.length) { startIndex = indexOf(array, objectToFind, startIndex); if (startIndex == INDEX_NOT_FOUND) { break; } ret.set(startIndex); ++startIndex; } return ret; }</code><technical_language>"ret" is a great name, "bitSet"</technical_language>

Target:
public static BitSet indexesOf(final Object[] array, final Object objectToFind, int startIndex) { BitSet bitSet = new BitSet(); if (array == null) { return bitSet; } while (startIndex < array.length) { startIndex = indexOf(array, objectToFind, startIndex); if (startIndex == INDEX_NOT_FOUND) { break; } bitSet.set(startIndex); ++startIndex; } return bitSet; }
Source:
<code>public void enablePluginInvocation() { canInvokePlugins = true; Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { <START> for (Plugin plugin : getPlugins()) { initPlugin(plugin); } UiPluginsInitializedEvent.fire(PluginManager.this); <END> } }); }</code><technical_language>please extract this a separate method? void initAllPlugins() { for (Plugin plugin : getPlugins()) { initPlugin(plugin); } UiPluginsInitializedEvent.fire(PluginManager.this); }</technical_language>

Target:
public void enablePluginInvocation() { canInvokePlugins = true; Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { initAllPlugins(); } }); }
Source:
<code>public boolean interact(Direction side, PlayerEntity player, Hand hand, ItemStack heldItem, float hitX, float hitY, float hitZ) { SawmillTileEntity master = master(); if(master!=null) <START> if(player.isSneaking()&&!master.sawblade.isEmpty()) <END> { if(heldItem.isEmpty()) player.setHeldItem(hand, master.sawblade.copy()); else if(!world.isRemote) player.entityDropItem(master.sawblade.copy(), 0); master.sawblade = ItemStack.EMPTY; this.updateMasterBlock(null, true); return true; } else if(IETags.sawblades.contains(heldItem.getItem())) { ItemStack tempMold = !master.sawblade.isEmpty()?master.sawblade.copy(): ItemStack.EMPTY; master.sawblade = Utils.copyStackWithAmount(heldItem, 1); heldItem.shrink(1); if(heldItem.getCount() <= 0) heldItem = ItemStack.EMPTY; else player.setHeldItem(hand, heldItem); if(!tempMold.isEmpty()) if(heldItem.isEmpty()) player.setHeldItem(hand, tempMold); else if(!world.isRemote) player.entityDropItem(tempMold, 0); this.updateMasterBlock(null, true); return true; } return false; }</code><technical_language>this before, I if(a) if(b) else braces outer if. add those</technical_language>

Target:
public boolean interact(Direction side, PlayerEntity player, Hand hand, ItemStack heldItem, float hitX, float hitY, float hitZ) { SawmillTileEntity master = master(); if(master!=null) { if(player.isSneaking()&&!master.sawblade.isEmpty()) { if(heldItem.isEmpty()) player.setHeldItem(hand, master.sawblade.copy()); else if(!world.isRemote) player.entityDropItem(master.sawblade.copy(), 0); master.sawblade = ItemStack.EMPTY; this.updateMasterBlock(null, true); return true; } else if(IETags.sawblades.contains(heldItem.getItem())) { ItemStack tempBlade = !master.sawblade.isEmpty()?master.sawblade.copy(): ItemStack.EMPTY; master.sawblade = Utils.copyStackWithAmount(heldItem, 1); heldItem.shrink(1); if(heldItem.getCount() <= 0) heldItem = ItemStack.EMPTY; else player.setHeldItem(hand, heldItem); if(!tempBlade.isEmpty()) { if(heldItem.isEmpty()) player.setHeldItem(hand, tempBlade); else if(!world.isRemote) player.entityDropItem(tempBlade, 0); } this.updateMasterBlock(null, true); return true; } } return false; }
Source:
<code>public void testStressCamera() throws Exception { SurfaceHolder mSurfaceHolder; mSurfaceHolder = MediaFrameworkTest.getSurfaceView().getHolder(); File stressOutFile = new File(WorkDir.getTopDir(), MEDIA_STRESS_OUTPUT); Writer output = new BufferedWriter(new FileWriter(stressOutFile, true)); output.write("Camera start preview stress:\n"); output.write("Total number of loops:" + NUMBER_OF_CAMERA_STRESS_LOOPS + "\n"); Log.v(TAG, "Start preview"); output.write("No of loop: "); <START> final boolean hasRearCamera = mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA); <END> for (int i = 0; i< NUMBER_OF_CAMERA_STRESS_LOOPS; i++) { runOnLooper(new Runnable() { @Override public void run() { if (hasRearCamera) { mCamera = Camera.open(); } else { mCamera = Camera.open(0); } } }); mCamera.setErrorCallback(mCameraErrorCallback); mCamera.setPreviewDisplay(mSurfaceHolder); mCamera.startPreview(); Thread.sleep(WAIT_TIME_CAMERA_TEST); mCamera.stopPreview(); mCamera.release(); output.write(" ," + i); } output.write("\n\n"); output.close(); }</code><technical_language>100 chars line please</technical_language>

Target:
public void testStressCamera() throws Exception { SurfaceHolder mSurfaceHolder; mSurfaceHolder = MediaFrameworkTest.getSurfaceView().getHolder(); File stressOutFile = new File(WorkDir.getTopDir(), MEDIA_STRESS_OUTPUT); Writer output = new BufferedWriter(new FileWriter(stressOutFile, true)); output.write("Camera start preview stress:\n"); output.write("Total number of loops:" + NUMBER_OF_CAMERA_STRESS_LOOPS + "\n"); Log.v(TAG, "Start preview"); output.write("No of loop: "); for (int i = 0; i< NUMBER_OF_CAMERA_STRESS_LOOPS; i++) { runOnLooper(new Runnable() { @Override public void run() { if (hasRearCamera) { mCamera = Camera.open(); } else if (hasFrontCamera) { mCamera = Camera.open(0); } else { mCamera = null; } } }); if (mCamera == null) { break; } mCamera.setErrorCallback(mCameraErrorCallback); mCamera.setPreviewDisplay(mSurfaceHolder); mCamera.startPreview(); Thread.sleep(WAIT_TIME_CAMERA_TEST); mCamera.stopPreview(); mCamera.release(); output.write(" ," + i); } output.write("\n\n"); output.close(); }
Source:
<code><START> public void onBuffer(Buffer buffer, int sequenceNumber, int backlog) throws IOException { <END> boolean enqueued = false; try { if (expectedSequenceNumber != sequenceNumber) { onError(new BufferReorderingException(expectedSequenceNumber, sequenceNumber)); return; } final boolean wasEmpty; final CheckpointBarrier notifyReceivedBarrier; final Buffer notifyReceivedBuffer; final BufferReceivedListener listener = inputGate.getBufferReceivedListener(); synchronized (receivedBuffers) { if (isReleased.get()) { return; } wasEmpty = receivedBuffers.isEmpty(); receivedBuffers.add(buffer); enqueued = true; if (listener != null && buffer.isBuffer() && receivedCheckpointId < lastRequestedCheckpointId) { notifyReceivedBuffer = buffer.retainBuffer(); } else { notifyReceivedBuffer = null; } notifyReceivedBarrier = listener != null ? parseCheckpointBarrierOrNull(buffer) : null; } ++expectedSequenceNumber; if (wasEmpty) { notifyChannelNonEmpty(); } if (backlog >= 0) { onSenderBacklog(backlog); } if (notifyReceivedBarrier != null) { receivedCheckpointId = notifyReceivedBarrier.getId(); listener.notifyBarrierReceived(notifyReceivedBarrier, channelInfo); } else if (notifyReceivedBuffer != null) { listener.notifyBufferReceived(notifyReceivedBuffer, channelInfo); } } finally { if (!enqueued) { buffer.recycleBuffer(); } } }</code><technical_language>renaming inversion is unnecessary. pulled setting recycleBuffer = false. Note this hotfix is academic. In case of some parse exception, TM is restarted anyways</technical_language>

Target:
public void onBuffer(Buffer buffer, int sequenceNumber, int backlog) throws IOException { boolean recycleBuffer = true; try { if (expectedSequenceNumber != sequenceNumber) { onError(new BufferReorderingException(expectedSequenceNumber, sequenceNumber)); return; } final boolean wasEmpty; final CheckpointBarrier notifyReceivedBarrier; final Buffer notifyReceivedBuffer; final BufferReceivedListener listener = inputGate.getBufferReceivedListener(); synchronized (receivedBuffers) { if (isReleased.get()) { return; } wasEmpty = receivedBuffers.isEmpty(); receivedBuffers.add(buffer); if (listener != null && buffer.isBuffer() && receivedCheckpointId < lastRequestedCheckpointId) { notifyReceivedBuffer = buffer.retainBuffer(); } else { notifyReceivedBuffer = null; } notifyReceivedBarrier = listener != null ? parseCheckpointBarrierOrNull(buffer) : null; } recycleBuffer = false; ++expectedSequenceNumber; if (wasEmpty) { notifyChannelNonEmpty(); } if (backlog >= 0) { onSenderBacklog(backlog); } if (notifyReceivedBarrier != null) { receivedCheckpointId = notifyReceivedBarrier.getId(); if (notifyReceivedBarrier.isCheckpoint()) { listener.notifyBarrierReceived(notifyReceivedBarrier, channelInfo); } } else if (notifyReceivedBuffer != null) { listener.notifyBufferReceived(notifyReceivedBuffer, channelInfo); } } finally { if (recycleBuffer) { buffer.recycleBuffer(); } } }
Source:
<code>private static Schema generateSchema() { Schema schema = new Schema("ApiTest", ApiTestSchema.class.getPackage().getName() + ".generated", Namespace.DEFAULT_NAMESPACE, OptionalType.JAVA8); schema.addTableDefinition("SchemaApiTest", new TableDefinition() { { javaTableName("SchemaApiTest"); rowName(); rowComponent("component1", ValueType.STRING); columns(); column("column1", "c", ValueType.VAR_LONG); column("column2", "d", StringValuePersister.class); enableV2Table(); rangeScanAllowed(); } }); schema.addTableDefinition("HashComponentsTest", new TableDefinition() { { javaTableName("HashComponentsTest"); rowName(); hashFirstNRowComponents(2); rowComponent("component1", ValueType.VAR_LONG); rowComponent("component2", ValueType.VAR_STRING); columns(); column("column", "c", ValueType.STRING); rangeScanAllowed(); } }); schema.addTableDefinition("AllValueTypesTest", new TableDefinition() { { javaTableName("AllValueTypesTest"); rowName(); rowComponent("component1", ValueType.STRING); columns(); IntStream.range(0, ValueType.values().length) .forEachOrdered(typeIndex -> <START> column("column" + typeIndex, "c" + typeIndex, ValueType.values()[typeIndex])); <END> } }); return schema; }</code><technical_language>nice! do this for row components well</technical_language>

Target:
private static Schema generateSchema() { Schema schema = new Schema("ApiTest", ApiTestSchema.class.getPackage().getName() + ".generated", Namespace.DEFAULT_NAMESPACE, OptionalType.JAVA8); schema.addTableDefinition("SchemaApiTest", new TableDefinition() { { javaTableName("SchemaApiTest"); rowName(); rowComponent("component1", ValueType.STRING); columns(); column("column1", "c", ValueType.VAR_LONG); column("column2", "d", StringValuePersister.class); enableV2Table(); rangeScanAllowed(); } }); schema.addTableDefinition("HashComponentsTest", new TableDefinition() { { javaTableName("HashComponentsTest"); rowName(); hashFirstNRowComponents(2); rowComponent("component1", ValueType.VAR_LONG); rowComponent("component2", ValueType.VAR_STRING); columns(); column("column", "c", ValueType.STRING); rangeScanAllowed(); } }); schema.addTableDefinition("AllValueTypesTest", new TableDefinition() { { javaTableName("AllValueTypesTest"); rowName(); Stream.of(ValueType.values()) .filter(type -> type != ValueType.BLOB && type != ValueType.STRING) .forEachOrdered(type -> rowComponent("component" + type.ordinal(), type)); rowComponent("blobComponent", ValueType.BLOB); columns(); Stream.of(ValueType.values()) .forEachOrdered(type -> column("column" + type.ordinal(), "c" + type.ordinal(), type)); } }); return schema; }
Source:
<code>public void insertOrUpdate_cyclicDependenciesFromOtherRealm() { RealmConfiguration config1 = configFactory.createConfiguration("realm1"); RealmConfiguration config2 = configFactory.createConfiguration("realm2"); Realm realm1 = Realm.getInstance(config1); Realm realm2 = Realm.getInstance(config2); realm1.beginTransaction(); Owner owner = realm1.createObject(Owner.class); Dog dog = realm1.createObject(Dog.class); owner.getDogs().add(dog); dog.setOwner(owner); realm1.commitTransaction(); realm2.beginTransaction(); realm2.insertOrUpdate(owner); realm2.commitTransaction(); assertEquals(1, realm1.where(Owner.class).count()); assertEquals(1, realm1.where(Owner.class).findFirst().getDogs().size()); assertEquals(1, realm1.where(Dog.class).count()); assertEquals(realm1.where(Owner.class).count(), realm2.where(Owner.class).count()); assertEquals(realm1.where(Dog.class).count(), realm2.where(Dog.class).count()); <START> assertEquals(1, realm2.where(Owner.class).findFirst().getDogs().size()); <END> realm1.close(); realm2.close(); }</code><technical_language>Is worth testing realm2.where(Owner.class).findFirst().getDogs().first() is realm2.where(Owner.class).findFirst()</technical_language>

Target:
public void insertOrUpdate_cyclicDependenciesFromOtherRealm() { RealmConfiguration config1 = configFactory.createConfiguration("realm1"); RealmConfiguration config2 = configFactory.createConfiguration("realm2"); Realm realm1 = Realm.getInstance(config1); Realm realm2 = Realm.getInstance(config2); realm1.beginTransaction(); Owner owner = realm1.createObject(Owner.class); owner.setName("Kiba"); Dog dog = realm1.createObject(Dog.class); dog.setName("Akamaru"); owner.getDogs().add(dog); dog.setOwner(owner); realm1.commitTransaction(); realm2.beginTransaction(); realm2.insertOrUpdate(owner); realm2.commitTransaction(); assertEquals(1, realm1.where(Owner.class).count()); assertEquals(1, realm1.where(Owner.class).findFirst().getDogs().size()); assertEquals(1, realm1.where(Dog.class).count()); assertEquals(realm1.where(Owner.class).count(), realm2.where(Owner.class).count()); assertEquals(realm1.where(Dog.class).count(), realm2.where(Dog.class).count()); assertEquals(1, realm2.where(Owner.class).findFirst().getDogs().size()); assertEquals(realm1.where(Owner.class).findFirst().getName(), realm2.where(Owner.class).findFirst().getName()); assertEquals(realm1.where(Owner.class).findFirst().getDogs().first().getName() , realm2.where(Owner.class).findFirst().getDogs().first().getName()); realm1.close(); realm2.close(); }
Source:
<code>public void checkVariantAnnotationVariants() throws AvroRemoteException { final String variantAnnotationSetId = Utils.getVariantAnnotationSetId(client); final SearchVariantAnnotationsRequest req = SearchVariantAnnotationsRequest.newBuilder() .setVariantAnnotationSetId(variantAnnotationSetId) .setReferenceName(TestData.VARIANT_ANNOTATION_REFERENCE_NAME) .setStart(start) .setEnd(end) .build(); final SearchVariantAnnotationsResponse resp = client.variantAnnotations.searchVariantAnnotations(req); for( VariantAnnotation variantAnn : resp.getVariantAnnotations() ){ final String variantId = variantAnn.getVariantId(); Variant v = client.variants.getVariant(variantId); assertThat(v).isNotNull(); assertThat(v.getId()).isEqualTo(variantId); <START> assertThat(v.getStart()).isEqualTo(start); <END> } }</code><technical_language>@david4096! This assert start is failing for - expected:<10[177]L> was:<10[234]L> VCF is 1-based GA4GH is 0-based, variant 10177 in VCF is 10176 in GA4GH terms target region starts 10177. variant returned is VCF 10235 GA4GH 10234 search region start</technical_language>

Target:
public void checkVariantAnnotationVariants() throws AvroRemoteException { final String variantAnnotationSetId = Utils.getVariantAnnotationSetByName(client, TestData.VARIANT_ANNOTATION_SET_NAMES.get(0)).getId(); final SearchVariantAnnotationsRequest req = SearchVariantAnnotationsRequest.newBuilder() .setVariantAnnotationSetId(variantAnnotationSetId) .setReferenceName(TestData.VARIANT_ANNOTATION_REFERENCE_NAME) .setStart(start) .setEnd(end) .build(); final SearchVariantAnnotationsResponse resp = client.variantAnnotations.searchVariantAnnotations(req); assertThat(resp.getVariantAnnotations()).isNotEmpty(); for( VariantAnnotation variantAnn : resp.getVariantAnnotations() ){ final String variantId = variantAnn.getVariantId(); Variant v = client.variants.getVariant(variantId); assertThat(v).isNotNull(); assertThat(v.getId()).isEqualTo(variantId); assertThat(v.getStart()).isGreaterThanOrEqualTo(start); } }
Source:
<code>public void removeFromHistory() { ArrayList<String> geocodes = new ArrayList<String>(adapter.getCheckedOrAllCaches().size()); for (Geocache cache : adapter.getCheckedOrAllCaches()) { geocodes.add(cache.getGeocode()); } Bundle b = new Bundle(); b.putStringArray(EXTRA_CACHELIST, geocodes.toArray(new String[geocodes.size()])); getSupportLoaderManager().initLoader(CacheListLoaderType.REMOVE_FROM_HISTORY.ordinal(), b, this); <START> } <END></code><technical_language>avoid intermediate ArrayList creation (and spare call adapter.getCheckedOrAllCaches creates a list too) using: java public void removeFromHistory() { final List<Geocache> caches = adapter.getCheckedOrAllCaches(); final String geocodes[] = new String[caches.size()]; for (int i = 0; i < geocodes.length; i++) { geocodes[i] = caches.get(i).getGeocode(); } Bundle b = new Bundle(); b.putStringArray(EXTRA_CACHELIST, geocodes); getSupportLoaderManager().initLoader(CacheListLoaderType.REMOVE_FROM_HISTORY.ordinal(), b, this); }</technical_language>

Target:
public void removeFromHistory() { final List<Geocache> caches = adapter.getCheckedOrAllCaches(); final String geocodes[] = new String[caches.size()]; for (int i = 0; i < geocodes.length; i++) { geocodes[i] = caches.get(i).getGeocode(); } Bundle b = new Bundle(); b.putStringArray(Intents.EXTRA_CACHELIST, geocodes); getSupportLoaderManager().initLoader(CacheListLoaderType.REMOVE_FROM_HISTORY.ordinal(), b, this); }
Source:
<code>public void setAttached(boolean attached) { <START> attached = attached; <END> }</code><technical_language>this is assignment - please modify to: this.attached = attached</technical_language>

Target:
public void setAttached(boolean attached) { this.attached = attached; }
Source:
<code>public void testStoreAndQueryEndTimeExclude() { Trace trace1 = new Trace(); trace1.setStartTime(1200); trace1.setId("1"); Consumer c1 = new Consumer(); trace1.getNodes().add(c1); List<Trace> traces = new ArrayList<>(); traces.add(trace1); try { tracePublisher.publish(null, traces); } catch (Exception e1) { fail("Failed to store: " + e1); } Criteria criteria = new Criteria(); <START> criteria.setEndTime(2); <END> Wait.until(() -> traceService.searchFragments(null, criteria).size() == 1); criteria.setEndTime(1); List<Trace> result = traceService.searchFragments(null, criteria); assertEquals(0, result.size()); }</code><technical_language>wrong - end times set precisely - updated 1500000</technical_language>

Target:
public void testStoreAndQueryEndTimeExclude() { Trace trace1 = new Trace(); trace1.setStartTime(1200000); trace1.setId("1"); Consumer c1 = new Consumer(); trace1.getNodes().add(c1); List<Trace> traces = new ArrayList<>(); traces.add(trace1); try { tracePublisher.publish(null, traces); } catch (Exception e1) { fail("Failed to store: " + e1); } Criteria criteria = new Criteria(); criteria.setEndTime(1500); Wait.until(() -> traceService.searchFragments(null, criteria).size() == 1); criteria.setEndTime(1100); List<Trace> result = traceService.searchFragments(null, criteria); assertEquals(0, result.size()); }
Source:
<code>public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mInflater = LayoutInflater.from(getActivity()); setIsLoading(true); final String chapterPlusId = getArguments().getString(Const.EXTRA_PLUS_ID); if (Utils.isOnline(getActivity())) { <START> App.getInstance().getModelCache().getAsync(Const.CACHE_KEY_PERSON + chapterPlusId, <END> true, new ModelCache.CacheListener() { @Override public void onGet(Object item) { updateUIOnlineFrom((Person) item); } @Override public void onNotFound(String key) { App.getInstance().getPlusApi().getPerson(chapterPlusId).enqueue( new Callback<Person>() { @Override public void success(Person person) { putPersonInCache(chapterPlusId, person); updateUIOnlineFrom(person); setIsLoading(false); } @Override public void failure(Throwable error) { super.failure(error); setIsLoading(false); } @Override public void networkFailure(Throwable error) { super.networkFailure(error); setIsLoading(false); } }); } }); } else { App.getInstance().getModelCache().getAsync( Const.CACHE_KEY_PERSON + chapterPlusId, false, new ModelCache.CacheListener() { @Override public void onGet(Object item) { final Person cachedChapter = (Person) item; updateChapterUIFrom(cachedChapter); addOrganizers(cachedChapter, false); } @Override public void onNotFound(String key) { showError(R.string.offline_alert); } }); } }</code><technical_language>This line exists in else statement [here](<LINK_0> I this isOnline check is helpful. of a hell of indentation here. I getAsync model 2 times. do is that, try get online, if is unsuccesful, try get cache, if fails, setIsloading(false)</technical_language>

Target:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mInflater = LayoutInflater.from(getActivity()); setIsLoading(true); final String chapterPlusId = getArguments().getString(Const.EXTRA_PLUS_ID); final boolean online = Utils.isOnline(getActivity()); App.getInstance().getModelCache().getAsync(Const.CACHE_KEY_PERSON + chapterPlusId, online, new ModelCache.CacheListener() { @Override public void onGet(Object item) { updateUIFrom((Person) item, online); } @Override public void onNotFound(String key) { if (online) { App.getInstance().getPlusApi().getPerson(chapterPlusId).enqueue( new Callback<Person>() { @Override public void success(Person person) { putPersonInCache(chapterPlusId, person); updateUIFrom(person, true); } @Override public void failure(Throwable error) { super.failure(error); setIsLoading(false); } @Override public void networkFailure(Throwable error) { super.networkFailure(error); setIsLoading(false); } }); } else { showError(R.string.offline_alert); setIsLoading(false); } } }); }
Source:
<code>private void pushHistoryStateIfNeeded(NavigationEvent event, UI ui) { boolean isRouterLink = NavigationTrigger.ROUTER_LINK .equals(event.getTrigger()); if (event instanceof ErrorNavigationEvent) { <START> if (isRouterLink) { <END> ErrorNavigationEvent errorNavigationEvent = (ErrorNavigationEvent) event; if (errorNavigationEvent.getErrorParameter() != null && errorNavigationEvent.getErrorParameter() .getCaughtException() instanceof NotFoundException) { pushHistoryState(event); } } } else if (isRouterLink) { JsonValue state = event.getState() .orElseThrow(() -> new IllegalStateException( "When the navigation trigger is ROUTER_LINK, event state should not be null.")); ui.getPage().executeJs( "this.scrollPositionHandlerAfterServerNavigation($0);", state); } else if (!event.isForwardTo() && (!ui.getInternals().hasLastHandledLocation() || !event.getLocation().getPathWithQueryParameters() .equals(ui.getInternals() .getLastHandledLocation() .getPathWithQueryParameters()))) { if (shouldPushHistoryState(event)) { pushHistoryState(event); } ui.getInternals().setLastHandledNavigation(event.getLocation()); } }</code><technical_language>I suggest combine (event instanceof ErrorNavigationEvent) && isRouterLink in if. nested ifs</technical_language>

Target:
private void pushHistoryStateIfNeeded(NavigationEvent event, UI ui) { boolean isRouterLink = NavigationTrigger.ROUTER_LINK .equals(event.getTrigger()); if (event instanceof ErrorNavigationEvent) { if (isRouterLinkNotFoundNavigationError( (ErrorNavigationEvent) event)) { pushHistoryState(event); } } else if (isRouterLink) { JsonValue state = event.getState() .orElseThrow(() -> new IllegalStateException( "When the navigation trigger is ROUTER_LINK, event state should not be null.")); ui.getPage().executeJs( "this.scrollPositionHandlerAfterServerNavigation($0);", state); } else if (!event.isForwardTo() && (!ui.getInternals().hasLastHandledLocation() || !event.getLocation().getPathWithQueryParameters() .equals(ui.getInternals() .getLastHandledLocation() .getPathWithQueryParameters()))) { if (shouldPushHistoryState(event)) { pushHistoryState(event); } ui.getInternals().setLastHandledNavigation(event.getLocation()); } }
Source:
<code>public synchronized SubQuery nextSubQuery() throws DbException, QueryKilledException { Preconditions.checkState(currentSubQuery == null, "must call finishSubQuery before calling nextSubQuery"); if (isDone()) { return null; } if (status == Status.KILLING) { throw new QueryKilledException(); } if (!subQueryQ.isEmpty()) { currentSubQuery = subQueryQ.removeFirst(); currentSubQuery.setSubQueryId(new SubQueryId(queryId, subqueryId)); addDerivedSubQueries(currentSubQuery); <START> QueryConstruct.setQueryExecutionOptions(currentSubQuery.getWorkerPlans(), ftMode, subqueryId == 0 ? profiling <END> : PROFILING_MODE.NONE); currentSubQuery.getMasterPlan().setFTMode(ftMode); ++subqueryId; if (subqueryId >= MyriaConstants.MAXIMUM_NUM_SUBQUERIES) { throw new DbException("Infinite-loop safeguard: quitting after " + MyriaConstants.MAXIMUM_NUM_SUBQUERIES + " subqueries."); } return currentSubQuery; } planQ.getFirst().instantiate(planQ, subQueryQ, new ConstructArgs(server, queryId)); return nextSubQuery(); }</code><technical_language>parentheses</technical_language>

Target:
public synchronized SubQuery nextSubQuery() throws DbException, QueryKilledException { Preconditions.checkState(currentSubQuery == null, "must call finishSubQuery before calling nextSubQuery"); if (isDone()) { return null; } if (status == Status.KILLING) { throw new QueryKilledException(); } if (!subQueryQ.isEmpty()) { currentSubQuery = subQueryQ.removeFirst(); currentSubQuery.setSubQueryId(new SubQueryId(queryId, subqueryId)); addDerivedSubQueries(currentSubQuery); PROFILING_MODE profilingMode = profiling; if (subqueryId != 0) { profilingMode = PROFILING_MODE.NONE; } QueryConstruct.setQueryExecutionOptions(currentSubQuery.getWorkerPlans(), ftMode, profilingMode); currentSubQuery.getMasterPlan().setFTMode(ftMode); ++subqueryId; if (subqueryId >= MyriaConstants.MAXIMUM_NUM_SUBQUERIES) { throw new DbException("Infinite-loop safeguard: quitting after " + MyriaConstants.MAXIMUM_NUM_SUBQUERIES + " subqueries."); } return currentSubQuery; } planQ.getFirst().instantiate(planQ, subQueryQ, new ConstructArgs(server, queryId)); return nextSubQuery(); }
Source:
<code>protected int doWork() { IOUtil.assertFilesAreReadable(metricsFiles); final MetricsFile<?, ?> metricsA = new MetricsFile(); final MetricsFile<?, ?> metricsB = new MetricsFile(); try { metricsA.read(new FileReader(metricsFiles.get(0))); metricsB.read(new FileReader(metricsFiles.get(1))); final boolean areEqual = metricsA.areMetricsEqual(metricsB) && metricsA.areHistogramsEqual(metricsB); final String status = areEqual ? "EQUAL" : "NOT EQUAL"; <START> System.out.println("Files " + metricsFiles.get(0) + " and " + metricsFiles.get(1) + "are " + status); <END> } catch (final Exception e) { throw new PicardException(e.getMessage()); } return 0; }</code><technical_language>this writing standard output</technical_language>

Target:
protected int doWork() { IOUtil.assertFilesAreReadable(metricsFiles); final MetricsFile<?, ?> metricsA = new MetricsFile(); final MetricsFile<?, ?> metricsB = new MetricsFile(); try { metricsA.read(new FileReader(metricsFiles.get(0))); metricsB.read(new FileReader(metricsFiles.get(1))); final boolean areEqual = metricsA.areMetricsEqual(metricsB) && metricsA.areHistogramsEqual(metricsB); final String status = areEqual ? "EQUAL" : "NOT EQUAL"; log.info("Files " + metricsFiles.get(0) + " and " + metricsFiles.get(1) + "are " + status); } catch (final Exception e) { throw new PicardException(e.getMessage()); } return 0; }
Source:
<code>public void editClientID() throws Exception { final String VALUE = RandomStringUtils.randomAlphanumeric(5); <START> ModelNodeResult defaultValueResult = operations.readAttribute(JMS_BRIDGE_ADDRESS, CLIENT_ID_IDENTIFIER, ReadAttributeOption.NOT_INCLUDE_DEFAULTS); <END> defaultValueResult.assertSuccess(); ModelNode defaultValue = defaultValueResult.value(); try { new ConfigChecker.Builder(client, JMS_BRIDGE_ADDRESS) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.TEXT, CLIENT_ID_IDENTIFIER, VALUE) .verifyFormSaved() .verifyAttribute(CLIENT_ID_IDENTIFIER, VALUE); } finally { operations.writeAttribute(JMS_BRIDGE_ADDRESS, CLIENT_ID_IDENTIFIER, defaultValue); } }</code><technical_language>Renaming origValue more sense changed default original value, undefined instead of default value</technical_language>

Target:
public void editClientID() throws Exception { final String VALUE = RandomStringUtils.randomAlphanumeric(5); ModelNodeResult origValueResult = operations.readAttribute(JMS_BRIDGE_ADDRESS, CLIENT_ID_IDENTIFIER, ReadAttributeOption.NOT_INCLUDE_DEFAULTS); origValueResult.assertSuccess(); ModelNode origValue = origValueResult.value(); try { new ConfigChecker.Builder(client, JMS_BRIDGE_ADDRESS) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.TEXT, CLIENT_ID_IDENTIFIER, VALUE) .verifyFormSaved() .verifyAttribute(CLIENT_ID_IDENTIFIER, VALUE); } finally { operations.writeAttribute(JMS_BRIDGE_ADDRESS, CLIENT_ID_IDENTIFIER, origValue); } }
Source:
<code>protected final Widget[] findItems(Object element) { Widget result = doFindInputItem(element); if (result != null) { return new Widget[] { result }; } if (usingElementMap() <START> && element != null) { <END> Object widgetOrWidgets = elementMap.get(element); if (widgetOrWidgets==null) { return NO_WIDGETS; } else if (widgetOrWidgets instanceof Widget) { return new Widget[] {(Widget) widgetOrWidgets}; } else { return (Widget[])widgetOrWidgets; } } result = doFindItem(element); return result == null ? NO_WIDGETS : new Widget[] { result }; }</code><technical_language>This is enough. element if in doFindItem() is abstract... in other places elementMap null keys</technical_language>

Target:
protected final Widget[] findItems(Object element) { Widget result = doFindInputItem(element); if (result != null || element == null) { return new Widget[] { result }; } if (usingElementMap()) { Object widgetOrWidgets = elementMap.get(element); if (widgetOrWidgets==null) { return NO_WIDGETS; } else if (widgetOrWidgets instanceof Widget) { return new Widget[] {(Widget) widgetOrWidgets}; } else { return (Widget[])widgetOrWidgets; } } result = doFindItem(element); return result == null ? NO_WIDGETS : new Widget[] { result }; }
Source:
<code>public void buildVmGraphicsDevices() { boolean graphicsOverridden = vm.isRunOnce() && vm.getGraphicsInfos() != null && !vm.getGraphicsInfos().isEmpty(); boolean isHeadlessMode = vm.getDefaultDisplayType() == DisplayType.none; Map<GraphicsType, GraphicsInfo> infos = vm.getGraphicsInfos(); Map<String, Object> specParamsFromVm = null; if (infos != null) { specParamsFromVm = new HashMap<>(); addVmGraphicsOptions(infos, specParamsFromVm); } if (graphicsOverridden <START> || isHeadlessMode) { <END> buildVmGraphicsDevicesOverridden(infos, specParamsFromVm); } else { buildVmGraphicsDevicesFromDb(specParamsFromVm); } }</code><technical_language>if headless, reason execute #161 all</technical_language>

Target:
public void buildVmGraphicsDevices() { boolean graphicsOverridden = vm.isRunOnce() && vm.getGraphicsInfos() != null && !vm.getGraphicsInfos().isEmpty(); boolean isHeadlessMode = vm.getDefaultDisplayType() == DisplayType.none; if (isHeadlessMode) { return; } Map<GraphicsType, GraphicsInfo> infos = vm.getGraphicsInfos(); Map<String, Object> specParamsFromVm = null; if (infos != null) { specParamsFromVm = new HashMap<>(); addVmGraphicsOptions(infos, specParamsFromVm); } if (graphicsOverridden) { buildVmGraphicsDevicesOverridden(infos, specParamsFromVm); } else { buildVmGraphicsDevicesFromDb(specParamsFromVm); } }
Source:
<code>public void validateVendorIdAndCustomerInstitutionIdentifier() { <START> if (payeeId.split("-").length > 1) { <END> BusinessObjectService bos = SpringContext.getBean(BusinessObjectService.class); Map<String, String> fieldValues = new HashMap<String, String>(); fieldValues.put("vendorAddressGeneratedIdentifier", customerInstitutionNumber); String[] headerDetails = payeeId.split("-"); fieldValues.put("vendorHeaderGeneratedIdentifier", headerDetails[0] ); fieldValues.put("vendorDetailAssignedIdentifier", headerDetails[1]); List<VendorAddress> addrs = (List<VendorAddress>)bos.findMatching(VendorAddress.class, fieldValues); if (addrs.size() == 1) { VendorAddress addr = (VendorAddress) addrs.get(0); setVendorAddress(addr); } else { throw new RuntimeException("Invalid Address [ "+customerInstitutionNumber+" ] for payee [ "+payeeId + " ]"); } } }</code><technical_language>a regex if payee ID matches "headerId-detailId" format</technical_language>

Target:
public void validateVendorIdAndCustomerInstitutionIdentifier() { BusinessObjectService bos = SpringContext.getBean(BusinessObjectService.class); Map<String, String> fieldValues = new HashMap<String, String>(); fieldValues.put("vendorAddressGeneratedIdentifier", customerInstitutionNumber); String[] headerDetails = payeeId.split("-"); fieldValues.put("vendorHeaderGeneratedIdentifier", headerDetails[0] ); fieldValues.put("vendorDetailAssignedIdentifier", headerDetails[1]); List<VendorAddress> addrs = (List<VendorAddress>) bos.findMatching(VendorAddress.class, fieldValues); if (addrs.size() == 1) { VendorAddress addr = (VendorAddress) addrs.get(0); setVendorAddress(addr); } else { throw new RuntimeException( "Invalid Address [ " + customerInstitutionNumber + " ] for payee [ " + payeeId + " ]"); } }
Source:
<code>static void removeOperator(JSONObject op, JSONObject graph){ <START> List<JSONObject> opList = new ArrayList<>(); <END> opList.add(op); removeOperators(opList, graph); }</code><technical_language>Collections a singletonList method</technical_language>

Target:
static void removeOperator(JSONObject op, JSONObject graph){ removeOperators(Collections.singletonList(op), graph); }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE); myLayout = (LinearLayout) inflater.inflate(R.layout.calendar_widget, container); if(myCal == null){ myCal = Calendar.getInstance(); } initDisplay(); initWeekDays(); initOnClick(); refresh(); Rect displayRectangle = new Rect(); Window window = getActivity().getWindow(); window.getDecorView().getWindowVisibleDisplayFrame(displayRectangle); <START> myLayout.setMinimumWidth((int)(displayRectangle.width() * 0.9f)); <END> return myLayout; }</code><technical_language>Check this in landscape mode</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE); inflateView(inflater, container); if(savedInstanceState != null && savedInstanceState.containsKey(TIME)){ calendar = Calendar.getInstance(); calendar.setTimeInMillis(savedInstanceState.getLong(TIME)); } disableScreenRotation(); initDisplay(); initWeekDays(); initOnClick(); refresh(); setWindowSize(); return layout; }
Source:
<code>IndexValue markAsPermanent(StoreKey id, FileSpan fileSpan, long operationTimeMs) throws StoreException { validateFileSpan(fileSpan, true); IndexValue value = findKey(id); if (value == null) { throw new StoreException("Id " + id + " not present in index " + dataDir, StoreErrorCodes.ID_Not_Found); } else if (value.isFlagSet(IndexValue.Flags.Delete_Index)) { throw new StoreException("Id " + id + " deleted in index " + dataDir, StoreErrorCodes.ID_Deleted); } else if (value.isFlagSet(IndexValue.Flags.Ttl_Update_Index)) { throw new StoreException("TTL of " + id + " already updated in index" + dataDir, StoreErrorCodes.TTL_Already_Updated); } long size = fileSpan.getEndOffset().getOffset() - fileSpan.getStartOffset().getOffset(); IndexValue newValue = new IndexValue(value.getSize(), value.getOffset(), value.getFlags(), Utils.Infinite_Time, operationTimeMs, value.getAccountId(), value.getContainerId()); newValue.setFlag(IndexValue.Flags.Ttl_Update_Index); newValue.setNewOffset(fileSpan.getStartOffset()); newValue.setNewSize(size); addToIndex(new IndexEntry(id, newValue, null), fileSpan); <START> return new IndexValue(newValue.getOffset().getName(), newValue.getBytes(), newValue.getVersion()); <END> }</code><technical_language>Is potential case need return IndexValue</technical_language>

Target:
IndexValue markAsPermanent(StoreKey id, FileSpan fileSpan, long operationTimeMs) throws StoreException { validateFileSpan(fileSpan, true); IndexValue value = findKey(id); if (value == null) { throw new StoreException("Id " + id + " not present in index " + dataDir, StoreErrorCodes.ID_Not_Found); } else if (value.isFlagSet(IndexValue.Flags.Delete_Index)) { throw new StoreException("Id " + id + " deleted in index " + dataDir, StoreErrorCodes.ID_Deleted); } else if (value.isFlagSet(IndexValue.Flags.Ttl_Update_Index)) { throw new StoreException("TTL of " + id + " already updated in index" + dataDir, StoreErrorCodes.Already_Updated); } long size = fileSpan.getEndOffset().getOffset() - fileSpan.getStartOffset().getOffset(); IndexValue newValue = new IndexValue(value.getSize(), value.getOffset(), value.getFlags(), Utils.Infinite_Time, operationTimeMs, value.getAccountId(), value.getContainerId()); newValue.setFlag(IndexValue.Flags.Ttl_Update_Index); newValue.setNewOffset(fileSpan.getStartOffset()); newValue.setNewSize(size); addToIndex(new IndexEntry(id, newValue, null), fileSpan); return newValue; }
Source:
<code><START> public MirrorSourceConnector(List<TopicPartition> knownTopicPartitions, MirrorConnectorConfig config) { <END> this.knownTopicPartitions = knownTopicPartitions; this.config = config; }</code><technical_language>drop "public" here, tests in package</technical_language>

Target:
MirrorSourceConnector(List<TopicPartition> knownTopicPartitions, MirrorConnectorConfig config) { this.knownTopicPartitions = knownTopicPartitions; this.config = config; }
Source:
<code>private PushButton createButton(final Pair<T, V> item, boolean plusButton) { final T value = item.getFirst(); final V widget = item.getSecond(); final PushButton button = new PushButton(new Image(plusButton ? resources.increaseIcon() : resources.decreaseIcon())); button.addStyleName(style.buttonStyle()); button.setEnabled(!isGhost(value)); button.addClickHandler(plusButton ? new ClickHandler() { @Override public void onClick(ClickEvent event) { getEntry(widget).removeLastButton(); Pair<T, V> item = addGhostEntry(); onAdd(item.getFirst(), item.getSecond()); } } : new ClickHandler() { @Override public void onClick(ClickEvent event) { ListIterator<Pair<T, V>> last = items.listIterator(items.size()); if (!last.hasPrevious()) { return; } <START> if (item == last.previous() && last.hasPrevious()) { END> Pair<T, V> previousItem = last.previous(); getEntry(previousItem.getSecond()).appendButton(createButton(previousItem, true)); } removeEntry(item); onRemove(value, widget); if (items.isEmpty()) { Pair<T, V> item = addGhostEntry(); onAdd(item.getFirst(), item.getSecond()); } } }); return button; }</code><technical_language>ok, picky last.hasPrevious() is redundant checked :)</technical_language>

Target:
private PushButton createButton(final Pair<T, V> item, boolean plusButton) { final T value = item.getFirst(); final V widget = item.getSecond(); final PushButton button = new PushButton(new Image(plusButton ? resources.increaseIcon() : resources.decreaseIcon())); button.addStyleName(style.buttonStyle()); button.setEnabled(!isGhost(value)); button.addClickHandler(plusButton ? new ClickHandler() { @Override public void onClick(ClickEvent event) { getEntry(widget).removeLastButton(); Pair<T, V> item = addGhostEntry(); onAdd(item.getFirst(), item.getSecond()); } } : new ClickHandler() { @Override public void onClick(ClickEvent event) { ListIterator<Pair<T, V>> last = items.listIterator(items.size()); if (item == last.previous() && last.hasPrevious()) { Pair<T, V> previousItem = last.previous(); getEntry(previousItem.getSecond()).appendButton(createButton(previousItem, true)); } removeEntry(item); onRemove(value, widget); if (items.isEmpty()) { Pair<T, V> item = addGhostEntry(); onAdd(item.getFirst(), item.getSecond()); } } }); return button; }
Source:
<code>protected void updateDestinationField() { if(assist == null) return; for(Ref ref : assist.getRefsForContentAssist(false, true)) <START> if(ref.getName().equals(sourceName)) <END> remoteRefName.setText(sourceName); }</code><technical_language>if looked for remote tracking branch is configured for sourceName. reuse jgit's BranchConfig.getRemoteTrackingBranch()</technical_language>

Target:
protected void updateDestinationField() { setMessage(NLS.bind(UIText.SimplePushSpecPage_message, sourceName)); String checkRemote = sourceName; if (sourceName.startsWith(Constants.R_HEADS)) { try { BranchTrackingStatus status = BranchTrackingStatus.of( repository, sourceName.substring(Constants.R_HEADS.length())); if (status != null) { checkRemote = status.getRemoteTrackingBranch(); checkRemote = Constants.R_HEADS + checkRemote.substring(checkRemote.indexOf('/', Constants.R_REMOTES.length() + 1) + 1); setMessage(NLS.bind( UIText.SimplePushSpecPage_pushAheadInfo, new Object[] { sourceName, Integer.valueOf(status.getAheadCount()), status.getRemoteTrackingBranch() }), IStatus.INFO); } } catch (Exception e) { } if (assist == null) { if (checkRemote != null) remoteRefName.setText(checkRemote); return; } if (checkRemote == null) checkRemote = sourceName; for (Ref ref : assist.getRefsForContentAssist(false, true)) if (ref.getName().equals(checkRemote)) remoteRefName.setText(checkRemote); } }
Source:
<code>protected boolean doesTargetStorageSupportNewDiskOffering(StoragePool destPool, DiskOfferingVO newDiskOffering) { String newDiskOfferingTags = newDiskOffering.getTags(); boolean isnewDiskOfferingTagsBlank = org.apache.commons.lang.StringUtils.isBlank(newDiskOfferingTags); if (isnewDiskOfferingTagsBlank) { return true; <START> } <END> String storageTags = getStoragePoolTags(destPool); boolean isStorageTagsBlank = org.apache.commons.lang.StringUtils.isBlank(storageTags); if (isStorageTagsBlank) { return false; } String[] storageTagsAsStringArray = org.apache.commons.lang.StringUtils.split(storageTags, ","); String[] newDiskOfferingTagsAsStringArray = org.apache.commons.lang.StringUtils.split(newDiskOfferingTags, ","); return CollectionUtils.isSubCollection(Arrays.asList(newDiskOfferingTagsAsStringArray), Arrays.asList(storageTagsAsStringArray)); }</code><technical_language>@rafaelweingartner, Thanks for fix. I suggest variable name storagePoolTags</technical_language>

Target:
protected boolean doesTargetStorageSupportNewDiskOffering(StoragePool destPool, DiskOfferingVO newDiskOffering) { String newDiskOfferingTags = newDiskOffering.getTags(); return doesTargetStorageSupportDiskOffering(destPool, newDiskOfferingTags); }
Source:
<code>public ReflectedMethod(final Method m) { this.method = m; this.parameters = m.getParameters(); <START> this.hasVarArgs = parameters.length > 0 && parameters[method.getParameters().length - 1].isVarArgs(); <END> }</code><technical_language>Replace method.getParameters() parameters</technical_language>

Target:
public ReflectedMethod(final Method m) { this.method = m; this.parameters = m.getParameters(); this.hasVarArgs = parameters.length > 0 && parameters[parameters.length - 1].isVarArgs(); }
Source:
<code>private void openUrl(String url) throws IOException { Runtime rt = Runtime.getRuntime(); <START> String os = System.getProperty("os.name").toLowerCase(); <END> if (os.contains("win")) { rt.exec("rundll32 url.dll,FileProtocolHandler " + url); } else if (os.contains("mac")) { rt.exec("open " + url); } else if (os.contains("nix") || os.contains("nux")) { rt.exec("xdg-open " + url); } else { logger.error("Browser could not be opened - please open in a browser on this device.", url); } }</code><technical_language>of non-localized String.toUpperCase() String.toLowerCase() in com.azure.identity.implementation.IdentityClient.openUrl(String) [com.azure.identity.implementation.IdentityClient] IdentityClient.java:[line 497] DM_CONVERT_CASE</technical_language>

Target:
private void openUrl(String url) throws IOException { Runtime rt = Runtime.getRuntime(); String os = System.getProperty("os.name").toLowerCase(Locale.ROOT); if (os.contains("win")) { rt.exec("rundll32 url.dll,FileProtocolHandler " + url); } else if (os.contains("mac")) { rt.exec("open " + url); } else if (os.contains("nix") || os.contains("nux")) { rt.exec("xdg-open " + url); } else { logger.error("Browser could not be opened - please open in a browser on this device.", url); } }