auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void canDisconnect(IContainerDMContext[] contDmcs, DataRequestMonitor<Boolean> rm) { if (contDmcs.length == 0) { rm.setData(false); rm.done(); return; } IMultiDetach multiDetach = fTracker.getService(IMultiDetach.class); if (multiDetach != null) { multiDetach.canDetachDebuggerFromSomeProcesses(contDmcs, rm); } <START> else { <END> IProcesses procService = fTracker.getService(IProcesses.class); if (procService != null) { procService.canDetachDebuggerFromProcess(contDmcs[0], rm); } else { rm.setData(false);; rm.done(); } } }</code><technical_language>If is MultiDetach service, revert previous behaviour of allowing detaching multiple elements selected? confusing arbitrarily allow detail selection allows it. need add a check if (contDmcs.length != 1) rm.done(false);</technical_language>

Target:
private void canDisconnect(IContainerDMContext[] contDmcs, DataRequestMonitor<Boolean> rm) { if (contDmcs.length == 0) { rm.setData(false); rm.done(); return; } IMultiDetach multiDetach = fTracker.getService(IMultiDetach.class); if (multiDetach != null) { multiDetach.canDetachDebuggerFromSomeProcesses(contDmcs, rm); } else { IProcesses procService = fTracker.getService(IProcesses.class); if (procService != null && contDmcs.length == 1) { procService.canDetachDebuggerFromProcess(contDmcs[0], rm); } else { rm.setData(false); rm.done(); } } }
Source:
<code>public void makesAGetRequestToUri() throws Exception { <START> MockWebServer mockWebServer = mockWebServerTester.startMockWebServer(); <END> mockWebServer.enqueue(new MockResponse()); URI uri = mockWebServer.url("/blah").uri(); subject.executeGetRequest(uri, null, null); assertThat(mockWebServer.getRequestCount(), equalTo(1)); RecordedRequest request = mockWebServer.takeRequest(); assertThat(request.getMethod(), equalTo("GET")); assertThat(request.getRequestUrl().uri(), equalTo(uri)); }</code><technical_language>Is benefit of initializing mockWebServer locally tighter scope is is another benefit seeing</technical_language>

Target:
public void makesAGetRequestToUri() throws Exception { mockWebServer.enqueue(new MockResponse()); URI uri = mockWebServer.url("/blah").uri(); subject.executeGetRequest(uri, null, null); assertThat(mockWebServer.getRequestCount(), equalTo(1)); RecordedRequest request = mockWebServer.takeRequest(); assertThat(request.getMethod(), equalTo("GET")); assertThat(request.getRequestUrl().uri(), equalTo(uri)); }
Source:
<code>private String findAuthorOwnedBy(HazelcastInstance hz) { int ownedKey = 0; Member localMember = hz.getCluster().getLocalMember(); for (int i = 0; i < BOOK_COUNT; i++) { if (localMember.equals(hz.getPartitionService().getPartition(i).getOwner())) { ownedKey = i; break; } } <START> return String.valueOf(ownedKey % 7); <END> }</code><technical_language>please explain this magic "7" me</technical_language>

Target:
private String findAuthorOwnedBy(HazelcastInstance hz) { int ownedKey = 0; Member localMember = hz.getCluster().getLocalMember(); for (int i = 0; i < BOOK_COUNT; i++) { if (localMember.equals(hz.getPartitionService().getPartition(i).getOwner())) { ownedKey = i; break; } } return getAuthorNameByKey(ownedKey); }
Source:
<code>public void createProject() { <START> Script script; <END> brickPosition = 1; ifBrick = new PhiroIfLogicBeginBrick(); IfLogicElseBrick ifLogicElseBrick = new IfLogicElseBrick(ifBrick); IfLogicEndBrick ifLogicEndBrick = new IfLogicEndBrick(ifLogicElseBrick, ifBrick); ifBrick.setIfElseBrick(ifLogicElseBrick); ifBrick.setIfEndBrick(ifLogicEndBrick); script = BrickTestUtils.createProjectAndGetStartScript("PhiroIfBrickTest"); script.addBrick(ifBrick); script.addBrick(ifLogicElseBrick); script.addBrick(ifLogicEndBrick); }</code><technical_language>initialization separate assignment? (line120)</technical_language>

Target:
public void createProject() { brickPosition = 1; ifBrick = new PhiroIfLogicBeginBrick(); IfLogicElseBrick ifLogicElseBrick = new IfLogicElseBrick(ifBrick); IfLogicEndBrick ifLogicEndBrick = new IfLogicEndBrick(ifLogicElseBrick, ifBrick); ifBrick.setIfElseBrick(ifLogicElseBrick); ifBrick.setIfEndBrick(ifLogicEndBrick); Script script = BrickTestUtils.createProjectAndGetStartScript("PhiroIfBrickTest"); script.addBrick(ifBrick); script.addBrick(ifLogicElseBrick); script.addBrick(ifLogicEndBrick); }
Source:
<code>public static AdapterPair adapterTrimIlluminaPairedReads(final SAMRecord read1, final SAMRecord read2, final int minMatchBases, final double maxErrorRate, final AdapterPair ... adapters) { AdapterPair matched = null; for (final AdapterPair adapterPair : adapters) { final int index1 = findIndexOfClipSequence( getReadBases(read1), adapterPair.get3PrimeAdapterBytes(), minMatchBases, maxErrorRate); final int index2 = findIndexOfClipSequence( getReadBases(read2), adapterPair.get5PrimeAdapterBytesInReadOrder(), minMatchBases, maxErrorRate); final int numBasesClipped1 = (NO_MATCH == index1) ? 0 : read1.getReadLength() - index1; final int numBasesClipped2 = (NO_MATCH == index2) ? 0 : read2.getReadLength() - index2; <START> if (numBasesClipped1 == numBasesClipped2) { <END> if (index1 != NO_MATCH) { read1.setAttribute(ReservedTagConstants.XT, index1 + 1); read2.setAttribute(ReservedTagConstants.XT, index2 + 1); return adapterPair; } else { } } else if (index1 == NO_MATCH || index2 == NO_MATCH) { if(attemptOneSidedMatch(read1, read2, numBasesClipped1, numBasesClipped2, 2 * minMatchBases)) { matched = adapterPair; } } else { } } return matched; }</code><technical_language>I this change is wrong. point is if reads reading other's start point, template, encounter adapter sequence number of bases (i.e. template insert length), finding adapter number of bases in reads is a strong signal right</technical_language>

