auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void sendError(int status, String message) { if ((status < 100) || (status > 999)) { throw new IllegalArgumentException("HTTP status code must be between 100 and 999."); } if ((message == null) || message.isEmpty()) { throw new IllegalArgumentException("Error message cannot be null or empty."); } throw new HttpErrorException(status, message); }

Target:
public static void sendError(int status, String message) { if ((status < 100) || (status > 599)) { throw new IllegalArgumentException("HTTP status code must be between 100 and 599."); } if ((message == null) || message.isEmpty()) { throw new IllegalArgumentException("Error message cannot be null or empty."); } throw new HttpErrorException(status, message); }
Source:
public void setNode(Node selectedNode) { if ((selectedNode == null) || (!isSupported(selectedNode))) { resetComponent(); return; } AbstractFile file = selectedNode.getLookup().lookup(AbstractFile.class); if (file == null) { resetComponent(); return; } dataSource = file; resetComponent(); if(dataSource.getType() == TSK_DB_FILES_TYPE_ENUM.LOCAL && dataSource.getLocalAbsPath().endsWith(".html")) { loadWebEngineFileURL(dataSource.getLocalAbsPath()); } else { try { long size = file.getSize(); byte[] dataBytes = new byte[(int)size]; dataSource.read(dataBytes, 0, (int)size); String HTML = new String(dataBytes); loadWebEngineContent(HTML); } catch (TskCoreException ex) { Exceptions.printStackTrace(ex); } } }

Target:
public void setNode(Node selectedNode) { if ((selectedNode == null) || (!isSupported(selectedNode))) { resetComponent(); return; } AbstractFile file = selectedNode.getLookup().lookup(AbstractFile.class); if (file == null) { resetComponent(); return; } dataSource = file; resetComponent(); if(dataSource.getType() == TSK_DB_FILES_TYPE_ENUM.LOCAL && hasValidPathExtension(dataSource.getLocalAbsPath())) { loadWebEngineFileURL(dataSource.getLocalAbsPath()); } else { try { long size = file.getSize(); byte[] dataBytes = new byte[(int)size]; dataSource.read(dataBytes, 0, (int)size); String HTML = new String(dataBytes); loadWebEngineContent(HTML); } catch (TskCoreException ex) { logger.log(Level.WARNING, "An error occurred while reading data from a " + "file in the HTML content viewer.", ex); } } }
Source:
@Override public ClassName withoutAnnotations() { ClassName resultEnclosingClassName = enclosingClassName != null ? enclosingClassName.withoutAnnotations() : null; return isAnnotated() ? new ClassName(packageName, resultEnclosingClassName, simpleName) : this; }

Target:
@Override public ClassName withoutAnnotations() { if (!isAnnotated()) return this; ClassName resultEnclosingClassName = enclosingClassName != null ? enclosingClassName.withoutAnnotations() : null; return new ClassName(packageName, resultEnclosingClassName, simpleName); }
Source:
private static List<DirectoryUser> queryPrincipals( final ExtensionProxy extension, final String namespace, final ExtMap filter, boolean groupsResolving) { ExtMap inputMap = new ExtMap().mput( Authz.InvokeKeys.QUERY_ENTITY, Authz.QueryEntity.PRINCIPAL ).mput( Authz.InvokeKeys.QUERY_FLAGS, groupsResolving ? Authz.QueryFlags.RESOLVE_GROUPS : Authz.QueryFlags.RESOLVE_GROUPS_NONE ).mput( Authz.InvokeKeys.QUERY_FILTER, filter ).mput( Authz.InvokeKeys.NAMESPACE, namespace ); return populatePrincipals( extension, namespace, inputMap); }

Target:
private static List<DirectoryUser> queryPrincipals( final ExtensionProxy extension, final String namespace, final ExtMap filter, boolean groupsResolving) { ExtMap inputMap = new ExtMap().mput( Authz.InvokeKeys.QUERY_ENTITY, Authz.QueryEntity.PRINCIPAL ).mput( Authz.InvokeKeys.QUERY_FLAGS, queryFlagValue(groupsResolving, false) ).mput( Authz.InvokeKeys.QUERY_FILTER, filter ).mput( Authz.InvokeKeys.NAMESPACE, namespace ); return populatePrincipals( extension, namespace, inputMap); }
Source:
private void collectReadData(final SAMRecord record) { if (record.getSupplementaryAlignmentFlag()) return; metrics.TOTAL_READS++; readLengthHistogram.increment(record.getReadBases().length); if (!record.getReadFailsVendorQualityCheckFlag()) { metrics.PF_READS++; if (isNoiseRead(record)) metrics.PF_NOISE_READS++; if (record.getReadUnmappedFlag() || record.getMappingQuality() == 0) { final byte[] readBases = record.getReadBases(); final boolean revComp = !record.getReadUnmappedFlag() && record.getMappingQuality() == 0 && record.getReadNegativeStrandFlag(); if (!(record instanceof BAMRecord)) { StringUtil.toUpperCase(readBases); } if (adapterUtility.isAdapterSequence(readBases, revComp)) { this.adapterReads++; } } if (!record.getReadUnmappedFlag() && doRefMetrics) { metrics.PF_READS_ALIGNED++; if (record.getReadPairedFlag() && !record.getProperPairFlag()) metrics.PF_READS_IMPROPER_PAIRS++; if (!record.getReadNegativeStrandFlag()) numPositiveStrand++; if (record.getReadPairedFlag() && !record.getMateUnmappedFlag()) { metrics.READS_ALIGNED_IN_PAIRS++; final Integer mateMq = record.getIntegerAttribute(SAMTag.MQ.toString()); if (mateMq == null || mateMq >= MAPPING_QUALITY_THRESHOLD && record.getMappingQuality() >= MAPPING_QUALITY_THRESHOLD) { ++this.chimerasDenominator; if (ChimeraUtil.isChimeric(record, maxInsertSize, expectedOrientations)) { ++this.chimeras; } } } else { if (record.getMappingQuality() >= MAPPING_QUALITY_THRESHOLD) { ++this.chimerasDenominator; if (record.getAttribute(SAMTag.SA.toString()) != null) ++this.chimeras; } } } } }

