auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public DrmSession<T> acquireSession(Looper playbackLooper, DrmInitData drmInitData) { Assertions.checkState(this.playbackLooper == null || this.playbackLooper == playbackLooper); if (++openCount != 1) { return this; } if (this.playbackLooper == null) { this.playbackLooper = playbackLooper; mediaDrmHandler = new MediaDrmHandler(playbackLooper); postResponseHandler = new PostResponseHandler(playbackLooper); } requestHandlerThread = new HandlerThread("DrmRequestHandler"); requestHandlerThread.start(); postRequestHandler = new PostRequestHandler(requestHandlerThread.getLooper()); if (offlineLicenseKeySetId == null) { SchemeData schemeData = drmInitData.get(uuid); if (schemeData == null) { onError(new IllegalStateException("Media does not support uuid: " + uuid)); return this; } schemeInitData = schemeData.data; schemeMimeType = schemeData.mimeType; if (Util.SDK_INT < 21) { byte[] psshData = PsshAtomUtil.parseSchemeSpecificData(schemeInitData, C.WIDEVINE_UUID); if (psshData == null) { } else { schemeInitData = psshData; } } if (C.CENC_UUID.equals(uuid) && MimeTypes.VIDEO_MP4.equals(schemeMimeType)) { if (Util.SDK_INT < 19 || !MediaDrm.isCryptoSchemeSupported(uuid, MimeTypes.VIDEO_MP4)) { schemeMimeType = CENC_INIT_DATA_FORMAT; } } } state = STATE_OPENING; openInternal(true); return this; }

Target:
public DrmSession<T> acquireSession(Looper playbackLooper, DrmInitData drmInitData) { Assertions.checkState(this.playbackLooper == null || this.playbackLooper == playbackLooper); if (++openCount != 1) { return this; } if (this.playbackLooper == null) { this.playbackLooper = playbackLooper; mediaDrmHandler = new MediaDrmHandler(playbackLooper); postResponseHandler = new PostResponseHandler(playbackLooper); } requestHandlerThread = new HandlerThread("DrmRequestHandler"); requestHandlerThread.start(); postRequestHandler = new PostRequestHandler(requestHandlerThread.getLooper()); if (offlineLicenseKeySetId == null) { SchemeData schemeData = drmInitData.get(uuid); if (schemeData == null) { onError(new IllegalStateException("Media does not support uuid: " + uuid)); return this; } schemeInitData = schemeData.data; schemeMimeType = schemeData.mimeType; if (Util.SDK_INT < 21) { byte[] psshData = PsshAtomUtil.parseSchemeSpecificData(schemeInitData, C.WIDEVINE_UUID); if (psshData == null) { } else { schemeInitData = psshData; } } if (C.CENC_UUID.equals(uuid)) { if (MimeTypes.VIDEO_MP4.equals(schemeMimeType) || MimeTypes.AUDIO_MP4.equals( schemeMimeType)) { if (Util.SDK_INT >= 26) { } else if (Util.SDK_INT == 25 && !MediaDrm.isCryptoSchemeSupported(uuid, schemeMimeType)) { schemeMimeType = CENC_INIT_DATA_FORMAT; } else if (Util.SDK_INT <= 24) { schemeMimeType = CENC_INIT_DATA_FORMAT; } } } } state = STATE_OPENING; openInternal(true); return this; }
Source:
public boolean equals(Object o) { if (o instanceof SLADueDate) { SLADueDate other = (SLADueDate) o; return (null != value) ? value.equals(other.value) : null == other.value; } return false; }

Target:
public boolean equals(Object o) { if (o instanceof SLADueDate) { SLADueDate other = (SLADueDate) o; return Objects.equals(value, other.value); } return false; }
Source:
private Charset getCharset(FileStatement fileStatement) { final Charset charset; if (fileStatement.getCharset() != null) { final Object charsetValue = doSwitch(fileStatement.getCharset()); if (charsetValue != null) { final String charsetString = toString(charsetValue); Charset defaultCharset = Charset.forName("UTF-8"); try { defaultCharset = Charset.forName(charsetString); } catch (IllegalCharsetNameException | UnsupportedCharsetException e) { final BasicDiagnostic diagnostic = new BasicDiagnostic(Diagnostic.WARNING, ID, 0, e .getMessage() + " fallback to UTF-8", new Object[] {fileStatement.getUrl(), new HashMap<String, Object>(peekVariables()) }); environment.getGenerationResult().addDiagnostic(diagnostic); } charset = defaultCharset; } else { final BasicDiagnostic diagnostic = new BasicDiagnostic(Diagnostic.WARNING, ID, 0, "The Charset can't be null, fallback to UTF-8", new Object[] {fileStatement.getUrl(), new HashMap<String, Object>(peekVariables()) }); environment.getGenerationResult().addDiagnostic(diagnostic); charset = Charset.forName("UTF-8"); } } else { charset = Charset.forName("UTF-8"); } return charset; }

Target:
private Charset getCharset(FileStatement fileStatement) { final Charset charset; if (fileStatement.getCharset() != null) { final Object charsetValue = doSwitch(fileStatement.getCharset()); if (charsetValue != null) { final String charsetString = toString(charsetValue); Charset defaultCharset = StandardCharsets.UTF_8; try { defaultCharset = Charset.forName(charsetString); } catch (IllegalCharsetNameException | UnsupportedCharsetException e) { final BasicDiagnostic diagnostic = new BasicDiagnostic(Diagnostic.WARNING, ID, 0, e .getMessage() + " fallback to UTF-8", new Object[] {fileStatement.getUrl(), new HashMap<String, Object>(peekVariables()) }); environment.getGenerationResult().addDiagnostic(diagnostic); } charset = defaultCharset; } else { final BasicDiagnostic diagnostic = new BasicDiagnostic(Diagnostic.WARNING, ID, 0, "The Charset can't be null, fallback to UTF-8", new Object[] {fileStatement.getUrl(), new HashMap<String, Object>(peekVariables()) }); environment.getGenerationResult().addDiagnostic(diagnostic); charset = StandardCharsets.UTF_8; } } else { charset = StandardCharsets.UTF_8; } return charset; }
Source:
public WriteOperation<?> createWriteOperation() { return null; }

