auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void refreshActionsWidget(final List<ActionCol52> actionColumns) { getActionsConfigWidget().clear(); if (actionColumns == null || actionColumns.isEmpty()) { getAccordion().getItem(GuidedDecisionTableAccordionItem.Type.ACTION).setOpen(false); getActionsConfigWidget().add(blankSlate()); return; } getActionsConfigWidget().add(getActionsPanel()); final Map<String, List<BaseColumn>> columnGroups = actionColumns.stream().collect( Collectors.groupingBy( column -> DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column), Collectors.toList() ) ); getActionsPanel().renderColumns(columnGroups); }

Target:
public void refreshActionsWidget(final List<ActionCol52> actionColumns) { getActionsConfigWidget().clear(); if (actionColumns == null || actionColumns.isEmpty()) { getAccordion().getItem(GuidedDecisionTableAccordionItem.Type.ACTION).setOpen(false); getActionsConfigWidget().add(blankSlate()); return; } getActionsConfigWidget().add(getActionsPanel()); final Map<String, List<BaseColumn>> columnGroups = actionColumns.stream().collect( Collectors.groupingBy( DecisionTableColumnViewUtils::getColumnManagementGroupTitle, Collectors.toList() ) ); getActionsPanel().renderColumns(columnGroups); }
Source:
public CustomizeExternalFileTypesDialog() { this.setTitle(Localization.lang("Manage external file types")); ViewLoader.view(this) .load() .setAsDialogPane(this); this.setResultConverter(button -> { if (button == ButtonType.OK) { viewModel.storeSettings(); fileTypesTable.refresh(); } return null; }); }

Target:
public CustomizeExternalFileTypesDialog() { this.setTitle(Localization.lang("Manage external file types")); ViewLoader.view(this) .load() .setAsDialogPane(this); this.setResultConverter(button -> { if (button == ButtonType.OK) { viewModel.storeSettings(); } return null; }); }
Source:
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { mProgressBar = view.findViewById(R.id.top_progress_bar); mListener = (TroubleSigningInListener) getActivity(); String email = getArguments().getString(ExtraConstants.EMAIL); setBodyText(view, email); setOnClickListeners(view, email); setPrivacyFooter(view); }

Target:
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mTopLevelView = view.findViewById(R.id.top_level_view); mTopLevelView.setVisibility(View.GONE); String email = getArguments().getString(ExtraConstants.EMAIL); setBodyText(view, email); setOnClickListeners(view, email); setPrivacyFooter(view); }
Source:
public Binder<Bind, Object> build(Bind annotation) { return this; }

Target:
public Binder<Bind, Object> build(Bind annotation) { return (q, param, index, b, arg) -> { String nameFromAnnotation = b == null ? "" : b.value(); final String name = ParameterUtil.getParameterName(b, nameFromAnnotation, param); Type type = param.getParameterizedType(); if (q instanceof PreparedBatchPart) { Class<?> erasedType = GenericTypes.getErasedType(type); if (Iterable.class.isAssignableFrom(erasedType)) { type = GenericTypes.findGenericParameter(type, Iterable.class).get(); } else if (Iterator.class.isAssignableFrom(erasedType)) { type = GenericTypes.findGenericParameter(type, Iterator.class).get(); } } q.bindByType(index, arg, type); q.bindByType(name, arg, type); }; }
Source:
public void testTestSuiteSetting() throws JSONException { List<String> errors = new ArrayList<>(); for (String testGroup : allTests.keySet()) { if (!groups.contains(testGroup)) { CLog.i("Skip checking tests with group: %s", testGroup); continue; } for (TestInfo testInfo : allTests.get(testGroup)) { if (!validateSuiteSetting(testInfo.getName(), testInfo.getKeywords())) { errors.add( String.format( "Missing test_suite setting for test: %s, test group: %s, " + "TEST_MAPPING file path: %s", testInfo.getName(), testGroup, testInfo.getSources())); } } } if (!errors.isEmpty()) { fail(String.format("Fail test_suite setting check:\n%s", Joiner.on("\n").join(errors))); } }

Target:
public void testTestSuiteSetting() throws JSONException { List<String> errors = new ArrayList<>(); for (String testGroup : allTests.keySet()) { if (!TEST_GROUPS_TO_VALIDATE.contains(testGroup)) { CLog.d("Skip checking tests with group: %s", testGroup); continue; } for (TestInfo testInfo : allTests.get(testGroup)) { if (!validateSuiteSetting(testInfo.getName(), testInfo.getKeywords())) { errors.add( String.format( "Missing test_suite setting for test: %s, test group: %s, " + "TEST_MAPPING file path: %s", testInfo.getName(), testGroup, testInfo.getSources())); } } } if (!errors.isEmpty()) { fail(String.format("Fail test_suite setting check:\n%s", Joiner.on("\n").join(errors))); } }
Source:
public void cacheManagerStarting(GlobalComponentRegistry gcr, GlobalConfiguration globalConfiguration) { if (globalConfiguration.globalJmxStatistics().enabled()) { BasicComponentRegistry bcr = gcr.getComponent(BasicComponentRegistry.class); Interpreter interpreter = new Interpreter(); bcr.registerComponent(Interpreter.class, interpreter, true); try { CacheManagerJmxRegistration jmxRegistration = bcr.getComponent(CacheManagerJmxRegistration.class).running(); jmxRegistration.registerMBean(interpreter); } catch (Exception e) { log.jmxRegistrationFailed(); } } }

Target:
public void cacheManagerStarting(GlobalComponentRegistry gcr, GlobalConfiguration globalConfiguration) { if (globalConfiguration.statistics()) { BasicComponentRegistry bcr = gcr.getComponent(BasicComponentRegistry.class); Interpreter interpreter = new Interpreter(); bcr.registerComponent(Interpreter.class, interpreter, true); try { CacheManagerJmxRegistration jmxRegistration = bcr.getComponent(CacheManagerJmxRegistration.class).running(); jmxRegistration.registerMBean(interpreter); } catch (Exception e) { log.jmxRegistrationFailed(); } } }
Source:
public void run() { if (shouldSkipCheck()) { skippedHealthChecks++; LOG.info("Detected long delay in scheduling HB processing thread. " + "Skipping heartbeat checks for one iteration."); } else { checkNodesHealth(); } scheduleNextHealthCheck(); return; }