Target:
public static AdapterPair adapterTrimIlluminaPairedReads(final SAMRecord read1, final SAMRecord read2, final int minMatchBases, final double maxErrorRate, final AdapterPair ... adapters) { AdapterPair matched = null; for (final AdapterPair adapterPair : adapters) { final int index1 = findIndexOfClipSequence( getReadBases(read1), adapterPair.get3PrimeAdapterBytes(), minMatchBases, maxErrorRate); final int index2 = findIndexOfClipSequence( getReadBases(read2), adapterPair.get5PrimeAdapterBytesInReadOrder(), minMatchBases, maxErrorRate); if (index1 == index2) { if (index1 != NO_MATCH) { read1.setAttribute(ReservedTagConstants.XT, index1 + 1); read2.setAttribute(ReservedTagConstants.XT, index2 + 1); return adapterPair; } else { } } else if (index1 == NO_MATCH || index2 == NO_MATCH) { if(attemptOneSidedMatch(read1, read2, index1, index2, 2 * minMatchBases)) { matched = adapterPair; } } else { } } return matched; }
Source:
<code>protected boolean canDoAction() { boolean result = super.canDoAction(); if (result && userProfileDao.getByUserId(getUserId()) != null) { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__ADD); <START> addCanDoActionMessage(VdcBllMessages.VAR__TYPE__ROLE); <END> addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NAME_ALREADY_USED); result = false; } return result; }</code><technical_language>1. this TYPE__ROLE 2. move action type msg variables a specific method: @Override protected void setActionMessageParameters() { .. }</technical_language>

Target:
protected boolean canDoAction() { boolean result = super.canDoAction(); if (result && userProfileDao.getByUserId(getUserId()) != null) { setActionMessageParameters(); result = false; } return result; }
Source:
<code><START> public static Collection<ImmutableWorkerInfo> getImmutableWorkerFromZK(Collection<ZkWorker> workers) <END> { return Collections2.transform( workers, new Function<ZkWorker, ImmutableWorkerInfo>() { @Override public ImmutableWorkerInfo apply(ZkWorker input) { return input.toImmutable(); } } ); }</code><technical_language>I this private. immediately ImmutableList, for this method return ImmutableList</technical_language>

Target:
private static ImmutableList<ImmutableWorkerInfo> getImmutableWorkerFromZK(Collection<ZkWorker> workers) { return ImmutableList.copyOf( Collections2.transform( workers, new Function<ZkWorker, ImmutableWorkerInfo>() { @Override public ImmutableWorkerInfo apply(ZkWorker input) { return input.toImmutable(); } } ) ); }
Source:
<code>synchronized void markSequenceUnresolved(ProducerBatch batch) { <START> log.debug("Marking partition unresolved", batch.topicPartition); <END> partitionsWithUnresolvedSequences.put(batch.topicPartition, batch.baseSequence() + batch.recordCount); }</code><technical_language>add sequence number this message</technical_language>

Target:
synchronized void markSequenceUnresolved(ProducerBatch batch) { int nextSequence = batch.lastSequence() + 1; partitionsWithUnresolvedSequences.compute(batch.topicPartition, (k, v) -> v == null ? nextSequence : Math.max(v, nextSequence)); log.debug("Marking partition unresolved with next sequence number {}", batch.topicPartition, partitionsWithUnresolvedSequences.get(batch.topicPartition)); }
Source:
<code>protected String doInBackground(File... params) { Log.d(TAG, "getExifInformation"); if (params[0] == null) { return ""; } try { String exifReturnString = ""; String exifDate = ""; String exifTime = ""; String exifCity = ""; String exifCountry = ""; ExifInterface exif = new ExifInterface(params[0]); String tagDateTime = exif.getAttribute(ExifInterface.TAG_DATETIME); if (tagDateTime != null) { String[] exifDateTime = tagDateTime.split(" "); String[] exifDateSplit = exifDateTime[0].split(":"); exifDate = exifDateSplit[2] + "." + exifDateSplit[1] + "." + exifDateSplit[0]; exifTime = exifDateTime[1]; } <START> if (!exifDate.equals("")) { <END> exifReturnString = exifDate + "\n"; } if (!exifTime.equals("")) { exifReturnString += exifTime + "\n"; } String tagGpsLatitude = exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE); String tagGpsLongitude = exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE); if (tagGpsLatitude != null && tagGpsLongitude != null) { String[] separatedLat = tagGpsLatitude.split(","); String[] separatedLong = tagGpsLongitude.split(","); Geocoder geocoder = new Geocoder(mContext, Locale.getDefault()); List<Address> addressList = geocoder.getFromLocation( convertArcMinToDegrees(separatedLat), convertArcMinToDegrees(separatedLong), 1 ); if (addressList != null && addressList.size() > 0) { Address address = addressList.get(0); exifCity = address.getLocality(); exifCountry = address.getCountryName(); } } if ((exifCity != null) && (!exifCity.equals(""))) { exifReturnString += exifCity + "\n"; } if ((exifCountry != null) && (!exifCountry.equals(""))) { exifReturnString += exifCountry + "\n"; } return exifReturnString; } catch (IOException | IndexOutOfBoundsException e) { Log.e(TAG, "exception: ", e); return ""; } }</code><technical_language>if (!exifDate.isEmpty())</technical_language>

Target:
protected Boolean doInBackground(File... params) { return exifView.getExifView(mContext, params[0], getSecondaryColor()); }
Source:
<code>boolean shouldCheckForStarvation() { long now = scheduler.getClock().getTime(); <START> return now > nextStarvationCheck; <END> }</code><technical_language>\>=</technical_language>

Target:
boolean shouldCheckForStarvation() { return scheduler.getClock().getTime() >= nextStarvationCheck; }
Source:
<code>public void listDirectory(OCFile directory) { FileDataStorageManager storageManager = mContainerActivity.getStorageManager(); if (storageManager != null) { if(directory == null){ if(mFile != null){ directory = mFile; } else { directory = storageManager.getFileByPath("/"); if (directory == null) return; } } if(!directory.isFolder()){ Log_OC.w(TAG, "You see, that is not a directory -> " + directory.toString()); directory = storageManager.getFileById(directory.getParentId()); } mAdapter.swapDirectory(directory, storageManager); if (mFile == null || !mFile.equals(directory)) { imageView.setSelection(0); } mFile = directory; double countImages = 0; double countFiles = 0; Vector<OCFile> files = storageManager.getFolderContent(directory); <START> for (OCFile file : files){ <END> if (!file.isFolder()){ countFiles++; if (file.isImage()){ countImages++; } } } if ((countImages / countFiles) >= 0.5){ Log_OC.i(TAG, "Image View"); switchImageView(); } else { Log_OC.i(TAG, "Folder View"); switchFileView(); } } }</code><technical_language>This code is in FileListListAdapter class. in moving a common method in a Utils class</technical_language>