Target:
public WriteOperation<?> createWriteOperation() { return new MarkLogicWriteOperation(); }
Source:
public void runWebConnectivity() { final CountDownLatch signal = new CountDownLatch(1); boolean submitted = false; String report_id_1 = "r1"; String report_id_2 = "r2"; OONIMKTask task = null; Settings settings = new Settings(c, a.getPreferenceManager()); Gson gson = a.getGson(); settings.name = MK_NAME; settings.inputs = Collections.singletonList("<LINK_0>"); settings.options.max_runtime = 10; settings.annotations.origin = TAG; settings.options.no_collector = false; settings.options.probe_services_base_url = CLIENT_URL; try { task = Engine.startExperimentTask(settings.toExperimentSettings(gson, c)); } catch (Exception exc) { Assert.fail(); signal.countDown(); } while (!task.isDone()){ try { String json = task.waitForNextEvent(); Log.d(TAG, json); EventResult event = gson.fromJson(json, EventResult.class); switch (event.key) { case "status.report_create": report_id_1 = event.value.report_id; break; case "measurement": JsonResult jr = gson.fromJson(event.value.json_str, JsonResult.class); Assert.assertNotNull(jr); report_id_2 = jr.report_id; if (jr.test_keys.blocking == null) { Assert.fail(); signal.countDown(); } break; case "failure.report_create": case "failure.measurement_submission": case "failure.startup": Assert.fail(); signal.countDown(); break; case "status.measurement_submission": submitted = true; break; default: Log.w(UNUSED_KEY, event.key); break; } } catch (Exception ignored) { } } Assert.assertEquals(report_id_1, report_id_2); Assert.assertTrue(submitted); signal.countDown(); }

Target:
public void runWebConnectivity() { boolean submitted = false; String report_id_1 = "r1"; String report_id_2 = "r2"; OONIMKTask task = null; Settings settings = new Settings(c, a.getPreferenceManager()); Gson gson = a.getGson(); settings.name = EXPERIMENT_NAME; settings.inputs = Collections.singletonList("<LINK_0>"); settings.options.max_runtime = 10; settings.annotations.origin = TAG; settings.options.no_collector = false; settings.options.probe_services_base_url = CLIENT_URL; try { task = Engine.startExperimentTask(settings.toExperimentSettings(gson, c)); } catch (Exception exc) { Assert.fail(); } while (!task.isDone()){ try { String json = task.waitForNextEvent(); Log.d(TAG, json); EventResult event = gson.fromJson(json, EventResult.class); switch (event.key) { case "status.report_create": report_id_1 = event.value.report_id; break; case "measurement": JsonResult jr = gson.fromJson(event.value.json_str, JsonResult.class); Assert.assertNotNull(jr); report_id_2 = jr.report_id; if (jr.test_keys.blocking == null) { Assert.fail(); } break; case "failure.report_create": case "failure.measurement_submission": case "failure.startup": Assert.fail(); break; case "status.measurement_submission": submitted = true; break; default: Log.w(UNUSED_KEY, event.key); break; } } catch (Exception ignored) { } } Assert.assertEquals(report_id_1, report_id_2); Assert.assertTrue(submitted); }
Source:
public void run() { if (checkAndReportInvalidState()) { return; } if (permissions != null) { notifyCallbackWithSuccess(permissions); } else { loadingPermissions = permissionRealm.where(Permission.class).findAllAsync(); loadingPermissions.addChangeListener(new RealmChangeListener <RealmResults<Permission>>() { @Override public void onChange(RealmResults <Permission> loadedPermissions) { loadingPermissions.removeChangeListener(this); if (checkAndReportInvalidState()) { return; } if (permissions == null) { permissions = loadedPermissions; } notifyCallbackWithSuccess(permissions); } }); } }

Target:
public void run() { if (checkAndReportInvalidState()) { return; } if (permissions != null) { notifyCallbackWithSuccess(permissions); } else { loadingPermissions = permissionRealm.where(Permission.class).findAllAsync(); loadingPermissions.addChangeListener(new RealmChangeListener <RealmResults<Permission>>() { @Override public void onChange(RealmResults <Permission> loadedPermissions) { if (loadedPermissions.size() > 0) { loadingPermissions.removeChangeListener(this); if (checkAndReportInvalidState()) { return; } if (permissions == null) { permissions = loadedPermissions; } notifyCallbackWithSuccess(permissions); } } }); } }
Source:
public void before() { InMemoryState state = new InMemoryState(); PersistedCassandraFrameworkConfiguration config = new PersistedCassandraFrameworkConfiguration( state, "name", 60, 30, "2.1", 0.5, 1024, 1024, 512, 1, 1, "role", "", false, true, "RACK1", "DC1", Arrays.asList(ExternalDc.newBuilder() .setName("dc") .setUrl("http://dc") .setSeedFetchTime(-SeedManager.FETCH_PERIOD) .build()) ); seedManager = new SeedManager(config) { @Override protected JsonNode fetchJson(String url) { try { return new ObjectMapper().readTree(jsonResponse); } catch (IOException e) { e.printStackTrace(); return null; } } }; }

Target:
public void before() { InMemoryState state = new InMemoryState(); PersistedCassandraFrameworkConfiguration config = new PersistedCassandraFrameworkConfiguration( state, "name", 60, 30, "2.1", 0.5, 1024, 1024, 512, 1, 1, "role", "", false, true, "RACK1", "DC1", Arrays.asList(ExternalDc.newBuilder() .setName("dc") .setUrl("http://dc") .build()) ); seedManager = new SeedManager(config, new ObjectMapper(), new SystemClock()) { @Override @Nullable protected JsonNode fetchJson(@NotNull final String url) { try { return new ObjectMapper().readTree(jsonResponse); } catch (IOException e) { e.printStackTrace(); return null; } } }; }
Source:
public ResponseEntity<String> searchConcepts(@RequestParam("searchTerm") String searchTerm) { ConceptpowerReply reply = connector.search(searchTerm, POS.NOUN); List<ConceptEntry> conceptList = reply.getConceptEntry(); reply = connector.search(searchTerm, POS.VERB); conceptList.addAll(reply.getConceptEntry()); reply = connector.search(searchTerm, POS.ADJECTIVE); conceptList.addAll(reply.getConceptEntry()); reply = connector.search(searchTerm, POS.ADVERB); conceptList.addAll(reply.getConceptEntry()); List<JSONObject> jsonResults = new ArrayList<JSONObject>(); CopyOnWriteArrayList<ConceptEntry> cowConceptList = new CopyOnWriteArrayList<>(conceptList); Iterator<ConceptEntry> conceptIterator = cowConceptList.iterator(); if (conceptList != null) { while (conceptIterator.hasNext()) { ConceptEntry result = conceptIterator.next(); try { JSONObject jsonResult = new JSONObject(); jsonResult.put("id", result.getId()); jsonResult.put("name", result.getLemma()); jsonResult.put("description", result.getDescription()); jsonResult.put("pos", result.getPos()); jsonResult.put("type", result.getType()); jsonResults.add(jsonResult); } catch (JSONException e) { logger.error("Json exception while adding the results", e); } } } JSONObject jsonResponse = new JSONObject(); try { jsonResponse.put("terms", jsonResults); } catch (JSONException e) { return new ResponseEntity<String>("{'error':'" + e.getMessage() + "'}", HttpStatus.INTERNAL_SERVER_ERROR); } return new ResponseEntity<String>(jsonResponse.toString(), HttpStatus.OK); }