Target:
public void run() { if (shouldSkipCheck()) { skippedHealthChecks++; LOG.info("Detected long delay in scheduling HB processing thread. " + "Skipping heartbeat checks for one iteration."); } else { checkNodesHealth(); } scheduleNextHealthCheck(); }
Source:
public String readASCIIString() throws IOException { final int size = readInt32(); if (size > 0) { if (size < getCurrentRemaining()) { String value = Utf8Utils.decodeASCII(_currentSegment.getArray(), _localOffset, size, _textBuffer); _localOffset += size; return value; } else { ByteStringLongDecoderState state = new ByteStringLongDecoderState(_byteArrays, _currentIndex, _localOffset); String value = Utf8Utils.decodeLongASCII(state, size, _textBuffer); _currentIndex = state.getCurrentIndex(); _currentSegment = _byteArrays.get(_currentIndex); _localOffset = state.getPosition(); return value; } } else if (size == 0) { return ""; } else { throw new IOException("Read negative size: " + size + ". Invalid string"); } }

Target:
public String readASCIIString() throws IOException { final int size = readInt32(); if (size > 0) { if (size <= getCurrentRemaining()) { String value = Utf8Utils.decodeASCII(_currentSegment.getArray(), _currentArrayOffset, size, _textBuffer); _currentArrayOffset += size; return value; } else { ByteStringLongDecoderState state = new ByteStringLongDecoderState(_byteArrays, _currentIndex, _currentArrayOffset); String value = Utf8Utils.decodeLongASCII(state, size, _textBuffer); _currentIndex = state.getCurrentIndex(); _currentSegment = _byteArrays.get(_currentIndex); _currentArrayOffset = state.getPosition(); return value; } } else if (size == 0) { return ""; } else { throw new IOException("Read negative size: " + size + ". Invalid string"); } }
Source:
public long getNewDiskSizeInGB() { CinderDisk cinderDisk = (CinderDisk) getNewDisk(); return cinderDisk.getSize() / (1024 * 1024 * 1024); }

Target:
public long getNewDiskSizeInGB() { CinderDisk cinderDisk = (CinderDisk) getNewDisk(); return cinderDisk.getSize() / BYTES_IN_GB; }
Source:
public List<VDS> filter(SchedulingContext context, List<VDS> hosts, List<VM> vmGroup, PerHostMessages messages) { List<VM> vmsToCheck = vmGroup.stream() .filter(vm -> vm.getStatus() != VMStatus.Paused) .collect(Collectors.toList()); if (vmsToCheck.isEmpty()) { return hosts; } boolean canDelay = false; List<VDS> resultList = new ArrayList<>(); List<VDS> overcommitFailed = new ArrayList<>(); for (VDS vds : hosts) { List<VM> vmsNotRunningOnHost = vmsToCheck.stream() .filter(vm -> !vds.getId().equals(vm.getRunOnVds())) .collect(Collectors.toList()); if (vmsNotRunningOnHost.isEmpty()) { resultList.add(vds); continue; } if (vds.getPendingVmemSize() > 0) { canDelay = true; } int pendingRealMemory = PendingMemory.collectForHost(getPendingResourceManager(), vds.getId()); if (!slaValidator.hasPhysMemoryToRunVmGroup(vds, vmsNotRunningOnHost, pendingRealMemory)) { logInsufficientPhysicalMemory(vds, messages); continue; } if (!slaValidator.hasOvercommitMemoryToRunVM(vds, vmsNotRunningOnHost)) { overcommitFailed.add(vds); continue; } resultList.add(vds); } if (context.isCanDelay() && !context.isShouldDelay() && canDelay && resultList.isEmpty()) { context.setShouldDelay(true); return Collections.emptyList(); } overcommitFailed.forEach(vds -> logInsufficientOvercommitMemory(vds, messages)); return resultList; }

Target:
public List<VDS> filter(SchedulingContext context, List<VDS> hosts, List<VM> vmGroup, PerHostMessages messages) { List<VM> vmsToCheck = vmGroup.stream() .filter(vm -> vm.getStatus() != VMStatus.Paused) .collect(Collectors.toList()); if (vmsToCheck.isEmpty()) { return hosts; } boolean canDelay = false; List<VDS> resultList = new ArrayList<>(); for (VDS vds : hosts) { List<VM> vmsNotRunningOnHost = vmsToCheck.stream() .filter(vm -> !vds.getId().equals(vm.getRunOnVds())) .collect(Collectors.toList()); if (vmsNotRunningOnHost.isEmpty()) { resultList.add(vds); continue; } if (vds.getPendingVmemSize() > 0) { canDelay = true; } int pendingRealMemory = PendingMemory.collectForHost(getPendingResourceManager(), vds.getId()); if (!slaValidator.hasPhysMemoryToRunVmGroup(vds, vmsNotRunningOnHost, pendingRealMemory)) { logInsufficientPhysicalMemory(vds, messages); continue; } if (!slaValidator.hasOvercommitMemoryToRunVM(vds, vmsNotRunningOnHost)) { logInsufficientOvercommitMemory(vds, messages); continue; } resultList.add(vds); } if (context.isCanDelay() && !context.isShouldDelay() && canDelay && resultList.isEmpty()) { context.setShouldDelay(true); return Collections.emptyList(); } return resultList; }
Source:
public void readerClosed(BlockReader reader, BlockStoreLocation location) { Preconditions.checkState(locationValid(location)); mScheduler.schedule(() -> { mStreamsPerLocation.compute(location, (k, v) -> { Set<Object> streamList = v; Preconditions.checkState(streamList != null && !streamList.isEmpty(), "Unexpected load tracker state"); streamList.remove(reader); return streamList; }); }, mLoadDetectionCoolDownMs, TimeUnit.MILLISECONDS); }

Target:
public void readerClosed(BlockReader reader, BlockStoreLocation location) { streamClosed(reader, location); }
Source:
public double getWorldY() { return _x; }

Target:
public double getWorldY() { return _y; }
Source:
PersonIdent getServerIdent() { return serverIdent; }

Target:
PersonIdent getServerIdent() { return serverIdentProvider.get(); }
Source:
public void testUserExceptionDoesNothing() throws Exception { SFSB1Interface sfsb1 = getBean(); Assert.assertFalse(isPreDestroy.is()); try { sfsb1.userException(); } catch (TestException e) { Assert.assertTrue(e.getMessage().contains(SFSB1.MESSAGE)); } Assert.assertFalse(isPreDestroy.is()); try { sfsb1.userException(); } catch (TestException e) { Assert.assertTrue(e.getMessage().contains(SFSB1.MESSAGE)); } sfsb1.remove(); Assert.assertTrue("As remove was called preDestroy callback is expected", isPreDestroy.is()); }