Target:
public void listDirectory(OCFile directory) { FileDataStorageManager storageManager = mContainerActivity.getStorageManager(); if (storageManager != null) { if(directory == null){ if(mFile != null){ directory = mFile; } else { directory = storageManager.getFileByPath("/"); if (directory == null) return; } } if(!directory.isFolder()){ Log_OC.w(TAG, "You see, that is not a directory -> " + directory.toString()); directory = storageManager.getFileById(directory.getParentId()); } mAdapter.swapDirectory(directory, storageManager); if (mFile == null || !mFile.equals(directory)) { imageView.setSelection(0); } mFile = directory; Vector<OCFile> files = storageManager.getFolderContent(directory); TextView footerText = (TextView) mFooterView.findViewById(R.id.footerText); footerText.setText(generateFooterText(directory)); if (DisplayUtils.decideViewLayout(files)){ switchImageView(); } else { switchFileView(); } } }
Source:
<code>public WorkspaceEdit organizeImports(String path) { CompletableFuture<Object> result = getLanguageServer() .getWorkspaceService() .executeCommand( new ExecuteCommandParams( Commands.ORGANIZE_IMPORTS_COMMAND, ImmutableList.of(prefixURI(path)))); try { return gson.fromJson(gson.toJson(result.get(10, TimeUnit.SECONDS)), WorkspaceEdit.class); } catch (JsonSyntaxException | InterruptedException | ExecutionException | TimeoutException e) { throw new JsonRpcException(-27000, e.getMessage()); } <START> } <END></code><technical_language>I simplify this method replacing public WorkspaceEdit organizeImports(String path) { return doGetOne(Commands.ORGANIZE_IMPORTS_COMMAND, prefixURI(path), WorkspaceEdit.class); }</technical_language>

Target:
public WorkspaceEdit organizeImports(String path) { Type type = new TypeToken<WorkspaceEdit>() {}.getType(); return doGetOne("java.edit.organizeImports", singletonList(prefixURI(path)), type); }
Source:
<code>public AirShield(final Player player) { super(player); this.maxRadius = getConfig().getDouble("Abilities.Air.AirShield.Radius"); this.isToggledByAvatarState = getConfig().getBoolean("Abilities.Avatar.AvatarState.Air.AirShield.IsAvatarStateToggle"); <START> this.radius = 0; <END> this.cooldown = getConfig().getLong("Abilities.Air.AirShield.Cooldown"); this.duration = getConfig().getLong("Abilities.Air.AirShield.Duration"); this.speed = getConfig().getDouble("Abilities.Air.AirShield.Speed"); this.streams = getConfig().getInt("Abilities.Air.AirShield.Streams"); this.particles = getConfig().getInt("Abilities.Air.AirShield.Particles"); this.random = new Random(); this.angles = new HashMap<>(); if (this.bPlayer.isAvatarState() && hasAbility(player, AirShield.class) && this.isToggledByAvatarState) { getAbility(player, AirShield.class).remove(); return; } int angle = 0; final int di = (int) (this.maxRadius * 2 / this.streams); for (int i = -(int) this.maxRadius + di; i < (int) this.maxRadius; i += di) { this.angles.put(i, angle); angle += 90; if (angle == 360) { angle = 0; } } this.start(); }</code><technical_language>A new instance variable double initialRadius config option Abilities.Air.AirShield.initialRadius added allow for shield growth functionality instead of forcing servers start 0. Some servers want shield grow</technical_language>

Target:
public AirShield(final Player player) { super(player); this.maxRadius = getConfig().getDouble("Abilities.Air.AirShield.MaxRadius"); this.initialRadius = getConfig().getDouble("Abilities.Air.AirShield.InitialRadius"); this.isToggledByAvatarState = getConfig().getBoolean("Abilities.Avatar.AvatarState.Air.AirShield.IsAvatarStateToggle"); this.radius = initialRadius; this.cooldown = getConfig().getLong("Abilities.Air.AirShield.Cooldown"); this.duration = getConfig().getLong("Abilities.Air.AirShield.Duration"); this.speed = getConfig().getDouble("Abilities.Air.AirShield.Speed"); this.streams = getConfig().getInt("Abilities.Air.AirShield.Streams"); this.particles = getConfig().getInt("Abilities.Air.AirShield.Particles"); this.random = new Random(); this.angles = new HashMap<>(); if (this.bPlayer.isAvatarState() && hasAbility(player, AirShield.class) && this.isToggledByAvatarState) { getAbility(player, AirShield.class).remove(); return; } int angle = 0; final int di = (int) (this.maxRadius * 2 / this.streams); for (int i = -(int) this.maxRadius + di; i < (int) this.maxRadius; i += di) { this.angles.put(i, angle); angle += 90; if (angle == 360) { angle = 0; } } this.start(); }
Source:
<code>public static String displayRub3(Context context, int page) <START> { <END> int rub3 = QuranInfo.getRub3FromPage(page); int hizb = (rub3 / 4) + 1; StringBuilder sb = new StringBuilder(); if (rub3 == -1) { return ""; } int remainder = rub3 % 4; if (remainder == 1) { sb.append(context.getString(R.string.quran_rob3)).append(' '); } else if (remainder == 2) { sb.append(context.getString(R.string.quran_nos)).append(' '); } else if (remainder == 3) { sb.append(context.getString(R.string.quran_talt_arb3)).append(' '); } sb.append(context.getString(R.string.quran_hizb)).append(' ') .append(QuranUtils.getLocalizedNumber(context, hizb)); return sb.toString(); }</code><technical_language>Please line method declaration for opening bracket</technical_language>