Target:
public ResponseEntity<String> searchConcepts(@RequestParam("searchTerm") String searchTerm) { ConceptpowerReply reply = connector.search(searchTerm, POS.NOUN); List<ConceptEntry> conceptList = reply.getConceptEntry(); reply = connector.search(searchTerm, POS.VERB); conceptList.addAll(reply.getConceptEntry()); reply = connector.search(searchTerm, POS.ADJECTIVE); conceptList.addAll(reply.getConceptEntry()); reply = connector.search(searchTerm, POS.ADVERB); conceptList.addAll(reply.getConceptEntry()); List<JSONObject> jsonResults = new ArrayList<JSONObject>(); if (conceptList != null) { for (ConceptEntry result : conceptList) { try { JSONObject jsonResult = new JSONObject(); jsonResult.put("id", result.getId()); jsonResult.put("name", result.getLemma()); jsonResult.put("description", result.getDescription()); jsonResult.put("pos", result.getPos()); jsonResult.put("type", result.getType()); jsonResults.add(jsonResult); } catch (JSONException e) { logger.error("Json exception while adding the results", e); } } } JSONObject jsonResponse = new JSONObject(); try { jsonResponse.put("terms", jsonResults); } catch (JSONException e) { return new ResponseEntity<String>("{'error':'" + e.getMessage() + "'}", HttpStatus.INTERNAL_SERVER_ERROR); } return new ResponseEntity<String>(jsonResponse.toString(), HttpStatus.OK); }
Source:
protected void done() { mFieldController.onDone(); boolean bChangeToText = false; if (mField.getType() == EFieldType.IMAGE) { if (mField.getImagePath() == null) { bChangeToText = true; } if (!bChangeToText) { File f = new File(mField.getImagePath()); if (!f.exists()) { bChangeToText = true; } long length = f.length(); if (length > 1024 * 1024) { showCropDialog((float) (1.0 * length / (1024 * 1024))); return; } } } else if (mField.getType() == EFieldType.AUDIO) { if (mField.getAudioPath() == null) { bChangeToText = true; } if (!bChangeToText) { File f = new File(mField.getAudioPath()); if (!f.exists()) { bChangeToText = true; } } } if (bChangeToText) { mField = new TextField(); } saveAndExit(); }

Target:
protected void done() { mFieldController.onDone(); boolean bChangeToText = false; if (mField.getType() == EFieldType.IMAGE) { if (mField.getImagePath() == null) { bChangeToText = true; } if (!bChangeToText) { File f = new File(mField.getImagePath()); if (!f.exists()) { bChangeToText = true; } long length = f.length(); if (length > sImageLimit) { String size = Formatter.formatFileSize(this, length); Uri uri = FileProvider.getUriForFile(this, getPackageName() + ".apkgfileprovider", f); showCropDialog(size, uri); return; } } } else if (mField.getType() == EFieldType.AUDIO_RECORDING) { if (mField.getAudioPath() == null) { bChangeToText = true; } if (!bChangeToText) { File f = new File(mField.getAudioPath()); if (!f.exists()) { bChangeToText = true; } } } if (bChangeToText) { mField = new TextField(); } saveAndExit(); }
Source:
public boolean hasNext() { if (last != null) return true; while (super.hasNext()) { last = super.next(); if (last.getName().equals(name)) { return true; } else { last = null; } } return false; }

Target:
public boolean hasNext() { if (last != null) return true; while (super.hasNext()) { last = super.next(); if (last.getName().equals(name)) return true; last = null; } return false; }
Source:
protected boolean canDoAction() { boolean retVal = super.canDoAction(); if (retVal) { StoragePool storagePool = DbFacade.getInstance().getStoragePoolDao().getForVds(getParameters().getVdsId()); if (storagePool == null) { addCanDoActionMessage(VdcBllMessages.NETWORK_CLUSTER_HAVE_NOT_EXISTING_DATA_CENTER_NETWORK); retVal = false; } else { setStoragePool(storagePool); } if (retVal && (getStorageDomain().getStorageDomainType() == StorageDomainType.Data || getStorageDomain().getStorageDomainType() == StorageDomainType.ISO) && storagePool.getStorageType() != StorageType.LOCALFS) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_IS_NOT_LOCAL); retVal = false; } if (retVal && storagePool.getstatus() != StoragePoolStatus.Uninitialized) { retVal = checkMasterDomainIsUp(); } if (retVal && this.getVds().getVdsType() == VDSType.oVirtNode) { StorageServerConnections conn = DbFacade.getInstance().getStorageServerConnectionDao().get(getParameters().getStorageDomain() .getStorage()); String rhevhLocalFSPath = Config.<String> GetValue(ConfigValues.RhevhLocalFSPath); if (!conn.getconnection().equals(rhevhLocalFSPath)) { addCanDoActionMessage(VdcBllMessages.RHEVH_LOCALFS_WRONG_PATH_LOCATION); addCanDoActionMessage(String.format("$path %1$s", rhevhLocalFSPath)); retVal = false; } } } return retVal; }