Target:
private void collectReadData(final SAMRecord record) { if (record.getSupplementaryAlignmentFlag()) return; metrics.TOTAL_READS++; readLengthHistogram.increment(record.getReadBases().length); if (!record.getReadFailsVendorQualityCheckFlag()) { metrics.PF_READS++; if (isNoiseRead(record)) metrics.PF_NOISE_READS++; if (adapterUtility.isAdapter(record)) { this.adapterReads++; } if (!record.getReadUnmappedFlag() && doRefMetrics) { metrics.PF_READS_ALIGNED++; if (record.getReadPairedFlag() && !record.getProperPairFlag()) metrics.PF_READS_IMPROPER_PAIRS++; if (!record.getReadNegativeStrandFlag()) numPositiveStrand++; if (record.getReadPairedFlag() && !record.getMateUnmappedFlag()) { metrics.READS_ALIGNED_IN_PAIRS++; final Integer mateMq = record.getIntegerAttribute(SAMTag.MQ.toString()); if (mateMq == null || mateMq >= MAPPING_QUALITY_THRESHOLD && record.getMappingQuality() >= MAPPING_QUALITY_THRESHOLD) { ++this.chimerasDenominator; if (ChimeraUtil.isChimeric(record, maxInsertSize, expectedOrientations)) { ++this.chimeras; } } } else { if (record.getMappingQuality() >= MAPPING_QUALITY_THRESHOLD) { ++this.chimerasDenominator; if (record.getAttribute(SAMTag.SA.toString()) != null) ++this.chimeras; } } } } }
Source:
protected RepositoryPath getTrashPath(RepositoryPath path) throws IOException { if (RepositoryFiles.isTrash(path)) { return path; } RepositoryPath trashBasePath = path.getFileSystem().getTrashPath(); RepositoryPath trashPath = rebase(path, trashBasePath); if (!Files.exists(trashPath.getParent().getTarget())) { logger.debug("Creating: dir-[{}]", trashPath.getParent()); Files.createDirectories(trashPath.getParent().getTarget()); } return trashPath; }

Target:
protected RepositoryPath getTrashPath(RepositoryPath path) throws IOException { if (RepositoryFiles.isTrash(path)) { return path; } RepositoryPath trashBasePath = path.getFileSystem().getTrashPath(); RepositoryPath trashPath = rebase(path, trashBasePath); if (!Files.exists(trashPath.getParent().getTarget())) { logger.debug("Creating: [{}]", trashPath.getParent()); Files.createDirectories(trashPath.getParent().getTarget()); } return trashPath; }
Source:
private static void stop() throws Exception { String twillId = verifyTwillId(); TwillController controller = twillRunner.lookup(FLUO_APP_NAME, RunIds.fromString(twillId)); if ((controller != null) && controller.isRunning()) { System.out.print("Stopping Fluo instance " + getAppInfo()+ "..."); controller.stopAndWait(); System.out.println("DONE"); deleteZkData(); } else { System.out.println("WARNING - " + existsButNotRunningMsg()); } }

Target:
private static void stop() throws Exception { String twillId = verifyTwillId(); TwillController controller = twillRunner.lookup(FLUO_APP_NAME, RunIds.fromString(twillId)); if (controller != null) { System.out.print("Stopping Fluo instance " + getAppInfo()+ "..."); controller.stopAndWait(); System.out.println("DONE"); } else { logExistsButNotRunning(); } deleteZkData(); }
Source:
public EntryHeader(ByteBuffer buffer) { if (useMagic) { if (buffer.getInt() != MAGIC) throw new IllegalStateException(); } this.keyLength = buffer.getShort(); this.metadataLength = buffer.getShort(); this.valueLength = buffer.getInt(); this.internalMetadataLength = buffer.getInt(); this.seqId = buffer.getLong(); this.expiration = buffer.getLong(); }

Target:
public EntryHeader(ByteBuffer buffer) { this(buffer, false); }
Source:
public MySearchResult(Task t, TaskSearchService searchService, String query, String snippet, String snippetText) { super(t.getTaskID(), "Task", t.getName(), query, snippet, snippetText, "", t, searchService); }

Target:
MySearchResult(Task t, TaskSearchService searchService, String query, String snippet, String snippetText) { super(t.getTaskID(), GanttLanguage.getInstance().getText("generic.task"), t.getName(), query, snippet, snippetText, t, searchService); }
Source:
private ThrottleJobProperty getThrottleJobProperty(Task task) { if (task instanceof Job) { Job<?,?> p = (Job<?,?>) task; if (task instanceof MatrixConfiguration) { p = (Job<?,?>)((MatrixConfiguration)task).getParent(); } ThrottleJobProperty tjp = p.getProperty(ThrottleJobProperty.class); return tjp; } return null; }

Target:
private ThrottleJobProperty getThrottleJobProperty(Task task) { if (task instanceof Job) { Job<?,?> p = (Job<?,?>) task; if (task instanceof MatrixConfiguration) { p = ((MatrixConfiguration)task).getParent(); } ThrottleJobProperty tjp = p.getProperty(ThrottleJobProperty.class); return tjp; } return null; }
Source:
public void testExecuteUpdate() throws Exception { try (Connection connection = createConnection("blackhole", "blackhole")) { try (Statement statement = connection.createStatement()) { statement.execute("CREATE TABLE test_execute_update (" + "c_boolean boolean, " + "c_tinyint tinyint, " + "c_smallint smallint, " + "c_integer integer, " + "c_bigint bigint, " + "c_real real, " + "c_double double, " + "c_decimal decimal, " + "c_varchar varchar, " + "c_varbinary varbinary, " + "c_date date, " + "c_time time, " + "c_timestamp timestamp," + "c_null bigint)"); } try (PreparedStatement statement = connection.prepareStatement( "INSERT INTO test_execute_update VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")) { setTestValues(statement); assertEquals(statement.executeUpdate(), 1); } } }

Target:
public void testExecuteUpdate() throws Exception { try (Connection connection = createConnection("blackhole", "blackhole")) { try (Statement statement = connection.createStatement()) { statement.execute("CREATE TABLE test_execute_update (" + "c_boolean boolean, " + "c_bigint bigint, " + "c_double double, " + "c_decimal decimal, " + "c_varchar varchar, " + "c_varbinary varbinary, " + "c_null bigint)"); } try (PreparedStatement statement = connection.prepareStatement( "INSERT INTO test_execute_update VALUES (?, ?, ?, ?, ?, ?, ?)")) { statement.setBoolean(1, true); statement.setLong(2, 5L); statement.setDouble(3, 7.0d); statement.setBigDecimal(4, BigDecimal.valueOf(8L)); statement.setString(5, "abc'xyz"); statement.setBytes(6, "xyz".getBytes(UTF_8)); statement.setNull(7, Types.BIGINT); assertEquals(statement.executeUpdate(), 1); assertFalse(statement.execute()); assertEquals(statement.getUpdateCount(), 1); assertEquals(statement.getLargeUpdateCount(), 1); } try (Statement statement = connection.createStatement()) { statement.execute("DROP TABLE test_execute_update"); } } }
Source:
public void testDefaultProperty() { Properties p = new Properties(); p.put("p1", "v1"); Interpreter intp = new Interpreter(p) { @Override public void open() { } @Override public void close() { } @Override public InterpreterResult interpret(String st, InterpreterContext context) { return null; } @Override public void cancel(InterpreterContext context) { } @Override public FormType getFormType() { return null; } @Override public int getProgress(InterpreterContext context) { return 0; } }; assertEquals(1, intp.getProperty().size()); assertEquals("v1", intp.getProperty().get("p1")); assertEquals("v1", intp.getProperty("p1")); }