Target:
public static String displayRub3(Context context, int page){ int rub3 = QuranInfo.getRub3FromPage(page); if (rub3 == -1) { return ""; } int hizb = (rub3 / 4) + 1; StringBuilder sb = new StringBuilder(); sb.append(" , "); int remainder = rub3 % 4; if (remainder == 1) { sb.append(context.getString(R.string.quran_rob3)).append(' '); } else if (remainder == 2) { sb.append(context.getString(R.string.quran_nos)).append(' '); } else if (remainder == 3) { sb.append(context.getString(R.string.quran_talt_arb3)).append(' '); } sb.append(context.getString(R.string.quran_hizb)).append(' ') .append(QuranUtils.getLocalizedNumber(context, hizb)); return sb.toString(); }
Source:
<code>private void requestEvents(int month, int date) { progressBar.setVisibility(VISIBLE); eventsRecycler.setVisibility(GONE); errorView.setVisibility(GONE); disposables.add(ServiceFactory.getRest(wiki).getOnThisDay(month + 1, date) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .doAfterTerminate(() -> { progressBar.setVisibility(GONE); <START> eventsRecycler.postDelayed(() -> { <END> if (positionToScrollTo != -1 && yearClickedOnCardView != -1) { eventsRecycler.scrollToPosition(positionToScrollTo); } }, 500); }) .subscribe(response -> { onThisDay = response; eventsRecycler.setVisibility(VISIBLE); eventsRecycler.setAdapter(new RecyclerAdapter(onThisDay.events(), wiki)); List<OnThisDay.Event> events = onThisDay.events(); for (int i = 0; i < events.size(); i++) { if (yearClickedOnCardView == events.get(i).year()) { positionToScrollTo = i; break; } } int beginningYear = events.get(events.size() - 1).year(); dayInfoTextView.setText(String.format(getString(R.string.events_count_text), Integer.toString(events.size()), DateUtil.yearToStringWithEra(beginningYear), events.get(0).year())); }, throwable -> { L.e(throwable); errorView.setError(throwable); errorView.setVisibility(VISIBLE); eventsRecycler.setVisibility(GONE); })); }</code><technical_language>Adding a check prevent a crash</technical_language>

Target:
private void requestEvents(int month, int date) { progressBar.setVisibility(VISIBLE); eventsRecycler.setVisibility(GONE); errorView.setVisibility(GONE); disposables.add(ServiceFactory.getRest(wiki).getOnThisDay(month + 1, date) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .doAfterTerminate(() -> { if (!isAdded()) { return; } progressBar.setVisibility(GONE); eventsRecycler.postDelayed(() -> { if (positionToScrollTo != -1 && yearOnCardView != -1) { eventsRecycler.scrollToPosition(positionToScrollTo); } }, 500); }) .subscribe(response -> { onThisDay = response; eventsRecycler.setVisibility(VISIBLE); eventsRecycler.setAdapter(new RecyclerAdapter(onThisDay.events(), wiki)); List<OnThisDay.Event> events = onThisDay.events(); for (int i = 0; i < events.size(); i++) { if (yearOnCardView == events.get(i).year()) { positionToScrollTo = i; break; } } int beginningYear = events.get(events.size() - 1).year(); dayInfoTextView.setText(String.format(getString(R.string.events_count_text), Integer.toString(events.size()), DateUtil.yearToStringWithEra(beginningYear), events.get(0).year())); }, throwable -> { L.e(throwable); errorView.setError(throwable); errorView.setVisibility(VISIBLE); eventsRecycler.setVisibility(GONE); })); }
Source:
<code>public Map<String, ContainerRaw> getContainersMap() { final Map<String, ContainerRaw> containerRawMap = new HashMap<>(); containers.stream().forEach(containerRaw -> { final Container container = containerRaw.getContainer(); if (container instanceof FileAssetContainer) { try { <START> final Host host = APILocator.getHostAPI().findParentHost(container, APILocator.systemUser(), false); <END> String path = null; if (host == null || this.site.getIdentifier().equals(host.getIdentifier())) { path = FileAssetContainer.class.cast(container).getPath(); } else { path = FileAssetContainerUtil.getInstance().getFullPath((FileAssetContainer) container); } containerRawMap.put(path, containerRaw); } catch (DotDataException | DotSecurityException e) { Logger.debug(PageView.class, e.getMessage()); } } else { final String identifier = container.getIdentifier(); containerRawMap.put(identifier, containerRaw); } }); return containerRawMap; }</code><technical_language>Instead of this, store host id FileAssetContainer compare current host</technical_language>

Target:
public Map<String, ContainerRaw> getContainersMap() { final Map<String, ContainerRaw> containerRawMap = new HashMap<>(); containers.stream().forEach(containerRaw -> { final Container container = containerRaw.getContainer(); if (container instanceof FileAssetContainer) { final Host host = ((FileAssetContainer) container).getHost(); String path = null; if (host == null || this.site.getIdentifier().equals(host.getIdentifier())) { path = FileAssetContainer.class.cast(container).getPath(); } else { path = FileAssetContainerUtil.getInstance().getFullPath((FileAssetContainer) container); } containerRawMap.put(path, containerRaw); } else { final String identifier = container.getIdentifier(); containerRawMap.put(identifier, containerRaw); } }); return containerRawMap; }
Source:
<code>public String getEmulatorEndpoint() { <START> return getContainerIpAddress() + ":" + getMappedPort(PORT); <END> }</code><technical_language>suggestion return getHost() + ":" + getEmulatorPort();</technical_language>

Target:
public String getEmulatorEndpoint() { return getHost() + ":" + getEmulatorPort(); }
Source:
<code>private void showComments(HNPostComments comments) { if (comments.getHeaderHtml() != null && mCommentHeaderText.getVisibility() != View.VISIBLE) { mCommentHeaderText.setVisibility(View.VISIBLE); mCommentHeaderText.setText(Html.fromHtml(comments.getHeaderHtml()).toString().trim()); Linkify.addLinks(mCommentHeaderText, <START> Pattern.compile("((h|H)ttps?:\\/\\/)([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?(\\?(\\w+\\=\\w+&?)+)?"), ""); <END> } mComments = comments; if (mComments.getComments().size() == 0) mCommentsList.setEmptyView(null); mCommentsListAdapter.notifyDataSetChanged(); }</code><technical_language>'i' flag</technical_language>

