auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testNameSampleSerDe() throws IOException { NameSample nameSample = createGoldSample(); String fileName = "file.ser"; try (FileOutputStream fileOutputStream = new FileOutputStream(tempDirectory.newFile(fileName))) { ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); objectOutputStream.writeObject(nameSample); objectOutputStream.close(); } NameSample deSerializedNameSample = null; try (FileInputStream fileInputStream = new FileInputStream(new File(tempDirectory.getRoot(), fileName))) { ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream); deSerializedNameSample = (NameSample) objectInputStream.readObject(); } catch (ClassNotFoundException cfe) { } Assert.assertNotNull(deSerializedNameSample); Assert.assertEquals(nameSample.getId(), deSerializedNameSample.getId()); Assert.assertArrayEquals(nameSample.getNames(), deSerializedNameSample.getNames()); Assert.assertArrayEquals(nameSample.getSentence(), deSerializedNameSample.getSentence()); Assert.assertArrayEquals(nameSample.getAdditionalContext(), deSerializedNameSample.getAdditionalContext()); }

Target:
public void testNameSampleSerDe() throws IOException { NameSample nameSample = createGoldSample(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(byteArrayOutputStream); out.writeObject(nameSample); out.flush(); byte[] bytes = byteArrayOutputStream.toByteArray(); ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); ObjectInput objectInput = new ObjectInputStream(byteArrayInputStream); NameSample deSerializedNameSample = null; try { deSerializedNameSample = (NameSample) objectInput.readObject(); } catch (ClassNotFoundException e) { } Assert.assertNotNull(deSerializedNameSample); Assert.assertArrayEquals(nameSample.getSentence(), deSerializedNameSample.getSentence()); Assert.assertArrayEquals(nameSample.getNames(), deSerializedNameSample.getNames()); Assert.assertArrayEquals(nameSample.getAdditionalContext(), deSerializedNameSample.getAdditionalContext()); }
Source:
@Override public Object invoke(MethodInvocation invocation) throws Throwable { Method method = invocation.getMethod(); if (method == null) { return invocation.proceed(); } Method mostSpecificMethod = AopUtils .getMostSpecificMethod(method, invocation.getThis().getClass()); NewSpan newSpan = SleuthAnnotationUtils.findAnnotation(mostSpecificMethod, NewSpan.class); ContinueSpan continueSpan = SleuthAnnotationUtils.findAnnotation(mostSpecificMethod, ContinueSpan.class); if (newSpan == null && continueSpan == null) { return invocation.proceed(); } Span span = tracer().getCurrentSpan(); String log = log(newSpan, continueSpan); boolean hasLog = StringUtils.hasText(log); try { if (newSpan != null) { span = spanCreator().createSpan(invocation, newSpan); } if (hasLog) { spanTagAnnotationHandler().addAnnotatedParameters(invocation); span.logEvent(log + ".start"); } return invocation.proceed(); } finally { if (span != null) { if (hasLog) { span.logEvent(log + ".end"); } if (newSpan != null) { tracer().close(span); } } } }

Target:
public Object invoke(MethodInvocation invocation) throws Throwable { Method method = invocation.getMethod(); if (method == null) { return invocation.proceed(); } Method mostSpecificMethod = AopUtils .getMostSpecificMethod(method, invocation.getThis().getClass()); NewSpan newSpan = SleuthAnnotationUtils.findAnnotation(mostSpecificMethod, NewSpan.class); ContinueSpan continueSpan = SleuthAnnotationUtils.findAnnotation(mostSpecificMethod, ContinueSpan.class); if (newSpan == null && continueSpan == null) { return invocation.proceed(); } Span span = tracer().getCurrentSpan(); String log = log(continueSpan); boolean hasLog = StringUtils.hasText(log); try { if (newSpan != null) { span = spanCreator().createSpan(invocation, newSpan); } if (hasLog) { logEvent(span, log + ".before"); } spanTagAnnotationHandler().addAnnotatedParameters(invocation); return invocation.proceed(); } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug("Exception occurred while trying to continue the pointcut", e); } if (hasLog) { logEvent(span, log + ".afterFailure"); } tracer().addTag(Span.SPAN_ERROR_TAG_NAME, ExceptionUtils.getExceptionMessage(e)); throw e; } finally { if (span != null) { if (hasLog) { logEvent(span, log + ".after"); } if (newSpan != null) { tracer().close(span); } } } }
Source:
public void afterSuite() throws IOException { for (ObjectName mbean : _server.queryNames(null, null)) { try { _server.unregisterMBean(mbean); } catch (Exception e) { } } _gSetupTool.close(); _baseAccessor.close(); _gZkClient.close(); TestHelper.stopZkServer(_zkServer); if (System.getProperty(MULTI_ZK_PROPERTY_KEY) != null) { for (int i = 0; i < _numZk; i++) { if (_baseDataAccessorMap != null && _baseDataAccessorMap.containsKey(i)) { _baseDataAccessorMap.get(i).close(); } if (_clusterSetupMap != null && _clusterSetupMap.containsKey(i)) { _clusterSetupMap.get(i).close(); } if (_helixZkClientMap != null && _helixZkClientMap.containsKey(i)) { _helixZkClientMap.get(i).close(); } if (_zkServerMap != null && _zkServerMap.containsKey(i)) { TestHelper.stopZkServer(_zkServerMap.get(i)); } } } }

Target:
public void afterSuite() throws IOException { for (ObjectName mbean : _server.queryNames(null, null)) { try { _server.unregisterMBean(mbean); } catch (Exception e) { } } _baseDataAccessorMap.values().forEach(BaseDataAccessor::close); _clusterSetupMap.values().forEach(ClusterSetup::close); _helixZkClientMap.values().forEach(HelixZkClient::close); _zkServerMap.values().forEach(TestHelper::stopZkServer); }
Source:
public boolean areAckedBookiesAdheringToPlacementPolicy(Set<BookieSocketAddress> ackedBookies, int writeQuorumSize, int ackQuorumSize) { HashSet<String> rackCounter = new HashSet<>(); int minWriteQuorumNumRacksPerWriteQuorum = Math.min(writeQuorumSize, minNumRacksPerWriteQuorum); ReentrantReadWriteLock.ReadLock readLock = rwLock.readLock(); readLock.lock(); try { for (BookieSocketAddress bookie : ackedBookies) { try { rackCounter.add(knownBookies.get(bookie).getNetworkLocation()); } catch (Exception e) { LOG.warn("Received exception while trying to get network location of bookie: {}", bookie, e); } } if (LOG.isDebugEnabled()) { LOG.debug("areAckedBookiesAdheringToPlacementPolicy returning because number of racks = and " + "minNumRacksPerWriteQuorum = {}", rackCounter.size() >= minNumRacksPerWriteQuorum, rackCounter.size(), minNumRacksPerWriteQuorum); } } finally { readLock.unlock(); } return rackCounter.size() >= minWriteQuorumNumRacksPerWriteQuorum; }