Target:
public void testDefaultProperty() { Properties p = new Properties(); p.put("p1", "v1"); Interpreter intp = new DummyInterpreter(p); assertEquals(1, intp.getProperty().size()); assertEquals("v1", intp.getProperty().get("p1")); assertEquals("v1", intp.getProperty("p1")); }
Source:
public Collection<DataManipulator<?, ?>> getContainers() { return null; }

Target:
public Collection<DataManipulator<?, ?>> getContainers() { return Collections.emptyList(); }
Source:
private String toComparableJson(List<JsonObject> bodyParts) { JsonArray array = new JsonArray( bodyParts.size() ); for ( JsonObject bodyPart : bodyParts ) { array.add( bodyPart ); } return array.toString(); }

Target:
private String toComparableJson(List<JsonObject> bodyParts) { JsonArray array = new JsonArray( bodyParts.size() ); for ( JsonObject bodyPart : bodyParts ) { array.add( bodyPart ); } return gson.toJson( array ); }
Source:
public String getUnifiedDiff() { PatchList patchList; try { patchList = getPatchList(); if (patchList.getOldId() == null) { return "[Octopus merge; cannot be formatted as a diff.]\n"; } } catch (PatchListNotAvailableException e) { log.error("Cannot format patch", e); return ""; } TemporaryBuffer.Heap buf = new TemporaryBuffer.Heap(8192, args.settings.maximumDiffSize); try (DiffFormatter fmt = new DiffFormatter(buf)) { Repository git; try { git = args.server.openRepository(change.getProject()); } catch (IOException e) { log.error("Cannot open repository to format patch", e); return ""; } try { fmt.setRepository(git); fmt.setDetectRenames(true); fmt.format(patchList.getOldId(), patchList.getNewId()); return RawParseUtils.decode(buf.toByteArray()); } catch (IOException e) { if (JGitText.get().inMemoryBufferLimitExceeded.equals(e.getMessage())) { return ""; } log.error("Cannot format patch", e); return ""; } finally { git.close(); } } }

Target:
public String getUnifiedDiff() { PatchList patchList; try { patchList = getPatchList(); if (patchList.getOldId() == null) { return "[Octopus merge; cannot be formatted as a diff.]\n"; } } catch (PatchListNotAvailableException e) { log.error("Cannot format patch", e); return ""; } TemporaryBuffer.Heap buf = new TemporaryBuffer.Heap(HEAP_EST_SIZE, args.settings.maximumDiffSize); try (DiffFormatter fmt = new DiffFormatter(buf)) { Repository git; try { git = args.server.openRepository(change.getProject()); } catch (IOException e) { log.error("Cannot open repository to format patch", e); return ""; } try { fmt.setRepository(git); fmt.setDetectRenames(true); fmt.format(patchList.getOldId(), patchList.getNewId()); return RawParseUtils.decode(buf.toByteArray()); } catch (IOException e) { if (JGitText.get().inMemoryBufferLimitExceeded.equals(e.getMessage())) { return ""; } log.error("Cannot format patch", e); return ""; } finally { git.close(); } } }
Source:
protected ApplicationInfo getAppInfo() { try { return context.getPackageManager().getApplicationInfo(context.getPackageName(), 0); } catch (final PackageManager.NameNotFoundException e) { return null; } }

Target:
private ApplicationInfo getAppInfo() { try { return mContext.getPackageManager().getApplicationInfo(mContext.getPackageName(), 0); } catch (final PackageManager.NameNotFoundException e) { return null; } }
Source:
public boolean removeJobs(String sessionId, List<String> jobsId) throws RestException { try { checkAccess(sessionId, "DELETE jobs/"); Scheduler s = checkAccess(sessionId, "DELETE jobs/" + jobsId.get(0)); return s.removeJobs(jobsId.stream().map(JobIdImpl::makeJobId).collect(Collectors.toList())); } catch (SchedulerException e) { throw RestException.wrapExceptionToRest(e); } }

Target:
public boolean removeJobs(String sessionId, List<String> jobsId) throws RestException { try { checkAccess(sessionId, "DELETE jobs/"); Scheduler s = checkAccess(sessionId, "DELETE jobs/" + (jobsId.isEmpty() ? "" : jobsId.get(0))); return s.removeJobs(jobsId.stream().map(JobIdImpl::makeJobId).collect(Collectors.toList())); } catch (SchedulerException e) { throw RestException.wrapExceptionToRest(e); } }
Source:
private Map<Node, Map<TopicPartition, ListOffsetRequest.PartitionData>> groupListOffsetRequests( Map<TopicPartition, Long> timestampsToSearch, Set<TopicPartition> partitionsToRetry) { final Map<TopicPartition, ListOffsetRequest.PartitionData> partitionDataMap = new HashMap<>(); for (Map.Entry<TopicPartition, Long> entry: timestampsToSearch.entrySet()) { TopicPartition tp = entry.getKey(); Long offset = entry.getValue(); Optional<Metadata.LeaderAndEpoch> leaderAndEpochOpt = metadata.currentLeader(tp); if (!leaderAndEpochOpt.isPresent()) { log.debug("Leader for partition is unknown for fetching offset {}", tp, offset); metadata.requestUpdate(); partitionsToRetry.add(tp); } else { Metadata.LeaderAndEpoch leaderAndEpoch = leaderAndEpochOpt.get(); Node leader = leaderAndEpoch.leader; if (client.isUnavailable(leader)) { client.maybeThrowAuthFailure(leader); log.debug("Leader for partition is unavailable for fetching offset until reconnect backoff expires", leader, tp); partitionsToRetry.add(tp); } else { partitionDataMap.put(tp, new ListOffsetRequest.PartitionData(offset, leaderAndEpoch.epoch)); } } } return regroupPartitionMapByNode(partitionDataMap); }