Target:
protected boolean canDoAction() { boolean retVal = super.canDoAction(); if (retVal) { StoragePool storagePool = DbFacade.getInstance().getStoragePoolDao().getForVds(getParameters().getVdsId()); if (storagePool == null) { addCanDoActionMessage(VdcBllMessages.NETWORK_CLUSTER_HAVE_NOT_EXISTING_DATA_CENTER_NETWORK); retVal = false; } else { setStoragePool(storagePool); } if (retVal && getStorageDomain().getStorageType() == StorageType.LOCALFS && storagePool.getStorageType() != StorageType.LOCALFS) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_IS_NOT_LOCAL); retVal = false; } if (retVal && storagePool.getstatus() != StoragePoolStatus.Uninitialized) { retVal = checkMasterDomainIsUp(); } if (retVal && this.getVds().getVdsType() == VDSType.oVirtNode) { StorageServerConnections conn = DbFacade.getInstance().getStorageServerConnectionDao().get(getParameters().getStorageDomain() .getStorage()); String rhevhLocalFSPath = Config.<String> GetValue(ConfigValues.RhevhLocalFSPath); if (!conn.getconnection().equals(rhevhLocalFSPath)) { addCanDoActionMessage(VdcBllMessages.RHEVH_LOCALFS_WRONG_PATH_LOCATION); addCanDoActionMessage(String.format("$path %1$s", rhevhLocalFSPath)); retVal = false; } } } return retVal; }
Source:
public void testGhostRendering() { GwtMockito.useProviderForType(Group.class, clazz -> ghostGroup); doReturn(new HashSet<>(Arrays.asList(container, expressionGrid))).when(gridLayer).getGridWidgets(); doReturn(ghostRectangle).when(gridLayer).getGhostRectangle(); when(expressionGrid.isSelected()).thenReturn(true); gridLayer.doBatch(); verify(ghostRectangle).setWidth(eq(CONTAINER_WIDTH + BaseExpressionGridTheme.STROKE_WIDTH)); verify(ghostRectangle).setHeight(eq(CONTAINER_HEIGHT + BaseExpressionGridTheme.STROKE_WIDTH)); verify(ghostGroup).setX(CONTAINER_X + VIEWPORT_TRANSLATE_X); verify(ghostGroup).setY(CONTAINER_Y + VIEWPORT_TRANSLATE_Y); verify(ghostGroup).setPathClipper(any(InverseGridWidgetClipper.class)); verify(ghostGroup).add(ghostRectangle); verify(ghostGroup).drawWithTransforms(eq(context2D), anyDouble(), any(BoundingBox.class)); }

Target:
public void testGhostRendering() { GwtMockito.useProviderForType(Group.class, clazz -> ghostGroup); doReturn(new HashSet<>(Arrays.asList(container, expressionGrid))).when(gridLayer).getGridWidgets(); doReturn(ghostRectangle).when(gridLayer).getGhostRectangle(); when(expressionGrid.isSelected()).thenReturn(true); gridLayer.doBatch(); verify(ghostRectangle).setWidth(eq(CONTAINER_WIDTH + BaseExpressionGridTheme.STROKE_WIDTH)); verify(ghostRectangle).setHeight(eq(CONTAINER_HEIGHT + BaseExpressionGridTheme.STROKE_WIDTH)); verify(ghostRectangle).setFillColor(ColorName.WHITE); verify(ghostRectangle).setAlpha(0.50); verify(ghostRectangle).setListening(false); verify(ghostGroup).setX(CONTAINER_X + VIEWPORT_TRANSLATE_X); verify(ghostGroup).setY(CONTAINER_Y + VIEWPORT_TRANSLATE_Y); verify(ghostGroup).setPathClipper(any(InverseGridWidgetClipper.class)); verify(ghostGroup).add(ghostRectangle); verify(ghostGroup).drawWithTransforms(eq(context2D), anyDouble(), any(BoundingBox.class)); }
Source:
private static void initCustomAbilities() { final String METHOD_NAME = "initCustomAbilities()"; customAbilities = new ArrayList<>(); Document xmlDoc = null; try { InputStream is = new FileInputStream("data/universe/customspa.xml"); DocumentBuilder db = MekHqXmlUtil.newUnsafeDocumentBuilder(); xmlDoc = db.parse(is); is.close(); } catch (Exception ex) { MekHQ.getLogger().error(CustomOption.class, METHOD_NAME, ex); } Element spaEle = xmlDoc.getDocumentElement(); NodeList nl = spaEle.getChildNodes(); spaEle.normalize(); for (int x = 0; x < nl.getLength(); x++) { Node wn = nl.item(x); if (wn.getParentNode() != spaEle) continue; int xc = wn.getNodeType(); if (xc == Node.ELEMENT_NODE) { String xn = wn.getNodeName(); if (xn.equalsIgnoreCase("option")) { CustomOption option = CustomOption.generateInstanceFromXML(wn); if (null != option) { customAbilities.add(option); } } } } }

Target:
private static void initCustomAbilities() { final String METHOD_NAME = "initCustomAbilities()"; customAbilities = new ArrayList<>(); Document xmlDoc = null; try (InputStream is = new FileInputStream("data/universe/customspa.xml")) { DocumentBuilder db = MekHqXmlUtil.newUnsafeDocumentBuilder(); xmlDoc = db.parse(is); } catch (Exception ex) { MekHQ.getLogger().error(CustomOption.class, METHOD_NAME, ex); } Element spaEle = xmlDoc.getDocumentElement(); NodeList nl = spaEle.getChildNodes(); spaEle.normalize(); for (int x = 0; x < nl.getLength(); x++) { Node wn = nl.item(x); if (wn.getParentNode() != spaEle) continue; int xc = wn.getNodeType(); if (xc == Node.ELEMENT_NODE) { String xn = wn.getNodeName(); if (xn.equalsIgnoreCase("option")) { CustomOption option = CustomOption.generateInstanceFromXML(wn); if (null != option) { customAbilities.add(option); } } } } }
Source:
public void shouldGetPreferences() throws Exception { Ruleset ruleset = rulesetService.getById(1); List<DocStructTypeInterface> docStructTypeInterfaces = rulesetService.getPreferences(ruleset).getAllDocStructTypes(); int actual = docStructTypeInterfaces.size(); assertEquals("Size of docstruct types in ruleset file is incorrect!", 2, actual); String firstName = docStructTypeInterfaces.get(0).getName(); assertEquals("Name of first docstruct type in ruleset file is incorrect!", "Acknowledgment", firstName); String secondName = docStructTypeInterfaces.get(1).getName(); assertEquals("Name of first docstruct type in ruleset file is incorrect!", "Article", secondName); }

Target:
public void shouldGetPreferences() throws Exception { Ruleset ruleset = rulesetService.getById(1); List<DocStructTypeInterface> docStructTypes = rulesetService.getPreferences(ruleset).getAllDocStructTypes(); int actual = docStructTypes.size(); assertEquals("Size of docstruct types in ruleset file is incorrect!", 2, actual); String firstName = docStructTypes.get(0).getName(); assertEquals("Name of first docstruct type in ruleset file is incorrect!", "Acknowledgment", firstName); String secondName = docStructTypes.get(1).getName(); assertEquals("Name of first docstruct type in ruleset file is incorrect!", "Article", secondName); }
Source:
private WebSocketProxy getDelegate(Integer channelId) { if (!connectedProxies.containsKey(channelId) && !closedProxies.containsKey(channelId)) { logger.warn("Selected WebSocket channel is not connected. Unable to send manual crafted message!"); throw new IllegalArgumentException(Constant.messages.getString("websocket.manual_send.fail.disconnected_channel") + " " + Constant.messages.getString("websocket.manual_send.fail")); }else if (closedProxies.containsKey(channelId)){ logger.warn("Selected WebSocket channel is not connected. Unable to send manual crafted message!"); throw new IllegalArgumentException(Constant.messages.getString("websocket.manual_send.fail.disconnected_channel") + " " + Constant.messages.getString("websocket.manual_send.use_reopen")); } return connectedProxies.get(channelId); }