Target:
private void showComments(HNPostComments comments) { if (comments.getHeaderHtml() != null && mCommentHeaderText.getVisibility() != View.VISIBLE) { mCommentHeaderText.setVisibility(View.VISIBLE); mCommentHeaderText.setText(Html.fromHtml(comments.getHeaderHtml()).toString().trim()); Linkify.addLinks(mCommentHeaderText, Linkify.WEB_URLS); } mComments = comments; if (mComments.getComments().size() == 0) mCommentsList.setEmptyView(null); mCommentsListAdapter.notifyDataSetChanged(); }
Source:
<code>public void init(FilterConfig filterConfig) throws ServletException { try { KeyStore ks = KeyStore.getInstance(EngineLocalConfig.getInstance().getPKITrustStoreType()); try (InputStream is = new FileInputStream(EngineLocalConfig.getInstance().getPKITrustStore())) { ks.load(is, EngineLocalConfig.getInstance().getPKITrustStorePassword().toCharArray()); } ticketDecoder = new TicketDecoder(ks, EngineLocalConfig.getInstance().getSsoStoreEku()); } catch (Exception e) { throw new RuntimeException("Unable to instantiate TicketDecoder", e); <START> } <END> }</code><technical_language>this code aaa utilities something... return instance of ticket utils. in engine messy design, hold static ticket decoder utils class... this is ugly</technical_language>

Target:
public void init(FilterConfig filterConfig) throws ServletException { }
Source:
<code>private boolean findChildren(CalledFunction node, int depth, ITmfStateSystem ss, int maxQuark, IProgressMonitor monitor) { fStore.add(node); long curTime = node.getStart(); long limit = node.getEnd(); ITmfStateInterval interval = null; while (curTime < limit) { if (monitor.isCanceled()) { return false; } try { if (depth + 1 < fCurrentQuarks.size()) { interval = ss.querySingleState(curTime, fCurrentQuarks.get(depth + 1)); } else { return true; } } catch (StateSystemDisposedException e) { Activator.getInstance().logError(Messages.QueringStateSystemError, e); return false; } ITmfStateValue stateValue = interval.getStateValue(); if (!stateValue.isNull()) { long intervalStart = interval.getStartTime(); long intervalEnd = interval.getEndTime(); if (intervalStart < node.getStart() || intervalEnd > limit) { return true; } CalledFunction segment = new CalledFunction(intervalStart, intervalEnd + 1, <START> stateValue.unboxLong(), node.getDepth() <END> + 1); findChildren(segment, depth + 1, ss, maxQuark, monitor); node.addChild(segment); } curTime = interval.getEndTime() + 1; } return true; }</code><technical_language>Needs fixed too</technical_language>

Target:
private boolean findChildren(CalledFunction node, int depth, ITmfStateSystem ss, int maxQuark, IProgressMonitor monitor) { fStore.add(node); long curTime = node.getStart(); long limit = node.getEnd(); ITmfStateInterval interval = null; while (curTime < limit) { if (monitor.isCanceled()) { return false; } try { if (depth + 1 < fCurrentQuarks.size()) { interval = ss.querySingleState(curTime, fCurrentQuarks.get(depth + 1)); } else { return true; } } catch (StateSystemDisposedException e) { Activator.getInstance().logError(Messages.QueringStateSystemError, e); return false; } ITmfStateValue stateValue = interval.getStateValue(); if (!stateValue.isNull()) { long intervalStart = interval.getStartTime(); long intervalEnd = interval.getEndTime(); if (intervalStart < node.getStart() || intervalEnd > limit) { return true; } CalledFunction segment = new CalledFunction(intervalStart, intervalEnd + 1, stateValue, node.getDepth() + 1); findChildren(segment, depth + 1, ss, maxQuark, monitor); node.addChild(segment); } curTime = interval.getEndTime() + 1; } return true; }
Source:
<code>public void cancelJob() throws IOException, SignatureException, XmlProcessingException { final String bucketName = "test_cancel_job"; try { client.putBucket(new PutBucketRequest(bucketName)); final List<Ds3Object> objectsOne = new ArrayList<>(); final Ds3Object obj = new Ds3Object("testOne", 2); objectsOne.add(obj); final Ds3ClientHelpers.Job job = wrap(client).startWriteJob(bucketName, objectsOne); final CancelJobSpectraS3Response response = client .cancelJobSpectraS3(new CancelJobSpectraS3Request(job.getJobId())); <START> response.checkStatusCode(204); <END> assertTrue(client.getActiveJobsSpectraS3(new GetActiveJobsSpectraS3Request()) .getActiveJobListResult().getActiveJobs().isEmpty()); } finally { deleteAllContents(client, bucketName); } }</code><technical_language>response generation this. assert status code</technical_language>

Target:
public void cancelJob() throws IOException, SignatureException, XmlProcessingException { try { final Ds3ClientHelpers.Job job = HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("testOne", 2))); final CancelJobSpectraS3Response response = client .cancelJobSpectraS3(new CancelJobSpectraS3Request(job.getJobId())); assertEquals(response.getStatusCode(),204); assertTrue(client.getActiveJobsSpectraS3(new GetActiveJobsSpectraS3Request()) .getActiveJobListResult().getActiveJobs().isEmpty()); } finally { deleteAllContents(client, BUCKET_NAME); } }
Source:
<code>private boolean needsOverflow(byte[] tableMetadata) { boolean needsOverflow = false; TableMetadata metadata = TableMetadata.BYTES_HYDRATOR.hydrateFromBytes(tableMetadata); if (metadata != null) { needsOverflow = metadata.getColumns().getMaxValueSize() > AtlasDbConstants.ORACLE_OVERFLOW_THRESHOLD; } return needsOverflow; <START> } <END></code><technical_language>nit: This is fine, extracted method explicitly need boolean anymore. Separately, this static i.e. private static boolean needsOverflow(byte[] tableMetadata) { TableMetadata metadata = TableMetadata.BYTES_HYDRATOR.hydrateFromBytes(tableMetadata); if (metadata != null) { return metadata.getColumns().getMaxValueSize() > AtlasDbConstants.ORACLE_OVERFLOW_THRESHOLD; } return false; } private static boolean needsOverflow(byte[] tableMetadata) { TableMetadata metadata = TableMetadata.BYTES_HYDRATOR.hydrateFromBytes(tableMetadata); return metadata != null && metadata.getColumns().getMaxValueSize() > AtlasDbConstants.ORACLE_OVERFLOW_THRESHOLD; }</technical_language>

Target:
private boolean needsOverflow(byte[] tableMetadata) { TableMetadata metadata = TableMetadata.BYTES_HYDRATOR.hydrateFromBytes(tableMetadata); return (metadata != null) && (metadata.getColumns().getMaxValueSize() > AtlasDbConstants.ORACLE_OVERFLOW_THRESHOLD); }
Source:
<code>public static <T> MutableMessageBuilder<T> fromMessage(Message<T> message) { Assert.notNull(message, "message must not be null"); if (message instanceof CloneableMessage) { logger.warn("For CloneableMessages consider to use regular MessageBuilder. " + "Otherwise custom Message context may be lost."); <START> } <END> return new MutableMessageBuilder<T>(message); }</code><technical_language>If move logic builder factories, this needed</technical_language>

