auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private int getSeparator(String qualified) { int result = -1; if (userNameFormat == UserNameFormat.UPN && qualified.indexOf("\\") == -1) { result = qualified.lastIndexOf("@"); } else if (userNameFormat == UserNameFormat.DOWN_LEVEL_LOGON_NAME && qualified.indexOf("@") == -1) { result = qualified.lastIndexOf("\\"); } return result; }

Target:
private int getSeparator(String qualified) { int result = -1; if (userNameFormat == UserNameFormat.UPN && qualified.indexOf("\\") == -1) { result = qualified.lastIndexOf("@"); } else if (userNameFormat == UserNameFormat.RESTAPI_SPECIFIC && qualified.indexOf("@") == -1) { result = qualified.indexOf("\\"); } return result; }
Source:
private Context getMockContext(final Signature signature, final String brokerPackageName, final String contextPackageName, boolean permissionStatus) throws NameNotFoundException { Context mockContext = mock(Context.class); PackageManager mockPackageManager = getPackageManager(signature, brokerPackageName, permissionStatus); when(mockContext.getPackageManager()).thenReturn(mockPackageManager); when(mockContext.getPackageName()).thenReturn(contextPackageName); List<ResolveInfo> mockList = new ArrayList<>(); mockList.add(new ResolveInfo()); int size = mockList.size(); when(mockPackageManager.queryIntentActivities(Matchers.any(Intent.class), anyInt())).thenReturn(mockList); return mockContext; }

Target:
private Context getMockContext(final Signature signature, final String brokerPackageName, final String contextPackageName, boolean permissionStatus) throws NameNotFoundException { Context mockContext = mock(Context.class); PackageManager mockPackageManager = getPackageManager(signature, brokerPackageName, permissionStatus); when(mockContext.getPackageManager()).thenReturn(mockPackageManager); when(mockContext.getPackageName()).thenReturn(contextPackageName); List<ResolveInfo> mockList = new ArrayList<>(); mockList.add(new ResolveInfo()); when(mockPackageManager.queryIntentActivities(Matchers.any(Intent.class), anyInt())).thenReturn(mockList); return mockContext; }
Source:
public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { for (Object cookie : cookiesToClear) { Cookie realCookie = null; if (cookie instanceof String) { realCookie = new Cookie((String) cookie, null); String cookiePath = request.getContextPath() + "/"; realCookie.setPath(cookiePath); realCookie.setMaxAge(0); }else if (cookie instanceof Cookie){ realCookie = (Cookie) cookie; } response.addCookie(realCookie); } }

Target:
public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { cookiesToClear.forEach( f -> response.addCookie(f.apply(request)) ); }
Source:
private void runSe(String filename) { JavaScriptVisitorContext context; try { context = createContext(new TestInputFile("src/test/resources/se/", filename)); verifier.scanExpectedIssues(context); SeChecksDispatcher seChecksDispatcher = new SeChecksDispatcher(ImmutableList.of((SeCheck) verifier)); seChecksDispatcher.scanTree(context); } catch (IOException e) { Throwables.propagate(e); } }

Target:
private void runSe(String filename) { JavaScriptVisitorContext context = createContext(new TestInputFile("src/test/resources/se/", filename)); verifier.scanExpectedIssues(context); SeChecksDispatcher seChecksDispatcher = new SeChecksDispatcher(ImmutableList.of((SeCheck) verifier)); seChecksDispatcher.scanTree(context); }
Source:
public static void saveCustomSettings(PostgresConnectionSettings settings) { Map<String, String> map = new HashMap<String, String>(); map.put(HOST_KEY, settings.getHost()); map.put(PORT_KEY, Integer.toString(settings.getPort())); map.put(DBNAME_KEY, settings.getDbName()); map.put(BULK_THRESHOLD_KEY, Integer.toString(settings.getBulkThreshold())); map.put(USER_KEY, settings.getUserName()); try { map.put(PASSWORD_KEY, TextConverter.convertTextToHexText(settings.getPassword())); } catch (TextConverterException ex) { LOGGER.log(Level.SEVERE, "Failed to convert password from text to hex text.", ex); } ModuleSettings.setConfigSettings(MODULE_KEY, map); }

Target:
public void saveCustomSettings(PostgresConnectionSettings settings) { Map<String, String> map = new HashMap<String, String>(); map.put(HOST_KEY, settings.getHost()); map.put(PORT_KEY, Integer.toString(settings.getPort())); map.put(DBNAME_KEY, settings.getDbName()); map.put(BULK_THRESHOLD_KEY, Integer.toString(settings.getBulkThreshold())); map.put(USER_KEY, settings.getUserName()); try { map.put(PASSWORD_KEY, TextConverter.convertTextToHexText(settings.getPassword())); } catch (TextConverterException ex) { LOGGER.log(Level.SEVERE, "Failed to convert password from text to hex text.", ex); } ModuleSettings.setConfigSettings(MODULE_KEY, map); }
Source:
public DocumentModel run(DocumentModel doc) throws ConcurrentUpdateException, IOException { if (changeToken != null) { save = true; doc.putContextData(CoreSession.CHANGE_TOKEN, changeToken); } DocumentHelper.setProperties(session, doc, properties); if (save) { doc = session.saveDocument(doc); } return doc; }

Target:
public DocumentModel run(DocumentModel doc) throws ConcurrentUpdateException, IOException { if (changeToken != null) { doc.putContextData(CoreSession.CHANGE_TOKEN, changeToken); } DocumentHelper.setProperties(session, doc, properties); if (save) { doc = session.saveDocument(doc); } return doc; }
Source:
private void handleEOF() { MySubscriber<Void> fnfsub = new MySubscriber<>(0L, AGENT); RSocket fnfclient = createClient; Publisher<Void> fnfpub = fnfclient.fireAndForget(new PayloadImpl("shutdown", "shutdown")); fnfpub.subscribe(fnfsub); fnfsub.request(1); }