Target:
private WebSocketProxy getDelegate(Integer channelId) { if (closedProxies.containsKey(channelId)) { logger.warn("Selected WebSocket channel is not connected. Unable to send manual crafted message!"); throw new IllegalArgumentException(Constant.messages.getString("websocket.manual_send.fail.disconnected_channel") + " " + Constant.messages.getString("websocket.manual_send.use_reopen")); } return connectedProxies.get(channelId); }
Source:
public void appendMediaFile(final MediaFile mediaFile, final String mediaUrl, ImageLoader imageLoader) { if (!mDomHasLoaded) { mWaitingMediaFiles.put(mediaUrl, mediaFile); return; } mWebView.post(new Runnable() { @Override public void run() { if (URLUtil.isNetworkUrl(mediaUrl)) { String mediaId = mediaFile.getMediaId(); mWebView.execJavaScriptFromString("ZSSEditor.insertImage('" + mediaUrl + "', '" + mediaId + "');"); mEditorFragmentListener.onTrackableEvent(TrackableEvent.NETWORK_MEDIA_ADDED); } else { String id = mediaFile.getMediaId(); mWebView.execJavaScriptFromString("ZSSEditor.insertLocalImage(" + id + ", '" + mediaUrl + "');"); mWebView.execJavaScriptFromString("ZSSEditor.setProgressOnImage(" + id + ", " + 0 + ");"); mUploadingMediaIds.add(id); mEditorFragmentListener.onTrackableEvent(TrackableEvent.LOCAL_MEDIA_ADDED); } } }); }

Target:
public void appendMediaFile(final MediaFile mediaFile, final String mediaUrl, ImageLoader imageLoader) { if (!mDomHasLoaded) { mWaitingMediaFiles.put(mediaUrl, mediaFile); return; } mWebView.post(new Runnable() { @Override public void run() { if (URLUtil.isNetworkUrl(mediaUrl)) { String mediaId = mediaFile.getMediaId(); mWebView.execJavaScriptFromString("ZSSEditor.insertImage('" + mediaUrl + "', '" + mediaId + "');"); mEditorFragmentListener.onTrackableEvent(TrackableEvent.NETWORK_IMAGE_ADDED); } else { String id = mediaFile.getMediaId(); mWebView.execJavaScriptFromString("ZSSEditor.insertLocalImage(" + id + ", '" + mediaUrl + "');"); mWebView.execJavaScriptFromString("ZSSEditor.setProgressOnImage(" + id + ", " + 0 + ");"); mUploadingMediaIds.add(id); mEditorFragmentListener.onTrackableEvent(TrackableEvent.LOCAL_IMAGE_ADDED); } } }); }
Source:
public void createInteractiveBrowserCredential() { InteractiveBrowserCredential interactiveBrowserCredential = new InteractiveBrowserCredentialBuilder() .port(8765) .build(); SecretClient client = new SecretClientBuilder() .vaultUrl("https://{YOUR_VAULT_NAME}.vault.azure.net") .credential(interactiveBrowserCredential) .buildClient(); }

Target:
public void createInteractiveBrowserCredential() { InteractiveBrowserCredential interactiveBrowserCredential = new InteractiveBrowserCredentialBuilder() .clientId("<YOUR CLIENT ID>") .port(8765) .build(); SecretClient client = new SecretClientBuilder() .vaultUrl("https://{YOUR_VAULT_NAME}.vault.azure.net") .credential(interactiveBrowserCredential) .buildClient(); }
Source:
public CommandProcessingResult update(Long likelihoodId, JsonCommand command) { this.context.authenticatedUser(); try { this.likelihoodDataValidator.validateForUpdate(command); final Likelihood likelihood = this.repository.findOne(likelihoodId); String disableLikelihoodSql = "update ppi_likelihoods_ppi set enabled = "+ LikelihoodStatus.DISABLED + " WHERE ppi_likelihoods_ppi.id IN " + " ( SELECT t.id FROM ( SELECT * FROM ppi_likelihoods_ppi ) as t " + " WHERE t.ppi_name = '" + likelihood.getPpiName() + "' AND t.id !=" +likelihood.getId()+ " ) "; if (!likelihood.update(command).isEmpty()) { this.repository.save(likelihood); if(likelihood.isActivateCommand(command)) { jdbcTemplate.execute(disableLikelihoodSql); } } return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(likelihood.getId()).build(); } catch (final DataIntegrityViolationException dve) { handleDataIntegrityIssues(dve); return CommandProcessingResult.empty(); } }

Target:
public CommandProcessingResult update(Long likelihoodId, JsonCommand command) { this.context.authenticatedUser(); try { this.likelihoodDataValidator.validateForUpdate(command); final Likelihood likelihood = this.repository.findOne(likelihoodId); if (!likelihood.update(command).isEmpty()) { this.repository.save(likelihood); if(likelihood.isActivateCommand(command)) { List<Likelihood> likelihoods = this.repository.findByPpiNameAndLikeliHoodId(likelihood.getPpiName(),likelihood.getId()); for(Likelihood aLikelihood:likelihoods) { aLikelihood.disable(); } this.repository.save(likelihoods); } } return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(likelihood.getId()).build(); } catch (final DataIntegrityViolationException dve) { handleDataIntegrityIssues(dve); return CommandProcessingResult.empty(); } }
Source:
private String encode(String prefix, String userAndPass) { if (userAndPass==null) { return null; } return prefix+" "+Scrambler.scramble(userAndPass); }