Target:
public void testUserExceptionDoesNothing() throws Exception { SFSB1Interface sfsb1 = getBean(); Assert.assertFalse(isPreDestroy.is()); try { sfsb1.userException(); Assert.fail("It was expected a user exception being thrown"); } catch (TestException e) { Assert.assertTrue(e.getMessage().contains(SFSB1.MESSAGE)); } Assert.assertFalse(isPreDestroy.is()); try { sfsb1.userException(); Assert.fail("It was expected a user exception being thrown"); } catch (TestException e) { Assert.assertTrue(e.getMessage().contains(SFSB1.MESSAGE)); } sfsb1.remove(); Assert.assertTrue("As remove was called preDestroy callback is expected", isPreDestroy.is()); }
Source:
private void createBackground() { Sprite backgroundImage = new Sprite( 0 , 0 , resourceManager.getLoadedTextureRegion( getStringResource(R.string.MENU_BACKGROUND_TEXTURE)) , mEngine.getVertexBufferObjectManager()); this.attachChild(backgroundImage); Color backgroundColor = new Color(0.09804f, 0.6274f, 0.8784f); this.setBackground(new Background(backgroundColor)); }

Target:
private void createBackground() { ITextureRegion backgroundTexture = resourceManager.getLoadedTextureRegion( getStringResource(R.string.MENU_BACKGROUND_TEXTURE)); Sprite backgroundImage = new Sprite( 0 , 0 , backgroundTexture , mEngine.getVertexBufferObjectManager()); this.attachChild(backgroundImage); Color backgroundColor = new Color(0.09804f, 0.6274f, 0.8784f); this.setBackground(new Background(backgroundColor)); }
Source:
@Override public void onRefresh() { setUpTriggersForced(); }

Target:
public void onRefresh() { setUpTriggersForced(); }
Source:
private InterpreterSetting inlineCreateNewSetting(String name, String group, List<Dependency> dependencies, InterpreterOption option, Map<String, InterpreterProperty> properties) throws IOException { if (name == null) { throw new IOException("Interpreter name shouldn't be empty."); } Pattern pattern = Pattern.compile("^[-_a-zA-Z0-9]+$"); Matcher matcher = pattern.matcher(name); if(!matcher.find()){ throw new IOException("Interpreter name shouldn't be empty, and can consist only of: -_a-zA-Z0-9"); } for (InterpreterSetting interpreterSetting : interpreterSettings.values()) { if (interpreterSetting.getName().equals(name)) { throw new IOException("Interpreter " + name + " already existed"); } } InterpreterSetting setting = new InterpreterSetting(interpreterSettingTemplates.get(group)); setting.setName(name); setting.setGroup(group); setting.appendDependencies(dependencies); setting.setInterpreterOption(option); setting.setProperties(properties); initInterpreterSetting(setting); interpreterSettings.put(setting.getId(), setting); saveToFile(); return setting; }

Target:
private InterpreterSetting inlineCreateNewSetting(String name, String group, List<Dependency> dependencies, InterpreterOption option, Map<String, InterpreterProperty> properties) throws IOException { if (name == null) { throw new IOException("Interpreter name shouldn't be empty."); } Matcher matcher = VALID_INTERPRETER_NAME.matcher(name); if(!matcher.find()){ throw new IOException("Interpreter name shouldn't be empty, and can consist only of: -_a-zA-Z0-9"); } for (InterpreterSetting interpreterSetting : interpreterSettings.values()) { if (interpreterSetting.getName().equals(name)) { throw new IOException("Interpreter " + name + " already existed"); } } InterpreterSetting setting = new InterpreterSetting(interpreterSettingTemplates.get(group)); setting.setName(name); setting.setGroup(group); setting.appendDependencies(dependencies); setting.setInterpreterOption(option); setting.setProperties(properties); initInterpreterSetting(setting); interpreterSettings.put(setting.getId(), setting); saveToFile(); return setting; }
Source:
public Mono<Void> abandon(MessageLockToken lockToken, Map<String, Object> propertiesToModify, ServiceBusTransactionContext transactionContext) { throw new UnsupportedOperationException("Not implemented"); }

Target:
public Mono<Void> abandon(MessageLockToken lockToken, Map<String, Object> propertiesToModify, ServiceBusTransactionContext transactionContext) { return abandon(lockToken, propertiesToModify, receiverOptions.getSessionId(), transactionContext); }
Source:
public COMEarlyBindingObject(CLSID clsid, boolean useActiveInstance, int dwClsContext) { Native.setProtected(true); HRESULT hr = Ole32.INSTANCE.CoInitialize(null); if (COMUtils.FAILED(hr)) { this.Release(); Ole32.INSTANCE.CoUninitialize(); throw new COMException("CoInitialize() failed!"); } if (COMUtils.FAILED(hr)) { Ole32.INSTANCE.CoUninitialize(); throw new COMException("CLSIDFromProgID() failed!"); } if (useActiveInstance) { hr = OleAuto.INSTANCE.GetActiveObject(clsid, null, this.pUnknown); if (COMUtils.SUCCEEDED(hr)) { hr = this.QueryInterface(IDispatch.IID_IDispatch, this.pDispatch); } else { hr = Ole32.INSTANCE.CoCreateInstance(clsid, null, dwClsContext, IDispatch.IID_IDispatch, this.pDispatch); } } else { hr = Ole32.INSTANCE.CoCreateInstance(clsid, null, dwClsContext, IDispatch.IID_IDispatch, this.pDispatch); } if (COMUtils.FAILED(hr)) { throw new COMException("COM object with CLSID " + clsid.toGuidString() + " not registered properly!"); } this.setPointer(this.pDispatch.getValue()); }