Target:
private Map<Node, Map<TopicPartition, ListOffsetRequest.PartitionData>> groupListOffsetRequests( Map<TopicPartition, Long> timestampsToSearch, Set<TopicPartition> partitionsToRetry) { final Map<TopicPartition, ListOffsetRequest.PartitionData> partitionDataMap = new HashMap<>(); for (Map.Entry<TopicPartition, Long> entry: timestampsToSearch.entrySet()) { TopicPartition tp = entry.getKey(); Long offset = entry.getValue(); Metadata.LeaderAndEpoch leaderAndEpoch = metadata.currentLeader(tp); if (!leaderAndEpoch.leader.isPresent()) { log.debug("Leader for partition is unknown for fetching offset {}", tp, offset); metadata.requestUpdate(); partitionsToRetry.add(tp); } else { Node leader = leaderAndEpoch.leader.get(); if (client.isUnavailable(leader)) { client.maybeThrowAuthFailure(leader); log.debug("Leader for partition is unavailable for fetching offset until reconnect backoff expires", leader, tp); partitionsToRetry.add(tp); } else { partitionDataMap.put(tp, new ListOffsetRequest.PartitionData(offset, leaderAndEpoch.epoch)); } } } return regroupPartitionMapByNode(partitionDataMap); }
Source:
public void testNonExistentVersion() throws Exception { HttpResponse localVersionNegotiationResponse = HttpResponse.builder().statusCode(300).message("HTTP/1.1 300 Multiple Choices").payload( payloadFromResourceWithContentType("/glanceVersionResponseVersionUnavailable.json", "application/json")).build(); GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess, versionNegotiationRequest, localVersionNegotiationResponse); try { apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").list(); } catch (UncheckedExecutionException e) { if (e.getCause().getClass() == HttpException.class) return; } fail("Did not throw expected HttpException"); }

Target:
public void testNonExistentVersion() throws Exception { HttpResponse localVersionNegotiationResponse = HttpResponse.builder().statusCode(300).message("HTTP/1.1 300 Multiple Choices").payload( payloadFromResourceWithContentType("/glanceVersionResponseVersionUnavailable.json", "application/json")).build(); GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess, versionNegotiationRequest, localVersionNegotiationResponse); apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").list(); }
Source:
private static String buildExceptionMessage(final Error error, final ImmutableList<Integer> expectedStatusCodes, final int statusCode) { final Joiner joiner = Joiner.on(','); return error == null ? String.format( "Expected a status code of %s but got %d. Could not parse the response for additional information.", joiner.join(expectedStatusCodes), statusCode ) : String.format( "Expected a status code of %s but got %d. Error message: \"%s\"", joiner.join(expectedStatusCodes), statusCode, error.getMessage() ); }

Target:
private static String buildExceptionMessage(final Error error, final ImmutableList<Integer> expectedStatusCodes, final int statusCode) { final Joiner joiner = Joiner.on(", "); return error == null ? String.format( "Expected a status code of %s but got %d. Could not parse the response for additional information.", joiner.join(expectedStatusCodes), statusCode ) : String.format( "Expected a status code of %s but got %d. Error message: \"%s\"", joiner.join(expectedStatusCodes), statusCode, error.getMessage() ); }
Source:
public void shouldGetReports() { when(commcareHttpClient.reportsListMetadataRequest(configService.getByName(null).getAccountConfig())).thenReturn(getResponseForReportsList()); ReportsMetadataInfo reportsMetadataInfo = reportService.getReportsList(); assertThat(reportsMetadataInfo.getMetadataInfo().getTotalCount(), equalTo(2)); assertThat(reportsMetadataInfo.getReportMetadataInfoList().size(), equalTo(2)); assertThat(reportsMetadataInfo.getReportMetadataInfoList().get(0).getColumns().size(), equalTo(3)); assertThat(reportsMetadataInfo.getReportMetadataInfoList().get(0).getFilters().size(), equalTo(2)); }

Target:
public void shouldGetReports() { ReportsMetadataInfo reportsMetadataInfo = prepareReportsMetadataInfo(); when(commcareHttpClient.reportsListMetadataRequest(configService.getByName(null).getAccountConfig())).thenReturn(getResponseForReportsListMetadata()); ReportsMetadataInfo fetched = reportService.getReportsList(); assertEquals(reportsMetadataInfo, fetched); }
Source:
public static String pathToRemoteSystem(IHost host, String path, String append) { boolean hostIsWindows = hostIsWindows(host); char sep = hostIsWindows ? WINDOWS_SEPARATOR : UNIX_SEPARATOR; boolean endsWithSep = path.endsWith(Character.toString(WINDOWS_SEPARATOR)) || path.endsWith(Character.toString(UNIX_SEPARATOR)); String path2 = append == null ? path : (endsWithSep ? path : path + sep) + append; String path3 = hostIsWindows ? separatorsToWindows(path2) : separatorsToUnix(path2); return path3; }

Target:
public static String pathToRemoteSystem(IHost host, String path, String append) { boolean hostIsWindows = isHostWindows(host); char sep = hostIsWindows ? WINDOWS_SEPARATOR : UNIX_SEPARATOR; boolean endsWithSep = path.endsWith(Character.toString(WINDOWS_SEPARATOR)) || path.endsWith(Character.toString(UNIX_SEPARATOR)); String path2 = append == null ? path : (endsWithSep ? path : path + sep) + append; String path3 = hostIsWindows ? separatorsToWindows(path2) : separatorsToUnix(path2); return path3; }
Source:
public Response getPMMLAvailability(@PathParam("algorithmName") String algorithmName, @QueryParam("format") String format) { if (algorithmName == null) { return Response.status(Response.Status.BAD_REQUEST).entity("Cannot find the algorithm name from the URI.") .build(); } if (format == null || format.equals("pmml")) { List<MLAlgorithm> mlAlgorithms = MLCoreServiceValueHolder.getInstance().getAlgorithms(); for (MLAlgorithm mlAlgorithm : mlAlgorithms) { if (algorithmName.equals(mlAlgorithm.getName()) && mlAlgorithm.getPmmlExportable()) { return Response.ok().build(); } } return Response.status(Response.Status.NOT_FOUND) .entity("PMML downoald not supported for : " + algorithmName).build(); } else { return Response.status(Response.Status.BAD_REQUEST).entity("unidentified value for query parameter") .build(); } }

Target:
public Response getPMMLAvailability(@PathParam("algorithmName") String algorithmName, @QueryParam("format") String format) { if (algorithmName == null) { return Response.status(Response.Status.BAD_REQUEST).entity("Cannot find the algorithm name from the URI.") .build(); } if (format == null || format.equals(MLConstants.ML_MODEL_FORMAT_PMML)) { List<MLAlgorithm> mlAlgorithms = MLCoreServiceValueHolder.getInstance().getAlgorithms(); for (MLAlgorithm mlAlgorithm : mlAlgorithms) { if (algorithmName.equals(mlAlgorithm.getName()) && mlAlgorithm.getPmmlExportable()) { return Response.ok().build(); } } return Response.status(Response.Status.NOT_FOUND) .entity("PMML download not supported for : " + algorithmName).build(); } else { return Response.status(Response.Status.BAD_REQUEST).entity("unidentified value for query parameter") .build(); } }
Source:
private MPMetrics(Context context, String token) { mContext = context; mToken = token; mCarrier = getCarrier(); mModel = getModel(); mVersion = getVersion(); mDeviceId = getDeviceId(); mSuperProperties = new JSONObject(); mDbAdapter = new MPDbAdapter(mContext, mToken); mDbAdapter.cleanupEvents(System.currentTimeMillis() - MPConfig.DATA_EXPIRATION, MPDbAdapter.EVENTS_TABLE); mDbAdapter.cleanupEvents(System.currentTimeMillis() - MPConfig.DATA_EXPIRATION, MPDbAdapter.PEOPLE_TABLE); sExecutor.setKeepAliveTime(MPConfig.SUBMIT_THREAD_TTL, TimeUnit.MILLISECONDS); mTimerHandler = new UniqueHandler(); mPushPref = context.getSharedPreferences("mpPushPref", 0); }

Target:
private MPMetrics(Context context, String token) { mContext = context; mToken = token; mCarrier = getCarrier(); mModel = getModel(); mVersion = getVersion(); mDeviceId = getDeviceId(); mSuperProperties = new JSONObject(); mDbAdapter = new MPDbAdapter(mContext, mToken); mDbAdapter.cleanupEvents(System.currentTimeMillis() - MPConfig.DATA_EXPIRATION, MPDbAdapter.EVENTS_TABLE); mDbAdapter.cleanupEvents(System.currentTimeMillis() - MPConfig.DATA_EXPIRATION, MPDbAdapter.PEOPLE_TABLE); sExecutor.setKeepAliveTime(MPConfig.SUBMIT_THREAD_TTL, TimeUnit.MILLISECONDS); mTimerHandler = new UniqueHandler(); mPushPref = context.getSharedPreferences("com.mixpanel.android.mpmetrics.MPMetrics", Context.MODE_PRIVATE); }
Source:
private void addMediaToPostCompletedMediaListMap(MediaModel media) { List<MediaModel> mediaListForPost = mCompletedUploads.get(media.getLocalPostId()); if (mediaListForPost == null) { mediaListForPost = new ArrayList<>(); } mediaListForPost.add(media); mCompletedUploads.put(new Integer(media.getLocalPostId()), mediaListForPost); }

Target:
private void addMediaToPostCompletedMediaListMap(MediaModel media) { List<MediaModel> mediaListForPost = mCompletedUploadsByPost.get(media.getLocalPostId()); if (mediaListForPost == null) { mediaListForPost = new ArrayList<>(); } mediaListForPost.add(media); mCompletedUploadsByPost.put(media.getLocalPostId(), mediaListForPost); }
Source:
public Collection<String> getEntitiesClassNames() { if (idMapping != null) { return idMapping.values(); } return null; }

Target:
public Collection<String> getEntitiesClassNames() { return idMapping.values(); }
Source:
public static int mapApiToArtVersion(int api) { if (api < 19) { return NO_VERSION; } switch (api) { case 19: case 20: return 7; case 21: return 39; case 22: return 45; case 23: return 64; case 24: case 25: return 79; case 26: return 124; case 27: return 131; case 28: return 144; } return 143; }

Target:
public static int mapApiToArtVersion(int api) { if (api < 19) { return NO_VERSION; } switch (api) { case 19: case 20: return 7; case 21: return 39; case 22: return 45; case 23: return 64; case 24: case 25: return 79; case 26: return 124; case 27: return 131; default: return 144; } }
Source:
public String getLocalSite() { SiteConfiguration sites = configurationManager.getGlobalConfiguration().sites(); return sites == null ? null : sites.localSite(); }

Target:
public String getLocalSite() { if (cacheManager.getTransport() == null) return null; return cacheManager.getTransport().localSiteName(); }
Source:
public static synchronized void decreaseClientNum() throws InterruptedException { if (--m_activeClientCount == 0) { VoltLogger.shutdownAsynchronousLogging(); EstTimeUpdater.stop(); ReverseDNSCache.stop(); } }

Target:
public static synchronized void decreaseClientNum() throws InterruptedException { if (!m_preserveResources && m_activeClientCount <= 1) { m_activeClientCount = 0; VoltLogger.shutdownAsynchronousLogging(); EstTimeUpdater.stop(); ReverseDNSCache.stop(); } else { m_activeClientCount--; } }
Source:
public void given__multibranch_with_primary__when__reporting_health__then__primary_health() throws Exception { try (MockSCMController c = MockSCMController.create()) { c.createRepository("foo"); c.createBranch("foo", "stable"); c.setPrimaryBranch("foo", "master"); HealthReportingMultiBranchProject prj = r.jenkins.createProject(HealthReportingMultiBranchProject.class, "foo"); prj.setCriteria(null); prj.getSourcesList().add(new BranchSource(new MockSCMSource(c, "foo", new MockSCMDiscoverBranches()))); prj.scheduleBuild2(0).getFuture().get(); r.waitUntilNoActivity(); prj.getHealthMetrics().replaceBy(Collections.singletonList(new PrimaryBranchHealthMetric())); prj.invalidateBuildHealthReports(); FreeStyleProject master = prj.getItem("master"); assertThat("We now have the master branch", master, notNullValue()); assertThat(prj.getBuildHealthReports(), containsInAnyOrder( master.getBuildHealthReports().stream().map(Matchers::is).collect(Collectors.toList()) )); } }

Target:
public void given__multibranch_with_primary__when__reporting_health__then__primary_health() throws Exception { try (MockSCMController c = MockSCMController.create()) { c.createRepository("foo"); c.createBranch("foo", "stable"); c.setPrimaryBranch("foo", "master"); HealthReportingMultiBranchProject prj = r.jenkins.createProject(HealthReportingMultiBranchProject.class, "foo"); prj.setCriteria(null); prj.getSourcesList().add(new BranchSource(new MockSCMSource(c, "foo", new MockSCMDiscoverBranches()))); prj.scheduleBuild2(0).getFuture().get(); r.waitUntilNoActivity(); prj.getHealthMetrics().replaceBy(Collections.singletonList(new PrimaryBranchHealthMetric())); prj.invalidateBuildHealthReports(); FreeStyleProject master = prj.getItem("master"); assertThat("We now have the master branch", master, notNullValue()); assertThat("'master' branch's reports should be exactly the reports as it is the primary branch", prj.getBuildHealthReports(), containsInAnyOrder(master.getBuildHealthReports().toArray()) ); } }
Source:
private void edit() { VM vm = (VM) getSelectedItem(); if (vm == null) { return; } if (getWindow() != null) { return; } UnitVmModel model = new UnitVmModel(new ExistingVmModelBehavior(vm)); model.getVmType().setSelectedItem(vm.getVmType()); model.setVmAttachedToPool(vm.getVmPoolId() != null); setWindow(model); model.setTitle(ConstantsManager.getInstance() .getMessages() .editVmTitle(ConstantsManager.getInstance().getConstants().vm())); model.setHashName("edit_vm"); model.setCustomPropertiesKeysList(getCustomPropertiesKeysList()); model.initialize(this.getSystemTreeSelectedItem()); VmBasedWidgetSwitchModeCommand switchModeCommand = new VmBasedWidgetSwitchModeCommand(); switchModeCommand.init(model); model.getCommands().add(switchModeCommand); UICommand tempVar = new UICommand("OnSave", this); tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok()); tempVar.setIsDefault(true); model.getCommands().add(tempVar); UICommand tempVar2 = new UICommand("Cancel", this); tempVar2.setTitle(ConstantsManager.getInstance().getConstants().cancel()); tempVar2.setIsCancel(true); model.getCommands().add(tempVar2); }

