auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void onSetUpAfterOpeningDesignerPerspective() throws Exception { changeDiagramUIPreference(SiriusDiagramUiPreferencesKeys.PREF_OLD_UI.name(), false); sessionAirdResource = new UIResource(designerProject, FILE_DIR, SESSION_FILE); localSession = designerPerspective.openSessionFromFile(sessionAirdResource); localSession.changeViewpointSelection(Sets.newHashSet("Design"), Sets.<String> newHashSet()); diagram = localSession.getLocalSessionBrowser().perCategory().selectViewpoint("Design").selectRepresentation("Entities").selectDiagramInstance("aaaa package entities").open(); editor = diagram.getEditor(); }

Target:
protected void onSetUpAfterOpeningDesignerPerspective() throws Exception { sessionAirdResource = new UIResource(designerProject, FILE_DIR, SESSION_FILE); localSession = designerPerspective.openSessionFromFile(sessionAirdResource); diagram = localSession.getLocalSessionBrowser().perCategory().selectViewpoint("Design").selectRepresentation("Entities").selectDiagramInstance("aaaa package entities").open(); editor = diagram.getEditor(); }
Source:
private static OkHttpClient createClient() { OkHttpClient.Builder builder = new OkHttpClient.Builder() .cookieJar(SharedPreferenceCookieManager.getInstance()) .cache(NET_CACHE) .addInterceptor(getLoggingInterceptor()) .addInterceptor(new UnsuccessfulResponseInterceptor()) .addInterceptor(new CommonHeaderRequestInterceptor()); if(BuildConfig.FLAVOR.equals("beta")){ builder.sslSocketFactory(SslUtils.INSTANCE.getSslContextForCertificateFile(CommonsApplication.getInstance(), "*.wikimedia.beta.wmflabs.org.cer").getSocketFactory()); } return builder.build(); }

Target:
private static OkHttpClient createClient() { OkHttpClient.Builder builder = new OkHttpClient.Builder() .cookieJar(SharedPreferenceCookieManager.getInstance()) .cache(NET_CACHE) .addInterceptor(getLoggingInterceptor()) .addInterceptor(new UnsuccessfulResponseInterceptor()) .addInterceptor(new CommonHeaderRequestInterceptor()); if(ConfigUtils.isBetaFlavour()){ builder.sslSocketFactory(SslUtils.INSTANCE.getSslContextForCertificateFile(CommonsApplication.getInstance(), "*.wikimedia.beta.wmflabs.org.cer").getSocketFactory()); } return builder.build(); }
Source:
public Dialog onCreateDialog(Bundle bundle) { final View rootView = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_restricted_login_dialog, null); TextView text = (TextView) rootView.findViewById(R.id.dialog_restricted_login_text); String link = Locale.getDefault().getLanguage().equals(Locale.GERMAN.getLanguage()) ? getString(R.string.schoolreg_link_german) : getString(R.string.schoolreg_link); text.setText(text.getText().toString().replace("%1$s", link)); Linkify.addLinks(text, Linkify.WEB_URLS); final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity()) .setView(rootView) .setTitle(R.string.dialog_restricted_login_title) .setPositiveButton(R.string.ok, null); restrictedLoginDialog = dialogBuilder.create(); restrictedLoginDialog.setCanceledOnTouchOutside(false); restrictedLoginDialog.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialog) { Button okButton = restrictedLoginDialog.getButton(AlertDialog.BUTTON_POSITIVE); okButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { PreferenceManager.getDefaultSharedPreferences(getActivity()).edit() .putBoolean(Constants.RESTRICTED_LOGIN_ACCEPTED, true) .apply(); if (!Utils.isUserLoggedIn(getActivity()) || !Utils.isCreateAtSchoolUser(getActivity())) { Utils.showPrivacyPolicyDialogWithLoginDialogAction(getActivity()); } dismiss(); } }); TextSizeUtil.enlargeViewGroup((ViewGroup) rootView.getRootView()); } }); return restrictedLoginDialog; }

Target:
public Dialog onCreateDialog(Bundle bundle) { final View rootView = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_restricted_login_dialog, null); TextView text = (TextView) rootView.findViewById(R.id.dialog_restricted_login_text); String link = Locale.getDefault().getLanguage().equals(Locale.GERMAN.getLanguage()) ? getString(R.string.schoolreg_link_german) : getString(R.string.schoolreg_link); text.setText(text.getText().toString().replace("%1$s", link)); Linkify.addLinks(text, Linkify.WEB_URLS); final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity()) .setView(rootView) .setTitle(R.string.dialog_restricted_login_title) .setPositiveButton(R.string.ok, null); restrictedLoginDialog = dialogBuilder.create(); restrictedLoginDialog.setCanceledOnTouchOutside(false); restrictedLoginDialog.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialog) { Button okButton = restrictedLoginDialog.getButton(AlertDialog.BUTTON_POSITIVE); okButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { PreferenceManager.getDefaultSharedPreferences(getActivity()).edit() .putBoolean(Constants.RESTRICTED_LOGIN_ACCEPTED, true) .apply(); if (!Utils.isUserLoggedIn(getActivity()) || !Utils.isCreateAtSchoolUser(getActivity())) { Utils.showPrivacyPolicyOrLoginDialog(getActivity()); } dismiss(); } }); TextSizeUtil.enlargeViewGroup((ViewGroup) rootView.getRootView()); } }); return restrictedLoginDialog; }
Source:
public boolean match(ChangeData object) throws OrmException { try { return object.commitMessage(repoManager, db).contains(value); } catch (IOException e) { return false; } }

Target:
public boolean match(ChangeData object) throws OrmException { try { for (ChangeData cData : index .getSource(new MessagePredicate(db, repoManager, index, value)) .read()) { if (cData.getId().equals(object.getId())) { return true; } } } catch (QueryParseException e) { throw new OrmException(e); } return false; }
Source:
public List<ExtensionDefinition> getAllExtensionDefinitions() { List<Extension> extensions = fromEntity(dao.getAllExtensions()); final List<ExtensionDefinition> extensionMaps = new ArrayList<>(); for (Extension extension : extensions) { final ExtensionDefinition extensionMap = new ExtensionDefinition(extension.getUrn()); for (Entry<String, Field> fieldEntry : extension.getFields().entrySet()) { final String field = fieldEntry.getKey(); final ExtensionFieldType<?> type = fieldEntry.getValue().getType(); extensionMap.addPair(field, type); } extensionMaps.add(extensionMap); } return extensionMaps; }