Target:
public boolean areAckedBookiesAdheringToPlacementPolicy(Set<BookieSocketAddress> ackedBookies, int writeQuorumSize, int ackQuorumSize) { HashSet<String> rackCounter = new HashSet<>(); int minWriteQuorumNumRacksPerWriteQuorum = Math.min(writeQuorumSize, minNumRacksPerWriteQuorum); ReentrantReadWriteLock.ReadLock readLock = rwLock.readLock(); readLock.lock(); try { for (BookieSocketAddress bookie : ackedBookies) { rackCounter.add(knownBookies.get(bookie).getNetworkLocation()); } if (LOG.isDebugEnabled()) { LOG.debug("areAckedBookiesAdheringToPlacementPolicy returning because number of racks = and " + "minNumRacksPerWriteQuorum = {}", rackCounter.size() >= minNumRacksPerWriteQuorum, rackCounter.size(), minNumRacksPerWriteQuorum); } } finally { readLock.unlock(); } return rackCounter.size() >= minWriteQuorumNumRacksPerWriteQuorum; }
Source:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { boolean acceptBasicAuth = (boolean) request.getSession().getServletContext().getAttribute(SSOUtils.ACCEPT_BASIC_AUTH_HEADERS); if (acceptBasicAuth) { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_BASIC_URI); } else { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_PHASE3_URI); } }

Target:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { SSOConfig config = (SSOConfig) request.getServletContext().getAttribute(SSOUtils.SSO_CONFIG); if (config.isEnableBasicAuth()) { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_BASIC_URI); } else { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_PHASE3_URI); } }
Source:
public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); try { response = urlopen.open("<LINK_0>"); Matcher matcher; Matcher matcher_b; matcher = reAccounts.matcher(response); while (matcher.find()) { if ("".equals(matcher.group(1))) { continue; } matcher_b = reBalance.matcher(matcher.group(2)); if (matcher_b.find()) { String balanceString = matcher_b.group(2).replaceAll("\\<a[^>]*>","").replaceAll("\\<[^>]*>","").trim(); accounts.add(new Account(Html.fromHtml(matcher.group(1)).toString().trim() , Helpers.parseBalance(balanceString), matcher.group(1))); balance = balance.add(Helpers.parseBalance(balanceString)); } } if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } } finally { super.updateComplete(); } }

Target:
public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); response = urlopen.open("<LINK_0>"); Matcher matcher; Matcher matcher_b; matcher = reAccounts.matcher(response); while (matcher.find()) { if ("".equals(matcher.group(1))) { continue; } matcher_b = reBalance.matcher(matcher.group(2)); if (matcher_b.find()) { String balanceString = matcher_b.group(2).replaceAll("\\<a[^>]*>","").replaceAll("\\<[^>]*>","").trim(); accounts.add(new Account(Html.fromHtml(matcher.group(1)).toString().trim() , Helpers.parseBalance(balanceString), matcher.group(1))); balance = balance.add(Helpers.parseBalance(balanceString)); } } if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } super.updateComplete(); }
Source:
private ListenableFuture<Void> writeNGramsIndex(final NGramGenerator ngrams, final CassandraLabelId labelId, final LabelType type) { List<ResultSetFuture> list = new ArrayList<>(); while (ngrams.hasNext()) { final String nGram = ngrams.next(); ResultSetFuture result = session.executeAsync(createNGramStatement.bind() .setString(0, nGram) .setString(1, type.toValue()) .setLong(2, CassandraLabelId.toLong(labelId))); addCallback(result, new FutureCallback<ResultSet>() { @Override public void onSuccess(final ResultSet result) { } @Override public void onFailure(final Throwable throwable) { LOG.error("Write of ngram with id of type {}", nGram, labelId, type); } }); list.add(result); } return transform(allAsList(list), new ToVoidFunction()); }

Target:
private ListenableFuture<Void> writeNGramsIndex(final NGramGenerator ngrams, final CassandraLabelId labelId, final LabelType type) { final List<ResultSetFuture> list = new ArrayList<>(); while (ngrams.hasNext()) { final String nGram = ngrams.next(); final ResultSetFuture result = session.executeAsync(createNGramStatement.bind() .setString(0, nGram) .setString(1, type.toValue()) .setLong(2, CassandraLabelId.toLong(labelId))); addCallback(result, new FutureCallback<ResultSet>() { @Override public void onSuccess(final ResultSet result) { } @Override public void onFailure(final Throwable throwable) { LOG.error("Write of n-gram with id of type failed", nGram, labelId, type, throwable); } }); list.add(result); } return transform(allAsList(list), new ToVoidFunction()); }
Source:
private void closeResponseChannel() { if (isOpen()) { try { channelWriteLock.lock(); responseChannelOpen.set(false); logger.trace("NettyResponseChannel for network channel closed", ctx.channel()); } finally { channelWriteLock.unlock(); } } }

Target:
private void closeResponseChannel() { if (isOpen()) { channelWriteLock.lock(); try { responseChannelOpen.set(false); logger.trace("NettyResponseChannel for network channel closed", ctx.channel()); } finally { channelWriteLock.unlock(); } } }
Source:
protected abstract void storageInit() throws IOException; public abstract void createTable(TableDesc tableDesc, boolean ifNotExists) throws IOException; public abstract void purgeTable(TableDesc tableDesc) throws IOException; public abstract List<Fragment> getSplits(String fragmentId, TableDesc tableDesc, ScanNode scanNode) throws IOException; public abstract List<Fragment> getNonForwardSplit(TableDesc tableDesc, int currentPage, int numFragments) throws IOException; public abstract StorageProperty getStorageProperty(); public abstract void closeStorageManager(); public abstract TupleRange[] getInsertSortRanges(OverridableConf queryContext, TableDesc tableDesc, Schema inputSchema, SortSpec[] sortSpecs, TupleRange dataRange) throws IOException; public abstract void beforeInsertOrCATS(LogicalNode node) throws IOException; public abstract void queryFailed(LogicalNode node) throws IOException; public StoreType getStoreType() { return storeType; }