Target:
private void edit() { VM vm = (VM) getSelectedItem(); if (vm == null) { return; } if (getWindow() != null) { return; } UnitVmModel model = new UnitVmModel(new ExistingVmModelBehavior(vm)); model.getVmType().setSelectedItem(vm.getVmType()); model.setVmAttachedToPool(vm.getVmPoolId() != null); setWindow(model); model.setTitle(ConstantsManager.getInstance() .getConstants().editVmTitle()); model.setHashName("edit_vm"); model.setCustomPropertiesKeysList(getCustomPropertiesKeysList()); model.initialize(this.getSystemTreeSelectedItem()); VmBasedWidgetSwitchModeCommand switchModeCommand = new VmBasedWidgetSwitchModeCommand(); switchModeCommand.init(model); model.getCommands().add(switchModeCommand); UICommand tempVar = new UICommand("OnSave", this); tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok()); tempVar.setIsDefault(true); model.getCommands().add(tempVar); UICommand tempVar2 = new UICommand("Cancel", this); tempVar2.setTitle(ConstantsManager.getInstance().getConstants().cancel()); tempVar2.setIsCancel(true); model.getCommands().add(tempVar2); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Usage usage = (Usage) o; if (!amount.equals(usage.amount)) return false; if (merchantTag != null ? !merchantTag.equals(usage.merchantTag) : usage.merchantTag != null) return false; if (recordingAt != null ? !recordingAt.equals(usage.recordingAt) : usage.recordingAt != null) return false; if (!usageAt.equals(usage.usageAt)) return false; if (createdAt != null ? !createdAt.equals(usage.createdAt) : usage.createdAt != null) return false; if (updatedAt != null ? !updatedAt.equals(usage.updatedAt) : usage.updatedAt != null) return false; if (billedAt != null ? !billedAt.equals(usage.billedAt) : usage.billedAt != null) return false; if (usageType != null ? !usageType.equals(usage.usageType) : usage.usageType != null) return false; if (unitAmountInCents != null ? !unitAmountInCents.equals(usage.unitAmountInCents) : usage.unitAmountInCents != null) return false; return usagePercentage != null ? usagePercentage.equals(usage.usagePercentage) : usage.usagePercentage == null; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Usage usage = (Usage) o; if (!amount.equals(usage.amount)) return false; if (merchantTag != null ? !merchantTag.equals(usage.merchantTag) : usage.merchantTag != null) return false; if (recordingAt != null ? recordingAt.compareTo(usage.recordingAt) != 0 : usage.recordingAt != null) return false; if (!usageAt.equals(usage.usageAt)) return false; if (createdAt != null ? createdAt.compareTo(usage.createdAt) != 0 : usage.createdAt != null) return false; if (updatedAt != null ? updatedAt.compareTo(usage.updatedAt) != 0 : usage.updatedAt != null) return false; if (billedAt != null ? billedAt.compareTo(usage.billedAt) != 0 : usage.billedAt != null) return false; if (usageType != null ? !usageType.equals(usage.usageType) : usage.usageType != null) return false; if (unitAmountInCents != null ? !unitAmountInCents.equals(usage.unitAmountInCents) : usage.unitAmountInCents != null) return false; return usagePercentage != null ? usagePercentage.equals(usage.usagePercentage) : usage.usagePercentage == null; }
Source:
private AdapterDeclaration parseAdapterDeclaration() throws TypeImportException, XMLStreamException { AdapterDeclaration a = LibraryElementFactory.eINSTANCE.createAdapterDeclaration(); readNameCommentAttributes(a); String typeName = getAttributeValue(LibraryElementTags.TYPE_ATTRIBUTE); if (null != typeName) { AdapterTypePaletteEntry entry = getAdapterPaletEntry(typeName, palette); a.setPaletteEntry(entry); AdapterType dataType = null; if (entry != null) { dataType = entry.getType(); } a.setTypeName(typeName); if (dataType != null) { a.setType(dataType); } } else { throw new TypeImportException(Messages.FBTImporter_ADAPTER_DECLARATION_TYPE_EXCEPTION); } PositionableElement pos = LibraryElementFactory.eINSTANCE.createPositionableElement(); getXandY(pos); adapterPositions.put(a.getName(), pos); proceedToEndElementNamed(LibraryElementTags.ADAPTER_DECLARATION_ELEMENT); return a; }