Target:
public List<ExtensionDefinition> getAllExtensionDefinitions() { List<Extension> extensions = fromEntity(dao.getAllExtensions()); final List<ExtensionDefinition> extensionDefinitions = new ArrayList<>(); for (Extension extension : extensions) { final ExtensionDefinition extensionDefinition = new ExtensionDefinition(extension.getUrn()); for (Entry<String, Field> fieldEntry : extension.getFields().entrySet()) { final String field = fieldEntry.getKey(); final ExtensionFieldType<?> type = fieldEntry.getValue().getType(); extensionDefinition.addPair(field, type); } extensionDefinitions.add(extensionDefinition); } return extensionDefinitions; }
Source:
public void register() { Chart chart = getChart(); chart.getPlotArea().addMouseTrackListener(this); chart.getPlotArea().addMouseMoveListener(this); chart.getPlotArea().addPaintListener(this); fTooltipHandler.activateHoverHelp(chart.getPlotArea()); }

Target:
public void register() { Chart chart = getChart(); chart.getPlotArea().addMouseMoveListener(this); chart.getPlotArea().addPaintListener(this); fTooltipHandler.activateHoverHelp(chart.getPlotArea()); }
Source:
private void addCreateProjectPanel() { final VerticalPanel fp = new VerticalPanel(); fp.setStyleName(Gerrit.RESOURCES.css().createProjectPanel()); initCreateTxt(); initCreateButton(); initParentBox(); addGrid(fp); emptyCommit = new CheckBox(Util.C.checkBoxEmptyCommit()); permissionsOnly = new CheckBox(Util.C.checkBoxPermissionsOnly()); fp.add(emptyCommit); fp.add(permissionsOnly); final HorizontalPanel bp = new HorizontalPanel(); bp.add(create); fp.add(bp); vp.add(fp); initSuggestedParents(); add(vp); }

Target:
private void addCreateProjectPanel() { final VerticalPanel fp = new VerticalPanel(); fp.setStyleName(Gerrit.RESOURCES.css().createProjectPanel()); initCreateTxt(); initCreateButton(); initParentBox(); addGrid(fp); emptyCommit = new CheckBox(Util.C.checkBoxEmptyCommit()); permissionsOnly = new CheckBox(Util.C.checkBoxPermissionsOnly()); fp.add(emptyCommit); fp.add(permissionsOnly); fp.add(create); vp.add(fp); initSuggestedParents(); add(vp); }
Source:
protected static String composeAttributeValueExtractionFailedMessage(Member member) { return "Attribute value extraction failed for: " + member + ". Make sure attribute values or collection/array " + "attribute value elements are all of the same and preferably concrete type. Consider custom attribute " + "extractors if it's impossible or undesirable to reduce the variety of types to a single type, see Custom " + "Attributes section in the reference manual for more details."; }

Target:
protected static String composeAttributeValueExtractionFailedMessage(Member member) { return "Attribute value extraction failed for: " + member + ". Make " + "sure attribute values or collection/array attribute value " + "elements are all of the same concrete type. Consider custom " + "attribute extractors if it's impossible or undesirable to " + "reduce the variety of types to a single type, see Custom " + "Attributes section in the reference manual for more details."; }
Source:
private XStream createXStream() { XStream xStream = new XStream(); xStream.alias("accounts", ImmutablePair.class); xStream.aliasField("activeAccount", ImmutablePair.class, "left"); xStream.aliasField("configuredAccounts", ImmutablePair.class, "right"); xStream.alias("xmppAccount", XMPPAccount.class); return xStream; }

Target:
private XStream createXStream() { XStream xStream = new XStream(); xStream.alias("accounts", AccountStoreInformation.class); xStream.alias("xmppAccount", XMPPAccount.class); return xStream; }
Source:
public static void testAddChartsToNewDocument() throws InvalidFormatException, IOException { XWPFDocument document = new XWPFDocument(); XWPFChart chart = document.addChart(); assertEquals(1, document.getCharts().size()); assertNotNull(chart); assertNotNull(chart.getCTChartSpace()); assertNotNull(chart.getCTChart()); assertEquals(XWPFChart.HEIGHT,chart.getChartHeight()); assertEquals(XWPFChart.WIDTH,chart.getChartWidth()); XWPFChart chart2 = document.addChart(); assertEquals(2, document.getCharts().size()); assertNotNull(chart2); assertNotNull(chart2.getCTChartSpace()); assertNotNull(chart2.getCTChart()); chart.setChartHeight(500500); assertEquals(500500,chart.getChartHeight()); assertNotNull(XWPFTestDataSamples.writeOutAndReadBack(document)); }

Target:
public static void testAddChartsToNewDocument() throws InvalidFormatException, IOException { XWPFDocument document = new XWPFDocument(); XWPFChart chart = document.createChart(); assertEquals(1, document.getCharts().size()); assertNotNull(chart); assertNotNull(chart.getCTChartSpace()); assertNotNull(chart.getCTChart()); assertEquals(XWPFChart.DEFAULT_HEIGHT,chart.getChartHeight()); assertEquals(XWPFChart.DEFAULT_WIDTH,chart.getChartWidth()); XWPFChart chart2 = document.createChart(); assertEquals(2, document.getCharts().size()); assertNotNull(chart2); assertNotNull(chart2.getCTChartSpace()); assertNotNull(chart2.getCTChart()); chart.setChartHeight(500500); assertEquals(500500,chart.getChartHeight()); assertNotNull(XWPFTestDataSamples.writeOutAndReadBack(document)); }
Source:
public static int setCodePointAt(int codePoint, Slice utf8, int position) { if (codePoint < 0) { throw new InvalidCodePointException(codePoint); } if (codePoint < 0x80) { utf8.setByte(position, codePoint); return 1; } if (codePoint < 0x800) { utf8.setByte(position, 0b1100_0000 | (codePoint >>> 6)); utf8.setByte(position + 1, 0b1000_0000 | (codePoint & 0b0011_1111)); return 2; } if (0xD800 <= codePoint && codePoint <= 0xDFFF) { throw new InvalidCodePointException(codePoint); } if (codePoint < 0x1_0000) { utf8.setByte(position, 0b1110_0000 | ((codePoint >>> 12) & 0b0000_1111)); utf8.setByte(position + 1, 0b1000_0000 | ((codePoint >>> 6) & 0b0011_1111)); utf8.setByte(position + 2, 0b1000_0000 | (codePoint & 0b0011_1111)); return 3; } if (codePoint < 0x11_0000) { utf8.setByte(position, 0b1111_0000 | ((codePoint >>> 18) & 0b0000_0111)); utf8.setByte(position + 1, 0b1000_0000 | ((codePoint >>> 12) & 0b0011_1111)); utf8.setByte(position + 2, 0b1000_0000 | ((codePoint >>> 6) & 0b0011_1111)); utf8.setByte(position + 3, 0b1000_0000 | (codePoint & 0b0011_1111)); return 4; } throw new InvalidCodePointException(codePoint); }