Target:
private void handleEOF() { MySubscriber<Void> fnfsub = new MySubscriber<>(0L, AGENT); RSocket fnfclient = createClient.get(); Publisher<Void> fnfpub = fnfclient.fireAndForget(new PayloadImpl("shutdown", "shutdown")); fnfpub.subscribe(fnfsub); fnfsub.request(1); }
Source:
public void commit() throws TransactionException { final DatabaseTransaction transaction = getCurrentTransaction(); logger.trace("Committing transaction: " + transaction.transactionId()); try { transaction.applyActions(databaseTemplate); currentTransaction.remove(); logger.trace("Transaction successfully commit: " + transaction.transactionId()); } catch (final Throwable e) { throw new TransactionalResourceException("Failed to commit DynamoDb transaction: " + transaction.transactionId(), e); } }

Target:
public void commit() throws TransactionException { final DatabaseTransaction transaction = getCurrentTransaction(); logger.trace("Committing transaction: " + transaction.transactionId()); try { transaction.applyActions(databaseTemplate); currentTransaction.remove(); logger.trace("Transaction successfully committed: " + transaction.transactionId()); } catch (final Throwable e) { throw new TransactionalResourceException("Failed to commit DatabaseTemplate transaction: " + transaction.transactionId(), e); } }
Source:
public static void readInDocFromString(String fName, ByteBufferInputStream bbis, DataInputStream di, ArrayBackedValueStorage abvs, IParser parser) throws IOException { Reader input; if (!fName.contains("hdfs:/")) { File file = new File(fName); if (file.exists()) { input = new InputStreamReader(new FileInputStream(file)); parser.parse(input, abvs); } else{ throw new IOException(); } } else { HDFSFunctions hdfs = new HDFSFunctions(null, null); FileSystem fs = hdfs.getFileSystem(); if (fs != null) { String fHdfsName = fName.replaceAll("hdfs:/", ""); Path xmlDocument = new Path(fHdfsName); if (fs.exists(xmlDocument)) { InputStream in = fs.open(xmlDocument).getWrappedStream(); input = new InputStreamReader(in); parser.parse(input, abvs); in.close(); } fs.close(); } } }

Target:
public static void readInDocFromString(String fName, ByteBufferInputStream bbis, DataInputStream di, ArrayBackedValueStorage abvs, IParser parser) throws IOException { Reader input; if (!fName.contains("hdfs:/")) { File file = new File(fName); if (file.exists()) { input = new InputStreamReader(new FileInputStream(file)); parser.parse(input, abvs); } else { throw new FileNotFoundException(file.getAbsolutePath()); } } else { HDFSFunctions hdfs = new HDFSFunctions(null, null); FileSystem fs = hdfs.getFileSystem(); if (fs != null) { String fHdfsName = fName.replaceAll("hdfs:/", ""); Path xmlDocument = new Path(fHdfsName); if (fs.exists(xmlDocument)) { InputStream in = fs.open(xmlDocument).getWrappedStream(); input = new InputStreamReader(in); parser.parse(input, abvs); in.close(); } else { throw new FileNotFoundException(xmlDocument.getName()); } fs.close(); } else { throw new IOException(); } } }
Source:
protected Control createContents(Composite parent) { PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IIDEHelpContextIds.WORKSPACE_PREFERENCE_PAGE); Composite composite = createComposite(parent); PreferenceLinkArea area = new PreferenceLinkArea(composite, SWT.NONE, "org.eclipse.ui.preferencePages.Startup", IDEWorkbenchMessages.IDEWorkspacePreference_relatedLink, (IWorkbenchPreferenceContainer) getContainer(),null); GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); area.getControl().setLayoutData(data); createSpace(composite); createMissingNaturePref(composite); createAutoBuildPref(composite); createAutoRefreshControls(composite); createSaveAllBeforeBuildPref(composite); createCloseUnrelatedProjPrefControls(composite); createSpace(composite); createSaveIntervalGroup(composite); createSpace(composite); createWorkspaceLocationGroup(composite); createSpace(composite); createOpenPrefControls(composite); createSpace(composite); createSystemExplorerGroup(composite); createSpace(composite); Composite lower = new Composite(composite,SWT.NONE); GridLayout lowerLayout = new GridLayout(); lowerLayout.marginWidth = 0; lowerLayout.numColumns = 2; lowerLayout.makeColumnsEqualWidth = true; lower.setLayout(lowerLayout); lower.setLayoutData(new GridData( GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL)); createEncodingEditorControls(lower); createLineSeparatorEditorControls(lower); applyDialogFont(composite); return composite; }

Target:
protected Control createContents(Composite parent) { PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IIDEHelpContextIds.WORKSPACE_PREFERENCE_PAGE); Composite composite = createComposite(parent); PreferenceLinkArea area = new PreferenceLinkArea(composite, SWT.NONE, "org.eclipse.ui.preferencePages.Startup", IDEWorkbenchMessages.IDEWorkspacePreference_relatedLink, (IWorkbenchPreferenceContainer) getContainer(),null); GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); area.getControl().setLayoutData(data); createSpace(composite); createAutoBuildPref(composite); createAutoRefreshControls(composite); createSaveAllBeforeBuildPref(composite); createCloseUnrelatedProjPrefControls(composite); createSpace(composite); createSaveIntervalGroup(composite); createSpace(composite); createWorkspaceLocationGroup(composite); createSpace(composite); Composite comboParent = new Composite(composite, SWT.NONE); comboParent.setLayout(new GridLayout(2, false)); createOpenPrefControls(comboParent); createMissingNaturePref(comboParent); createSpace(composite); createSystemExplorerGroup(composite); createSpace(composite); Composite lower = new Composite(composite,SWT.NONE); GridLayout lowerLayout = new GridLayout(); lowerLayout.marginWidth = 0; lowerLayout.numColumns = 2; lowerLayout.makeColumnsEqualWidth = true; lower.setLayout(lowerLayout); lower.setLayoutData(new GridData( GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL)); createEncodingEditorControls(lower); createLineSeparatorEditorControls(lower); applyDialogFont(composite); return composite; }
Source:
void increment_operator() { int i = 0; i++; int b = 12; ++b; int j = -1; while ((j = foo(++j)) != -1) { System.out.println(""); } }

Target:
int increment_operator() { int i = 0; int b = 12; ++b; int c = 0; foo(++c); int j = -1; while ((j = foo(++j)) != -1) { System.out.println(""); } if(i != 0) { return i++; } else { return ++i; } }
Source:
public List<T> get() { return new ArrayList<>(registerableList); }