Target:
public COMEarlyBindingObject(CLSID clsid, boolean useActiveInstance, int dwClsContext) { HRESULT hr = Ole32.INSTANCE.CoInitialize(null); if (COMUtils.FAILED(hr)) { this.Release(); Ole32.INSTANCE.CoUninitialize(); throw new COMException("CoInitialize() failed!"); } if (COMUtils.FAILED(hr)) { Ole32.INSTANCE.CoUninitialize(); throw new COMException("CLSIDFromProgID() failed!"); } if (useActiveInstance) { hr = OleAuto.INSTANCE.GetActiveObject(clsid, null, this.pUnknown); if (COMUtils.SUCCEEDED(hr)) { hr = this.QueryInterface(IDispatch.IID_IDISPATCH, this.pDispatch); } else { hr = Ole32.INSTANCE.CoCreateInstance(clsid, null, dwClsContext, IDispatch.IID_IDISPATCH, this.pDispatch); } } else { hr = Ole32.INSTANCE.CoCreateInstance(clsid, null, dwClsContext, IDispatch.IID_IDISPATCH, this.pDispatch); } if (COMUtils.FAILED(hr)) { throw new COMException("COM object with CLSID " + clsid.toGuidString() + " not registered properly!"); } this.setPointer(this.pDispatch.getValue()); }
Source:
private Object buildArray(Array array) throws SQLException { if (UNSUPPORTED_TYPES.contains(array.getBaseType())) { return buildFromResultSet(array); } try { Object[] objectArray = (Object[]) array.getArray(); Object componentTypeArray = java.lang.reflect.Array.newInstance(componentType, objectArray.length); for (int i = 0; i < objectArray.length; i++) { java.lang.reflect.Array.set(componentTypeArray, i,objectArray[i]); } return componentTypeArray; } catch (SQLFeatureNotSupportedException e) { UNSUPPORTED_TYPES.add(array.getBaseType()); return buildFromResultSet(array); } }

Target:
private Object buildArray(Array array) throws SQLException { if (UNSUPPORTED_TYPES.contains(array.getBaseType())) { return buildFromResultSet(array); } try { Object[] objectArray = (Object[]) array.getArray(); if (componentType == Object.class) { return objectArray; } else { Object componentTypeArray = java.lang.reflect.Array.newInstance(componentType, objectArray.length); for (int i = 0; i < objectArray.length; i++) { java.lang.reflect.Array.set(componentTypeArray, i, objectArray[i]); } return componentTypeArray; } } catch (SQLFeatureNotSupportedException e) { UNSUPPORTED_TYPES.add(array.getBaseType()); return buildFromResultSet(array); } }
Source:
@VisibleForTesting boolean fileNameMatches(String name) { if (patternsAreEquals()) { return false; } boolean result = isMatchingPattern(name, regExPattern).orElse(false) || !isMatchingPattern(name, notRegExPattern).orElse(true); LOGGER.debug("attachment {}", name, (result) ? "matches" : "does not match"); return result; }

Target:
@VisibleForTesting boolean fileNameMatches(String name) { if (patternsAreEquals()) { return false; } boolean result = isMatchingPattern(name, regExPattern).orElse(false) || !isMatchingPattern(name, notRegExPattern).orElse(true); LOGGER.debug("attachment {}", name, result ? "matches" : "does not match"); return result; }
Source:
public void PropertyType() { assertEquals(java.util.Date.class, QProperties3Test_Order.order.orderDate.getType()); }

Target:
public void PropertyType() throws IllegalAccessException, NoSuchFieldException { start(QProperties3Test_Order.class, QProperties3Test_Order.order); match(DateTimePath.class, "orderDate"); matchType(java.util.Date.class, "orderDate"); }
Source:
public String replaceToStringCallOnCurrentObjectInStringConcat() { String s1 = " " + StringSample.this + StringSample.this + this; String s2 = StringSample.this + " " + this; return s1 + s2; }

Target:
public String replaceToStringCallOnCurrentObjectInStringConcat() { String s1 = String.valueOf(StringSample.this) + StringSample.this + this; String s2 = String.valueOf(StringSample.this) + this; return s1 + s2; }
Source:
public static NodeSequence append( final NodeSequence first, final NodeSequence second ) { if (first == null) { return second != null ? second : emptySequence(0); } if (second == null) return first; int firstWidth = first.width(); final int secondWidth = second.width(); final int sequenceWidth = Math.min(firstWidth, secondWidth); if (first.isEmpty()) return second; if (second.isEmpty()) return first; long firstCount = first.getRowCount(); long secondCount = second.getRowCount(); final long count = firstCount < 0 ? -1 : (secondCount < 0 ? -1 : firstCount + secondCount); return new NodeSequence() { private NodeSequence current = first; @Override public int width() { return sequenceWidth; } @Override public long getRowCount() { return count; } @Override public boolean isEmpty() { return false; } @Override public Batch nextBatch() { Batch batch = current.nextBatch(); while (batch == null && current == first) { current = second; batch = current.nextBatch(); } return batch; } @Override public void close() { try { first.close(); } finally { second.close(); } } @Override public String toString() { return "(append width=" + width() + " " + first + "," + second + " )"; } }; }

Target:
public static NodeSequence append( final NodeSequence first, final NodeSequence second ) { if (first == null) { return second != null ? second : emptySequence(0); } if (second == null) return first; int firstWidth = first.width(); final int secondWidth = second.width(); if (firstWidth > 0 && secondWidth > 0 && firstWidth != secondWidth) { throw new IllegalArgumentException("The sequences must have the same width: " + first + " and " + second); } if (first.isEmpty()) return second; if (second.isEmpty()) return first; long firstCount = first.getRowCount(); long secondCount = second.getRowCount(); final long count = firstCount < 0 ? -1 : (secondCount < 0 ? -1 : firstCount + secondCount); return new NodeSequence() { private NodeSequence current = first; @Override public int width() { return secondWidth; } @Override public long getRowCount() { return count; } @Override public boolean isEmpty() { return false; } @Override public Batch nextBatch() { Batch batch = current.nextBatch(); while (batch == null && current == first) { current = second; batch = current.nextBatch(); } return batch; } @Override public void close() { try { first.close(); } finally { second.close(); } } @Override public String toString() { return "(append width=" + width() + " " + first + "," + second + " )"; } }; }
Source:
protected String getSanitizedFilenameWithoutPath(String filename) { int sep = Math.max(filename.lastIndexOf('\\'), filename.lastIndexOf('/')); if (sep != -1) { filename = filename.substring(sep + 1); } return JSESSION_ID_REGEX.matcher(filename).replaceAll(StringUtils.EMPTY); }

Target:
protected String getSanitizedFilenameWithoutPath(String filename) { int sep = Math.max(filename.lastIndexOf('\\'), filename.lastIndexOf('/')); if (sep != -1) { filename = filename.substring(sep + 1); } return FILENAME_SANITIZATION_REGEX.matcher(filename).replaceAll(""); }
Source:
public KHyperLogLogState createGroupedState() { throw new IllegalArgumentException("GROUP BY of KHyperLogLog is not supported."); }