Target:
private String encode(String prefix, String userAndPass) { if (userAndPass==null) { return null; } return prefix + " " + Base64.getEncoder().encodeToString(userAndPass.getBytes(StandardCharsets.UTF_8)); }
Source:
public void receiveMessage(PubsubMessage message, AckReplyConsumer consumer) { String messagePayload = message.getData().toStringUtf8(); log.debug("Received message with payload: {}", messagePayload); String messageKey = pubsubMessageCache.makeKey(messagePayload, pubsubType, subscriptionName); if (!pubsubMessageCache.acquireMessageLock(messageKey, identity.getIdentity(), 5 * TimeUnit.SECONDS.toMillis(ackDeadlineSeconds))) { consumer.nack(); return; } consumer.ack(); postEvent(message); pubsubMessageCache.setMessageHandled(messageKey, identity.getIdentity(), TimeUnit.DAYS.toMillis(7)); }

Target:
public void receiveMessage(PubsubMessage message, AckReplyConsumer consumer) { String messagePayload = message.getData().toStringUtf8(); log.debug("Received message with payload: {}", messagePayload); MessageInstanceDescription description = MessageInstanceDescription.builder() .subscriptionName(subscriptionName) .messagePayload(messagePayload) .pubsubType(pubsubType) .ackDeadlineMillis(5 * TimeUnit.SECONDS.toMillis(ackDeadlineSeconds)) .retentionDeadlineMillis(TimeUnit.DAYS.toMillis(7)) .build(); GoogleMessageAcknowledger acknowledger = new GoogleMessageAcknowledger(consumer); pubsubMessageHandler.handleMessage(description, acknowledger, identity.getIdentity()); }
Source:
public void handleError(ClientHttpResponse response) throws IOException { LOGGER.error("Http response error: {}", response.getStatusCode(), response.getStatusText()); }

Target:
public void handleError(ClientHttpResponse response) throws IOException { LOGGER.error("HTTP response error: {}", response.getStatusCode(), response.getStatusText()); }
Source:
public CaseRoleAssignmentLogDeleteBuilderImpl inCaseDefId(String caseDefId) { if (checkIfNull(caseDefId)) { return (CaseRoleAssignmentLogDeleteBuilderImpl) this; } this.caseDefId = caseDefId; return (CaseRoleAssignmentLogDeleteBuilderImpl) this; }

Target:
public CaseRoleAssignmentLogDeleteBuilder inCaseDefId(String caseDefId) { if (checkIfNull(caseDefId)) { return this; } this.caseDefId = caseDefId; return this; }
Source:
public String endTask(CoreSession coreSession, NuxeoPrincipal principal, Task task, String comment, String eventName, boolean isValidated) { if (!isTaskActive(task)) { throw new ConcurrentUpdateException(String.format("The task '%s' is not active", task.getName())); } else if (!canEndTask(principal, task)) { throw new DocumentSecurityException( String.format("User with id '%s' cannot end this task", principal.getName())); } String taskProviderId = task.getVariable(Task.TASK_PROVIDER_KEY); if (taskProviderId == null) { taskProviderId = DEFAULT_TASK_PROVIDER; } TaskProvider taskProvider = tasksProviders.get(taskProviderId); if (taskProvider == null) { throw new NuxeoException(String.format( "No task provider registered, cannot end task. Please contribute at least the default task provider: %s.", DEFAULT_TASK_PROVIDER)); } return taskProvider.endTask(coreSession, principal, task, comment, eventName, isValidated); }

Target:
public String endTask(CoreSession coreSession, NuxeoPrincipal principal, Task task, String comment, String eventName, boolean isValidated) { if (!checkPermissions(principal, task)) { throw new DocumentSecurityException( String.format("User with id '%s' cannot end this task", principal.getName())); } else if (!isTaskActive(task)) { throw new ConcurrentUpdateException(String.format("The task '%s' is not active", task.getName())); } String taskProviderId = task.getVariable(Task.TASK_PROVIDER_KEY); if (taskProviderId == null) { taskProviderId = DEFAULT_TASK_PROVIDER; } TaskProvider taskProvider = tasksProviders.get(taskProviderId); if (taskProvider == null) { throw new NuxeoException(String.format( "No task provider registered, cannot end task. Please contribute at least the default task provider: %s.", DEFAULT_TASK_PROVIDER)); } return taskProvider.endTask(coreSession, principal, task, comment, eventName, isValidated); }
Source:
public Map<Integer, Iterable<T>> getInitPartitions() { return partitions; }

Target:
public Map<Integer, Iterable<T>> getInitPartitions() { return initPartitions; }
Source:
public Token next() { char c = nextChar(); if (c == '(') { return finishToken(TokenType.PAREN_START); } else if (c == ')') { return finishToken(TokenType.PAREN_END); } else if (c == '{') { return readEnumOrQuotedToken(TokenType.SYMBOL,'}'); } else if (c == '[') { return readEnumOrQuotedToken(TokenType.SYMBOL,']'); } else if (c == ',') { return finishToken(TokenType.COMMA); } else if (c == '.') { return finishToken(TokenType.DOT); } else if (c == DOUBLE_QUOTE) { return readEnumOrQuotedToken(TokenType.STRING_LITERAL,DOUBLE_QUOTE); } else if (c == SINGLE_QUOTE) { return readEnumOrQuotedToken(TokenType.STRING_LITERAL,SINGLE_QUOTE); } else if (StringUtil.isWhitespace(c)) { return readWhitespace(); } else if (isNumberPart(c)) { return readNumber(); } else if (isOperator(c)) { return readOperator(c); } else if (isBooleanLiteral(c)) { return readBooleanLiteral(c); } else if (isSymbolStart(c)) { return readSymbol(TokenType.SYMBOL); } else { throw new RuntimeException("Symbol '" + c + "' is not supported"); } }

Target:
public Token next() { char c = nextChar(); if (c == '(') { return finishToken(TokenType.PAREN_START); } else if (c == ')') { return finishToken(TokenType.PAREN_END); } else if (c == '{') { return readQuotedToken(TokenType.SYMBOL, '}'); } else if (c == '[') { return readQuotedToken(TokenType.SYMBOL, ']'); } else if (c == ',') { return finishToken(TokenType.COMMA); } else if (c == '.') { return finishToken(TokenType.DOT); } else if (c == DOUBLE_QUOTE) { return readQuotedToken(TokenType.STRING_LITERAL, DOUBLE_QUOTE); } else if (c == SINGLE_QUOTE) { return readQuotedToken(TokenType.STRING_LITERAL, SINGLE_QUOTE); } else if (StringUtil.isWhitespace(c)) { return readWhitespace(); } else if (isNumberPart(c)) { return readNumber(); } else if (isOperator(c)) { return readOperator(c); } else if (isBooleanLiteral(c)) { return readBooleanLiteral(c); } else if (isSymbolStart(c)) { return readSymbol(TokenType.SYMBOL); } else { throw new RuntimeException("Symbol '" + c + "' is not supported"); } }
Source:
public void testSnackBarWithAction() { final BaseActivity activity = getActivity(); activity.runOnUiThread(new Runnable() { @Override public void run() { activity.snackBar("This is a SnackBar with action Test!", "Action", new View .OnClickListener() { @Override public void onClick(View v) { Toast.makeText( activity, "What?", Toast.LENGTH_LONG ).show(); } }); } }); expectVisibleSoon(viewWithText("This is a SnackBar with action Test!")); expectVisible(viewWithId(R.id.snackbar_action)); expectVisible(viewThat(hasText("Action"))); click(viewWithText("Action")); onView(withText("What?")) .inRoot(withDecorView(not(is( getActivity().getWindow().getDecorView()))) ).check(matches(isDisplayed())); }