Target:
public List<T> get() { return unmodifiableList(registerableList); }
Source:
public Optional<ItemType> getById(String id) { checkNotNull(id); if (!id.contains(":")) { id = "minecraft:" + id.toLowerCase(); } return Optional.ofNullable(this.itemTypeMappings.get(id)); }

Target:
public Optional<ItemType> getById(String id) { checkNotNull(id); if (!id.contains(":")) { id = "minecraft:" + id.toLowerCase(Locale.ENGLISH); } return Optional.ofNullable(this.itemTypeMappings.get(id)); }
Source:
private Pair<Integer, Integer> findLeafCombineDegreeAndNumBuffers( ByteBuffer combineBuffer, int requiredMinimumBufferCapacity, int numAvailableThreads, int numLeafNodes ) { for (int leafCombineDegree = MINIMUM_LEAF_COMBINE_DEGREE; leafCombineDegree <= numLeafNodes; leafCombineDegree++) { final int requiredBufferNum = computeRequiredBufferNum(numLeafNodes, leafCombineDegree); if (requiredBufferNum <= numAvailableThreads) { final int expectedSliceSize = combineBuffer.capacity() / requiredBufferNum; if (expectedSliceSize >= requiredMinimumBufferCapacity) { return Pair.of(leafCombineDegree, requiredBufferNum); } } } throw new ISE("Cannot find a proper leaf combine degree. Try increasing druid.processing.buffer.sizeBytes."); }

Target:
private Pair<Integer, Integer> findLeafCombineDegreeAndNumBuffers( ByteBuffer combineBuffer, int requiredMinimumBufferCapacity, int numAvailableThreads, int numLeafNodes ) { for (int leafCombineDegree = MINIMUM_LEAF_COMBINE_DEGREE; leafCombineDegree <= numLeafNodes; leafCombineDegree++) { final int requiredBufferNum = computeRequiredBufferNum(numLeafNodes, leafCombineDegree); if (requiredBufferNum <= numAvailableThreads) { final int expectedSliceSize = combineBuffer.capacity() / requiredBufferNum; if (expectedSliceSize >= requiredMinimumBufferCapacity) { return Pair.of(leafCombineDegree, requiredBufferNum); } } } throw new ISE( "Cannot find a proper leaf combine degree for the combining tree. " + "Each node of the combining tree requires a buffer of [%d] bytes. " + "Try increasing druid.processing.buffer.sizeBytes for larger buffer or " + "druid.query.groupBy.intermediateCombineDegree for a smaller tree", requiredMinimumBufferCapacity ); }
Source:
protected void addCleaner(final Exchange exchange, final Message message) { message.addMessageObserver(new MessageObserverAdapter() { @Override public void onCancel() { complete("canceled"); } @Override public void failed() { complete("failed"); } private void complete(final String action) { if (exchange.executeComplete()) { if (exchange.isOfLocalOrigin()) { LOG.debug("{}, request [MID={}, {}]", exchange, exchange.getRequest().getMID(), exchange.getRequest().getToken()); } else { LOG.debug("{}, response [MID={}, {}]", exchange, exchange.getResponse().getMID(), exchange.getResponse().getToken()); } message.removeMessageObserver(this); } } }); }

Target:
protected void addCleaner(final Exchange exchange, final Message message) { message.addMessageObserver(new MessageObserverAdapter() { @Override public void onCancel() { complete("canceled"); } @Override public void failed() { complete("failed"); } private void complete(final String action) { if (exchange.executeComplete()) { if (exchange.isOfLocalOrigin()) { LOG.debug("{}, request [MID={}, Token={}]", exchange, action, exchange.getRequest().getMID(), exchange.getRequest().getToken()); } else { LOG.debug("{}, request [MID={}, Token={}]", exchange, action, exchange.getResponse().getMID(), exchange.getResponse().getToken()); } message.removeMessageObserver(this); } } }); }
Source:
public static String buildJobGroupId(InterpreterContext context) { return context.getAuthenticationInfo().getUser() + "-" + context.getNoteId() + "-" + context.getParagraphId(); }

Target:
public static String buildJobGroupId(InterpreterContext context) { String uName = "anonymous"; if (context.getAuthenticationInfo() != null) { uName = getUserName(context.getAuthenticationInfo()); } return "zeppelin-" + uName + "-" + context.getNoteId() + "-" + context.getParagraphId(); }
Source:
private AttributeType getEnrichedType(AttributeType guess, Object value) { if (guess == null || value == null) { return guess; } if (guess.equals(STRING)) { String stringValue = value.toString(); if (stringValue.length() > MAX_STRING_LENGTH) { return TEXT; } if (Boolean.TRUE.equals(canValueBeUsedAsDate(value))) { return DATE; } } else if (guess.equals(DECIMAL)) { if (value instanceof Integer) { return INT; } else if (value instanceof Long) { Long longValue = (Long) value; return longValue > Integer.MIN_VALUE && longValue < Integer.MAX_VALUE ? INT : LONG; } else if (value instanceof Double) { Double doubleValue = (Double) value; if (doubleValue != Math.rint(doubleValue)) { return DECIMAL; } if (doubleValue > Integer.MIN_VALUE && doubleValue < Integer.MAX_VALUE) { return INT; } if (doubleValue > Long.MIN_VALUE && doubleValue < Long.MAX_VALUE) { return LONG; } } } return guess; }

Target:
private AttributeType getEnrichedType(AttributeType guess, Object value) { if (guess == null || value == null) { return guess; } if (guess.equals(STRING)) { String stringValue = value.toString(); if (stringValue.length() > MAX_STRING_LENGTH) { return TEXT; } if (canValueBeUsedAsDate(value)) { return DATE; } } else if (guess.equals(DECIMAL)) { if (value instanceof Integer) { return INT; } else if (value instanceof Long) { Long longValue = (Long) value; return longValue > Integer.MIN_VALUE && longValue < Integer.MAX_VALUE ? INT : LONG; } else if (value instanceof Double) { Double doubleValue = (Double) value; if (doubleValue != Math.rint(doubleValue)) { return DECIMAL; } if (doubleValue > Integer.MIN_VALUE && doubleValue < Integer.MAX_VALUE) { return INT; } if (doubleValue > Long.MIN_VALUE && doubleValue < Long.MAX_VALUE) { return LONG; } } } return guess; }
Source:
public String[] getFilePaths(RepoObject repoObject) throws RepoException { String[] paths = null; try { paths = mfs.getPaths(getObjectLocationString(repoObject.getBucketName(), repoObject.getChecksum()), true); } catch (Exception e){ throw new RepoException(e); } return paths; }