Target:
private AdapterDeclaration parseAdapterDeclaration() throws TypeImportException, XMLStreamException { AdapterDeclaration a = LibraryElementFactory.eINSTANCE.createAdapterDeclaration(); readNameCommentAttributes(a); String typeName = getAttributeValue(LibraryElementTags.TYPE_ATTRIBUTE); if (null != typeName) { AdapterTypePaletteEntry entry = getAdapterPaletEntry(typeName, palette); a.setPaletteEntry(entry); AdapterType dataType = null; if (null != entry) { dataType = entry.getType(); } a.setTypeName(typeName); if (null != dataType) { a.setType(dataType); } } else { throw new TypeImportException(Messages.FBTImporter_ADAPTER_DECLARATION_TYPE_EXCEPTION); } PositionableElement pos = LibraryElementFactory.eINSTANCE.createPositionableElement(); getXandY(pos); adapterPositions.put(a.getName(), pos); proceedToEndElementNamed(LibraryElementTags.ADAPTER_DECLARATION_ELEMENT); return a; }
Source:
public void run() { try { boolean caughtUp = true; while (running) { if (!hardDelete()) { caughtUp = true; try { Thread.sleep(hardDeleterSleepTimeWhenCaughtUpMs); } catch (InterruptedException e) { logger.info("Caught interrupted exception"); } } else if (caughtUp) { caughtUp = false; logger.info("Resumed hard deletes for after having caught up", dataDir); } } } finally { close(); } }