Target:
public void testSnackBarWithAction() { final View.OnClickListener mockListener = mock(View.OnClickListener.class); final BaseActivity activity = getActivity(); activity.runOnUiThread(new Runnable() { @Override public void run() { activity.snackBar("This is a SnackBar with action Test!", "Action", mockListener); } }); expectVisibleSoon(viewWithText("This is a SnackBar with action Test!")); expectVisible(viewWithId(R.id.snackbar_action)); expectVisible(viewThat(hasText("Action"))); click(viewWithText("Action")); verify(mockListener).onClick(any(View.class)); }
Source:
public void handleNewSession(String sessionId) throws Exception { waitUntilConnected(); if (sessionId != null && !getSessionId().equals(sessionId)) { LOG.info("Session is expired and not handled. Expected: {}. Actual: {}.", sessionId, getSessionId()); return; } if (sessionId == null) { sessionId = getSessionId(); LOG.warn("Session id: <null> is passed in. Current session id: will be used.", sessionId); } LOG.info("Handle new session, instance: {}, type: {}, session id: {}.", _instanceName, _instanceType, sessionId); stopTimerTasks(); if (_leaderElectionHandler != null) { _leaderElectionHandler.reset(false); } resetHandlers(false); _baseDataAccessor.reset(); if (!ZKUtil.isClusterSetup(_clusterName, _zkclient)) { throw new HelixException("Cluster structure is not set up for cluster: " + _clusterName); } _sessionStartTime = System.currentTimeMillis(); switch (_instanceType) { case PARTICIPANT: handleNewSessionAsParticipant(sessionId); break; case CONTROLLER: handleNewSessionAsController(); break; case CONTROLLER_PARTICIPANT: handleNewSessionAsParticipant(sessionId); handleNewSessionAsController(); break; case ADMINISTRATOR: case SPECTATOR: default: break; } startTimerTasks(); initHandlers(_handlers); if (_stateListener != null) { try { _stateListener.onConnected(this); } catch (Exception e) { LOG.warn("stateListener.onConnected callback fails", e); } } }

Target:
public void handleNewSession(String sessionId) throws Exception { waitUntilConnected(); if (sessionId != null && !getSessionId().equals(sessionId)) { LOG.warn("Session is expired and not handled. Expected: {}. Actual: {}.", sessionId, getSessionId()); return; } if (sessionId == null) { sessionId = getSessionId(); LOG.debug("Session id: <null> is passed in. Current session id: will be used.", sessionId); } LOG.info("Handle new session, instance: {}, type: {}, session id: {}.", _instanceName, _instanceType, sessionId); stopTimerTasks(); if (_leaderElectionHandler != null) { _leaderElectionHandler.reset(false); } resetHandlers(false); _baseDataAccessor.reset(); if (!ZKUtil.isClusterSetup(_clusterName, _zkclient)) { throw new HelixException("Cluster structure is not set up for cluster: " + _clusterName); } _sessionStartTime = System.currentTimeMillis(); switch (_instanceType) { case PARTICIPANT: handleNewSessionAsParticipant(sessionId); break; case CONTROLLER: handleNewSessionAsController(); break; case CONTROLLER_PARTICIPANT: handleNewSessionAsParticipant(sessionId); handleNewSessionAsController(); break; case ADMINISTRATOR: case SPECTATOR: default: break; } startTimerTasks(); initHandlers(_handlers); if (_stateListener != null) { try { _stateListener.onConnected(this); } catch (Exception e) { LOG.warn("stateListener.onConnected callback fails", e); } } }
Source:
private static void postReport(final DeliveryOptions deliveryOptions, final Map<String, Object> reportParameters, final ByteArrayOutputStream outputStream, final String fileName) { final String url = deliveryOptions.getWebhookUrl(); final String substitutedUrl = substituteUrl(url, deliveryOptions, reportParameters); try (final ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray()); final CloseableHttpClient client = HttpClients.createDefault(); ) { LOG.debug("Posting generated report with name to endpoint (input was {})", fileName, substitutedUrl, url); final HttpEntity entity = MultipartEntityBuilder.create() .addBinaryBody("file", inputStream, ContentType.DEFAULT_BINARY, fileName) .build(); final HttpPost httpPost = new HttpPost(substitutedUrl); httpPost.setEntity(entity); try (CloseableHttpResponse response = client.execute(httpPost)) { LOG.debug("Request performed. Received response: {}", response); final int statusCode = response.getStatusLine().getStatusCode(); if (statusCode < 200 || statusCode >= 300) { throw new IOException("Expected status code of >= 200 and <= 300 but received: " + statusCode + ". Reason: " + response.getStatusLine().toString()); } } } catch (IOException ex) { LOG.error("Error while posting data to endpoint {}: {}", url, ex.getMessage(), ex); } }