Target:
protected abstract void storageInit() throws IOException; public abstract void createTable(TableDesc tableDesc, boolean ifNotExists) throws IOException; public abstract void purgeTable(TableDesc tableDesc) throws IOException; public abstract List<Fragment> getSplits(String fragmentId, TableDesc tableDesc, ScanNode scanNode) throws IOException; public abstract List<Fragment> getNonForwardSplit(TableDesc tableDesc, int currentPage, int numFragments) throws IOException; public abstract StorageProperty getStorageProperty(); public abstract void closeStorageManager(); public abstract TupleRange[] getInsertSortRanges(OverridableConf queryContext, TableDesc tableDesc, Schema inputSchema, SortSpec[] sortSpecs, TupleRange dataRange) throws IOException; public abstract void beforeInsertOrCATS(LogicalNode node) throws IOException; public abstract void rollbackOutputCommit(LogicalNode node) throws IOException; public StoreType getStoreType() { return storeType; }
Source:
void reset() { if( mState == State.PENDING_DECODE ) { if ( mTileRenderRunnableWeakReference != null ) { TileRenderRunnable runnable = mTileRenderRunnableWeakReference.get(); if( runnable != null ) { runnable.cancel( true ); } } } mState = State.UNASSIGNED; mRenderTimeStamp = null; if( mBitmap != null && !mBitmap.isRecycled() ) { BitmapRecycler recycler = mBitmapRecyclerReference.get(); if( recycler != null ) { recycler.recycleBitmap( mBitmap ); } else { mBitmap.recycle(); } } mBitmap = null; }

Target:
void reset() { if( mState == State.PENDING_DECODE ) { if ( mTileRenderRunnableWeakReference != null ) { TileRenderRunnable runnable = mTileRenderRunnableWeakReference.get(); if( runnable != null ) { runnable.cancel( true ); } } } mState = State.UNASSIGNED; mRenderTimeStamp = null; if( mBitmap != null ) { BitmapRecycler recycler = mBitmapRecyclerReference.get(); if( recycler != null ) { recycler.recycleBitmap( mBitmap ); } } mBitmap = null; }
Source:
public DefaultBoxMacro() { super("Box", DESCRIPTION, new DefaultContentDescriptor(CONTENT_DESCRIPTION, true, new DefaultParameterizedType(null, List.class, Block.class)), BoxMacroParameters.class); setDefaultCategory(DEFAULT_CATEGORY_FORMATTING); }

Target:
public DefaultBoxMacro() { super("Box", DESCRIPTION, new DefaultContentDescriptor(CONTENT_DESCRIPTION, true, Block.LIST_BLOCK_TYPE), BoxMacroParameters.class); setDefaultCategory(DEFAULT_CATEGORY_FORMATTING); }
Source:
private String toCSV(Collection<String> strings) { StringBuilder strB = new StringBuilder(); strings.forEach(s -> strB.append(s).append(",")); return strB.toString(); }

Target:
private String toCSV(Collection<String> strings) { return strings.stream().collect(Collectors.joining(",")); }
Source:
private HttpResponse executeRequest(HttpUriRequest request) throws RapidProClientException { try { generateTokenAuthHeader(request); LOGGER.debug(EXECUTING_REQUEST + request.toString()); HttpResponse response = client.execute(request); checkHttpStatusCode(response); return response; } catch (IOException e) { LOGGER.error(e.getMessage()); throw new RapidProClientException(UNABLE_TO_EXECUTE, e); } }

Target:
private HttpResponse executeRequest(HttpUriRequest request) throws RapidProClientException { try { generateTokenAuthHeader(request); LOGGER.debug(EXECUTING_REQUEST + request.toString()); HttpResponse response = client.execute(request); checkHttpStatusCode(response); return response; } catch (IOException e) { throw new RapidProClientException(UNABLE_TO_EXECUTE, e); } }
Source:
public static List<File> getReportsDirectories(Settings settings, FileSystem fs, PathResolver pathResolver) { File dir = getReportsDirectoryFromProperty(settings, fs, pathResolver); List<File> dirs = getReportsDirectoriesFromProperty(settings, fs, pathResolver); if (dir != null ^ dirs != null) { if (dirs != null) { return dirs; } return Collections.singletonList(dir); } if (dir == null) { return Collections.singletonList(new File(fs.baseDir(), "target/surefire-reports")); } LOGGER.info("Property '" + SUREFIRE_REPORTS_PATH_PROPERTY + "' is deprecated and will be ignorded, as property '" + SUREFIRE_REPORT_PATHS_PROPERTY + "' is also set."); return dirs; }

Target:
public static List<File> getReportsDirectories(Settings settings, FileSystem fs, PathResolver pathResolver) { File dir = getReportsDirectoryFromDeprecatedProperty(settings, fs, pathResolver); List<File> dirs = getReportsDirectoriesFromProperty(settings, fs, pathResolver); if (dirs != null) { if (dir != null) { LOGGER.info("Property '{}' is deprecated and will be ignored, as property '{}' is also set.", SUREFIRE_REPORTS_PATH_PROPERTY, SUREFIRE_REPORT_PATHS_PROPERTY); } return dirs; } if (dir != null) { return Collections.singletonList(dir); } return Collections.singletonList(new File(fs.baseDir(), "target/surefire-reports")); }
Source:
public DefaultDmnEngineConfiguration enableFeelLegacyBehavior(boolean enableFeelLegacyBehavior) { this.enableFeelLegacyBehavior = enableFeelLegacyBehavior; return this; }

Target:
public DefaultDmnEngineConfiguration enableFeelLegacyBehavior(boolean enableFeelLegacyBehavior) { setEnableFeelLegacyBehavior(enableFeelLegacyBehavior); return this; }
Source:
public static String getTimeSpanToXSDuration(TimeSpan timeOffset) { String offsetStr = (timeOffset.getTotalSeconds() < 0) ? "-" : ""; return String.format("%sP%sDT%sH%sM%sS", offsetStr, Math.abs(timeOffset.getDays()), Math.abs(timeOffset.getHours()), Math.abs(timeOffset.getMinutes()), Math.abs(timeOffset.getSeconds()) + "." + Math.abs(timeOffset.getMilliseconds())); }