Target:
public void run() { try { while (running) { if (!hardDelete()) { isCaughtUp = true; try { Thread.sleep(hardDeleterSleepTimeWhenCaughtUpMs); } catch (InterruptedException e) { logger.info("Caught interrupted exception"); } } else if (isCaughtUp) { isCaughtUp = false; logger.info("Resumed hard deletes for after having caught up", dataDir); } } } finally { close(); } }
Source:
private boolean hasDependentType(AnnotatedTypeMirror atm) { if (atm == null) { return false; } boolean b = new SimpleAnnotatedTypeScanner<>( (type, p) -> { for (AnnotationMirror am : type.getAnnotations()) { if (isExpressionAnno(am)) { return true; } } return false; }, Boolean::logicalOr, false) .visit(atm); return b; }

Target:
private boolean hasDependentType(AnnotatedTypeMirror atm) { if (atm == null) { return false; } boolean b = new SimpleAnnotatedTypeScanner<>( (type, p) -> type.getAnnotations().stream() .anyMatch(this::isExpressionAnno), Boolean::logicalOr, false) .visit(atm); return b; }
Source:
private AbstractTaskReference adaptFromRevCommit(RevCommit commit) { Repository[] repositories = Activator.getDefault().getRepositoryCache().getAllRepositories(); for (Repository r : repositories) { RevWalk revWalk = new RevWalk(r); String repoUrl = null; String message = null; try { RevCommit revCommit = revWalk.parseCommit(commit); if (revCommit != null) { repoUrl = getRepoUrl(r); message = revCommit.getFullMessage(); } } catch (IOException e) { continue; } if (message == null || message.trim().length() == 0) continue; String taskRepositoryUrl = null; if (repoUrl != null) { TaskRepository repository = getTaskRepositoryByGitRepoURL(repoUrl); if (repository != null) taskRepositoryUrl = repository.getRepositoryUrl(); } return new LinkedTaskInfo(taskRepositoryUrl, null, null, message); } return null; }

Target:
private AbstractTaskReference adaptFromRevCommit(RevCommit commit) { Repository[] repositories = Activator.getDefault().getRepositoryCache().getAllRepositories(); for (Repository r : repositories) { RevWalk revWalk = new RevWalk(r); String repoUrl = null; String message = null; long timestamp = 0; try { RevCommit revCommit = revWalk.parseCommit(commit); if (revCommit != null) { repoUrl = getRepoUrl(r); message = revCommit.getFullMessage(); timestamp = (long)revCommit.getCommitTime() * 1000; } } catch (IOException e) { continue; } catch (IllegalArgumentException e) { continue; } if (message == null || message.trim().length() == 0) continue; String taskRepositoryUrl = null; if (repoUrl != null) { TaskRepository repository = getTaskRepositoryByGitRepoURL(repoUrl); if (repository != null) taskRepositoryUrl = repository.getRepositoryUrl(); } return new LinkedTaskInfo(taskRepositoryUrl, null, null, message, timestamp); } return null; }
Source:
public EurekaHttpResponse<Void> register(InstanceInfo info) { String urlPath = "apps/" + info.getAppName(); Response response = null; try { Builder resourceBuilder = jerseyClient.target(serviceUrl).path(urlPath).request(); addExtraProperties(resourceBuilder); addExtraHeaders(resourceBuilder); response = resourceBuilder .accept(MediaType.APPLICATION_JSON) .acceptEncoding("gzip") .post(Entity.entity(info, MediaType.APPLICATION_JSON_TYPE)); return anEurekaHttpResponse(response.getStatus()).headers(headersOf(response)).build(); } finally { if (logger.isDebugEnabled()) { logger.debug("Jersey2 HTTP POST {}/{} with instance {}; statusCode={}", serviceUrl, urlPath, info.getId(), response == null ? "N/A" : response.getStatus()); } if (response != null) { response.close(); } } }

Target:
public EurekaHttpResponse<Void> register(InstanceInfo info) { String urlPath = "apps/" + info.getAppName(); Response response = null; try { Builder resourceBuilder = jerseyClient.target(serviceUrl).path(urlPath).request(); addExtraProperties(resourceBuilder); addExtraHeaders(resourceBuilder); response = resourceBuilder .accept(MediaType.APPLICATION_JSON) .acceptEncoding("gzip") .post(Entity.json(info)); return anEurekaHttpResponse(response.getStatus()).headers(headersOf(response)).build(); } finally { if (logger.isDebugEnabled()) { logger.debug("Jersey2 HTTP POST {}/{} with instance {}; statusCode={}", serviceUrl, urlPath, info.getId(), response == null ? "N/A" : response.getStatus()); } if (response != null) { response.close(); } } }
Source:
public Configuration clone() { try { super.clone(); } catch (CloneNotSupportedException ex) { } for (String config : BaseConfigurations.DEFAULT_CONFIGURATIONS) { if (!configurations.containsKey(config)) { load(config); } } return new Configuration(configurations); }