Target:
public static <T> MutableMessageBuilder<T> fromMessage(Message<T> message) { Assert.notNull(message, "message must not be null"); return new MutableMessageBuilder<T>(message); }
Source:
<code>public void testTranslateDedicatedResourcePoolConfiguration() { ClusteredResourceConfigurationParser configTranslator = new ClusteredResourceConfigurationParser(); DedicatedClusteredResourcePoolImpl dedicatedClusteredResourcePool = new DedicatedClusteredResourcePoolImpl("from", 12, MemoryUnit.GB); Node retElement = configTranslator.unparseResourcePool(dedicatedClusteredResourcePool); assertThat(retElement, is(notNullValue())); assertThat(retElement.getNodeName(), is("ehcache:resources")); assertThat(retElement.getAttributes(), is(notNullValue())); assertThat(retElement.getAttributes().getLength(), is(1)); assertThat(retElement.getAttributes().item(0).getNodeName(), is("xmlns:ehcache")); assertThat(retElement.getAttributes().item(0).getNodeValue(), is("<LINK_0>")); Node clusterElement = retElement.getFirstChild(); assertThat(clusterElement, is(notNullValue())); assertThat(clusterElement.getAttributes(), is(notNullValue())); <START> assertThat(clusterElement.getAttributes().getLength(), is(3)); <END> assertThat(clusterElement.getAttributes().item(0).getNodeName(), is("from")); assertThat(clusterElement.getAttributes().item(0).getNodeValue(), is("from")); assertThat(clusterElement.getAttributes().item(1).getNodeName(), is("unit")); assertThat(clusterElement.getAttributes().item(1).getNodeValue(), is("GB")); assertThat(clusterElement.getAttributes().item(2).getNodeName(), is("xmlns:tc")); assertThat(clusterElement.getAttributes().item(2).getNodeValue(), is("<LINK_0>/clustered")); assertThat(clusterElement.getNodeName(), is("tc:clustered-dedicated")); assertThat(clusterElement.getFirstChild().getNodeValue(), is("12")); }</code><technical_language>A bunch of method extractions well</technical_language>

Target:
public void testTranslateDedicatedResourcePoolConfiguration() { ClusteredResourceConfigurationParser configTranslator = new ClusteredResourceConfigurationParser(); DedicatedClusteredResourcePoolImpl dedicatedClusteredResourcePool = new DedicatedClusteredResourcePoolImpl("from", 12, MemoryUnit.GB); Node retElement = configTranslator.unparseResourcePool(dedicatedClusteredResourcePool); assertThat(retElement, is(notNullValue())); assertThat(retElement.getNodeName(), is("ehcache:resources")); checkAttributeItems(retElement); Node clusterElement = retElement.getFirstChild(); assertThat(clusterElement, is(notNullValue())); assertThat(clusterElement.getNodeName(), is("tc:clustered-dedicated")); checkAttributeItems(clusterElement); assertThat(clusterElement.getFirstChild().getNodeValue(), is("12")); }
Source:
<code>public DataAccount getDataAccount(Long id, Boolean deleted) throws DataAccessException { DataAccount dataAccount = null; IDatabaseService databaseService = DatabaseServiceProvider.provide(); Connection dataAccountConnection = databaseService.getNamedConnection(DatabaseType.DatabaseTypeDataAccount.toString()); String getDataAccountQuery = String.format( "SELECT *, convert(aes_decrypt(`password`,UNHEX('%s')), CHAR(1000)) AS `clearpassword` FROM `dataaccount` WHERE `id`='%d' %s LIMIT 1", key(), <START> id.longValue(), (deleted) ? "" : "AND `deleted`='n'"); <END> try { dataAccountConnection.connect(); dataAccountConnection.executeQuery(getDataAccountQuery); if (dataAccountConnection.fetchNextRow()) { dataAccount = toDataAccount(dataAccountConnection); } } finally { if (dataAccountConnection != null) { dataAccountConnection.disconnect(); } } return dataAccount; }</code><technical_language>need for brackets deleted</technical_language>

Target:
public DataAccount getDataAccount(Long id, Boolean deleted) throws DataAccessException { DataAccount dataAccount = null; IDatabaseService databaseService = DatabaseServiceProvider.provide(); Connection dataAccountConnection = databaseService.getNamedConnection(DatabaseType.DatabaseTypeDataAccount.toString()); String getDataAccountQuery = String.format( "SELECT *, convert(aes_decrypt(`password`,UNHEX('%s')), CHAR(1000)) AS `clearpassword` FROM `dataaccount` WHERE `id`='%d' %s LIMIT 1", key(), id.longValue(), deleted ? "" : "AND `deleted`='n'"); try { dataAccountConnection.connect(); dataAccountConnection.executeQuery(getDataAccountQuery); if (dataAccountConnection.fetchNextRow()) { dataAccount = toDataAccount(dataAccountConnection); } } finally { if (dataAccountConnection != null) { dataAccountConnection.disconnect(); } } return dataAccount; }
Source:
<code>public String toString() { StringBuilder stringBuilder = new StringBuilder(); <START> stringBuilder.append("[MessageInfo:").append("Key-").append(key).append("Size-").append(size) <END> .append("ExpirationTimeInMs-").append(expirationTimeInMs).append("IsDeleted-").append(isDeleted).append("]"); return stringBuilder.toString(); }</code><technical_language>add some commas and/or white space in toSTring? e.g. .append("Key-").append(key).append(", ")</technical_language>

Target:
public String toString() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("[MessageInfo:").append("Key-").append(key).append(",").append("Size-").append(size) .append(",").append("ExpirationTimeInMs-").append(expirationTimeInMs).append(",").append("IsDeleted-") .append(isDeleted).append("]"); return stringBuilder.toString(); }
Source:
<code><START> public A value() { <END> return trampoline().run(); }</code><technical_language>final</technical_language>

Target:
public final A value() { return trampoline().run(); }
Source:
<code>public String save() { try { this.serviceManager.getClientService().save(this.client); <START> return "/pages/clients?faces-redirect=true"; <END> } catch (DataException e) { Helper.setFehlerMeldung("Error, could not save client", e.getMessage()); return null; } }</code><technical_language>BaseForm class provides a constant for this faces-redirect=true. Please this constant</technical_language>