Target:
public static String getTimeSpanToXSDuration(TimeSpan timeOffset) { String offsetStr = (timeOffset.getTotalSeconds() < 0) ? "-" : ""; long days = Math.abs(timeOffset.getDays()); long hours = Math.abs(timeOffset.getHours()); long minutes = Math.abs(timeOffset.getMinutes()); long seconds = Math.abs(timeOffset.getSeconds()); long milliseconds = Math.abs(timeOffset.getMilliseconds()); return offsetStr + "P" + days + "DT" + hours + "H" + minutes + "M" + seconds + "." + milliseconds + "S"; }
Source:
private boolean isHostNetworkUnreacable(VDS vds) { VdsDynamic vdsDynamic = vds.getDynamicData(); return ((vdsDynamic.getStatus() == VDSStatus.Down) || (vdsDynamic.getStatus() == VDSStatus.Reboot) || (vdsDynamic.getStatus() == VDSStatus.NonOperational && vdsDynamic.getNonOperationalReason() == NonOperationalReason.NETWORK_UNREACHABLE)); }

Target:
private boolean isHostNetworkUnreacable(VDS vds) { VdsDynamic vdsDynamic = vds.getDynamicData(); return (vdsDynamic.getStatus() == VDSStatus.Down || vdsDynamic.getStatus() == VDSStatus.Reboot || (vdsDynamic.getStatus() == VDSStatus.NonOperational && vdsDynamic.getNonOperationalReason() == NonOperationalReason.NETWORK_UNREACHABLE)); }
Source:
boolean checkEquality(String a, File b) { try { return a != null && b != null && new File(a).getCanonicalPath().equals(b.getCanonicalPath()); } catch (IOException e) { } return false; }

Target:
boolean checkEquality(String a, File b) { assertNotNull(a); assertNotNull(b); return new File(a).equals(b); }
Source:
public static int getLocalIconResId(@Nullable String identifier) { if (ID_BICYCLE.equals(identifier)) { return R.drawable.ic_bicycle; } else if (ID_WALK.equals(identifier)) { return R.drawable.ic_walk; } else if (ID_PUBLIC_TRANSPORT.equals(identifier)) { return R.drawable.ic_public_transport; } else if (ID_TAXI.equals(identifier)) { return R.drawable.ic_taxi; } else if (ID_SHUTTLE_BUS.equals(identifier)) { return R.drawable.ic_shuttlebus; } else if (ID_MOTORBIKE.equals(identifier)) { return R.drawable.ic_motorbike; } else if (ID_CAR.equals(identifier)) { return R.drawable.ic_car; } else if (ID_AIR.equals(identifier)) { return R.drawable.ic_aeroplane; } else if (identifier != null && identifier.startsWith(ID_BICYCLE) && identifier.contains(MIDDLE_FIX_BIC)) { return R.drawable.ic_bicycle_share; } else { return 0; } }

Target:
public static int getLocalIconResId(@Nullable String identifier) { if (ID_BICYCLE.equals(identifier)) { return R.drawable.ic_bicycle; } else if (ID_WALK.equals(identifier)) { return R.drawable.ic_walk; } else if (ID_PUBLIC_TRANSPORT.equals(identifier)) { return R.drawable.ic_public_transport; } else if (ID_TAXI.equals(identifier)) { return R.drawable.ic_taxi; } else if (ID_SHUTTLE_BUS.equals(identifier)) { return R.drawable.ic_shuttlebus; } else if (ID_MOTORBIKE.equals(identifier)) { return R.drawable.ic_motorbike; } else if (ID_CAR.equals(identifier)) { return R.drawable.ic_car; } else if (ID_AIR.equals(identifier)) { return R.drawable.ic_aeroplane; } else if (identifier != null && identifier.startsWith("cy_bic-s")) { return R.drawable.ic_bicycle_share; } else { return 0; } }
Source:
protected void configure() { super.configure(); bindHttpApi(binder(), AuthenticationApi.class); bindHttpApi(binder(), TempAuthApi.class); requestStaticInjection(SwiftAuthenticationModule.class); }