Target:
public String[] getFilePaths(RepoObject repoObject) throws RepoException { String[] paths = null; try{ paths = mfs.getPaths(getObjectLocationString(repoObject.getBucketName(), repoObject.getChecksum()), true); if (paths == null) { throw new RepoException(RepoException.Type.ObjectFilePathMissing); } } catch(Exception e){ throw new RepoException(e); } return paths; }
Source:
void completePlayerSetup(boolean asked) { if (asked) { skinLayout = (OoyalaSkinLayout) findViewById(R.id.ooyalaSkin); PlayerDomain playerDomain = new PlayerDomain(domain); Options options = null; if(selectedFormat.equalsIgnoreCase("default")) options = new Options.Builder().setShowNativeLearnMoreButton(false).setShowPromoImage(false).setUseExoPlayer(true).build(); else options = new Options.Builder().setShowNativeLearnMoreButton(false).setShowPromoImage(false).setUseExoPlayer(true).setPlayerInfo(new CustomPlayerInfo(selectedFormat)).build(); if(getCallingActivity().getClassName().contains("AddAssetActivity")) { ACCOUNT_ID = accountId; APIKEY = apiKey; SECRET = secret; } if(isStaging) { Log.i(TAG, "Environment Set to Staging:"); OoyalaPlayer.setEnvironment(Environment.EnvironmentType.STAGING, Environment.PROTOCOL_HTTPS); } else { OoyalaPlayer.setEnvironment(Environment.EnvironmentType.PRODUCTION, Environment.PROTOCOL_HTTPS); } player = new OoyalaPlayer(pcode, playerDomain,this, options); JSONObject overrides = createSkinOverrides(); SkinOptions skinOptions = new SkinOptions.Builder().setSkinOverrides(overrides).build(); playerLayoutController = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); playerLayoutController.addObserver(this); player.addObserver(this); if (player.setEmbedCode(embedCode)) { if(autoPlay) { player.play(); } } else { Log.e(TAG, "Asset Failure"); } } }

Target:
void completePlayerSetup(boolean asked) { if (asked) { skinLayout = (OoyalaSkinLayout) findViewById(R.id.ooyalaSkin); PlayerDomain playerDomain = new PlayerDomain(domain); Options.Builder optionsBuilder = new Options.Builder().setShowNativeLearnMoreButton(false).setShowPromoImage(false).setUseExoPlayer(true); if(!selectedFormat.equalsIgnoreCase("default")) { optionsBuilder.setPlayerInfo(new CustomPlayerInfo(selectedFormat)).build(); } Options options = optionsBuilder.build(); if(getIntent().getExtras().getString("className").contains("AddAssetActivity")) { ACCOUNT_ID = accountId; APIKEY = apiKey; SECRET = secret; } if(isStaging) { Log.i(TAG, "Environment Set to Staging:"); OoyalaPlayer.setEnvironment(Environment.EnvironmentType.STAGING, Environment.PROTOCOL_HTTPS); } else { Log.i(TAG, "Environment Set to Production:"); OoyalaPlayer.setEnvironment(Environment.EnvironmentType.PRODUCTION, Environment.PROTOCOL_HTTPS); } player = new OoyalaPlayer(pcode, playerDomain,this, options); JSONObject overrides = createSkinOverrides(); SkinOptions skinOptions = new SkinOptions.Builder().setSkinOverrides(overrides).build(); playerLayoutController = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); playerLayoutController.addObserver(this); player.addObserver(this); if (player.setEmbedCode(embedCode)) { if(autoPlay) { player.play(); } } else { Log.e(TAG, "Asset Failure"); } } }
Source:
private List<ObservationUnitRow> createObservationUnitRowsGroup(final int column, final int range, final int noOfItems) { final List<ObservationUnitRow> observationUnitRows = new LinkedList<>(); for (int i = 1; i <= noOfItems; i++) { final ObservationUnitData fieldMapRangeObservationData = new ObservationUnitData(); fieldMapRangeObservationData.setValue(String.valueOf(range)); final ObservationUnitData fieldMapColumnObservationData = new ObservationUnitData(); fieldMapColumnObservationData.setValue(String.valueOf(column)); final ObservationUnitRow observationUnitRow = new ObservationUnitRow(); final Map<String, ObservationUnitData> variables = new HashMap<>(); variables.put(ExperimentDao.FIELD_MAP_RANGE, fieldMapRangeObservationData); variables.put(ExperimentDao.FIELD_MAP_COLUMN, fieldMapColumnObservationData); observationUnitRow.setVariables(variables); observationUnitRows.add(observationUnitRow); } return observationUnitRows; }

Target:
private List<ObservationUnitRow> createObservationUnitRowsGroup(final int column, final int range, final int noOfItems) { final List<ObservationUnitRow> observationUnitRows = new LinkedList<>(); for (int i = 1; i <= noOfItems; i++) { final ObservationUnitData fieldMapRangeObservationData = new ObservationUnitData(); fieldMapRangeObservationData.setValue(String.valueOf(range)); final ObservationUnitData fieldMapColumnObservationData = new ObservationUnitData(); fieldMapColumnObservationData.setValue(String.valueOf(column)); final ObservationUnitRow observationUnitRow = new ObservationUnitRow(); final Map<String, ObservationUnitData> variables = new HashMap<>(); variables.put(DataCollectionSorter.FIELDMAP_RANGE, fieldMapRangeObservationData); variables.put(DataCollectionSorter.FIELDMAP_COLUMN, fieldMapColumnObservationData); observationUnitRow.setVariables(variables); observationUnitRows.add(observationUnitRow); } return observationUnitRows; }
Source:
public CRUDHealth checkHealth() { boolean isHealthy = true; Collection<MongoConfiguration> configs = dbResolver.getConfigurations(); Map<String, Object> details = new LinkedHashMap<>(); DBObject ping = new BasicDBObject("ping", 1); DB db = null; for (MongoConfiguration config : configs) { try { db = dbResolver.get(new MongoDataStore(config.getDatabase(), null, null)); CommandResult result = db.command(ping); if (!result.get("ok").equals(1.0)) { isHealthy = false; } else { isHealthy = true; } } catch (Exception e) { isHealthy = false; details.put("stackTrace", e); } details.putAll(getMongoConfigDetails(config)); } return new CRUDHealth(isHealthy, details); }