Target:
public static int setCodePointAt(int codePoint, Slice utf8, int position) { if (codePoint < 0) { throw new InvalidCodePointException(codePoint); } if (codePoint < 0x80) { utf8.setByte(position, codePoint); return 1; } if (codePoint < 0x800) { utf8.setByte(position, 0b1100_0000 | (codePoint >>> 6)); utf8.setByte(position + 1, 0b1000_0000 | (codePoint & 0b0011_1111)); return 2; } if (MIN_SURROGATE <= codePoint && codePoint <= MAX_SURROGATE) { throw new InvalidCodePointException(codePoint); } if (codePoint < 0x1_0000) { utf8.setByte(position, 0b1110_0000 | ((codePoint >>> 12) & 0b0000_1111)); utf8.setByte(position + 1, 0b1000_0000 | ((codePoint >>> 6) & 0b0011_1111)); utf8.setByte(position + 2, 0b1000_0000 | (codePoint & 0b0011_1111)); return 3; } if (codePoint < 0x11_0000) { utf8.setByte(position, 0b1111_0000 | ((codePoint >>> 18) & 0b0000_0111)); utf8.setByte(position + 1, 0b1000_0000 | ((codePoint >>> 12) & 0b0011_1111)); utf8.setByte(position + 2, 0b1000_0000 | ((codePoint >>> 6) & 0b0011_1111)); utf8.setByte(position + 3, 0b1000_0000 | (codePoint & 0b0011_1111)); return 4; } throw new InvalidCodePointException(codePoint); }
Source:
public static void initializeDefaults(IPreferenceStore store) { PreferenceConverter.setDefault(store, P_DEFAULT, DEFAULT); PreferenceConverter.setDefault(store, P_PROC_INSTR, PROC_INSTR); PreferenceConverter.setDefault(store, P_STRING, STRING); PreferenceConverter.setDefault(store, P_EXTERNALIZED_STRING, EXTERNALIZED_STRING); PreferenceConverter.setDefault(store, P_TAG, TAG); PreferenceConverter.setDefault(store, P_XML_COMMENT, XML_COMMENT); PreferenceConverter.setDefault(store, P_HEADER_KEY, HEADER_KEY); PreferenceConverter.setDefault(store, P_HEADER_OSGI, HEADER_OSGI); store.setDefault(P_HEADER_OSGI + IPDEColorConstants.P_BOLD_SUFFIX, true); PreferenceConverter.setDefault(store, P_HEADER_VALUE, HEADER_VALUE); PreferenceConverter.setDefault(store, P_HEADER_ATTRIBUTES, HEADER_ATTRIBUTES); store.setDefault(P_HEADER_ATTRIBUTES + IPDEColorConstants.P_ITALIC_SUFFIX, true); PreferenceConverter.setDefault(store, P_HEADER_ASSIGNMENT, HEADER_ASSIGNMENT); try { Display display = Display.getDefault(); Runnable runnable = () -> { if (!display.isDisposed() && display.getHighContrast()) { PreferenceConverter.setDefault(store, P_DEFAULT, DEFAULT_HIGH_CONTRAST); PreferenceConverter.setDefault(store, P_HEADER_VALUE, HEADER_VALUE_HIGH_CONTRAST); PreferenceConverter.setDefault(store, P_HEADER_ATTRIBUTES, HEADER_ASSIGNMENT_HIGH_CONTRAST); } }; if (display == Display.getCurrent()) { runnable.run(); } else { display.asyncExec(runnable); } } catch (SWTException e) { } }

Target:
public static void initializeDefaults(IPreferenceStore store) { PreferenceConverter.setDefault(store, P_DEFAULT, DEFAULT); PreferenceConverter.setDefault(store, P_PROC_INSTR, PROC_INSTR); PreferenceConverter.setDefault(store, P_STRING, STRING); PreferenceConverter.setDefault(store, P_EXTERNALIZED_STRING, EXTERNALIZED_STRING); PreferenceConverter.setDefault(store, P_TAG, TAG); PreferenceConverter.setDefault(store, P_XML_COMMENT, XML_COMMENT); PreferenceConverter.setDefault(store, P_HEADER_KEY, HEADER_KEY); PreferenceConverter.setDefault(store, P_HEADER_OSGI, HEADER_OSGI); store.setDefault(P_HEADER_OSGI + IPDEColorConstants.P_BOLD_SUFFIX, true); PreferenceConverter.setDefault(store, P_HEADER_VALUE, HEADER_VALUE); PreferenceConverter.setDefault(store, P_HEADER_ATTRIBUTES, HEADER_ATTRIBUTES); store.setDefault(P_HEADER_ATTRIBUTES + IPDEColorConstants.P_ITALIC_SUFFIX, true); PreferenceConverter.setDefault(store, P_HEADER_ASSIGNMENT, HEADER_ASSIGNMENT); try { Display display = PlatformUI.getWorkbench().getDisplay(); Runnable runnable = () -> { if (!display.isDisposed() && display.getHighContrast()) { PreferenceConverter.setDefault(store, P_DEFAULT, DEFAULT_HIGH_CONTRAST); PreferenceConverter.setDefault(store, P_HEADER_VALUE, HEADER_VALUE_HIGH_CONTRAST); PreferenceConverter.setDefault(store, P_HEADER_ATTRIBUTES, HEADER_ASSIGNMENT_HIGH_CONTRAST); } }; if (display == Display.getCurrent()) { runnable.run(); } else { display.asyncExec(runnable); } } catch (SWTException e) { } }
Source:
public ByteBufOutputStream(ByteBuf buffer) { ObjectUtil.checkNotNull(buffer, "buffer"); this.buffer = buffer; startIndex = buffer.writerIndex(); }

Target:
public ByteBufOutputStream(ByteBuf buffer) { this.buffer = ObjectUtil.checkNotNull(buffer, "buffer"); startIndex = buffer.writerIndex(); }
Source:
public <S, A, P> A searchForAdversarialAction(Game<S, A, P> game, Integer... params) { SearchForAdversarialActionFunction<S, A> searchFn; if (params != null) { if ("MinimaxDecision".equals(searchFunctionName)) { searchFn = new MinimaxDecision<>(game); } else { searchFn = new AlphaBetaSearch<>(game); } } else { searchFn = new IterativeDeepeningAlphaBetaSearch<>(game, params[0], params[1], params[2]); } return searchFn.apply(game.initialState()); }