Target:
protected void configure() { super.configure(); bindHttpApi(binder(), AuthenticationApi.class); bindHttpApi(binder(), TempAuthApi.class); }
Source:
public void run() { Thread.currentThread().setName("DataServiceImpl:Submit"); while (publisherEnabled) { long sleepingTime = -1; if (DataServiceImpl.this.dataTransportService.isConnected()) { try { DataMessage message = DataServiceImpl.this.store.getNextMessage(); if (message != null) { checkInFlightMessages(message); boolean messagePublished; if (dataServiceOptions.isRateLimitEnabled() && message.getPriority() >= 5) { messagePublished = publishMessageTokenBucket(message); } else { messagePublished = publishMessageUnbound(message); } if (messagePublished) { continue; } else { sleepingTime = DataServiceImpl.this.throttle.getNextRefillEta(); } } } catch (KuraNotConnectedException e) { logger.info("DataPublisherService is not connected"); } catch (KuraTooManyInflightMessagesException e) { logger.info("Too many in-flight messages"); handleInFlightCongestion(); } catch (Exception e) { logger.error("Probably an unrecoverable exception", e); } } else { logger.info("DataPublisherService not connected"); } try { suspendPublisher(sleepingTime, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { logger.debug("Interrupting publishing thread."); Thread.currentThread().interrupt(); } } logger.debug("Exited publisher loop."); }

Target:
public void run() { Thread.currentThread().setName("DataServiceImpl:Submit"); while (publisherEnabled.get()) { long sleepingTime = -1; boolean messagePublished = false; if (DataServiceImpl.this.dataTransportService.isConnected()) { try { DataMessage message = DataServiceImpl.this.store.getNextMessage(); if (message != null) { checkInFlightMessages(message); if (dataServiceOptions.isRateLimitEnabled() && message.getPriority() >= 5) { messagePublished = publishMessageTokenBucket(message); sleepingTime = DataServiceImpl.this.throttle.getTokenWaitTime(); } else { publishMessageUnbound(message); messagePublished = true; } } } catch (KuraNotConnectedException e) { logger.info("DataPublisherService is not connected"); } catch (KuraTooManyInflightMessagesException e) { logger.info("Too many in-flight messages"); handleInFlightCongestion(); } catch (Exception e) { logger.error("Probably an unrecoverable exception", e); } } else { logger.info("DataPublisherService not connected"); } if (!messagePublished) { suspendPublisher(sleepingTime, TimeUnit.MILLISECONDS); } } logger.debug("Exited publisher loop."); }
Source:
protected Acceptor buildAcceptor(HeuristicConfigPolicy configPolicy) { AcceptorConfig acceptorConfig_; if (acceptorConfig != null) { if (localSearchType != null) { throw new IllegalArgumentException("The localSearchType (" + localSearchType + ") must not be configured if the acceptorConfig (" + acceptorConfig + ") is explicitly configured."); } acceptorConfig_ = acceptorConfig; } else { LocalSearchType localSearchType_ = defaultIfNull(localSearchType, LocalSearchType.LATE_ACCEPTANCE); acceptorConfig_ = new AcceptorConfig(); switch (localSearchType_) { case HILL_CLIMBING: acceptorConfig_.setAcceptorTypeList(Collections.singletonList(AcceptorType.HILL_CLIMBING)); break; case TABU_SEARCH: acceptorConfig_.setAcceptorTypeList(Collections.singletonList(AcceptorType.ENTITY_TABU)); break; case SIMULATED_ANNEALING: acceptorConfig_.setAcceptorTypeList(Collections.singletonList(AcceptorType.SIMULATED_ANNEALING)); break; case LATE_ACCEPTANCE: acceptorConfig_.setAcceptorTypeList(Collections.singletonList(AcceptorType.LATE_ACCEPTANCE)); break; case VARIABLE_NEIGHBORHOOD_DESCENT: acceptorConfig_.setAcceptorTypeList(Collections.singletonList(AcceptorType.HILL_CLIMBING)); break; default: throw new IllegalStateException("The localSearchType (" + localSearchType_ + ") is not implemented."); } } return acceptorConfig_.buildAcceptor(configPolicy); }

Target:
protected Acceptor buildAcceptor(HeuristicConfigPolicy configPolicy) { AcceptorConfig acceptorConfig_; if (acceptorConfig != null) { if (localSearchType != null) { throw new IllegalArgumentException("The localSearchType (" + localSearchType + ") must not be configured if the acceptorConfig (" + acceptorConfig + ") is explicitly configured."); } acceptorConfig_ = acceptorConfig; } else { LocalSearchType localSearchType_ = defaultIfNull(localSearchType, LocalSearchType.LATE_ACCEPTANCE); acceptorConfig_ = new AcceptorConfig(); switch (localSearchType_) { case HILL_CLIMBING: case VARIABLE_NEIGHBORHOOD_DESCENT: acceptorConfig_.setAcceptorTypeList(Collections.singletonList(AcceptorType.HILL_CLIMBING)); break; case TABU_SEARCH: acceptorConfig_.setAcceptorTypeList(Collections.singletonList(AcceptorType.ENTITY_TABU)); break; case SIMULATED_ANNEALING: acceptorConfig_.setAcceptorTypeList(Collections.singletonList(AcceptorType.SIMULATED_ANNEALING)); break; case LATE_ACCEPTANCE: acceptorConfig_.setAcceptorTypeList(Collections.singletonList(AcceptorType.LATE_ACCEPTANCE)); break; default: throw new IllegalStateException("The localSearchType (" + localSearchType_ + ") is not implemented."); } } return acceptorConfig_.buildAcceptor(configPolicy); }
Source:
private boolean isLambda(RowExpression rowExpression) { if (isExpression(rowExpression)) { return castToExpression(rowExpression) instanceof LambdaExpression; } return rowExpression instanceof LambdaDefinitionExpression; }

Target:
private static boolean isLambda(RowExpression rowExpression) { return castToExpression(rowExpression) instanceof LambdaExpression; }
Source:
protected void removeChildVisual(EditPart childEditPart) { super.removeChildVisual(childEditPart); if (getContentPane().getChildren().size() == 0) { Dimension dim = TextUtilities.INSTANCE.getTextExtents(Messages.InterfaceContainerEditPart_Int, getContentPane().getFont()); dim.height = (int) (dim.height * 0.66); getContentPane().setPreferredSize(dim); } }

Target:
protected void removeChildVisual(EditPart childEditPart) { super.removeChildVisual(childEditPart); if (getContentPane().getChildren().size() == 0) { Dimension dim = TextUtilities.INSTANCE.getTextExtents("INT", getContentPane().getFont()); dim.height = (int) (dim.height * 0.66); getContentPane().setPreferredSize(dim); } }
Source:
protected void createPreparedStatement(Connection db) throws SQLException { ExpressionBuilder builder = dialect.expressionBuilder(); switch (mode) { case TABLE: builder.append("SELECT * FROM ").append(tableId); addSuffixIfPresent(builder); String queryStr = builder.toString(); recordQuery(queryStr); log.debug("{} prepared SQL query: {}", this, queryStr); stmt = dialect.createPreparedStatement(db, queryStr); break; case QUERY: addSuffixIfPresent(builder); queryStr = query + builder.toString(); recordQuery(queryStr); log.debug("{} prepared SQL query: {}", this, queryStr); stmt = dialect.createPreparedStatement(db, queryStr); break; default: throw new ConnectException("Unknown mode: " + mode); } }

Target:
protected void createPreparedStatement(Connection db) throws SQLException { ExpressionBuilder builder = dialect.expressionBuilder(); switch (mode) { case TABLE: builder.append("SELECT * FROM ").append(tableId); break; case QUERY: builder.append(query); break; default: throw new ConnectException("Unknown mode: " + mode); } addSuffixIfPresent(builder); String queryStr = builder.toString(); recordQuery(queryStr); log.debug("{} prepared SQL query: {}", this, queryStr); stmt = dialect.createPreparedStatement(db, queryStr); }
Source:
protected String classToCheck() { throw new UnsupportedOperationException(); }

Target:
protected String classToCheck() { throw new UnsupportedOperationException("touch method reimplemented in JettyContainer"); }
Source:
private NotificationCompat.Builder getNotificationBuilder(GalleryItem galleryItem, Bitmap savedImage, String localUrl) { String filename = galleryItem.getName(); String descriptionUrl = galleryItem.getDescriptionUrl(); Intent shareChooserIntent = buildImageShareChooserIntent(app, filename, descriptionUrl, localUrl); Intent viewImageIntent = buildViewInDefaultAppIntent(localUrl); PendingIntent savedImageSharePendingIntent = getPendingIntent(shareChooserIntent); PendingIntent viewInDefaultViewerAppPendingIntent = getPendingIntent(viewImageIntent); NotificationCompat.BigPictureStyle bigPictureStyle = new NotificationCompat.BigPictureStyle().bigPicture(savedImage); NotificationCompat.Action savedImageShareAction = buildSavedImageShareAction(savedImageSharePendingIntent); return new NotificationCompat.Builder(app) .setSmallIcon(R.drawable.launcher) .setContentTitle(getString(R.string.gallery_image_saved_notification_title)) .setContentText(getString(R.string.gallery_image_saved_notification_text)) .setContentIntent(viewInDefaultViewerAppPendingIntent) .setStyle(bigPictureStyle) .addAction(savedImageShareAction); }

Target:
private NotificationCompat.Builder getNotificationBuilder(GalleryItem galleryItem, Bitmap savedImage, String localUrl) { String filename = galleryItem.getName(); String descriptionUrl = imageTitle.getCanonicalUri(); Intent shareChooserIntent = buildImageShareChooserIntent(app, filename, descriptionUrl, localUrl); Intent viewImageIntent = buildViewInDefaultAppIntent(localUrl); PendingIntent savedImageSharePendingIntent = getPendingIntent(shareChooserIntent); PendingIntent viewInDefaultViewerAppPendingIntent = getPendingIntent(viewImageIntent); NotificationCompat.BigPictureStyle bigPictureStyle = new NotificationCompat.BigPictureStyle().bigPicture(savedImage); NotificationCompat.Action savedImageShareAction = buildSavedImageShareAction(savedImageSharePendingIntent); return new NotificationCompat.Builder(app) .setSmallIcon(R.drawable.launcher) .setContentTitle(getString(R.string.gallery_image_saved_notification_title)) .setContentText(getString(R.string.gallery_image_saved_notification_text)) .setContentIntent(viewInDefaultViewerAppPendingIntent) .setStyle(bigPictureStyle) .addAction(savedImageShareAction); }
Source:
private String getDomainIdTuple(Guid domainId) { storage_domain_static storage_domain = DbFacade.getInstance().getStorageDomainStaticDAO().get(domainId); if (storage_domain != null) { return domainId + ":" + storage_domain.getstorage_name(); } else { return domainId.toString(); } }

Target:
private static String getDomainIdTuple(Guid domainId) { storage_domain_static storage_domain = DbFacade.getInstance().getStorageDomainStaticDao().get(domainId); if (storage_domain != null) { return domainId + ":" + storage_domain.getstorage_name(); } else { return domainId.toString(); } }
Source:
public void shouldThrowExceptionIfChefNotExist() { when(userService.findUserById(1L)).thenReturn(empty()); chefProfileService.findChef(1L, "fe80::2dd3:fb76:73b6:c1da"); }

Target:
public void shouldThrowExceptionIfChefNotExist() { when(userService.findUserById(1L)).thenReturn(empty()); chefProfileService.findChef(1L); }
Source:
public void updateCacheStorageTest() { CacheStorageImpl cache = new CacheStorageImpl(); final Map<Identifier, OperatorState> queryState1= new HashMap<>(); queryState1.put(oid1, value1); OperatorState<Integer> value3 = new OperatorState<>(10); OperatorState<String> value4 = new OperatorState<>("abcd"); cache.create(qid1, queryState1); Assert.assertEquals(value1, cache.read(qid1, oid1)); Assert.assertEquals(true, cache.update(qid1, oid1, value3)); Assert.assertEquals(value3, cache.read(qid1, oid1)); Assert.assertEquals(true, cache.update(qid1, oid1, value4)); Assert.assertEquals(value4, cache.read(qid1, oid1)); Assert.assertEquals("abcd", cache.read(qid1, oid1).getState()); Assert.assertEquals(true, cache.update(qid1, oid1, value4)); Assert.assertEquals(value4, cache.read(qid1, oid1)); Assert.assertEquals(true, cache.update(qid1, oid2, value3)); Assert.assertSame(value3, cache.read(qid1, oid2)); Assert.assertEquals(false, cache.update(qid2, oid1, value3)); Assert.assertEquals(false, cache.update(qid2, oid3, value3)); }

Target:
public void updateCacheStorageTest() { final CacheStorage cache = new CacheStorageImpl(); final Map<Identifier, OperatorState> queryState1 = new HashMap<>(); queryState1.put(oid1, value1); final OperatorState<Integer> value5 = new OperatorState<>(10); final OperatorState<String> value6 = new OperatorState<>("abcd"); cache.create(qid1, queryState1); Assert.assertEquals(value1, cache.read(qid1, oid1)); Assert.assertTrue(cache.update(qid1, oid1, value5)); Assert.assertEquals(value5, cache.read(qid1, oid1)); Assert.assertTrue(cache.update(qid1, oid1, value6)); Assert.assertEquals(value6, cache.read(qid1, oid1)); Assert.assertEquals("abcd", cache.read(qid1, oid1).getState()); Assert.assertTrue(cache.update(qid1, oid1, value6)); Assert.assertEquals(value6, cache.read(qid1, oid1)); Assert.assertFalse(cache.update(qid1, oid2, value5)); Assert.assertFalse(cache.update(qid2, oid1, value5)); Assert.assertFalse(cache.update(qid2, oid3, value5)); }
Source:
protected void doWork(IProgressMonitor monitor) throws OseeCoreException { Map<String, String> parameters = new HashMap<String, String>(); parameters.put("function", Function.PURGE_BRANCH.name()); BranchState currentState = branch.getBranchState(); BranchArchivedState archivedState = branch.getArchiveState(); ArtifactCache.deCache(branch); branch.setBranchState(BranchState.PURGE_IN_PROGRESS); branch.setArchived(true); OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.Purging, branch.getGuid())); BranchManager.persist(branch); AcquireResult response = null; try { PurgeBranchRequest requestData = new PurgeBranchRequest(branch.getId(), recursive); response = HttpClientMessage.send(OseeServerContext.BRANCH_CONTEXT, parameters, CoreTranslatorId.PURGE_BRANCH_REQUEST, requestData, null); } catch (OseeCoreException ex) { branch.setBranchState(currentState); branch.setArchived(archivedState.isArchived()); OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.StateUpdated, branch.getGuid())); throw ex; } if (response.wasSuccessful()) { branch.setBranchState(BranchState.PURGED); branch.setArchived(true); BranchManager.decache(branch); BranchManager.getCache().reloadCache(); OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.Purged, branch.getGuid())); } }