Target:
public String save() { try { this.serviceManager.getClientService().save(this.client); return "/pages/clients?" + REDIRECT_PARAMETER; } catch (DataException e) { Helper.setFehlerMeldung("Error, could not save client", e.getMessage()); return null; } }
Source:
<code>private void retrieveModuleFields() throws IOException { if (sourceType.getValue() == SourceType.MODULE_SELECTION && StringUtils.isNotEmpty(moduleName.getValue())) { ClassLoader classLoader = this.getClass().getClassLoader(); RuntimeInfo runtimeInfo = new JarRuntimeInfo("mvn:org.talend.components/components-salesforce-runtime", <START> DependenciesReader.computeDependenciesFilePath("org.talend.components", "components-salesforce-runtime"), <END> "org.talend.components.salesforce.runtime.dataprep.SalesforceDataprepSource"); try (SandboxedInstance sandboxedInstance = RuntimeUtil.createRuntimeClass(runtimeInfo, classLoader)) { SalesforceRuntimeSourceOrSink runtime = (SalesforceRuntimeSourceOrSink) sandboxedInstance.getInstance(); SalesforceInputProperties properties = new SalesforceInputProperties("model"); properties.setDatasetProperties(this); runtime.initialize(null, properties); runtime.validate(null); List<NamedThing> moduleNames = runtime.getSchemaNames(null); moduleName.setPossibleNamedThingValues(moduleNames); Schema schema = runtime.getEndpointSchema(null, moduleName.getValue()); List<NamedThing> columns = new ArrayList<>(); for (Schema.Field field : schema.getFields()) { columns.add(new SimpleNamedThing(field.name(), field.name())); } selectColumnIds.setPossibleValues(columns); } } }</code><technical_language>*org.talend.components.salesforce.SalesforceDefinition.getCommonRuntimeInfo(String)* instead please</technical_language>

Target:
private void retrieveModuleFields() throws IOException { if (sourceType.getValue() == SourceType.MODULE_SELECTION && StringUtils.isNotEmpty(moduleName.getValue())) { Consumer consumer = new Consumer() { @Override public void accept(SalesforceRuntimeSourceOrSink runtime) throws IOException { List<NamedThing> moduleNames = runtime.getSchemaNames(null); moduleName.setPossibleNamedThingValues(moduleNames); Schema schema = runtime.getEndpointSchema(null, moduleName.getValue()); List<NamedThing> columns = new ArrayList<>(); for (Schema.Field field : schema.getFields()) { columns.add(new SimpleNamedThing(field.name(), field.name())); } selectColumnIds.setPossibleValues(columns); } }; runtimeTask(consumer); } }
Source:
<code>private static ExpressionRewriter createRewrite() { <START> return (expression, context) -> DesugarCurrentUserRewriter.rewrite(expression); <END> }</code><technical_language>Inline rewrite method. point in separate. (discussed @martint agrees) move getCall method need class anymore</technical_language>

Target:
private static ExpressionRewriter createRewrite() { return (expression, context) -> ExpressionTreeRewriter.rewriteWith(new com.facebook.presto.sql.tree.ExpressionRewriter<Void>() { @Override public Expression rewriteCurrentUser(CurrentUser node, Void context, ExpressionTreeRewriter<Void> treeRewriter) { return DesugarCurrentUser.getCall(node); } }, expression); }
Source:
<code>public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } MyPojo myPojo = (MyPojo) o; <START> return name != null ? name.equals(myPojo.name) : myPojo.name == null; <END> }</code><technical_language>simplified Objects.equals(name, myPojo.name)</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final MyPojo myPojo = (MyPojo) o; return Objects.equals(name, myPojo.name); }
Source:
<code>protected void executeCommand() { VDSReturnValue vdsReturnValue = extendUnderlyingVolumeSize(getImage()); setSucceeded(vdsReturnValue.getSucceeded()); if (vdsReturnValue.getSucceeded()) { Guid taskId = createTask(getAsyncTaskId(), vdsReturnValue.getCreationInfo(), getParameters().getParentCommand()); <START> getReturnValue().getInternalVdsmTaskIdList().add(taskId); <END> if (getParameters().getParentNotifiesCallback()) { getParameters().setVdsmTaskIds(new ArrayList<>(Collections.singletonList(taskId))); getReturnValue().getVdsmTaskIdList().add(taskId); persistCommand(getParameters().getParentCommand(), true); } } else { updateAuditLog(AuditLogType.USER_EXTEND_DISK_SIZE_FAILURE, getParameters().getNewSizeInGB()); } }</code><technical_language>1. replace getReturnValue().getInternalVdsmTaskIdList() getTaskIdList(). 2. In order safe side, leave behavior in case getParameters().getParentNotifiesCallback() is true (see line 56)</technical_language>

Target:
protected void executeCommand() { VDSReturnValue vdsReturnValue = extendUnderlyingVolumeSize(getImage()); setSucceeded(vdsReturnValue.getSucceeded()); if (vdsReturnValue.getSucceeded()) { Guid taskId = createTask(getAsyncTaskId(), vdsReturnValue.getCreationInfo(), getParameters().getParentCommand()); getTaskIdList().add(taskId); if (getParameters().getParentNotifiesCallback()) { getParameters().setVdsmTaskIds(new ArrayList<>(Collections.singletonList(taskId))); getReturnValue().getVdsmTaskIdList().add(taskId); persistCommand(getParameters().getParentCommand(), true); } } else { updateAuditLog(AuditLogType.USER_EXTEND_DISK_SIZE_FAILURE, getParameters().getNewSizeInGB()); } }
Source:
<code>public static ObjectListAttributeDefinition.Builder of(final String name, final ObjectTypeAttributeDefinition valueType) { return new ObjectListAttributeDefinition.Builder(name, valueType); <START> } <END></code><technical_language>This return ObjectMapAttributeDefinition.Builder, ObjectList..</technical_language>