Target:
public <S, A, P> A searchForAdversarialAction(Game<S, A, P> game, Integer... params) { SearchForAdversarialActionFunction<S, A> searchFn; if ("MinimaxDecision".equals(searchFunctionName)) { searchFn = new MinimaxDecision<>(game); } else if ("AlphaBetaSearch".equals(searchFunctionName)) { searchFn = new AlphaBetaSearch<>(game); } else { searchFn = new IterativeDeepeningAlphaBetaSearch<>(game, params[0], params[1], params[2]); } return searchFn.apply(game.initialState()); }
Source:
public void entersSuccessfully() throws IOException { final MemberProfileJson memberprofilejson = Mockito.mock(MemberProfileJson.class); Mockito.when( memberprofilejson.fetch( Mockito.anyString(), Mockito.anyString(), Mockito.any(Href.class) ) ).thenReturn( Json.createReader( new FileInputStream( PsLinkedinTest.class.getResource( "linkedinTestUser.json" ).getPath() ) ).readObject() ); MatcherAssert.assertThat( new PsLinkedin(memberprofilejson) .enter(REQUEST).next().urn(), Matchers.is("urn:linkedin:1") ); }

Target:
public void entersSuccessfully() throws IOException { MatcherAssert.assertThat( new PsLinkedin( this.mockRequest("linkedinTestUser.json"), "testApp", "testKey" ).enter(REQUEST).next().urn(), Matchers.is("urn:linkedin:1") ); }
Source:
private Requester requester() { return root.retrieve().method("POST").withPreview(ZZZAX); }

Target:
private Requester requester() { return root.createRequest().withPreview(ZZZAX); }
Source:
public void initialise() { RenderingConfig renderingConfig = config.getRendering(); renderingConfig.subscribe(RenderingConfig.BLOOM, this); requiresCondition(renderingConfig::isBloom); requiresFBO(HIGH_PASS_FBO_CONFIG, displayResolutionDependentFBOs); addDesiredStateChange(new BindFBO(HIGH_PASS_FBO, displayResolutionDependentFBOs)); addDesiredStateChange(new SetViewportToSizeOf(HIGH_PASS_FBO, displayResolutionDependentFBOs)); highPass = getMaterial(HIGH_PASS_MATERIAL); addDesiredStateChange(new EnableMaterial(HIGH_PASS_MATERIAL.toString())); int textureSlot = 0; addDesiredStateChange(new SetInputTextureFromFBO(textureSlot, new ResourceUrn("engine:sceneOpaque"), ColorTexture, displayResolutionDependentFBOs, HIGH_PASS_MATERIAL, "tex")); }

Target:
public void initialise() { RenderingConfig renderingConfig = config.getRendering(); renderingConfig.subscribe(RenderingConfig.BLOOM, this); requiresCondition(renderingConfig::isBloom); requiresFBO(HIGH_PASS_FBO_CONFIG, displayResolutionDependentFBOs); addDesiredStateChange(new BindFBO(HIGH_PASS_FBO, displayResolutionDependentFBOs)); addDesiredStateChange(new SetViewportToSizeOf(HIGH_PASS_FBO, displayResolutionDependentFBOs)); highPass = getMaterial(HIGH_PASS_MATERIAL); addDesiredStateChange(new EnableMaterial(HIGH_PASS_MATERIAL.toString())); int textureSlot = 0; addDesiredStateChange(new SetInputTextureFromFBO(textureSlot, READONLY_GBUFFER, ColorTexture, displayResolutionDependentFBOs, HIGH_PASS_MATERIAL, "tex")); }
Source:
public List<BranchProperty> getPropertiesFor(SCMHead head) { List<BranchProperty> properties = new ArrayList<>(); for (Named named : namedExceptions) { if (named.isMatch(head)) { properties.addAll(named.getProps()); } } if (properties.isEmpty()) { properties.addAll(defaultProperties); } return properties; }

Target:
public List<BranchProperty> getPropertiesFor(SCMHead head) { for (Named named : namedExceptions) { if (named.isMatch(head)) { return new ArrayList<>(named.getProps()); } } return new ArrayList<>(defaultProperties); }
Source:
private static long[] byteRangeAsNullSafe(final Long[] ranges, final SupportedCipherDetails cipherDetails) { final long plaintextMax = cipherDetails.getMaximumPlaintextSizeInBytes(); final long startPos; final long endPos; if (ranges[0] == null) { startPos = 0L; } else { startPos = ranges[0]; } if (ranges[1] == null) { endPos = plaintextMax; } else { endPos = ranges[1]; } return new long[] {startPos, endPos}; }

Target:
static long[] byteRangeAsNullSafe(final Long[] ranges, final SupportedCipherDetails cipherDetails) { final long plaintextMax = cipherDetails.getMaximumPlaintextSizeInBytes(); final long startPos; final long endPos; if (ranges[0] == null) { startPos = 0L; } else { startPos = ranges[0]; } if (ranges[1] == null) { endPos = plaintextMax; } else { endPos = ranges[1]; } return new long[] {startPos, endPos}; }
Source:
public RecipientListRouter rlRouter() { RecipientListRouter router = new RecipientListRouter(); router.setRecipients( Arrays.asList(new Recipient[] { new Recipient(barChannel()), new Recipient(bazChannel()) })); router.setDefaultOutputChannel(discards()); return router; }

Target:
public RecipientListRouter rlRouter() { RecipientListRouter router = new RecipientListRouter(); router.setChannels(Arrays.asList(barChannel(), bazChannel())); router.setDefaultOutputChannel(discards()); return router; }
Source:
private static long writeContainerForSamFileHeader(final int major, final SAMFileHeader samFileHeader, final OutputStream os) throws IOException { final byte[] data = toByteArray(samFileHeader); final int length = Math.max(1024, data.length + data.length / 2); final byte[] blockContent = new byte[length]; System.arraycopy(data, 0, blockContent, 0, Math.min(data.length, length)); final Block block = Block.uncompressedFileHeaderBlock(blockContent); final Container container = new Container(); container.blockCount = 1; container.blocks = new Block[]{block}; container.landmarks = new int[0]; container.slices = new Slice[0]; container.alignmentSpan = Slice.NO_ALIGNMENT_SPAN; container.alignmentStart = Slice.NO_ALIGNMENT_START; container.bases = 0; container.globalRecordCounter = 0; container.nofRecords = 0; container.sequenceId = 0; final ExposedByteArrayOutputStream byteArrayOutputStream = new ExposedByteArrayOutputStream(); block.write(major, byteArrayOutputStream); container.containerByteSize = byteArrayOutputStream.size(); final int containerHeaderByteSize = ContainerIO.writeContainerHeader(major, container, os); os.write(byteArrayOutputStream.getBuffer(), 0, byteArrayOutputStream.size()); return containerHeaderByteSize + byteArrayOutputStream.size(); }