Target:
public KHyperLogLogState createGroupedState() { return new GroupedKHyperLogLogState(); }
Source:
protected boolean canDoAction() { slaveVolume = getSlaveVolume(); if (slaveVolume != null) { setGlusterVolumeId(slaveVolume.getId()); setVdsGroupId(slaveVolume.getClusterId()); } if (slaveVolume == null) { return false; } if (slaveVolume.getStatus() != GlusterStatus.UP) { return false; } return super.canDoAction(); }

Target:
protected boolean canDoAction() { slaveVolume = getSlaveVolume(); if (slaveVolume != null) { setGlusterVolumeId(slaveVolume.getId()); setVdsGroupId(slaveVolume.getClusterId()); } else { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID); } if (slaveVolume.getStatus() != GlusterStatus.UP) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED); } return super.canDoAction(); }
Source:
private static LineReader buildLineReader() { try { Terminal terminal = TerminalBuilder.terminal(); LineReaderBuilder builder = LineReaderBuilder.builder().terminal(terminal); builder.terminal(terminal); builder.variable(LineReader.BLINK_MATCHING_PAREN, false); String userHome = System.getProperty("user.home"); if (userHome != null) { builder.variable(LineReader.HISTORY_FILE, userHome + "/.starlark_java_history"); } return builder.build(); } catch (IOException e) { throw new RuntimeException(e); } }

Target:
private static LineReader buildLineReader() { try { Terminal terminal = TerminalBuilder.terminal(); LineReaderBuilder builder = LineReaderBuilder.builder().terminal(terminal); builder.terminal(terminal); builder.variable(LineReader.BLINK_MATCHING_PAREN, false); String userHome = System.getProperty("user.home"); if (userHome != null) { builder.variable(LineReader.HISTORY_FILE, userHome + "/.starlark_java_history"); } return builder.build(); } catch (IOException e) { System.err.println("Failed to initialize terminal: " + e.getMessage()); return null; } }
Source:
public PersistentHostSetupNetworksParameters create(Guid hostId, List<Network> networks) { PersistentHostSetupNetworksParameters parameters = new PersistentHostSetupNetworksParameters(hostId); parameters.setRollbackOnFailure(true); parameters.setShouldBeLogged(false); parameters.setNetworkNames(getNetworkNames(networks)); parameters.setNetworkAttachments(getNetworkAttachmentsToSync(hostId, networks)); return parameters; }

Target:
public PersistentHostSetupNetworksParameters create(Guid hostId, List<Network> networks) { Map<Network, NetworkAttachment> networksToSync = getNetworksToSync(hostId, networks); PersistentHostSetupNetworksParameters parameters = new PersistentHostSetupNetworksParameters(hostId); parameters.setRollbackOnFailure(true); parameters.setShouldBeLogged(false); parameters.setNetworkNames(getNetworkNames(networksToSync.keySet())); parameters.setNetworkAttachments(new ArrayList<>(networksToSync.values())); return parameters; }
Source:
private ForwardingObservable<String> readCompressed(String address) { if (address.contains("BLOCKSERVER:IOCS")) { LoggerUtils.logIfExtraDebug(IsisLog.getLogger(getClass()), "(Ticket 2161) Reading from " + address); } return switchingObsFactory.getSwitchableObservable(new CompressedCharWaveformChannel(), InstrumentUtils.addPrefix(address)); }

Target:
private ForwardingObservable<String> readCompressed(String address) { if (address.contains("BLOCKSERVER:IOCS")) { LoggerUtils.logIfExtraDebug(LOG, "(Ticket 2161) Reading from " + address); } return switchingObsFactory.getSwitchableObservable(new CompressedCharWaveformChannel(), InstrumentUtils.addPrefix(address)); }
Source:
public String getConnectString() { return "127.0.0.1:" + Integer.toString(port); }