Target:
public CRUDHealth checkHealth() { boolean isHealthy = true; Collection<MongoConfiguration> configs = dbResolver.getConfigurations(); Map<String, Object> details = new LinkedHashMap<>(); DBObject ping = new BasicDBObject("ping", 1); DB db = null; for (MongoConfiguration config : configs) { try { db = dbResolver.get(new MongoDataStore(config.getDatabase(), null, null)); CommandResult result = db.command(ping); if (!result.get("ok").equals(1.0)) { isHealthy = false; } else { isHealthy = true; } } catch (Exception e) { isHealthy = false; details.put("exception", e); } details.putAll(getMongoConfigDetails(config)); } return new CRUDHealth(isHealthy, details); }
Source:
public DarkSuspicionsEffect() { super(Outcome.LoseLife); staticText = "that player loses X life, where X is the number of cards in that player's hand minus the number of cards in your hand."; }

Target:
public DarkSuspicionsEffect() { super(Outcome.LoseLife); staticText = "that player loses X life, where X is the number of cards in that player's hand minus the number of cards in your hand"; }
Source:
public MetadataImpl(XMPMetadata metadata, COSStream stream) { this.metadata = metadata; this.stream = stream; }

Target:
public MetadataImpl(XMPMetadata metadata, COSStream stream) { if (metadata == null) { throw new IllegalArgumentException("Metadata package can not be null"); } if (stream == null) { throw new IllegalArgumentException("Metadata stream can not be null"); } this.metadata = metadata; this.stream = stream; }
Source:
@Override public void checkJta() throws IgniteCheckedException { if (jtaTm == null) { try { CacheTmLookup tmLookup = tmLookupRef.get(); if (tmLookup == null) return; jtaTm = tmLookup.getTm(); } catch (Exception e) { throw new IgniteCheckedException("Failed to get transaction manager: " + e, e); } } if (jtaTm != null) { try { Transaction jtaTx = jtaTm.getTransaction(); if (jtaTx != null) { GridNearTxLocal tx = cctx.tm().userTx(); if (tx == null) { TransactionConfiguration tCfg = cctx.kernalContext().config() .getTransactionConfiguration(); tx = cctx.tm().newTx( false, false, null, tCfg.getDefaultTxConcurrency(), tCfg.getDefaultTxIsolation(), tCfg.getDefaultTxTimeout(), true, 0 ); CacheJtaResource rsrc = new CacheJtaResource(tx, cctx.kernalContext()); if (useJtaSync) jtaTx.registerSynchronization(rsrc); else if (!jtaTx.enlistResource(rsrc)) throw new IgniteCheckedException("Failed to enlist XA resource to JTA user transaction."); } } } catch (SystemException e) { throw new IgniteCheckedException("Failed to obtain JTA transaction.", e); } catch (RollbackException e) { throw new IgniteCheckedException("Failed to enlist XAResource to JTA transaction.", e); } } }

Target:
@Override public void checkJta() throws IgniteCheckedException { if (jtaTm == null) { try { CacheTmLookup tmLookup = tmLookupRef.get(); if (tmLookup == null) return; jtaTm = tmLookup.getTm(); } catch (Exception e) { throw new IgniteCheckedException("Failed to get transaction manager: " + e, e); } } if (jtaTm != null) { try { Transaction jtaTx = jtaTm.getTransaction(); if (jtaTx != null) { GridNearTxLocal tx = cctx.tm().userTx(); if (tx == null) { TransactionConfiguration txCfg = cctx.kernalContext().config().getTransactionConfiguration(); tx = cctx.tm().newTx( false, false, null, txCfg.getDefaultTxConcurrency(), txCfg.getDefaultTxIsolation(), txCfg.getDefaultTxTimeout(), true, 0 ); CacheJtaResource rsrc = new CacheJtaResource(tx, cctx.kernalContext()); if (useJtaSync) jtaTx.registerSynchronization(rsrc); else if (!jtaTx.enlistResource(rsrc)) throw new IgniteCheckedException("Failed to enlist XA resource to JTA user transaction."); } } } catch (SystemException e) { throw new IgniteCheckedException("Failed to obtain JTA transaction.", e); } catch (RollbackException e) { throw new IgniteCheckedException("Failed to enlist XAResource to JTA transaction.", e); } } }
Source:
public JumpingSumoAnimationsBrick(Animation animation) { this.animationenum = animation; this.animation = animationenum.name(); }

Target:
public JumpingSumoAnimationsBrick(Animation animation) { this.animation = animation; this.animationName = animation.name(); }
Source:
public String toStatsDString() { StringBuilder sb = new StringBuilder(); sb.append(String.format("_sc|%s|%d", name, status)); if (timestamp > 0) { sb.append(String.format("|d:%d", timestamp)); } if (hostname != null) { sb.append(String.format("|h:%s", hostname)); } if (tags != null && tags.length > 0) { sb.append(String.format("|#%s", tags[0])); for(int i=1;i<tags.length;i++) { sb.append(',').append(tags[i]); } sb.append(String.format("", hostname)); } if (message != null) { sb.append(String.format("|m:%s", this.getEscapedMessage())); } return sb.toString(); }