Target:
private static long writeContainerForSamFileHeader(final int major, final SAMFileHeader samFileHeader, final OutputStream os) throws IOException { final byte[] data = toByteArray(samFileHeader); final int length = Math.max(1024, data.length + data.length / 2); final byte[] blockContent = new byte[length]; System.arraycopy(data, 0, blockContent, 0, Math.min(data.length, length)); final Block block = Block.createRawFileHeaderBlock(blockContent); final Container container = new Container(); container.blockCount = 1; container.blocks = new Block[]{block}; container.landmarks = new int[0]; container.slices = new Slice[0]; container.alignmentSpan = Slice.NO_ALIGNMENT_SPAN; container.alignmentStart = Slice.NO_ALIGNMENT_START; container.bases = 0; container.globalRecordCounter = 0; container.nofRecords = 0; container.sequenceId = 0; final ExposedByteArrayOutputStream byteArrayOutputStream = new ExposedByteArrayOutputStream(); block.write(major, byteArrayOutputStream); container.containerByteSize = byteArrayOutputStream.size(); final int containerHeaderByteSize = ContainerIO.writeContainerHeader(major, container, os); os.write(byteArrayOutputStream.getBuffer(), 0, byteArrayOutputStream.size()); return containerHeaderByteSize + byteArrayOutputStream.size(); }
Source:
private TestSession logSessionInfo() { proxyLogger.fine("Was max sessions reached? " + (totalSessionsStarted >= maxSessionsAllowed) + " on node " + getId()); proxyLogger.fine("Was this a forcible shutdown? " + (forceShutDown) + " on node " + getId()); LOGGER.exiting(null); return null; }

Target:
private TestSession logSessionInfo() { proxyLogger.fine("Was max sessions reached? " + (totalSessionsStarted >= maxSessionsAllowed) + " on node " + getId()); proxyLogger.fine("Was this a forced shutdown? " + (forceShutDown) + " on node " + getId()); LOGGER.exiting(null); return null; }
Source:
public void testGetFirstRowItemCount_singleItemFullSpan() throws Throwable { int itemCount = 1; setUpPagedListView(itemCount); RecyclerView recyclerView = mPagedListView.getRecyclerView(); mActivityRule.runOnUiThread(() -> { ((GridLayoutManager) recyclerView.getLayoutManager()).setSpanSizeLookup( new GridLayoutManager.SpanSizeLookup() { @Override public int getSpanSize(int position) { return SPAN_COUNT; } }); }); InstrumentationRegistry.getInstrumentation().waitForIdleSync(); assertEquals(itemCount, GridLayoutManagerUtils.getFirstRowItemCount(recyclerView)); }