Target:
protected void doWork(IProgressMonitor monitor) throws OseeCoreException { Map<String, String> parameters = new HashMap<String, String>(); parameters.put("function", Function.PURGE_BRANCH.name()); BranchState currentState = branch.getBranchState(); BranchArchivedState archivedState = branch.getArchiveState(); ArtifactCache.deCache(branch); branch.setBranchState(BranchState.PURGE_IN_PROGRESS); branch.setArchived(true); OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.Purging, branch.getGuid())); AcquireResult response = null; try { PurgeBranchRequest requestData = new PurgeBranchRequest(branch.getId(), recursive); response = HttpClientMessage.send(OseeServerContext.BRANCH_CONTEXT, parameters, CoreTranslatorId.PURGE_BRANCH_REQUEST, requestData, null); } catch (OseeCoreException ex) { branch.setBranchState(currentState); branch.setArchived(archivedState.isArchived()); OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.StateUpdated, branch.getGuid())); throw ex; } if (response.wasSuccessful()) { branch.setBranchState(BranchState.PURGED); branch.setArchived(true); BranchManager.decache(branch); BranchManager.getCache().reloadCache(); OseeEventManager.kickBranchEvent(getClass(), new BranchEvent(BranchEventType.Purged, branch.getGuid())); } }
Source:
public static void init(Configuration configuration, StramHTTPAuthentication stramHTTPAuth) { hadoopWebSecurityEnabled = false; String authValue = configuration.get(HADOOP_HTTP_AUTH_PROP); if ((authValue != null) && !authValue.equals(HADOOP_HTTP_AUTH_VALUE_SIMPLE)) { hadoopWebSecurityEnabled = true; initAuth(configuration); } if (stramHTTPAuth == Context.StramHTTPAuthentication.FOLLOW_HADOOP_HTTP_AUTH) { stramWebSecurityEnabled = hadoopWebSecurityEnabled; } else if (stramHTTPAuth == StramHTTPAuthentication.FOLLOW_HADOOP_AUTH) { stramWebSecurityEnabled = UserGroupInformation.isSecurityEnabled(); } else if (stramHTTPAuth == StramHTTPAuthentication.ENABLE) { stramWebSecurityEnabled = true; } else if (stramHTTPAuth == StramHTTPAuthentication.DISABLE) { stramWebSecurityEnabled = false; } }