Target:
public String toStatsDString() { StringBuilder sb = new StringBuilder(); sb.append(String.format("_sc|%s|%d", name, status)); if (timestamp > 0) { sb.append(String.format("|d:%d", timestamp)); } if (hostname != null) { sb.append(String.format("|h:%s", hostname)); } if (tags != null && tags.length > 0) { sb.append(String.format("|#%s", tags[0])); for(int i=1;i<tags.length;i++) { sb.append(',').append(tags[i]); } } if (message != null) { sb.append(String.format("|m:%s", this.getEscapedMessage())); } return sb.toString(); }
Source:
public void processAst(IASTTranslationUnit ast) { list = (Object[]) getPreference(getProblemById(ERR_ID, getFile()), PARAM_BLACKLIST); if (list == null || list.length == 0) return; Arrays.sort(list); ast.accept(new ASTVisitor() { { shouldVisitNames = true; } @Override public int visit(IASTName name) { IBinding binding = name.resolveBinding(); if (binding instanceof ICPPFunction) { ICPPFunction method = (ICPPFunction) binding; try { if (isInBlackList(String.join("::", method.getQualifiedName()))) reportProblem(ERR_ID, name); } catch (DOMException e) { CodanCheckersActivator.log(e); } } else if (binding instanceof IFunction) { if (isInBlackList(binding.getName())) reportProblem(ERR_ID, name); } return PROCESS_CONTINUE; } }); }

Target:
public void processAst(IASTTranslationUnit ast) { Object[] list = (Object[]) getPreference(getProblemById(ERR_ID, getFile()), PARAM_BLACKLIST); if (list == null || list.length == 0) return; Arrays.sort(list); ast.accept(new ASTVisitor() { { shouldVisitNames = true; } @Override public int visit(IASTName name) { IBinding binding = name.resolveBinding(); String completeName = getBindingQualifiedName(binding); if (completeName != null && Arrays.binarySearch(list, completeName) >= 0) reportProblem(ERR_ID, name, completeName); return PROCESS_CONTINUE; } }); }
Source:
public void Soap(){ String actionSet = "Consume SOAP Web Service"; String project_SOAP_name = "SOAP_Web"; String model_SOAP_name = "soapSourceModel"; String view_SOAP_name = "soapViewModel"; String vdb_SOAP_name = "SOAP_VDB"; String test_SQL = "exec FullCountryInfo('US')"; String test_SQL2 = "exec FullCountryInfoAllCountries()"; String soapProfile = "SOAP_WS"; guides.createProjectViaGuides(actionSet, project_SOAP_name); guides.chooseAction(actionSet, "Create Web "); DefaultShell cp = new DefaultShell("New Connection Profile"); new LabeledText("Name:").setText(soapProfile); new PushButton(cp, "Next >").click(); WsdlConnectionProfileWizard.getInstance() .setWsdl("<LINK_0>") .testConnection() .nextPage() .setEndPoint("Countries") .finish(); guides.chooseAction(actionSet, "Generate "); new DefaultShell("Create Relational Model from Web Service"); wsdlImportWizard(soapProfile, model_SOAP_name, view_SOAP_name); guides.previewDataViaActionSet(actionSet, project_SOAP_name, view_SOAP_name+".xmi","FullCountryInfoAllCountries"); assertTrue(testLastPreview()); guides.defineVDB(actionSet, project_SOAP_name, vdb_SOAP_name, view_SOAP_name); assertTrue(guides.editVDB(actionSet, project_SOAP_name, vdb_SOAP_name)); List<Integer> results = guides.executeVDB(actionSet, teiidServer, vdb_SOAP_name,test_SQL,test_SQL2); assertEquals(Integer.valueOf(1),results.get(0)); assertEquals(Integer.valueOf(3),results.get(1)); }

Target:
public void Soap(){ String actionSet = "Consume SOAP Web Service"; String project_SOAP_name = "SOAP_Web"; String model_SOAP_name = "soapSourceModel"; String view_SOAP_name = "soapViewModel"; String vdb_SOAP_name = "SOAP_VDB"; String test_SQL = "exec FullCountryInfo('US')"; String test_SQL2 = "exec FullCountryInfoAllCountries()"; guides.createProjectViaGuides(actionSet, project_SOAP_name); guides.chooseAction(actionSet, "Create Web "); DefaultShell cp = new DefaultShell("New Connection Profile"); new CancelButton(cp).click(); guides.chooseAction(actionSet, "Generate "); new DefaultShell("Create Relational Model from Web Service"); wsdlImportWizard(ConnectionProfileConstants.SOAP, model_SOAP_name, view_SOAP_name); guides.previewDataViaActionSet(actionSet, project_SOAP_name, view_SOAP_name+".xmi","FullCountryInfoAllCountries"); assertTrue(testLastPreview()); guides.defineVDB(actionSet, project_SOAP_name, vdb_SOAP_name, view_SOAP_name); assertTrue(guides.editVDB(actionSet, project_SOAP_name, vdb_SOAP_name)); List<Integer> results = guides.executeVDB(actionSet, teiidServer, vdb_SOAP_name,test_SQL,test_SQL2); assertEquals(Integer.valueOf(1),results.get(0)); assertEquals(Integer.valueOf(3),results.get(1)); }
Source:
protected void performCall() { Object service; try { service = getService(call.getService()); } catch (OsgiServiceNotAvailableException e1) { handleExceptionWithFeedback(e1); return; } Method m; try { m = getMethodOfService(service,call.getMethod()); } catch (NoSuchMethodException ex) { throw new IllegalArgumentException(ex); } if(m == null){ return; } try { Object result = m.invoke(service, call.getArgumentsAsArray()); info("Methodcall called successfully"); Class<?> returnType = m.getReturnType(); if (returnType.equals(void.class)) { return; } String resultString; if (returnType.isArray()) { try { Constructor<String> constructor = String.class.getConstructor(returnType); resultString = constructor.newInstance(result); } catch (Exception e) { resultString = ArrayUtils.toString(result); } } else { resultString = result.toString(); } info("Result " + returnType.getName() + ": " + resultString); LOGGER.info("result: {}", resultString); } catch (IllegalAccessException e) { handleExceptionWithFeedback(e); } catch (InvocationTargetException e) { handleExceptionWithFeedback(e.getCause()); } }