Target:
private static void postReport(final DeliveryOptions deliveryOptions, final Map<String, Object> reportParameters, final ByteArrayOutputStream outputStream, final String fileName) { final String url = deliveryOptions.getWebhookUrl(); final String substitutedUrl = substituteUrl(url, deliveryOptions, reportParameters); try (final ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray()); final CloseableHttpClient client = HttpClients.createDefault(); ) { LOG.debug("Posting generated report with name to endpoint (input was {})", fileName, substitutedUrl, url); final HttpEntity entity = MultipartEntityBuilder.create() .addBinaryBody("file", inputStream, ContentType.DEFAULT_BINARY, fileName) .build(); final HttpPost httpPost = new HttpPost(substitutedUrl); httpPost.setEntity(entity); try (CloseableHttpResponse response = client.execute(httpPost)) { LOG.debug("Request performed. Received response: {}", response); final int statusCode = response.getStatusLine().getStatusCode(); if (statusCode < 200 || statusCode > 299) { throw new IOException("Expected status code of >= 200 and <= 299 but received: " + statusCode + ". Reason: " + response.getStatusLine().getReasonPhrase()); } } } catch (IOException ex) { LOG.error("Error while posting data to endpoint {}: {}", url, ex.getMessage(), ex); } }
Source:
public CallAdapter<?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { Class<?> rawType = getRawType(returnType); final String canonicalName = rawType.getCanonicalName(); boolean isSingle = "rx.Single".equals(canonicalName); boolean isCompletable = "rx.Completable".equals(canonicalName); if (rawType != Observable.class && !isSingle && !isCompletable) { return null; } if (!isCompletable && !(returnType instanceof ParameterizedType)) { String name = isSingle ? "Single" : "Observable"; throw new IllegalStateException(name + " return type must be parameterized" + " as " + name + "<Foo> or " + name + "<? extends Foo>"); } if (isCompletable) { return CompletableHelper.makeCompletable(); } else { CallAdapter<Observable<?>> callAdapter = getCallAdapter(returnType); if (isSingle) { return SingleHelper.makeSingle(callAdapter); } return callAdapter; } }

Target:
public CallAdapter<?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { Class<?> rawType = getRawType(returnType); final String canonicalName = rawType.getCanonicalName(); boolean isSingle = "rx.Single".equals(canonicalName); boolean isCompletable = "rx.Completable".equals(canonicalName); if (rawType != Observable.class && !isSingle && !isCompletable) { return null; } if (!isCompletable && !(returnType instanceof ParameterizedType)) { String name = isSingle ? "Single" : "Observable"; throw new IllegalStateException(name + " return type must be parameterized" + " as " + name + "<Foo> or " + name + "<? extends Foo>"); } if (isCompletable) { return CompletableHelper.makeCompletable(); } CallAdapter<Observable<?>> callAdapter = getCallAdapter(returnType); if (isSingle) { return SingleHelper.makeSingle(callAdapter); } return callAdapter; }
Source:
public void tearDown() throws IOException, SQLException { try { globalScheduler.shutdown(); } catch (Exception e) { } cleanup(); tearDownOnce(); }

Target:
public void tearDown(){ try { globalScheduler.shutdown(); } catch (Exception e) { } cleanup(); tearDownOnce(); }
Source:
public Fragment getFirstFragment() { final EnrolledCoursesResponse courseData = (EnrolledCoursesResponse) getIntent().getSerializableExtra(Router.EXTRA_COURSE_DATA); final Serializable serializable = getIntent().getSerializableExtra(Router.EXTRA_COURSE_UNIT); CourseComponent courseUnit = null; if (serializable != null) { courseUnit = (CourseComponent) serializable; } return CourseUpgradeWebViewFragment.newInstance(getIntent().getStringExtra(ARG_URL), null, true, courseData, courseUnit); }

Target:
public Fragment getFirstFragment() { final EnrolledCoursesResponse courseData = (EnrolledCoursesResponse) getIntent().getSerializableExtra(Router.EXTRA_COURSE_DATA); final CourseComponent courseUnit = (CourseComponent) getIntent().getSerializableExtra(Router.EXTRA_COURSE_UNIT); return CourseUpgradeWebViewFragment.newInstance(getIntent().getStringExtra(ARG_URL), null, true, courseData, courseUnit); }
Source:
public String toString() { return String.format( "size [%s, %s, %s); files [%d, %d); ratio %f; off-peak ratio %f; throttle point %d;" + " major period %d, major jitter %f, min locality to compact %f;" + " tiered compaction: max_age %d, incoming window min %d," + " compaction policy for tiered window %s, single output for minor %b," + " compaction window factory %s," + " region %s columnFamilyName %s", StringUtils.byteDesc(minCompactSize), StringUtils.byteDesc(maxCompactSize), StringUtils.byteDesc(offPeakMaxCompactSize), minFilesToCompact, maxFilesToCompact, compactionRatio, offPeakCompactionRatio, throttlePoint, majorCompactionPeriod, majorCompactionJitter, minLocalityToForceCompact, dateTieredMaxStoreFileAgeMillis, dateTieredIncomingWindowMin, compactionPolicyForDateTieredWindow, dateTieredSingleOutputForMinorCompaction, dateTieredCompactionWindowFactory, storeConfigInfo.getRegionInfo().getEncodedName(), storeConfigInfo.getColumnFamilyName() ); }

Target:
public String toString() { return String.format( "size [%s, %s, %s); files [%d, %d); ratio %f; off-peak ratio %f; throttle point %d;" + " major period %d, major jitter %f, min locality to compact %f;" + " tiered compaction: max_age %d, incoming window min %d," + " compaction policy for tiered window %s, single output for minor %b," + " compaction window factory %s," + " region %s columnFamilyName %s", StringUtils.byteDesc(minCompactSize), StringUtils.byteDesc(maxCompactSize), StringUtils.byteDesc(offPeakMaxCompactSize), minFilesToCompact, maxFilesToCompact, compactionRatio, offPeakCompactionRatio, throttlePoint, majorCompactionPeriod, majorCompactionJitter, minLocalityToForceCompact, dateTieredMaxStoreFileAgeMillis, dateTieredIncomingWindowMin, compactionPolicyForDateTieredWindow, dateTieredSingleOutputForMinorCompaction, dateTieredCompactionWindowFactory, RegionInfo.prettyPrint(storeConfigInfo.getRegionInfo().getEncodedName()), storeConfigInfo.getColumnFamilyName() ); }
Source:
public String formatToString(Object att, NumberFormat coordFormatter) { String value = null; if (att instanceof Number) { value = coordFormatter.format(att); } else if (att instanceof Date) { if (att instanceof java.sql.Date) { value = utcDateString((Date)att); } else if (att instanceof Time) { value = DateUtil.serializeSqlTime((Time)att); }else { value = utcDateString((Date)att); } } else { value = att.toString(); } return value; }

Target:
public String formatToString(Object att, NumberFormat coordFormatter) { String value = null; if (att instanceof Number) { value = coordFormatter.format(att); } else if (att instanceof Date) { if (att instanceof java.sql.Date) { value = DateUtil.serializeSqlDate((java.sql.Date)att); } else if (att instanceof Time) { value = DateUtil.serializeSqlTime((Time)att); }else { value = utcDateString((Date)att); } } else { value = att.toString(); } return value; }
Source:
protected boolean isWindows() { return OS.WINDOWS.equals(OS.getCurrent()); }

Target:
protected static boolean isWindows() { return OS.WINDOWS.equals(OS.getCurrent()); }