Target:
public static void init(Configuration configuration, StramHTTPAuthentication stramHTTPAuth) { hadoopWebSecurityEnabled = false; String authValue = configuration.get(HADOOP_HTTP_AUTH_PROP); if ((authValue != null) && !authValue.equals(HADOOP_HTTP_AUTH_VALUE_SIMPLE)) { hadoopWebSecurityEnabled = true; initAuth(configuration); } if (stramHTTPAuth == StramHTTPAuthentication.FOLLOW_HADOOP_HTTP_AUTH) { stramWebSecurityEnabled = hadoopWebSecurityEnabled; } else if (stramHTTPAuth == StramHTTPAuthentication.ENABLE) { stramWebSecurityEnabled = true; } else if (stramHTTPAuth == StramHTTPAuthentication.DISABLE) { stramWebSecurityEnabled = false; } else { stramWebSecurityEnabled = UserGroupInformation.isSecurityEnabled(); } }
Source:
public void getLogSegmentsNotInJournalTest() throws InterruptedException, IOException, StoreException { if (isLogSegmented) { testGetLogSegmentsNotInJournal(2, 2 * MAX_IN_MEM_ELEMENTS, false); testGetLogSegmentsNotInJournal(3, 2 * MAX_IN_MEM_ELEMENTS, false); } else { assertEquals("LogSegments mismatch for non segmented log ", null, state.index.getLogSegmentsNotInJournal()); } }

Target:
public void getLogSegmentsNotInJournalTest() throws InterruptedException, IOException, StoreException { if (isLogSegmented) { testGetLogSegmentsNotInJournal(2, 2 * MAX_IN_MEM_ELEMENTS); testGetLogSegmentsNotInJournal(3, 2 * MAX_IN_MEM_ELEMENTS); } else { assertEquals("LogSegments mismatch for non segmented log ", null, state.index.getLogSegmentsNotInJournal()); } }
Source:
public void testNonExistingFilePathProvided() throws Exception { params = new String[1]; params[0] = "/Users/c.xml"; new SubmitJobCommand(params).execute(currentContextMock); assertThat(stack.get(0).getMessage(), is("'" + params[0] + "' does not exist.")); Mockito.verify(schedulerRestClientMock, times(0)).submitJobArchive(anyString(), anyObject(), anyObject()); throw stack.get(0); }

Target:
public void testNonExistingFilePathProvided() throws Exception { params = new String[1]; params[0] = "/file/not/existing/c.xml"; new SubmitJobCommand(params).execute(currentContextMock); assertThat(stack.get(0).getMessage(), is("'" + params[0] + "' does not exist.")); Mockito.verify(schedulerRestClientMock, times(0)) .submitJobArchive(anyString(), convertObjectToInputStream(anyObject()), anyMap()); throw stack.get(0); }
Source:
public void onClick(View v) { if (mParentItemClickListener != null) { if (mClickableView != null) { if (mRotationEnabled) { RotateAnimation rotateAnimation = new RotateAnimation(ROTATED_POSITION, INITIAL_POSITION, RotateAnimation.RELATIVE_TO_SELF, PIVOT_VALUE, RotateAnimation.RELATIVE_TO_SELF, PIVOT_VALUE); mRotation = INITIAL_POSITION; rotateAnimation.setDuration(mDuration); rotateAnimation.setFillAfter(true); v.startAnimation(rotateAnimation); setExpanded(!mIsExpanded); } } mParentItemClickListener.onParentItemClickListener(getLayoutPosition()); } }

Target:
public void onClick(View v) { if (mParentItemClickListener != null) { if (mClickableView != null) { if (mRotationEnabled) { RotateAnimation rotateAnimation = new RotateAnimation(ROTATED_POSITION, INITIAL_POSITION, RotateAnimation.RELATIVE_TO_SELF, PIVOT_VALUE, RotateAnimation.RELATIVE_TO_SELF, PIVOT_VALUE); mRotation = INITIAL_POSITION; rotateAnimation.setDuration(mDuration); rotateAnimation.setFillAfter(true); v.startAnimation(rotateAnimation); } } setExpanded(!mIsExpanded); mParentItemClickListener.onParentItemClickListener(getLayoutPosition()); } }
Source:
public IndexIngestionSpec( @JsonProperty("dataSchema") DataSchema dataSchema, @JsonProperty("ioConfig") IndexIOConfig ioConfig, @JsonProperty("tuningConfig") IndexTuningConfig tuningConfig ) { super(dataSchema, ioConfig, tuningConfig); this.dataSchema = dataSchema; this.ioConfig = ioConfig; this.tuningConfig = tuningConfig == null ? new IndexTuningConfig() : tuningConfig; if (this.ioConfig.isAppendToExisting() && this.tuningConfig.isForceGuaranteedRollup()) { log.warn("Perfect rollup is not guaranteed when appending to existing data sources." + " forceGuaranteedRollup flag is ignored."); } }