Target:
public String getConnectString() { return NetUtils.normalizeInetSocketAddress(cnxnFactory.getLocalAddress()); }
Source:
public void applyInventory(InventoryEvent event) { String par = event.getMessage(); Player p = event.getPlayer(); Inventory i = p.getInventory(); if (par.equalsIgnoreCase(name)) { clearInv(p); ItemStack HEALTH_POTION = new ItemStack(Material.POTION, 1, (short) 16373); ItemStack STEAK = new ItemStack(Material.COOKED_BEEF, 3); ItemStack BOW = new ItemStack(Material.BOW, 1); ItemStack XP = new ItemStack(Material.EXP_BOTTLE, 5); ItemStack ARROWS = new ItemStack(Material.ARROW, 16); ItemStack IRON_HELMET = new ItemStack(Material.IRON_HELMET, 1); ItemStack IRON_CHESTPLATE = new ItemStack(Material.IRON_CHESTPLATE, 1); ItemStack IRON_PANTS = new ItemStack(Material.IRON_LEGGINGS, 1); ItemStack IRON_BOOTS = new ItemStack(Material.IRON_BOOTS, 1); ItemStack IRON_SWORD = new ItemStack(Material.IRON_SWORD, 1); p.getInventory().setBoots(IRON_BOOTS); p.getInventory().setLeggings(IRON_PANTS); p.getInventory().setChestplate(IRON_CHESTPLATE); p.getInventory().setHelmet(IRON_HELMET); i.setItem(0, IRON_SWORD); i.setItem(1, BOW); i.setItem(2, STEAK); i.setItem(3, HEALTH_POTION); i.setItem(4, EXP; i.setItem(8, ARROWS); } }

Target:
public void applyInventory(InventoryEvent event) { String par = event.getMessage(); Player p = event.getPlayer(); Inventory i = p.getInventory(); if (par.equalsIgnoreCase(name)) { clearInv(p); ItemStack HEALTH_POTION = new ItemStack(Material.POTION, 1, (short) 16373); ItemStack STEAK = new ItemStack(Material.COOKED_BEEF, 3); ItemStack BOW = new ItemStack(Material.BOW, 1); ItemStack EXP = new ItemStack(Material.EXP_BOTTLE, 5); ItemStack ARROWS = new ItemStack(Material.ARROW, 16); ItemStack IRON_HELMET = new ItemStack(Material.IRON_HELMET, 1); ItemStack IRON_CHESTPLATE = new ItemStack(Material.IRON_CHESTPLATE, 1); ItemStack IRON_PANTS = new ItemStack(Material.IRON_LEGGINGS, 1); ItemStack IRON_BOOTS = new ItemStack(Material.IRON_BOOTS, 1); ItemStack IRON_SWORD = new ItemStack(Material.IRON_SWORD, 1); p.getInventory().setBoots(IRON_BOOTS); p.getInventory().setLeggings(IRON_PANTS); p.getInventory().setChestplate(IRON_CHESTPLATE); p.getInventory().setHelmet(IRON_HELMET); i.setItem(0, IRON_SWORD); i.setItem(1, BOW); i.setItem(2, STEAK); i.setItem(3, HEALTH_POTION); i.setItem(4, EXP); i.setItem(8, ARROWS); } }
Source:
@Override public Void visitCall(RexCall call) { if (!RexUtil.isDeterministic(call)) { ++unsupportedCount; return null; } switch (call.getKind()) { case CAST: ++unsupportedCount; return null; default: return super.visitCall(call); } }

Target:
@Override public Void visitCall(RexCall call) { if (!RexInterpreter.SUPPORTED_SQL_KIND.contains(call.getKind())) { ++unsupportedCount; return null; } return super.visitCall(call); }
Source:
private void checkFileDescriptorPassing(ITestService service) throws TestFailException { mLog.log("Checking that service can receive and return file descriptors..."); try { FileOutputStream fileOutputStream = openFileOutput("test-dummy", Context.MODE_PRIVATE); FileDescriptor descriptor = fileOutputStream.getFD(); FileDescriptor journeyed = service.RepeatFileDescriptor(descriptor); fileOutputStream.close(); FileOutputStream journeyedStream = new FileOutputStream(journeyed); String testData = "FrazzleSnazzleFlimFlamFlibbityGumboChops"; byte[] output = testData.getBytes(); journeyedStream.write(output); journeyedStream.close(); FileInputStream fileInputStream = openFileInput("test-dummy"); byte[] input = new byte[output.length]; if (fileInputStream.read(input) != input.length) { mLog.logAndThrow("Read short count from file"); } if (!testData.equals(new String(input))) { mLog.logAndThrow("Read incorrect data"); } } catch (RemoteException ex) { mLog.log(ex.toString()); mLog.logAndThrow("Service failed to repeat a file descriptor."); } catch (IOException ex) { mLog.log(ex.toString()); mLog.logAndThrow("Exception while operating on temporary file"); } mLog.log("...service can receive and return file descriptors."); }

Target:
private void checkFileDescriptorPassing(ITestService service) throws TestFailException { mLog.log("Checking that service can receive and return file descriptors..."); try { FileOutputStream fileOutputStream = openFileOutput("test-dummy", Context.MODE_PRIVATE); FileDescriptor descriptor = fileOutputStream.getFD(); FileDescriptor journeyed = service.RepeatFileDescriptor(descriptor); fileOutputStream.close(); FileOutputStream journeyedStream = new FileOutputStream(journeyed); String testData = "FrazzleSnazzleFlimFlamFlibbityGumboChops"; byte[] output = testData.getBytes(); journeyedStream.write(output); journeyedStream.close(); FileInputStream fileInputStream = openFileInput("test-dummy"); byte[] input = new byte[output.length]; if (fileInputStream.read(input) != input.length) { mLog.logAndThrow("Read short count from file"); } if (!Arrays.equals(input, output)) { mLog.logAndThrow("Read incorrect data"); } } catch (RemoteException ex) { mLog.log(ex.toString()); mLog.logAndThrow("Service failed to repeat a file descriptor."); } catch (IOException ex) { mLog.log(ex.toString()); mLog.logAndThrow("Exception while operating on temporary file"); } mLog.log("...service can receive and return file descriptors."); }
Source:
public FileStat(ByteBuffer buffer) { super(buffer); if (OSUtils.isMacOS()) { System.exit(-1); } else if (OSUtils.isWindows()) { System.exit(-1); } else { } st_dev = new Unsigned64(); pad1 = null; st_ino = new Unsigned64(); st_nlink = new Unsigned64(); st_mode = new Unsigned32(); st_uid = new Unsigned32(); st_gid = new Unsigned32(); st_rdev = new Unsigned64(); st_size = new SignedLong(); st_blksize = new SignedLong(); st_blocks = new SignedLong(); st_atim = new SignedLong(); st_mtim = new SignedLong(); st_ctim = new SignedLong(); }

Target:
public FileStat(ByteBuffer buffer) { super(buffer); if (OSUtils.isMacOS()) { System.exit(-1); } else if (OSUtils.isWindows()) { System.exit(-1); } else { } st_dev = new Unsigned64(); pad1 = null; st_ino = new Unsigned64(); st_nlink = new Unsigned64(); st_mode = new Unsigned32(); st_uid = new Unsigned32(); st_gid = new Unsigned32(); st_rdev = new Unsigned64(); st_size = new SignedLong(); st_blksize = new SignedLong(); st_blocks = new SignedLong(); st_atim = new Timespec(); st_mtim = new Timespec(); st_ctim = new Timespec(); }
Source:
public void testExclusive() { ExclusiveGateway gateway = new ExclusiveGateway(); gateway.getGeneral().getName().setValue(NAME); gateway.getGeneral().getDocumentation().setValue(DOCUMENTATION); gateway.getExecutionSet().getDefaultRoute().setValue(DEFAULT_ROUTE); Node<View<BaseGateway>, ?> node = mockNode(UUID, gateway); when(propertyWriterFactory.of(any(org.eclipse.bpmn2.ExclusiveGateway.class))).thenReturn(gatewayPropertyWriter); assertEquals(gatewayPropertyWriter, converter.toFlowElement(node)); verifyCommonValues(gatewayPropertyWriter, node); verify(gatewayPropertyWriter).setDefaultRoute(DEFAULT_ROUTE); verify(gatewayPropertyWriter).setGatewayDirection(node); }

Target:
public void testExclusive() { ExclusiveGateway gateway = new ExclusiveGateway(); gateway.getGeneral().getName().setValue(NAME); gateway.getGeneral().getDocumentation().setValue(DOCUMENTATION); gateway.getExecutionSet().getDefaultRoute().setValue(DEFAULT_ROUTE); Node<View<BaseGateway>, ?> node = newNode(UUID, gateway); when(propertyWriterFactory.of(any(org.eclipse.bpmn2.ExclusiveGateway.class))).thenReturn(gatewayPropertyWriter); assertEquals(gatewayPropertyWriter, converter.toFlowElement(node)); verifyCommonValues(gatewayPropertyWriter, node); verify(gatewayPropertyWriter).setDefaultRoute(DEFAULT_ROUTE); verify(gatewayPropertyWriter).setGatewayDirection(node); }
Source:
public void testGetVerifiedNegotiatedProposalWithMismatchedTransform() throws Exception { byte[] inputPacket = TestUtils.hexStringToByteArray(PROPOSAL_RAW_PACKET); mValidNegotiatedTransformSet[0] = mEncrAesGcm8Key128Transform; Proposal.sTransformDecoder = new TransformDecoder() { @Override public Transform[] decodeTransforms(int count, ByteBuffer inputBuffer) throws IkeException { byte[] temp = new byte[inputBuffer.remaining()]; inputBuffer.get(temp); return mValidNegotiatedTransformSet; } }; IkeSaPayload respPayload = new IkeSaPayload(false, true, inputPacket); IkeSaPayload reqPayload = makeSaRequestPayload(); try { respPayload.getVerifiedNegotiatedProposal(reqPayload); fail("Expected to fail due to mismatched Transform."); } catch (NoValidProposalChosenException expected) { } }

Target:
public void testGetVerifiedNegotiatedProposalWithMismatchedTransform() throws Exception { byte[] inputPacket = TestUtils.hexStringToByteArray(PROPOSAL_RAW_PACKET); Transform[] negotiatedTransformSet = Arrays.copyOfRange( mValidNegotiatedTransformSet, 0, mValidNegotiatedTransformSet.length); negotiatedTransformSet[0] = mEncrAesGcm8Key128Transform; Proposal.sTransformDecoder = getDummyTransformDecoder(negotiatedTransformSet); IkeSaPayload respPayload = new IkeSaPayload(false, true, inputPacket); IkeSaPayload reqPayload = makeSaRequestPayload(); try { respPayload.getVerifiedNegotiatedProposal(reqPayload); fail("Expected to fail due to mismatched Transform."); } catch (NoValidProposalChosenException expected) { } }
Source:
protected static Cache<Object, Object> buildCache() { Caffeine<Object, Object> cacheBuilder = Caffeine.newBuilder(); cacheBuilder.maximumSize(100); return cacheBuilder.build(); }

Target:
protected static Cache<String, DateTimeFormatter> buildCache() { Caffeine<Object, Object> cacheBuilder = Caffeine.newBuilder(); cacheBuilder.maximumSize(100); return cacheBuilder.build(); }
Source:
static brave.http.HttpServerRequest toBrave(HttpServerRequest request) { if (request == null) { return null; } if (request instanceof BraveHttpServerRequest) { return ((BraveHttpServerRequest) request).delegate; } return new brave.http.HttpServerRequest() { @Override public Object unwrap() { return request.unwrap(); } @Override public String method() { return request.method(); } @Override public String path() { return request.path(); } @Override public String url() { return request.url(); } @Override public String header(String name) { return request.header(name); } @Override public boolean parseClientIpAndPort(brave.Span span) { boolean clientIpAndPortParsed = super.parseClientIpAndPort(span); if (clientIpAndPortParsed) { return true; } return resolveFromInetAddress(span); } private boolean resolveFromInetAddress(brave.Span span) { Object delegate = request.unwrap(); if (delegate instanceof ServerHttpRequest) { InetSocketAddress addr = ((ServerHttpRequest) delegate).getRemoteAddress(); if (addr == null) { return false; } return span.remoteIpAndPort(addr.getAddress().getHostAddress(), addr.getPort()); } else if (delegate instanceof HttpServletRequest) { HttpServletRequest servletRequest = (HttpServletRequest) delegate; return span.remoteIpAndPort(servletRequest.getRemoteAddr(), servletRequest.getRemotePort()); } return false; } }; }

Target:
static brave.http.HttpServerRequest toBrave(HttpServerRequest request) { if (request == null) { return null; } if (request instanceof BraveHttpServerRequest) { return ((BraveHttpServerRequest) request).delegate; } return new brave.http.HttpServerRequest() { @Override public Object unwrap() { return request.unwrap(); } @Override public String method() { return request.method(); } @Override public String path() { return request.path(); } @Override public String url() { return request.url(); } @Override public String header(String name) { return request.header(name); } @Override public boolean parseClientIpAndPort(brave.Span span) { boolean clientIpAndPortParsed = super.parseClientIpAndPort(span); if (clientIpAndPortParsed) { return true; } return resolveFromInetAddress(span); } private boolean resolveFromInetAddress(brave.Span span) { Object delegate = request.unwrap(); if (delegate instanceof ServerHttpRequest) { InetSocketAddress addr = ((ServerHttpRequest) delegate).getRemoteAddress(); if (addr == null) { return false; } return span.remoteIpAndPort(addr.getAddress().getHostAddress(), addr.getPort()); } else if (delegate instanceof ServletRequest) { ServletRequest servletRequest = (ServletRequest) delegate; String addr = servletRequest.getRemoteAddr(); if (addr == null) { return false; } return span.remoteIpAndPort(addr, servletRequest.getRemotePort()); } return false; } }; }
Source:
private static void testSerialization(String wkt) { OGCGeometry geometry = OGCGeometry.fromText(wkt); geometry.setSpatialReference(null); OGCGeometry deserializedGeometry = deserialize(serialize(geometry)); assertEquals(geometry.asText(), deserializedGeometry.asText()); }

Target:
private static void testSerialization(String wkt) { OGCGeometry geometry = OGCGeometry.fromText(wkt); OGCGeometry deserializedGeometry = deserialize(serialize(geometry)); if (geometry.isEmpty()) { assertTrue(deserializedGeometry.isEmpty()); } else { assertEquals(geometry.asText(), deserializedGeometry.asText()); } }
Source:
public static MessageType convert(StructType struct, FieldProjectionFilter filter) { State state = new State(new FieldsPath(), REPEATED, "ParquetSchema"); ConvertedField conv = struct.accept(new ThriftSchemaConvertVisitor(filter, true), state); MessageType messageType; if (!conv.isKeep()) { messageType = new MessageType(state.name, new ArrayList<Type>()); } else { messageType = new MessageType(state.name, conv.asKeep().getType().asGroupType().getFields()); } return messageType; }

Target:
public static MessageType convert(StructType struct, FieldProjectionFilter filter) { State state = new State(new FieldsPath(), REPEATED, "ParquetSchema"); ConvertedField converted = struct.accept(new ThriftSchemaConvertVisitor(filter, true), state); if (!converted.isKeep()) { throw new ThriftProjectionException("No columns have been selected"); } return new MessageType(state.name, converted.asKeep().getType().asGroupType().getFields()); }
Source:
private boolean updateVmLease() { if (Objects.equals(oldVm.getLeaseStorageDomainId(), newVmStatic.getLeaseStorageDomainId())) { if (!Objects.equals(oldVm.isAutoStartup(), newVmStatic.isAutoStartup()) && newVmStatic.isAutoStartup() && newVmStatic.getLeaseStorageDomainId() == null && !addDefaultVmLease(newVmStatic)) { return false; } return true; } throwIfCompensationEnabled(); if (getVm().isNotRunning()) { if (!addDefaultVmLease(newVmStatic)) { return false; } } else if (isHotSetEnabled()) { if (oldVm.getLeaseStorageDomainId() == null) { return addDefaultVmLease(newVmStatic); } boolean hotUnplugSucceeded = false; try { hotUnplugSucceeded = runVdsCommand(VDSCommandType.HotUnplugLease, new LeaseVDSParameters(getVm().getRunOnVds(), oldVm.getId(), oldVm.getLeaseStorageDomainId())).getSucceeded(); } catch (EngineException e) { log.error("Failure in hot unplugging a lease to VM {}, message: {}", oldVm.getId(), e.getMessage()); } if (!hotUnplugSucceeded) { auditLog(this, AuditLogType.HOT_UNPLUG_LEASE_FAILED); } } if (oldVm.getLeaseStorageDomainId() != null && newVmStatic.getLeaseStorageDomainId() == null) { vmDynamicDao.updateVmLeaseInfo(getVmId(), null); } removeVmLease(oldVm.getLeaseStorageDomainId(), oldVm.getId()); return true; }

Target:
private boolean updateVmLease() { if (Objects.equals(oldVm.getLeaseStorageDomainId(), newVmStatic.getLeaseStorageDomainId()) && Objects.equals(oldVm.isAutoStartup(), newVmStatic.isAutoStartup())) { return true; } throwIfCompensationEnabled(); newVmStatic.setLeaseStorageDomainId(getDefaultVmLease(newVmStatic)); if (getVm().isNotRunning()) { if (!addVmLease(newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId(), false)) { return false; } } else if (isHotSetEnabled()) { if (oldVm.getLeaseStorageDomainId() == null) { return addVmLease(newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId(), true); } boolean hotUnplugSucceeded = false; try { hotUnplugSucceeded = runVdsCommand(VDSCommandType.HotUnplugLease, new LeaseVDSParameters(getVm().getRunOnVds(), oldVm.getId(), oldVm.getLeaseStorageDomainId())).getSucceeded(); } catch (EngineException e) { log.error("Failure in hot unplugging a lease to VM {}, message: {}", oldVm.getId(), e.getMessage()); } if (!hotUnplugSucceeded) { auditLog(this, AuditLogType.HOT_UNPLUG_LEASE_FAILED); } } if (oldVm.getLeaseStorageDomainId() != null && newVmStatic.getLeaseStorageDomainId() == null) { vmDynamicDao.updateVmLeaseInfo(getVmId(), null); } removeVmLease(oldVm.getLeaseStorageDomainId(), oldVm.getId()); return true; }
Source:
private void display(final ChangeDetail detail) { displayTitle(detail.getChange().getKey(), detail.getChange().getSubject()); if (starChange != null) { setStarred(detail.isStarred()); } if (Status.MERGED == detail.getChange().getStatus()) { includedInPanel.setVisible(true); includedInPanel.addOpenHandler(includedInTable); } else { includedInPanel.setVisible(false); } dependencies.setAccountInfoCache(detail.getAccounts()); approvals.setAccountInfoCache(detail.getAccounts()); descriptionBlock.display(detail.getChange(), detail .getCurrentPatchSetDetail().getInfo(), detail.getAccounts()); dependsOn.display(detail.getDependsOn()); neededBy.display(detail.getNeededBy()); codependentWith.display(detail.getCodependentWith()); approvals.display(detail); for (PatchSet pId : detail.getPatchSets()) { if (patchesList != null) { patchesList.addItem(Util.M.patchSetHeader(pId.getPatchSetId()), pId .getId().toString()); } } if (diffBaseId != null && patchesList != null) { patchesList.setSelectedIndex(diffBaseId.get()); } patchSetsBlock.display(detail, diffBaseId); addComments(detail); boolean depsOpen = false; int outdated = 0; if (!detail.getChange().getStatus().isClosed() && detail.getDependsOn() != null) { for (final ChangeInfo ci : detail.getDependsOn()) { if (! ci.isLatest()) { depsOpen = true; outdated++; } else if (ci.getStatus() != Change.Status.MERGED) { depsOpen = true; } } } dependenciesPanel.setOpen(depsOpen); if (outdated > 0) { dependenciesPanel.getHeader().add(new InlineLabel( Util.M.outdatedHeader(outdated))); } }

Target:
private void display(final ChangeDetail detail) { displayTitle(detail.getChange().getKey(), detail.getChange().getSubject()); if (starChange != null) { setStarred(detail.isStarred()); } if (Status.MERGED == detail.getChange().getStatus()) { includedInPanel.setVisible(true); includedInPanel.addOpenHandler(includedInTable); } else { includedInPanel.setVisible(false); } dependencies.setAccountInfoCache(detail.getAccounts()); approvals.setAccountInfoCache(detail.getAccounts()); descriptionBlock.display(detail.getChange(), detail .getCurrentPatchSetDetail().getInfo(), detail.getAccounts()); dependsOn.display(detail.getDependsOn()); neededBy.display(detail.getNeededBy()); codependentWith.display(detail.getCodependentWith()); approvals.display(detail); for (PatchSet pId : detail.getPatchSets()) { if (patchesList != null) { patchesList.addItem(Util.M.patchSetHeader(pId.getPatchSetId()), pId .getId().toString()); } } if (diffBaseId != null && patchesList != null) { patchesList.setSelectedIndex(diffBaseId.get()); } patchSetsBlock.display(detail, diffBaseId); addComments(detail); boolean depsOpen = (detail.getCodependentWith() != null); int outdated = 0; if (!detail.getChange().getStatus().isClosed() && detail.getDependsOn() != null) { for (final ChangeInfo ci : detail.getDependsOn()) { if (! ci.isLatest()) { depsOpen = true; outdated++; } else if (ci.getStatus() != Change.Status.MERGED) { depsOpen = true; } } } dependenciesPanel.setOpen(depsOpen); if (outdated > 0) { dependenciesPanel.getHeader().add(new InlineLabel( Util.M.outdatedHeader(outdated))); } }