Target:
public static ObjectMapAttributeDefinition.Builder of(final String name, final ObjectTypeAttributeDefinition valueType) { return new ObjectMapAttributeDefinition.Builder(name, valueType); }
Source:
<code>public Collection<EObject> getInverseReferences(final String featureName) { Preconditions.checkNotNull(featureName); return getInverseReferences(new Predicate<EStructuralFeature.Setting>() { @Override public boolean apply(Setting input) { return input != null <START> && input.getEStructuralFeature() != null ? featureName.equals(input.getEStructuralFeature().getName()) <END> : false; } }); }</code><technical_language>&& input.getESF() != null && featureName.equals(input.getEFS().geName()</technical_language>

Target:
public Collection<EObject> getInverseReferences(final String featureName) { Preconditions.checkNotNull(featureName); return getInverseReferences(new Predicate<EStructuralFeature.Setting>() { @Override public boolean apply(Setting input) { return input != null && input.getEStructuralFeature() != null && featureName.equals(input.getEStructuralFeature().getName()); } }); }
Source:
<code>private void trySendBounce(Mail originalMail) throws MessagingException { MailImpl newMail = new MailImpl(originalMail); try { newMail.setRemoteHost(getRemoteHost()); newMail.setRemoteAddr(getRemoteAddr()); newMail.setRecipients(getSenderAsList(originalMail)); <START> if (getInitParameters().isDebug() && LOGGER.isDebugEnabled()) { <END> LOGGER.debug("New mail - sender: " + newMail.getSender() + ", recipients: " + StringUtils.arrayToString(newMail.getRecipients().toArray()) + ", name: " + newMail.getName() + ", remoteHost: " + newMail.getRemoteHost() + ", remoteAddr: " + newMail.getRemoteAddr() + ", state: " + newMail.getState() + ", lastUpdated: " + newMail.getLastUpdated() + ", errorMessage: " + newMail.getErrorMessage()); } newMail.setMessage(createBounceMessage(originalMail)); MailModifier mailModifier = MailModifier.builder() .mailet(this) .mail(newMail) .dns(dns) .build(); mailModifier.setRecipients(getRecipients(originalMail)); mailModifier.setTo(getTo(originalMail)); mailModifier.setSubjectPrefix(originalMail); mailModifier.setReplyTo(getReplyTo(originalMail), originalMail); mailModifier.setReversePath(getReversePath(originalMail), originalMail); mailModifier.setIsReply(getInitParameters().isReply(), originalMail); mailModifier.setSender(getSender(originalMail), originalMail); newMail.getMessage().setHeader(RFC2822Headers.DATE, getDateHeader(originalMail)); newMail.getMessage().saveChanges(); getMailetContext().sendMail(newMail); } finally { newMail.dispose(); } }</code><technical_language>Changed parameterized logging</technical_language>

Target:
private void trySendBounce(Mail originalMail) throws MessagingException { MailImpl newMail = MailImpl.duplicate(originalMail); try { newMail.setRemoteHost(getRemoteHost()); newMail.setRemoteAddr(getRemoteAddr()); newMail.setRecipients(getSenderAsList(originalMail)); if (getInitParameters().isDebug()) { LOGGER.debug("New mail - sender: {}, recipients: {}, name: {}, remoteHost: {}, remoteAddr: {}, state: {}, lastUpdated: {}, errorMessage: {}", newMail.getSender(), newMail.getRecipients(), newMail.getName(), newMail.getRemoteHost(), newMail.getRemoteAddr(), newMail.getState(), newMail.getLastUpdated(), newMail.getErrorMessage()); } newMail.setMessage(createBounceMessage(originalMail)); MailModifier mailModifier = MailModifier.builder() .mailet(this) .mail(newMail) .dns(dns) .build(); mailModifier.setRecipients(getRecipients(originalMail)); mailModifier.setTo(getTo(originalMail)); mailModifier.setSubjectPrefix(originalMail); mailModifier.setReplyTo(getReplyTo(originalMail), originalMail); mailModifier.setReversePath(getReversePath(originalMail), originalMail); mailModifier.setIsReply(getInitParameters().isReply(), originalMail); mailModifier.setSender(getSender(originalMail), originalMail); newMail.getMessage().setHeader(RFC2822Headers.DATE, getDateHeader(originalMail)); newMail.getMessage().saveChanges(); getMailetContext().sendMail(newMail); } finally { newMail.dispose(); } }
Source:
<code>public COMLateBindingBaseObject(IDispatch dispatch) { <START> Native.setProtected(true); <END> this.iDispatch = dispatch; }</code><technical_language>This defaults aon for windows, I drop other COM-related instances</technical_language>

Target:
public COMLateBindingBaseObject(IDispatch dispatch) { this.iDispatch = dispatch; }
Source:
<code>synchronized void update(DBObject fromMe) { MediaFile mf = (MediaFile) fromMe; files.removeAllElements(); files.addAll(mf.files); long oldStart = (times.length > 0 ? times[0] : 0); times = mf.times.clone(); long newStart = (times.length > 0 ? times[0] : 0); if (oldStart != newStart && isPicture() && Sage.client) { if (Sage.DBG) System.out.println("Clearing MetaImage from cache due to picture file update:" + this); MetaImage.clearFromCache(this); } archive = mf.archive; if (infoAiringID != mf.infoAiringID) myAiring = null; infoAiringID = mf.infoAiringID; <START> if (SageConstants.PVR) <END> videoDirectory = new String(mf.videoDirectory); host = mf.host; encodedBy = mf.encodedBy; generalType = mf.generalType; acquisitionTech = mf.acquisitionTech; forcedComplete = mf.forcedComplete; thumbnailFile = mf.thumbnailFile; thumbnailOffset = mf.thumbnailOffset; thumbnailSize = mf.thumbnailSize; name = mf.name; createWatchCount = mf.createWatchCount; fileFormat = mf.fileFormat; super.update(fromMe); }</code><technical_language>(!Sage.EMBEDDED || SageConstants.PVR) evaluates true in code</technical_language>

Target:
synchronized void update(DBObject fromMe) { MediaFile mf = (MediaFile) fromMe; files.removeAllElements(); files.addAll(mf.files); long oldStart = (times.length > 0 ? times[0] : 0); times = mf.times.clone(); long newStart = (times.length > 0 ? times[0] : 0); if (oldStart != newStart && isPicture() && Sage.client) { if (Sage.DBG) System.out.println("Clearing MetaImage from cache due to picture file update:" + this); MetaImage.clearFromCache(this); } archive = mf.archive; if (infoAiringID != mf.infoAiringID) myAiring = null; infoAiringID = mf.infoAiringID; videoDirectory = new String(mf.videoDirectory); host = mf.host; encodedBy = mf.encodedBy; generalType = mf.generalType; acquisitionTech = mf.acquisitionTech; forcedComplete = mf.forcedComplete; thumbnailFile = mf.thumbnailFile; thumbnailOffset = mf.thumbnailOffset; thumbnailSize = mf.thumbnailSize; name = mf.name; createWatchCount = mf.createWatchCount; fileFormat = mf.fileFormat; super.update(fromMe); }