Target:
public Configuration clone() { for (String config : BaseConfigurations.DEFAULT_CONFIGURATIONS) { if (!configurations.containsKey(config)) { load(config); } } return new Configuration(configurations); }
Source:
public void waitForOperation(Operation operation, long timeout, TimeUnit timeUnit) throws TimeoutException, InterruptedException { GetOperationRequest request = GetOperationRequest.newBuilder() .setName(operation.getName()) .build(); ExponentialBackOff backOff = new ExponentialBackOff.Builder() .setInitialIntervalMillis(100) .setMultiplier(1.3) .setMaxIntervalMillis(Ints.checkedCast(TimeUnit.SECONDS.toMillis(60))) .setMaxElapsedTimeMillis(Ints.checkedCast(timeUnit.toMillis(timeout))) .build(); Operation currentOperationState = operation; while (true) { if (currentOperationState.getDone()) { switch (currentOperationState.getResultCase()) { case RESPONSE: return; case ERROR: throw StatusProto.toStatusRuntimeException(currentOperationState.getError()); case RESULT_NOT_SET: throw new IllegalStateException( "System returned invalid response for Operation check: " + currentOperationState); } } final long backOffMillis; try { backOffMillis = backOff.nextBackOffMillis(); } catch (IOException e) { throw new RuntimeException(e); } if (backOffMillis == BackOff.STOP) { throw new TimeoutException("Operation did not complete in time"); } else { Thread.sleep(backOffMillis); } currentOperationState = getOperation(request); } }

Target:
public void waitForOperation(Operation operation, long timeout, TimeUnit timeUnit) throws TimeoutException, IOException { GetOperationRequest request = GetOperationRequest.newBuilder() .setName(operation.getName()) .build(); ExponentialBackOff backOff = new ExponentialBackOff.Builder() .setInitialIntervalMillis(100) .setMultiplier(1.3) .setMaxIntervalMillis(Ints.checkedCast(TimeUnit.SECONDS.toMillis(60))) .setMaxElapsedTimeMillis(Ints.checkedCast(timeUnit.toMillis(timeout))) .build(); Operation currentOperationState = operation; while (true) { if (currentOperationState.getDone()) { switch (currentOperationState.getResultCase()) { case RESPONSE: return; case ERROR: throw StatusProto.toStatusRuntimeException(currentOperationState.getError()); case RESULT_NOT_SET: throw new IllegalStateException( "System returned invalid response for Operation check: " + currentOperationState); } } final long backOffMillis; try { backOffMillis = backOff.nextBackOffMillis(); } catch (IOException e) { throw new RuntimeException(e); } if (backOffMillis == BackOff.STOP) { throw new TimeoutException("Operation did not complete in time"); } else { try { Thread.sleep(backOffMillis); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IOException("Interrupted while waiting for operation to finish"); } } currentOperationState = getOperation(request); } }
Source:
void execute() { File[] cacheKeyDirs = rootCacheDir.listFiles(new FilenameFilter() { @Override public boolean accept(File current, String name) { return new File(current, name).isDirectory(); } }); if (cacheKeyDirs == null || cacheKeyDirs.length == 0) { LOGGER.log(Level.FINE, "cacheKeys directory '{0]' is empty, nothing to clean up", rootCacheDir); } else { ExecutorService executor = Executors.newSingleThreadExecutor(); try { executor.execute(new Runnable() { @Override public void run() { for (File dir: cacheKeyDirs) { if (dir.isDirectory() && dir.exists() && cacheKeys.contains(dir.getName())) { LOGGER.log(Level.FINE, "cacheKey belongs to agent, keeping the directory '{0}'", dir.getName()); } else { try { FileUtils.deleteDirectory(dir); LOGGER.log(Level.INFO, "The agent is no longer available, cache entry {0} was deleted", dir.getName()); } catch (IOException e) { LOGGER.log(Level.WARNING, "Couldn't remove the cache directory " + dir.getName(), e); } } } } }); } catch (RuntimeException e) { LOGGER.log(Level.WARNING, "The clean up task has ended with errors", e); } finally { executor.shutdown(); } } }

Target:
void execute() { File[] cacheKeyDirs = rootCacheDir.listFiles(new FileFilter() { @Override public boolean accept(File file) { return file.isDirectory(); } }); if (cacheKeyDirs == null || cacheKeyDirs.length == 0) { LOGGER.log(Level.FINE, "cacheKeys directory '{0]' is empty, nothing to clean up", rootCacheDir); } else { ExecutorService executor = Executors.newSingleThreadExecutor(); try { executor.execute(new Runnable() { @Override public void run() { for (File dir: cacheKeyDirs) { if (cacheKeys.contains(dir.getName())) { LOGGER.log(Level.FINE, "cacheKey belongs to agent, keeping the directory '{0}'", dir.getName()); } else { try { FileUtils.deleteDirectory(dir); LOGGER.log(Level.INFO, "The agent is no longer available, cache entry {0} was deleted", dir.getAbsolutePath() ); } catch (IOException e) { LOGGER.log(Level.WARNING, "Couldn't remove the cache directory " + dir.getName(), e); } } } } }); } catch (RuntimeException e) { LOGGER.log(Level.WARNING, "The clean up task has ended with errors", e); } finally { executor.shutdown(); } } }
Source:
private void handleVdsLiveSnapshotFailure(VdcBLLException e) { log.warnFormat("Could not live snapshot due to error: {0}. VM will still be configured to the new created snapshot", ExceptionUtils.getMessage(e)); addCustomValue("SnapshotName", getSnapshotName()); addCustomValue("VmName", getVmName()); updateCallStackFromThrowable(e); AuditLogDirector.log(this, AuditLogType.USER_CREATE_LIVE_SNAPSHOT_FINISHED_FAILURE); }

Target:
private void handleVdsLiveSnapshotFailure(VdcBLLException e) { log.warnFormat("Could not perform live snapshot due to error: {0}. VM will still be configured to the new created snapshot", ExceptionUtils.getMessage(e)); addCustomValue("SnapshotName", getSnapshotName()); addCustomValue("VmName", getVmName()); updateCallStackFromThrowable(e); AuditLogDirector.log(this, AuditLogType.USER_CREATE_LIVE_SNAPSHOT_FINISHED_FAILURE); }
Source:
private void detectCycles( DMNModelImpl model ) { final Map<DecisionNodeImpl, Boolean> registry = new HashMap<>(); for ( DecisionNode decision : model.getDecisions() ) { assert decision instanceof DecisionNodeImpl; final DecisionNodeImpl decisionNode = (DecisionNodeImpl) decision; detectCycles( decisionNode, registry, model ); } }

Target:
private void detectCycles( DMNModelImpl model ) { final Map<DecisionNodeImpl, Boolean> registry = new HashMap<>(); for ( DecisionNode decision : model.getDecisions() ) { final DecisionNodeImpl decisionNode = (DecisionNodeImpl) decision; detectCycles( decisionNode, registry, model ); } }