Target:
public void testGetFirstRowItemCount_singleItemFullSpan() throws Throwable { int itemCount = 1; setUpPagedListView(itemCount, new GridLayoutManager.SpanSizeLookup() { @Override public int getSpanSize(int position) { return SPAN_COUNT; } }); RecyclerView recyclerView = mPagedListView.getRecyclerView(); InstrumentationRegistry.getInstrumentation().waitForIdleSync(); assertEquals(itemCount, GridLayoutManagerUtils.getFirstRowItemCount(recyclerView)); }
Source:
public void marshallAsElement(AttributeDefinition attribute, ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException { if (resourceModel.hasDefined(attribute.getName()) && attribute instanceof ObjectTypeAttributeDefinition) { AttributeDefinition[] valueTypes = ((ObjectTypeAttributeDefinition) attribute).getValueTypes(); writer.writeStartElement(attribute.getXmlName()); for (AttributeDefinition valueType : valueTypes) { if(resourceModel.get(attribute.getName()).hasDefined(valueType.getName())) { ModelNode handler = resourceModel.get(attribute.getName()); if(!marshallSimpleTypeAsAttribute) { valueType.marshallAsElement(handler, marshallDefault, writer); } else { marshallAsAttribute(valueType, handler, marshallDefault, writer); } } } writer.writeEndElement(); } }

Target:
public void marshallAsElement(AttributeDefinition attribute, ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException { assert attribute instanceof ObjectTypeAttributeDefinition; if (resourceModel.hasDefined(attribute.getName())) { AttributeDefinition[] valueTypes = ((ObjectTypeAttributeDefinition) attribute).getValueTypes(); writer.writeStartElement(attribute.getXmlName()); for (AttributeDefinition valueType : valueTypes) { if(resourceModel.hasDefined(attribute.getName(), valueType.getName())) { ModelNode handler = resourceModel.get(attribute.getName()); if(marshallSimpleTypeAsElement) { valueType.marshallAsElement(handler, marshallDefault, writer); } else { marshallAsAttribute(valueType, handler, marshallDefault, writer); } } } writer.writeEndElement(); } }
Source:
private Map<String, String> extractRequestParams(HttpServletRequest httpServletRequest) { return Collections.list(httpServletRequest.getParameterNames()).stream() .filter(p -> !EXCLUDED_PARAMS.contains(p)) .collect(Collectors.toMap(Function.identity(), name -> String.join(",", httpServletRequest.getParameterValues(name)))); }

Target:
private Map<String, String> extractRequestParams(HttpServletRequest httpServletRequest) { return list(httpServletRequest.getParameterNames()).stream() .filter(p -> !EXCLUDED_PARAMS.contains(p)) .collect(Collectors.toMap(Function.identity(), name -> joinWithComma(asList(httpServletRequest.getParameterValues(name))))); }
Source:
public void testCreateOrphanBranchWithStartPoint() throws Exception { CheckoutCommand co = git.checkout().setOrphan(true) .setName("orphanbranch"); co.setStartPoint("HEAD^").call(); assertEquals(2, trash.list().length); this.assertNoHead(); this.assertStatus(1); }

Target:
public void testCreateOrphanBranchWithStartPoint() throws Exception { CheckoutCommand co = newOrphanBranchCommand(); Ref ref = co.setStartPoint("HEAD^").call(); assertCheckoutRef(ref); assertEquals(2, trash.list().length); this.assertNoHead(); this.assertRepositoryCondition(1); }
Source:
public SearchStrategy strategize(SearchQuery query) { final String strategyString = config.withOverrides(query).getSearchStrategy(); switch (strategyString) { case AutoStrategy.NAME: log.debug("Auto strategy is selected"); return new AutoStrategy(query); case IndexOnlyStrategy.NAME: log.debug("Index-only execution strategy is selected"); return new IndexOnlyStrategy(query); case CursorBasedStrategy.NAME: log.debug("Cursor-based execution strategy is selected"); return new CursorBasedStrategy(query); default: throw new ISE("Unknown strategy[%s]", strategyString); } }

Target:
public SearchStrategy strategize(SearchQuery query) { final String strategyString = config.withOverrides(query).getSearchStrategy(); switch (strategyString) { case AutoStrategy.NAME: log.debug("Auto strategy is selected, query id [%s]", query.getId()); return AutoStrategy.of(query); case UseIndexesStrategy.NAME: log.debug("Use-index strategy is selected, query id [%s]", query.getId()); return UseIndexesStrategy.of(query); case CursorOnlyStrategy.NAME: log.debug("Cursor-only strategy is selected, query id [%s]", query.getId()); return CursorOnlyStrategy.of(query); default: throw new ISE("Unknown strategy[%s], query id [%s]", strategyString, query.getId()); } }
Source:
public static EchoTagStatementTree newEchoTagStatement(SeparatedList<ExpressionTree> expressions, InternalSyntaxToken eosToken) { return new EchoTagStatementTreeImpl(expressions, eosToken); }

Target:
private static EchoTagStatementTree newEchoTagStatement(SeparatedList<ExpressionTree> expressions, InternalSyntaxToken eosToken) { return new EchoTagStatementTreeImpl(expressions, eosToken); }
Source:
public void handle(GlowSession session, PlayerAbilitiesMessage message) { GlowPlayer player = session.getPlayer(); if (!player.getAllowFlight()) { return; } boolean flying = (message.getFlags() & 0x02) != 0; PlayerToggleFlightEvent event = EventFactory.getInstance().callEvent( new PlayerToggleFlightEvent(player, flying)); if (!event.isCancelled()) { player.setFlying(flying); } }

Target:
public void handle(GlowSession session, PlayerAbilitiesMessage message) { GlowPlayer player = session.getPlayer(); boolean flyingFlag = (message.getFlags() & 0x02) != 0; boolean isFlying = player.isFlying(); boolean canFly = player.getAllowFlight(); if (isFlying != flyingFlag) { if (!flyingFlag || canFly) { PlayerToggleFlightEvent event = EventFactory.getInstance() .callEvent(new PlayerToggleFlightEvent(player, flyingFlag)); if (event.isCancelled()) { session.getServer().sendPlayerAbilities(player); } else { player.setFlying(flyingFlag); } } } }
Source:
private Preference.OnPreferenceChangeListener buildAddArticlesPreferenceChangeListener() { return new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { return true; } }; }

Target:
private Preference.OnPreferenceChangeListener buildAddArticlesPreferenceChangeListener() { return new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { String title = "Test reading list"; int listSize = Integer.valueOf(newValue.toString().trim()) > MAX_ARTICLES ? MAX_ARTICLES : Integer.valueOf(newValue.toString().trim()); createReadingList(title, listSize); return true; } }; }
Source:
public Release latest() throws IOException { return this.get( this.latest.method(Request.GET) .fetch().as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_CREATED) .as(JsonResponse.class) .json().readObject().getInt("id") ); }