Target:
public IndexIngestionSpec( @JsonProperty("dataSchema") DataSchema dataSchema, @JsonProperty("ioConfig") IndexIOConfig ioConfig, @JsonProperty("tuningConfig") IndexTuningConfig tuningConfig ) { super(dataSchema, ioConfig, tuningConfig); this.dataSchema = dataSchema; this.ioConfig = ioConfig; this.tuningConfig = tuningConfig == null ? new IndexTuningConfig() : tuningConfig; }
Source:
public static <T> T toObject(String json, TypeReference<T> type) throws IOException { try { return mapper.readValue(json, type); } catch (JsonParseException e) { throw new RuntimeException("Could not parse " + json, e); } }

Target:
public static <T> T toObject(String json, TypeReference<T> type) throws IOException { try { return mapper.readValue(json, type); } catch (JsonParseException e) { throw new IOException(String.format("Failed to parse json '%s'", json), e); } }
Source:
private void binaryProperties(NodeState state, String path, BufferedWriter writer, AtomicInteger count) { for (PropertyState p : state.getProperties()) { String propPath = PathUtils.concat(path, p.getName()); try { String id ; if (p.getType() == Type.BINARY) { id = p.getValue(Type.BINARY).getContentIdentity(); if (id == null || id.startsWith(INLINE_BINARY_SUFFIX)) continue; writeAsLine(writer, getLine(id, propPath), false); count.incrementAndGet(); } else if (p.getType() == Type.BINARIES && p.count() > 0) { Iterator<Blob> iterator = p.getValue(Type.BINARIES).iterator(); while (iterator.hasNext()) { id = iterator.next().getContentIdentity(); if (id == null || id.startsWith(INLINE_BINARY_SUFFIX)) { continue; } writeAsLine(writer, getLine(id, propPath), false); count.incrementAndGet(); } } } catch (Exception e) { System.err.println("Error in retrieving blob id for path " + propPath); } } }

Target:
private void binaryProperties(NodeState state, String path, BufferedWriter writer, AtomicInteger count) { for (PropertyState p : state.getProperties()) { String propPath = PathUtils.concat(path, p.getName()); try { String id ; if (p.getType() == Type.BINARY) { id = p.getValue(Type.BINARY).getContentIdentity(); if (id == null || p.getValue(Type.BINARY).isInlined()) { continue; } writeAsLine(writer, getLine(id, propPath), false); count.incrementAndGet(); } else if (p.getType() == Type.BINARIES && p.count() > 0) { Iterator<Blob> iterator = p.getValue(Type.BINARIES).iterator(); while (iterator.hasNext()) { id = iterator.next().getContentIdentity(); if (id == null || p.getValue(Type.BINARY).isInlined()) { continue; } writeAsLine(writer, getLine(id, propPath), false); count.incrementAndGet(); } } } catch (Exception e) { System.err.println("Error in retrieving blob id for path " + propPath); } } }
Source:
protected void addCorrelationParameterValueExpression(AbstractExpression expr, List<AbstractExpression> pves) { int paramIdx = AbstractParsedStmt.NEXT_PARAMETER_ID.getAndIncrement(); m_parameterIdxList.add(paramIdx); ParameterValueExpression pve = new ParameterValueExpression(paramIdx, expr); pves.add(pve); }

Target:
protected void addCorrelationParameterValueExpression(AbstractExpression expr, List<AbstractExpression> pves) { int paramIdx = AbstractParsedStmt.NEXT_PARAMETER_ID++; m_parameterIdxList.add(paramIdx); ParameterValueExpression pve = new ParameterValueExpression(paramIdx, expr); pves.add(pve); }
Source:
public ThriftClientHandler(TabletServer server) { super(server.getContext(), server.getWatcher(), server.getFileSystem()); this.server = server; this.watcher = server.getWatcher(); this.fs = server.getFileSystem(); this.security = server.getSecurity(); this.sessionManager = server.getSessionManager(); this.updateMetrics = server.getUpdateMetrics(); this.scanMetrics = server.getScanMetrics(); this.logger = server.getLogger(); log.debug("{} created", ThriftClientHandler.class.getName()); }

Target:
ThriftClientHandler(TabletServer server) { super(server.getContext(), new TransactionWatcher(server.getContext()), server.getFileSystem()); this.server = server; log.debug("{} created", ThriftClientHandler.class.getName()); }
Source:
static boolean equals(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length) { int remainingBytes = length & 7; final long baseOffset1 = BYTE_ARRAY_BASE_OFFSET + startPos1; final long diff = startPos2 - startPos1; if (length > 7) { final long end = baseOffset1 + remainingBytes; for (long i = baseOffset1 - 8 + length; i >= end; i -= 8) { if (UNSAFE.getLong(bytes1, i) != UNSAFE.getLong(bytes2, i + diff)) { return false; } } } if (remainingBytes >= 4) { remainingBytes -= 4; long pos = baseOffset1 + remainingBytes; if (UNSAFE.getInt(bytes1, pos) != UNSAFE.getInt(bytes2, pos + diff)) { return false; } } long baseOffset2 = baseOffset1 + diff; if (remainingBytes >= 2) { return UNSAFE.getChar(bytes1, baseOffset1) == UNSAFE.getChar(bytes2, baseOffset2) && (remainingBytes == 2 || UNSAFE.getByte(bytes1, baseOffset1 + 2) == UNSAFE.getByte(bytes2, baseOffset2 + 2)); } return remainingBytes == 0 || UNSAFE.getByte(bytes1, baseOffset1) == UNSAFE.getByte(bytes2, baseOffset2); }

Target:
static boolean equals(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length) { int remainingBytes = length & 7; final long baseOffset1 = BYTE_ARRAY_BASE_OFFSET + startPos1; final long diff = startPos2 - startPos1; if (length >= 8) { final long end = baseOffset1 + remainingBytes; for (long i = baseOffset1 - 8 + length; i >= end; i -= 8) { if (UNSAFE.getLong(bytes1, i) != UNSAFE.getLong(bytes2, i + diff)) { return false; } } } if (remainingBytes >= 4) { remainingBytes -= 4; long pos = baseOffset1 + remainingBytes; if (UNSAFE.getInt(bytes1, pos) != UNSAFE.getInt(bytes2, pos + diff)) { return false; } } final long baseOffset2 = baseOffset1 + diff; if (remainingBytes >= 2) { return UNSAFE.getChar(bytes1, baseOffset1) == UNSAFE.getChar(bytes2, baseOffset2) && (remainingBytes == 2 || UNSAFE.getByte(bytes1, baseOffset1 + 2) == UNSAFE.getByte(bytes2, baseOffset2 + 2)); } return remainingBytes == 0 || UNSAFE.getByte(bytes1, baseOffset1) == UNSAFE.getByte(bytes2, baseOffset2); }