Target:
protected void performCall() { Object service; try { service = getService(call.getService()); } catch (OsgiServiceNotAvailableException e1) { handleExceptionWithFeedback(e1); return; } Method method; try { method = getMethodOfService(service,call.getMethod()); } catch (NoSuchMethodException ex) { throw new IllegalArgumentException(ex); } if(method == null){ return; } try { Object result = method.invoke(service, call.getArgumentsAsArray()); info("Methodcall called successfully"); Class<?> returnType = method.getReturnType(); if (returnType.equals(void.class)) { return; } String resultString; if (returnType.isArray()) { try { Constructor<String> constructor = String.class.getConstructor(returnType); resultString = constructor.newInstance(result); } catch (Exception e) { resultString = ArrayUtils.toString(result); } } else { resultString = result.toString(); } info("Result " + returnType.getName() + ": " + resultString); LOGGER.info("result: {}", resultString); } catch (IllegalAccessException e) { handleExceptionWithFeedback(e); } catch (InvocationTargetException e) { handleExceptionWithFeedback(e.getCause()); } }
Source:
void testDeleteArtifactAndEmptyTrashForAllRepositories(String acceptHeader, @MavenRepository(repositoryId = REPOSITORY_WITH_TRASH_3) @RepositoryAttributes(trashEnabled = true) Repository repository1, @MavenTestArtifact(repositoryId = REPOSITORY_WITH_TRASH_3, id = "org.carlspring.strongbox:test-artifact-to-trash", versions = "1.0") Path artifactPath1, @MavenRepository(repositoryId = REPOSITORY_WITH_FORCE_DELETE_2) Repository repository2, @MavenTestArtifact(repositoryId = REPOSITORY_WITH_FORCE_DELETE_2, id = "org.carlspring.strongbox:test-artifact-to-trash", versions = "1.1") Path artifactPath2) { String url = getContextBaseUrl(); ValidatableMockMvcResponse response = given().accept(acceptHeader) .when() .delete(url) .peek() .then() .statusCode(HttpStatus.OK.value()); String message = "The trash for all repositories was successfully removed."; validateResponseBody(response, acceptHeader, message); assertFalse(Files.exists(getPathToArtifactInTrash(repository1, artifactPath1)), "Failed to empty trash for repository '" + repository1.getId() + "'!"); }

Target:
void testDeleteArtifactAndEmptyTrashForAllRepositories(String acceptHeader, @MavenRepository(repositoryId = REPOSITORY_WITH_TRASH_3) @RepositoryAttributes(trashEnabled = true) Repository repository1, @MavenTestArtifact(repositoryId = REPOSITORY_WITH_TRASH_3, id = "org.carlspring.strongbox:test-artifact-to-trash", versions = "1.0") Path artifactPath1, @MavenRepository(repositoryId = REPOSITORY_WITH_FORCE_DELETE_2) Repository repository2, @MavenTestArtifact(repositoryId = REPOSITORY_WITH_FORCE_DELETE_2, id = "org.carlspring.strongbox:test-artifact-to-trash", versions = "1.1") Path artifactPath2) throws IOException { String url = getContextBaseUrl(); ValidatableMockMvcResponse response = given().accept(acceptHeader) .when() .delete(url) .peek() .then() .statusCode(HttpStatus.OK.value()); String message = "The trash for all repositories was successfully removed."; validateResponseBody(response, acceptHeader, message); final RepositoryPath artifactRepositoryPath = (RepositoryPath) artifactPath1.normalize(); final Path artifactFileInTrash = RepositoryFiles.trash(artifactRepositoryPath); assertFalse(Files.exists(artifactFileInTrash), "Failed to empty trash for repository '" + repository1.getId() + "'!"); }
Source:
public TransactionStatus(TransactionStateType status, String message, Iterable<FragmentReportType> fragmentReports) { this.status = checkNotNull(status); this.message = checkNotNull(message); if (fragmentReports == null) { this.fragmentReports = Optional.absent(); } else { this.fragmentReports = Optional.<List<FragmentReportType>>of( ImmutableList.copyOf(fragmentReports) ); } }

Target:
public TransactionStatus(TransactionStateType status, String message, Iterable<FragmentReportType> fragmentReports) { this.status = checkNotNull(status); this.message = checkNotNull(message); this.fragmentReports = fromNullable(fragmentReports); }
Source:
private void populateReviewAction() { final Button b = new Button(Util.C.buttonReview()); b.addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { Gerrit.display("change,publish," + patchSet.getId().toString(), new PublishCommentScreen(patchSet.getId())); } }); actionsPanel.add(b); }

Target:
private void populateReviewAction() { final Button b = new Button(Util.C.buttonReview()); b.addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { Gerrit.display(Dispatcher.toPublish(patchSet.getId())); } }); actionsPanel.add(b); }
Source:
public String rawId() { return String.valueOf(id); }

Target:
public String rawId() { return id; }
Source:
public void handleFault(MessageContext synCtx) { boolean traceOn = synCtx.getTracingState() == SynapseConstants.TRACING_ON; boolean traceOrDebugOn = traceOn || log.isDebugEnabled(); List handlers = synCtx.getEnvironment().getSynapseHandlers(); Iterator<SynapseHandler> iterator = handlers.iterator(); while (iterator.hasNext()) { SynapseHandler handler = iterator.next(); if ((handler instanceof AbstractExtendedSynapseHandler) && (synCtx.getProperty("HasCountedError") == null)) { if (!((AbstractExtendedSynapseHandler) handler).handleError(synCtx)) { return; } } } if (traceOrDebugOn) { traceOrDebugWarn(traceOn, "FaultHandler executing impl: " + this.getClass().getName()); } try { synCtx.getServiceLog().info("FaultHandler executing impl: " + this.getClass().getName()); onFault(synCtx); } catch (SynapseException e) { Stack faultStack = synCtx.getFaultStack(); if (faultStack != null && !faultStack.isEmpty()) { ((FaultHandler) faultStack.pop()).handleFault(synCtx); } } }