Target:
public Release latest() throws IOException { return this.get( this.request.uri().path("/latest") .back().method(Request.GET) .fetch().as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_CREATED) .as(JsonResponse.class) .json().readObject().getInt("id") ); }
Source:
String loginPhase2(HttpServletRequest request, HttpServletResponse response) throws IOException { HttpPost post = new HttpPost(config.gitHubOAuthAccessTokenUrl); post.setHeader("Accept", "application/json"); List<NameValuePair> nvps = new ArrayList<>(3); nvps.add(new BasicNameValuePair("client_id", config.gitHubClientId)); nvps.add(new BasicNameValuePair("client_secret", config.gitHubClientSecret)); nvps.add(new BasicNameValuePair("code", request.getParameter("code"))); post.setEntity(new UrlEncodedFormEntity(nvps, Charsets.UTF_8)); try { HttpResponse postResponse = http.execute(post); if (postResponse.getStatusLine().getStatusCode() != HttpURLConnection.HTTP_OK) { log.error("POST " + config.gitHubOAuthAccessTokenUrl + " request for access token failed with status " + postResponse.getStatusLine()); response.sendError(HttpURLConnection.HTTP_UNAUTHORIZED, "Request for access token not authorised"); EntityUtils.consume(postResponse.getEntity()); return null; } return getAccessToken(getAccessTokenJson(postResponse)); } catch (IOException e) { log.error("POST " + config.gitHubOAuthAccessTokenUrl + " request for access token failed", e); response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Request for access token not authorised"); return null; } }

Target:
String loginPhase2(HttpServletRequest request, HttpServletResponse response) throws IOException { HttpPost post = new HttpPost(config.gitHubOAuthAccessTokenUrl); post.setHeader("Accept", "application/json"); List<NameValuePair> nvps = new ArrayList<>(3); nvps.add(new BasicNameValuePair("client_id", config.gitHubClientId)); nvps.add(new BasicNameValuePair("client_secret", config.gitHubClientSecret)); nvps.add(new BasicNameValuePair("code", request.getParameter("code"))); post.setEntity(new UrlEncodedFormEntity(nvps, Charsets.UTF_8)); try { HttpResponse postResponse = http.execute(post); if (postResponse.getStatusLine().getStatusCode() != HttpURLConnection.HTTP_OK) { log.error("POST " + config.gitHubOAuthAccessTokenUrl + " request for access token failed with status " + postResponse.getStatusLine()); response.sendError(HttpURLConnection.HTTP_UNAUTHORIZED, "Request for access token not authorized"); EntityUtils.consume(postResponse.getEntity()); return null; } return getAccessToken(getAccessTokenJson(postResponse)); } catch (IOException e) { log.error("POST " + config.gitHubOAuthAccessTokenUrl + " request for access token failed", e); response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Request for access token not authorized"); return null; } }
Source:
public Void call() throws Exception { log.tracef("Received cluster event(s) %s, notifying cluster listener with id %s", events, identifier); clusterCacheNotifier.notifyClusterListeners(events, identifier); return null; }

Target:
public Void call() throws Exception { if (log.isTraceEnabled()) { log.tracef("Received cluster event(s) %s, notifying cluster listener with id %s", events, identifier); } clusterCacheNotifier.notifyClusterListeners(events, identifier); return null; }
Source:
public RouterSpec<R> subFlowMapping(String key, IntegrationFlow subFlow) { Assert.hasText(key); Assert.notNull(subFlow); Assert.state(!(StringUtils.hasText(this.prefix) || StringUtils.hasText(this.suffix)), "The 'prefix'('suffix') and 'subFlowMapping' are mutually exclusive"); DirectChannel channel = new DirectChannel(); this.subFlows.add(channel); IntegrationFlowBuilder flowBuilder = IntegrationFlows.from(channel); subFlow.accept(flowBuilder); this.subFlows.add(flowBuilder.get()); if (this.mappingProvider == null) { this.mappingProvider = new RouterSubFlowMappingProvider(this.target); this.subFlows.add(this.mappingProvider); } this.mappingProvider.addMapping(key, channel); return _this(); }

Target:
public RouterSpec<R> subFlowMapping(String key, IntegrationFlow subFlow) { Assert.hasText(key); Assert.notNull(subFlow); Assert.state(!(StringUtils.hasText(this.prefix) || StringUtils.hasText(this.suffix)), "The 'prefix'('suffix') and 'subFlowMapping' are mutually exclusive"); DirectChannel channel = new DirectChannel(); IntegrationFlowBuilder flowBuilder = IntegrationFlows.from(channel); subFlow.accept(flowBuilder); this.subFlows.add(flowBuilder); if (this.mappingProvider == null) { this.mappingProvider = new RouterSubFlowMappingProvider(this.target); this.subFlows.add(this.mappingProvider); } this.mappingProvider.addMapping(key, channel); return _this(); }
Source:
public void createNewVertex(VKmer createdVertexId, NeighborInfo reverseNeighborInfo, NeighborInfo forwardNeighborInfo) { @SuppressWarnings({ "rawtypes", "unchecked" }) Vertex<VKmer, VertexValueWritable, NullWritable, SplitRepeatMessage> newVertex = (Vertex) BspUtils .createVertex(getContext().getConfiguration()); VertexValueWritable vertexValue = new VertexValueWritable(); vertexValue.getEdgeMap(reverseNeighborInfo.et).put(reverseNeighborInfo.kmer, new ReadIdSet(reverseNeighborInfo.readIds)); vertexValue.getEdgeMap(forwardNeighborInfo.et).put(forwardNeighborInfo.kmer, new ReadIdSet(forwardNeighborInfo.readIds)); vertexValue.setInternalKmer(getVertexId()); newVertex.setVertexId(createdVertexId); newVertex.setVertexValue(vertexValue); addVertex(createdVertexId, newVertex); }

Target:
public void createNewVertex(VKmer createdVertexId, NeighborInfo reverseNeighborInfo, NeighborInfo forwardNeighborInfo) { Vertex<VKmer, VertexValueWritable, NullWritable, SplitRepeatMessage> newVertex = BspUtils .createVertex(getContext().getConfiguration()); VertexValueWritable vertexValue = new VertexValueWritable(); vertexValue.getEdgeMap(reverseNeighborInfo.et).put(reverseNeighborInfo.kmer, new ReadIdSet(reverseNeighborInfo.readIds)); vertexValue.getEdgeMap(forwardNeighborInfo.et).put(forwardNeighborInfo.kmer, new ReadIdSet(forwardNeighborInfo.readIds)); vertexValue.setInternalKmer(getVertexId()); newVertex.setVertexId(createdVertexId); newVertex.setVertexValue(vertexValue); addVertex(createdVertexId, newVertex); }
Source:
List<AqlSearchResult.SearchEntry> SearchByFileSpec(FileSpec file) throws IOException { List<AqlSearchResult.SearchEntry> results = null; AqlHelperBase aqlHelper = new AqlHelperBase(client, log); log.info("Searching for artifacts..."); switch (file.getSpecType()) { case PATTERN: { aqlHelper = new PatternAqlHelper(client, log); break; } case BUILD: { aqlHelper = new BuildAqlHelper(client, log); break; } case AQL: { break; } } aqlHelper.convertFileSpecToAql(file); results = aqlHelper.run(); results = (results == null ? new ArrayList<>() : results); log.info(String.format("Found %s artifacts.", results.size())); return results; }

Target:
List<AqlSearchResult.SearchEntry> SearchByFileSpec(FileSpec file) throws IOException { List<AqlSearchResult.SearchEntry> results = null; AqlHelperBase aqlHelper = null; log.info("Searching for artifacts..."); switch (file.getSpecType()) { case PATTERN: { aqlHelper = new PatternAqlHelper(client, log, file); break; } case BUILD: { aqlHelper = new BuildAqlHelper(client, log, file); break; } case AQL: { aqlHelper = new AqlHelperBase(client, log, file); break; } } results = aqlHelper.run(); log.info(String.format("Found %s artifacts.", results.size())); return results; }
Source:
private static String makeStateFuncFullName(String stateFuncSimpleName, DataType stateType, List<DataType> argumentTypes) { List<DataType> args = Lists.newArrayList(stateType); args.addAll(argumentTypes); return fullFunctionName(stateFuncSimpleName, args); }

Target:
private static String makeStateFuncFullName(String stateFuncSimpleName, DataType stateType, List<DataType> argumentTypes) { List<DataType> args = Lists.newArrayList(stateType); args.addAll(argumentTypes); return Metadata.fullFunctionName(stateFuncSimpleName, args); }
Source:
void restOfInit(IClientConfig clientConfig) { refeshIntervalMills = Integer.parseInt(clientConfig.getProperty( CommonClientConfigKey.ServerListRefreshInterval, LISTOFSERVERS_CACHE_REPEAT_INTERVAL).toString()); boolean primeConnection = this.isEnablePrimingConnections(); this.setEnablePrimingConnections(false); enableAndInitLearnNewServersFeature(); updateListOfServers(); if (primeConnection && this.getPrimeConnections() != null) { this.getPrimeConnections() .primeConnections(getServerList(true)); } this.setEnablePrimingConnections(primeConnection); }

Target:
void restOfInit(IClientConfig clientConfig) { refeshIntervalMills =clientConfig.get(CommonClientConfigKey.ServerListRefreshInterval, LISTOFSERVERS_CACHE_REPEAT_INTERVAL); boolean primeConnection = this.isEnablePrimingConnections(); this.setEnablePrimingConnections(false); enableAndInitLearnNewServersFeature(); updateListOfServers(); if (primeConnection && this.getPrimeConnections() != null) { this.getPrimeConnections() .primeConnections(getServerList(true)); } this.setEnablePrimingConnections(primeConnection); }
Source:
public void onShutdownRequest() { log.info("Shutting down (when running in rest-api dev mode)..."); if (server!=null) { try { server.stop(); server.join(); } catch (Exception e) { log.debug("Stopping server gave an error (not usually a concern): "+e); } } if (mgmt instanceof ManagementContextInternal) { ((ManagementContextInternal)mgmt).terminate(); } }

Target:
public void onShutdownRequest() { log.info("Shutting down server (when running in rest-api dev mode, using background thread)"); new Thread(new Runnable() { public void run() { Time.sleep(Duration.millis(250)); log.debug("Shutting down server in background thread, closing "+server+" and "+mgmt); if (server!=null) { try { server.stop(); server.join(); } catch (Exception e) { log.debug("Stopping server gave an error (not usually a concern): "+e); } } if (mgmt instanceof ManagementContextInternal) { ((ManagementContextInternal)mgmt).terminate(); } } }).start(); }
Source:
public <T> T withRepository(final RepositoryCallback<T> callable) throws IOException, InterruptedException { return workspace.act(new MasterToSlaveFileCallable<T>() { @Override public T invoke(File f, VirtualChannel channel) throws IOException, InterruptedException { final Repository repository = new RepositoryBuilder().setWorkTree(f).build(); return callable.invoke(repository, channel); } }); }

Target:
public <T> T withRepository(final RepositoryCallback<T> callable) throws IOException, InterruptedException { return workspace.act(new WithRepository<>(callable)); }
Source:
private Object getBindableBean(String boundElementName) { try { if (!this.boundElements.containsKey(boundElementName)) { this.boundElements.put(boundElementName, this.applicationContext.getBean(boundElementName)); } return this.boundElements.get(boundElementName); } catch (NoSuchBeanDefinitionException e) { throw new IllegalStateException("Target bean doesn't exist for the bound element name: " + boundElementName); } }

Target:
private Object getBindableBean(String boundElementName) { try { if (!this.boundElements.containsKey(boundElementName)) { this.boundElements.put(boundElementName, this.applicationContext.getBean(boundElementName)); } return this.boundElements.get(boundElementName); } catch (NoSuchBeanDefinitionException e) { throw new IllegalStateException(TARGET_BEAN_NOT_EXISTS + ": " + boundElementName, e); } }
Source:
private void rebuildIndexes(String dataTable, Configuration conf) { String schema = SchemaUtil.getSchemaNameFromFullName(dataTable); String table = SchemaUtil.getTableNameFromFullName(dataTable); for(String index: rebuildMap.get(dataTable)) { String outFile = "/tmp/index_rebuild_"+index+"_" + UUID.randomUUID().toString(); String indexName = SchemaUtil.getTableNameFromFullName(index); conf.set(QueryServices.TRANSACTIONS_ENABLED, Boolean.TRUE.toString()); indexingTool.setConf(conf); String args = {"-s", schema, "-dt", table, "-it", indexName, "-direct", "-runfg", "-op", outFile}; try { LOGGER.info("Rebuilding index "+ index); if(!dryRun) { indexingTool.run(args); } } catch (Exception e) { LOGGER.severe("Something went wrong while building the index "+ index +" "+e); } } }

Target:
private int rebuildIndexes(String dataTable, Configuration conf) { String schema = SchemaUtil.getSchemaNameFromFullName(dataTable); String table = SchemaUtil.getTableNameFromFullName(dataTable); for(Map.Entry<String, String> indexMap : rebuildMap.get(dataTable).entrySet()) { String index = indexMap.getKey(); String tenantId = indexMap.getValue(); String indexName = SchemaUtil.getTableNameFromFullName(index); String outFile = "/tmp/index_rebuild_" + indexName + (tenantId.equals(GLOBAL_INDEX_ID)?"":"_"+tenantId) +"_"+ UUID.randomUUID().toString(); String[] args = { "-s", schema, "-dt", table, "-it", indexName, "-direct", "-op", outFile }; indexingTool.setConf(conf); List<String> list = Arrays.asList(args); if (!tenantId.equals(GLOBAL_INDEX_ID)) { list.add("-tenant"); list.add(tenantId); } if (syncRebuild) { list.add("-runfg"); } args = list.toArray(new String[list.size()]); try { LOGGER.info("Rebuilding index " + indexName); if (!dryRun) { indexingTool.run(args); } } catch (Exception e) { LOGGER.severe("Something went wrong while building the index " + index + " " + e); return -1; } } return 0; }
Source:
public static int indexBitLength(int numberOfBuckets) { Preconditions.checkArgument(isPowerOf2(numberOfBuckets), "numberOfBuckets must be a power of 2, actual: %s", numberOfBuckets); return 31 - Integer.numberOfLeadingZeros(numberOfBuckets); }

Target:
public static int indexBitLength(int numberOfBuckets) { Preconditions.checkArgument(isPowerOf2(numberOfBuckets), "numberOfBuckets must be a power of 2, actual: %s", numberOfBuckets); return Integer.numberOfTrailingZeros(numberOfBuckets); }
Source:
public boolean isOpen() { return this.eventSink.isClosed(); }

Target:
public boolean isOpen() { synchronized (openLock) { return !eventSink.isClosed(); } }
Source:
public void launchesTerminated(ILaunch[] launches) { for (ILaunch launch : launches) { if (launch.equals(fLaunch)) { setEnabled(false); DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this); } } }

Target:
public void launchesTerminated(ILaunch[] launches) { for (ILaunch launch : launches) { if (launch.equals(fLaunch)) { setEnabled(false); DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this); break; } } }
Source:
public Set<SamplingUnit> getQueryEnabledRollups(final String metricName) { final Set<SamplingUnit> disabledUnits = queryBlacklistEntry(metricName) .map(RollupQueryBlacklistEntry::getPeriods) .orElse(ImmutableSet.of()); if (disabledUnits.isEmpty()) { return ALL_SAMPLING_UNITS; } return ALL_SAMPLING_UNITS .stream() .filter(unit -> !disabledUnits.contains(unit)) .collect(ImmutableSet.toImmutableSet()); }

Target:
public Set<SamplingUnit> getQueryEnabledRollups(final String metricName) { return queryWhitelistEntry(metricName) .map(RollupQueryWhitelistEntry::getPeriods) .orElse(ImmutableSet.of()); }