Target:
public void handleFault(MessageContext synCtx) { boolean traceOn = synCtx.getTracingState() == SynapseConstants.TRACING_ON; boolean traceOrDebugOn = traceOn || log.isDebugEnabled(); executeExtendedSynapseHandlerOnFault(synCtx); if (traceOrDebugOn) { traceOrDebugWarn(traceOn, "FaultHandler executing impl: " + this.getClass().getName()); } try { String msg = "FaultHandler executing impl: " + this.getClass().getName(); synCtx.getServiceLog().info(msg); onFault(synCtx); } catch (SynapseException e) { Stack faultStack = synCtx.getFaultStack(); if (faultStack != null && !faultStack.isEmpty()) { ((FaultHandler) faultStack.pop()).handleFault(synCtx); } } }
Source:
public Stream<StringResult> clearAllQueryCaches() { securityContext.assertCredentialsNotExpired(); if ( !securityContext.isAdmin() ) { throw new AuthorizationViolationException( PERMISSION_DENIED ); } QueryExecutionEngine queryExecutionEngine = graph.getDependencyResolver().resolveDependency( QueryExecutionEngine.class ); long numberOfClearedQueries = queryExecutionEngine.clearQueryCaches() - 1; String result = numberOfClearedQueries == 0 ? "Query cache already empty." : "Query caches successfully cleared of " + numberOfClearedQueries + " queries."; log.info( result ); return Stream.of( new StringResult( result ) ); }

Target:
public Stream<StringResult> clearAllQueryCaches() { securityContext.assertCredentialsNotExpired(); if ( !securityContext.isAdmin() ) { throw new AuthorizationViolationException( PERMISSION_DENIED ); } QueryExecutionEngine queryExecutionEngine = graph.getDependencyResolver().resolveDependency( QueryExecutionEngine.class ); long numberOfClearedQueries = queryExecutionEngine.clearQueryCaches() - 1; String result = numberOfClearedQueries == 0 ? "Query cache already empty." : "Query caches successfully cleared of " + numberOfClearedQueries + " queries."; log.info( "Called dbms.clearQueryCaches(): " + result ); return Stream.of( new StringResult( result ) ); }
Source:
public List<PatchSetApproval> byPatchSet(ReviewDb db, ChangeNotes notes, PatchSet.Id psId) throws OrmException { if (!migration.readPatchSetApprovals()) { return sortApprovals(db.patchSetApprovals().byPatchSet(psId)); } ImmutableListMultimap<Id, PatchSetApproval> approvals = notes.load().getApprovals(); if (approvals != null) { return approvals.get(psId); } return Collections.emptyList(); }

Target:
public List<PatchSetApproval> byPatchSet(ReviewDb db, ChangeNotes notes, PatchSet.Id psId) throws OrmException { if (!migration.readPatchSetApprovals()) { return sortApprovals(db.patchSetApprovals().byPatchSet(psId)); } return notes.load().getApprovals().get(psId); }
Source:
public ConfigTemperaturesMsg(String rawMsg) { super(rawMsg); logger.debug(this.msgType+" Payload Len -> "+this.payload.length); if (this.payload.length == CONFIG_TEMPERATURES_PAYLOAD_LEN) { this.comfortTemp = payload[0]/2.0; this.ecoTemp = payload[1]/2.0; this.maxTemp = payload[2]/2.0; this.minTemp = payload[3]/2.0; this.offset = (payload[4]/2.0)-3.5; this.windowOpenTemp = payload[5]/2.0; this.windowOpenTime = payload[6]*5.0; } else logger.error("Got "+this.msgType+" message with incorrect length!"); }

Target:
public ConfigTemperaturesMsg(String rawMsg) { super(rawMsg); logger.debug(this.msgType + " Payload Len -> " + this.payload.length); if (this.payload.length == CONFIG_TEMPERATURES_PAYLOAD_LEN) { this.comfortTemp = payload[0] / 2.0; this.ecoTemp = payload[1] / 2.0; this.maxTemp = payload[2] / 2.0; this.minTemp = payload[3] / 2.0; this.offset = (payload[4] / 2.0) - 3.5; this.windowOpenTemp = payload[5] / 2.0; this.windowOpenTime = payload[6] * 5.0; } else { logger.error("Got " + this.msgType + " message with incorrect length!"); } }
Source:
private Throwable extractException(Map<String, Throwable> failures) { if (failures.isEmpty()) { return new AssertionError(); } if (failures.size() == 1) { return failures.values().iterator().next(); } StringBuilder errorMessage = new StringBuilder(); for (Map.Entry<String, Throwable> failureEntry : failures.entrySet()) { errorMessage.append("\n\n").append(failureEntry.getKey()).append(":\n"); Throwable throwable = failureEntry.getValue(); errorMessage .append(throwable.getClass()).append(": ") .append(throwable.getMessage()); for (StackTraceElement e : throwable.getStackTrace()) { errorMessage.append("\n at ").append(e); } } return new AssertionError(errorMessage.toString()); }

Target:
private Throwable extractException(Map<String, Throwable> failures) { if (failures.isEmpty()) { return new AssertionError(); } if (failures.size() == 1) { return failures.values().iterator().next(); } StringBuilder errorMessage = new StringBuilder("========== Multiple Failures =========="); for (Map.Entry<String, Throwable> failureEntry : failures.entrySet()) { errorMessage.append("\n\n=== "). append(failureEntry.getKey()).append(" ===\n"); Throwable throwable = failureEntry.getValue(); errorMessage .append(throwable.getClass()).append(": ") .append(throwable.getMessage()); for (StackTraceElement e : throwable.getStackTrace()) { if (e.getClassName().equals(getClass().getName())) { break; } errorMessage.append("\n at ").append(e); } } errorMessage.append("\n=======================================\n\n"); AssertionError assertionError = new AssertionError(errorMessage.toString()); return assertionError; }
Source:
public void getReserveStatistics() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final ReserveService reserveService = adapter.create(ReserveService.class); reserveService.getStatistics(new RetrofitPromise<List<ReserveStatistics>>()); latch.await(); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/reserve/statistics", MOCK_URL)); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); }

Target:
public void getReserveStatistics() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final ReserveService reserveService = adapter.create(ReserveService.class); reserveService.getStatistics(new RetrofitPromise<List<ReserveStatistics>>()); latch.await(); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/reserve/statistics", MOCK_URL)); }
Source:
private String getSubject(final Report report, final Instant scheduled) { final String formattedTime = ZonedDateTime.ofInstant(scheduled, ZoneId.of("UTC")).toString(); return "[Report] " + report.getName() + " for " + formattedTime; }

Target:
private String getSubject(final Report report, final Instant scheduled) { final String formattedTime = ZonedDateTime.ofInstant(scheduled, ZoneOffset.UTC).toString(); return "[Report] " + report.getName() + " for " + formattedTime; }