auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected Void call() throws Exception { Objects.requireNonNull(version, "Version hasn't been set."); updateTitle(i18n.get("game.mapGeneration.generateMap.title", version, String.valueOf(seed))); Path workingDirectory = mapGeneratorService.getCustomMapsDirectory(); ProcessBuilder processBuilder = new ProcessBuilder(); processBuilder.inheritIO(); processBuilder.directory(workingDirectory.toFile()); processBuilder.command("java", "-jar", generatorExecutableFile.getAbsolutePath(), ".", String.valueOf(seed), version, mapFilename); logger.info("Starting map generator in directory: with command: {}", processBuilder.directory(), processBuilder.command().stream().reduce((l, r) -> l + " " + r).get()); try { Process process = processBuilder.start(); process.waitFor(MapGeneratorService.getGENERATION_TIMEOUT_SECONDS(), TimeUnit.SECONDS); if (process.isAlive()) { logger.warn("Map generation timed out, killing process..."); process.destroyForcibly(); notificationService.addNotification(new ImmediateNotification(i18n.get("game.mapGeneration.failed.title"), i18n.get("game.mapGeneration.failed.message"), Severity.ERROR)); } else { eventBus.post(new MapGeneratedEvent(mapFilename)); } } catch (IOException | InterruptedException e) { logger.error("Could not start map generator.", e); throw new RuntimeException(); } return null; }

Target:
protected Void call() throws Exception { Objects.requireNonNull(version, "Version hasn't been set."); updateTitle(i18n.get("game.mapGeneration.generateMap.title", version, String.valueOf(seed))); Path workingDirectory = mapGeneratorService.getCustomMapsDirectory(); ProcessBuilder processBuilder = new ProcessBuilder(); processBuilder.inheritIO(); processBuilder.directory(workingDirectory.toFile()); processBuilder.command("java", "-jar", generatorExecutableFile.getAbsolutePath(), ".", String.valueOf(seed), version, mapFilename); logger.info("Starting map generator in directory: with command: {}", processBuilder.directory(), processBuilder.command().stream().reduce((l, r) -> l + " " + r).get()); try { Process process = processBuilder.start(); process.waitFor(MapGeneratorService.getGENERATION_TIMEOUT_SECONDS(), TimeUnit.SECONDS); if (process.isAlive()) { logger.warn("Map generation timed out, killing process..."); process.destroyForcibly(); notificationService.addNotification(new ImmediateNotification(i18n.get("game.mapGeneration.failed.title"), i18n.get("game.mapGeneration.failed.message"), Severity.ERROR)); } else { eventBus.post(new MapGeneratedEvent(mapFilename)); } } catch (IOException | InterruptedException e) { logger.error("Could not start map generator.", e); throw new RuntimeException(e); } return null; }
Source:
Trigger dateTrigger() { Date date; DateFormat dateFormat = new SimpleDateFormat(config.getDateFormat()); String dateString = config.getDate() != null ? config.getDate() : new Date().toString(); try { date = dateFormat.parse(dateString); } catch (ParseException pe) { throw new BeanCreationException("Exception parsing the Date format: " + config.getDateFormat(), pe); } return new DateTrigger(date); }

Target:
public Trigger dateTrigger() { return new DateTrigger(config.getDate()); }
Source:
private FeedbackSessionResultsBundle getBundleForQuestionView( String needAjax, String courseId, String feedbackSessionName, InstructorAttributes instructor, InstructorFeedbackResultsPageData data, String selectedSection, SectionDetail selectedSectionDetail, String sortType, String questionId) throws EntityDoesNotExistException { FeedbackSessionResultsBundle bundle; if (questionId == null) { if (ALL_SECTION_OPTION.equals(selectedSection)) { data.setLargeNumberOfRespondents(needAjax != null); bundle = logic.getFeedbackSessionResultsForInstructorWithinRangeFromView( feedbackSessionName, courseId, instructor.email, 1, sortType); bundle.isComplete = true; } else { bundle = logic.getFeedbackSessionResultsForInstructorInSection(feedbackSessionName, courseId, instructor.email, selectedSection, selectedSectionDetail.name()); } } else { if (ALL_SECTION_OPTION.equals(selectedSection)) { bundle = logic.getFeedbackSessionResultsForInstructorFromQuestion(feedbackSessionName, courseId, instructor.email, questionId); } else { bundle = logic.getFeedbackSessionResultsForInstructorFromQuestionInSection( feedbackSessionName, courseId, instructor.email, questionId, selectedSection, selectedSectionDetail.name()); } } return bundle; }

Target:
private FeedbackSessionResultsBundle getBundleForQuestionView( String needAjax, String courseId, String feedbackSessionName, InstructorAttributes instructor, InstructorFeedbackResultsPageData data, String selectedSection, SectionDetail selectedSectionDetail, String sortType, String questionId) throws EntityDoesNotExistException { FeedbackSessionResultsBundle bundle; if (questionId == null) { if (ALL_SECTION_OPTION.equals(selectedSection)) { data.setLargeNumberOfRespondents(needAjax != null); bundle = logic.getFeedbackSessionResultsForInstructorWithinRangeFromView( feedbackSessionName, courseId, instructor.email, 1, sortType); bundle.isComplete = true; } else { bundle = logic.getFeedbackSessionResultsForInstructorInSection(feedbackSessionName, courseId, instructor.email, selectedSection, selectedSectionDetail); } } else { if (ALL_SECTION_OPTION.equals(selectedSection)) { bundle = logic.getFeedbackSessionResultsForInstructorFromQuestion(feedbackSessionName, courseId, instructor.email, questionId); } else { bundle = logic.getFeedbackSessionResultsForInstructorFromQuestionInSection( feedbackSessionName, courseId, instructor.email, questionId, selectedSection, selectedSectionDetail); } } return bundle; }
Source:
public List<String> getExternalLibraries(String workspaceId, String projectName) throws Exception { List<String> result = new ArrayList<>(); HttpJsonResponse response = requestFactory .fromUrl(workspaceAgentApiEndpoint.get(workspaceId) + "java/navigation/libraries") .useGetMethod() .addQueryParam("projectpath", "/" + projectName) .request(); parseResponseAsArray(response) .forEach( jsonElement -> result.add(jsonElement.getAsJsonObject().get("name").getAsString())); return result; }

Target:
public List<String> getExternalLibraries(String workspaceId, String projectName) throws Exception { HttpJsonResponse response = requestFactory .fromUrl( workspaceAgentApiEndpointUrlProvider.get(workspaceId) + "java/navigation/libraries") .useGetMethod() .addQueryParam("projectpath", "/" + projectName) .request(); return DtoFactory.getInstance() .createListDtoFromJson(response.asString(), ProjectConfigDto.class) .stream() .map(e -> e.getName()) .collect(Collectors.toList()); }
Source:
public ContentPopulatorSupplier( KeyedFileIndex<String, RoviProgramDescriptionLine> descriptionIndex, KeyedFileIndex<String, RoviEpisodeSequenceLine> episodeSequenceIndex, ContentResolver contentResolver, LoadingCache<String, Optional<Integer>> seasonNumberCache) { this.descriptionIndex = descriptionIndex; this.episodeSequenceIndex = episodeSequenceIndex; this.contentResolver = contentResolver; this.seasonNumberCache = seasonNumberCache; }

Target:
public ContentPopulatorSupplier( KeyedFileIndex<String, RoviProgramDescriptionLine> descriptionIndex, KeyedFileIndex<String, RoviEpisodeSequenceLine> episodeSequenceIndex, ContentResolver contentResolver, LoadingCache<String, Optional<Integer>> seasonNumberCache) { this.descriptionIndex = checkNotNull(descriptionIndex); this.episodeSequenceIndex = checkNotNull(episodeSequenceIndex); this.contentResolver = checkNotNull(contentResolver); this.seasonNumberCache = checkNotNull(seasonNumberCache); }
Source:
public void testSerializeLibraryMessage() throws IOException { List<SongMetadata> library = new ArrayList<SongMetadata>(Arrays.asList( new SongMetadata(69, "Driver that Had a Dick on his Shoulder", "Aziz Ansari", "Dangerously Delicious", "David"), new SongMetadata(1, "Lady with the Puppies", "Aziz Ansari", "Dangerously Delicious", "David"), new SongMetadata(23, "Toronto Customs Lady", "Aziz Ansari", "Dangerously Delicious", "David"))); LibraryMessage oldMessage = new LibraryMessage(library); LibraryMessage newMessage = super.testSerializeMessage(oldMessage); for(int i = 0; i < library.size(); i++) { assertEquals(library.get(i).getId() , newMessage.getLibrary().get(i).getId()); assertEquals(library.get(i).getTitle() , newMessage.getLibrary().get(i).getTitle()); assertEquals(library.get(i).getArtist() , newMessage.getLibrary().get(i).getArtist()); assertEquals(library.get(i).getAlbum() , newMessage.getLibrary().get(i).getAlbum()); assertEquals(library.get(i).getUsername() , newMessage.getLibrary().get(i).getUsername()); } }

Target:
public void testSerializeLibraryMessage() throws IOException { List<SongMetadata> library = new ArrayList<SongMetadata>(Arrays.asList( new SongMetadata(69, "Driver that Had a Dick on His Shoulder", "Aziz Ansari", "Dangerously Delicious", "David"), new SongMetadata(1, "Lady with the Puppies", null, "Dangerously Delicious", "David"), new SongMetadata(23, "Toronto Customs Lady", "Aziz Ansari", null, "David"))); new SongMetadata(42, "Motley Crue Tour vs. Aziz Tour", "Aziz Ansari", "Dangerously Delicious", null); LibraryMessage preSerializationLibraryMessage = new LibraryMessage(library); LibraryMessage postSerializationLibraryMessage = super.testSerializeMessage(preSerializationLibraryMessage); for(int i = 0; i < library.size(); i++) { SongMetadata preSerializationSongMetadata = library.get(i); SongMetadata postSerializationSongMetadata = postSerializationLibraryMessage.getLibrary().get(i); assertEquals(preSerializationSongMetadata.getId(), postSerializationSongMetadata.getId()); assertEquals(preSerializationSongMetadata.getTitle(), postSerializationSongMetadata.getTitle()); assertEquals(preSerializationSongMetadata.getArtist(), postSerializationSongMetadata.getArtist()); assertEquals(preSerializationSongMetadata.getAlbum(), postSerializationSongMetadata.getAlbum()); assertEquals(preSerializationSongMetadata.getUsername(), postSerializationSongMetadata.getUsername()); } }
Source:
public boolean equals(final Object obj) { if (!(obj instanceof Parameter)) { return false; } return getName().equals(((Parameter) obj).getName()) && getParameterType().equals(((Parameter) obj).getParameterType()) && getParameterPointerType().equals(((Parameter) obj).getParameterPointerType()) && getTypeModifier().equals(((Parameter) obj).getTypeModifier()); }

Target:
public boolean equals(final Object obj) { if (obj == null) { return false; } if (!(obj instanceof Parameter)) { return false; } final Parameter parameter = (Parameter) obj; return getName().equals(parameter.getName()) && getParameterType().equals(parameter.getParameterType()) && getParameterPointerType().equals(parameter.getParameterPointerType()) && getTypeModifier().equals(parameter.getTypeModifier()); }
Source:
public int getValidTime() { return (validTime < MIN_VALID_TIME) || (validTime > MAX_VALID_TIME) ? DEFAULT_VALID_TIME : validTime; }

Target:
private int getValidTime() { String validTimeGp = Context.getAdministrationService() .getGlobalProperty(OpenmrsConstants.GP_PASSWORD_RESET_VALIDTIME); final int validTime = StringUtils.isBlank(validTimeGp) ? DEFAULT_VALID_TIME : Integer.parseInt(validTimeGp); return (validTime < MIN_VALID_TIME) || (validTime > MAX_VALID_TIME) ? DEFAULT_VALID_TIME : validTime; }
Source:
public RankedAdapterFactoryDescriptor.Registry createFilteredAdapterFactoryRegistry() { String disabledAdapterFactoriesString = getEMFComparePreferences().get( EMFComparePreferences.DISABLED_ADAPTER_FACTORY, ""); final List<String> disabledAdapterFactories = Lists.newArrayList(disabledAdapterFactoriesString .split(";")); Multimap<Collection<?>, RankedAdapterFactoryDescriptor> filteredRegistry = ImmutableMultimap .copyOf(Multimaps.filterValues(adapterFactoryRegistry, new Predicate<RankedAdapterFactoryDescriptor>() { public boolean apply(RankedAdapterFactoryDescriptor input) { return !disabledAdapterFactories.contains(input.getId()); } })); return new RankedAdapterFactoryDescriptorRegistryImpl( ComposedAdapterFactory.Descriptor.Registry.INSTANCE, filteredRegistry); }

Target:
public RankedAdapterFactoryDescriptor.Registry createFilteredAdapterFactoryRegistry() { String disabledAdapterFactoriesString = getEMFComparePreferences().get( EMFComparePreferences.DISABLED_ADAPTER_FACTORY, ""); final List<String> disabledAdapterFactories = Lists.newArrayList(Splitter.on(';').omitEmptyStrings() .trimResults().split(disabledAdapterFactoriesString)); Multimap<Collection<?>, RankedAdapterFactoryDescriptor> filteredBackingMultimap = ImmutableMultimap .copyOf(Multimaps.filterValues(adapterFactoryRegistryBackingMultimap, new Predicate<RankedAdapterFactoryDescriptor>() { public boolean apply(RankedAdapterFactoryDescriptor input) { return !disabledAdapterFactories.contains(input.getId()); } })); return new RankedAdapterFactoryDescriptorRegistryImpl( ComposedAdapterFactory.Descriptor.Registry.INSTANCE, filteredBackingMultimap); }
Source:
public GridType overrideType(Type type) { if ( type == StandardBasicTypes.CALENDAR || type == StandardBasicTypes.CALENDAR_DATE ) { return StringCalendarDateType.INSTANCE; } else if ( type == StandardBasicTypes.BYTE ) { return ByteStringType.INSTANCE; } else if ( type == StandardBasicTypes.SHORT ) { return ShortType.INSTANCE; } else if ( type == StandardBasicTypes.FLOAT ) { return FloatType.INSTANCE; } else if ( type.getReturnedClass() == ObjectId.class ) { return ObjectIdGridType.INSTANCE; } else if ( type instanceof StringAsObjectIdType ) { return StringAsObjectIdGridType.INSTANCE; } return null; }

Target:
public GridType overrideType(Type type) { if ( type == StandardBasicTypes.CALENDAR || type == StandardBasicTypes.CALENDAR_DATE ) { return StringCalendarDateType.INSTANCE; } else if ( type == StandardBasicTypes.BYTE ) { return ByteStringType.INSTANCE; } else if ( type.getReturnedClass() == ObjectId.class ) { return ObjectIdGridType.INSTANCE; } else if ( type instanceof StringAsObjectIdType ) { return StringAsObjectIdGridType.INSTANCE; } return null; }
Source:
public static Range empty() { return Range.empty(); }

Target:
public static Range empty() { return EMPTY; }
Source:
private Runnable _confirmSignIn(final String signInChallengeResponse, final Callback<SignInResult> callback) { return new Runnable() { @Override public void run() { if (signInState == null) { callback.onError(new IllegalStateException("Cannot call confirmMFA(String, Callback) " + "without initiating sign-in. This call is used for SMS_MFA and NEW_PASSWORD_REQUIRED" + "sign-in state.")); return; } final CognitoIdentityProviderContinuation detectedContinuation; switch (signInState) { case SMS_MFA: signInMfaContinuation.setMfaCode(signInChallengeResponse); detectedContinuation = signInMfaContinuation; signInCallback = new InternalCallback<SignInResult>(callback); break; case NEW_PASSWORD_REQUIRED: ((NewPasswordContinuation) signInChallengeContinuation) .setPassword(signInChallengeResponse); detectedContinuation = signInChallengeContinuation; signInCallback = new InternalCallback<SignInResult>(callback); break; case DONE: callback.onError(new IllegalStateException("confirmSignIn called after signIn has succeeded")); return; default: callback.onError(new IllegalStateException("confirmSignIn called on unsupported operation, " + "please file a feature request")); return; } if (detectedContinuation != null) { detectedContinuation.continueTask(); } } }; }

Target:
private Runnable _confirmSignIn(final String signInChallengeResponse, final Callback<SignInResult> callback) { return new Runnable() { @Override public void run() { if (signInState == null) { callback.onError(new IllegalStateException("Cannot call confirmSignIn(String, Callback) " + "without initiating sign-in. This call is used for SMS_MFA and NEW_PASSWORD_REQUIRED " + "sign-in state.")); return; } final CognitoIdentityProviderContinuation detectedContinuation; switch (signInState) { case SMS_MFA: signInMfaContinuation.setMfaCode(signInChallengeResponse); detectedContinuation = signInMfaContinuation; signInCallback = new InternalCallback<SignInResult>(callback); break; case NEW_PASSWORD_REQUIRED: ((NewPasswordContinuation) signInChallengeContinuation) .setPassword(signInChallengeResponse); detectedContinuation = signInChallengeContinuation; signInCallback = new InternalCallback<SignInResult>(callback); break; case DONE: callback.onError(new IllegalStateException("confirmSignIn called after signIn has succeeded")); return; default: callback.onError(new IllegalStateException("confirmSignIn called on unsupported operation, " + "please file a feature request")); return; } if (detectedContinuation != null) { detectedContinuation.continueTask(); } } }; }
Source:
public void testHttpsClientDisableCNCheckTrue() { String url = "https://url"; AssertionType assertion = new AssertionType(); assertion.setTransactionTimeout(-1); CONNECTClient<TestServicePortType> endpoint = null; try { PropertyAccessor.getInstance().setProperty(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.DISABLE_CN_CHECK, "true"); boolean disableCNCheck = PropertyAccessor.getInstance() .getPropertyBoolean(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.DISABLE_CN_CHECK); endpoint = createClient(url, assertion); Client client = ClientProxy.getClient(endpoint.getPort()); HTTPConduit conduit = (HTTPConduit) client.getConduit(); TLSClientParameters tlsPara = conduit.getTlsClientParameters(); Assert.assertTrue("disableCNCheck==true", tlsPara.isDisableCNCheck()); } catch (PropertyAccessException ex) { System.out.println("Unable to set in memory property for disable-CN-Check."); } }

Target:
public void testHttpsClientDisableCNCheckTrue() { String url = "https://url"; AssertionType assertion = new AssertionType(); assertion.setTransactionTimeout(-1); CONNECTClient<TestServicePortType> endpoint = null; try { PropertyAccessor.getInstance().setProperty(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.DISABLE_CN_CHECK, "true"); boolean disableCNCheck = PropertyAccessor.getInstance() .getPropertyBoolean(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.DISABLE_CN_CHECK); endpoint = createClient(url, assertion); Client client = ClientProxy.getClient(endpoint.getPort()); HTTPConduit conduit = (HTTPConduit) client.getConduit(); TLSClientParameters tlsPara = conduit.getTlsClientParameters(); Assert.assertTrue("disableCNCheck==true", tlsPara.isDisableCNCheck()); } catch (PropertyAccessException ex) { Assert.fail("Unable to set in memory property for disable-CN-Check."); } }
Source:
private static PathMatcher buildPathMatcherForDirectory(final Path dir) { final StringBuilder builder = buildGlobPatternStringBuilder(dir.toString()); if (builder.charAt(builder.length() - 1) != File.separatorChar) { if (File.separatorChar == '\\') { builder.append('\\'); } builder.append(File.separator); } return FileSystems.getDefault().getPathMatcher("glob:" + builder.toString() + "**"); }

Target:
private static PathMatcher buildPathMatcherForDirectory(final Path dir) { final String dirString = dir.toString(); final int dirLength = dirString.length(); final StringBuilder builder = buildGlobPatternStringBuilder(dirString); if (dirLength > 1 && builder.charAt(dirLength - 1) != File.separatorChar) { if (File.separatorChar == '\\') { builder.append('\\'); } builder.append(File.separator); } return FileSystems.getDefault().getPathMatcher("glob:" + builder.toString() + "**"); }
Source:
public boolean hasBombs() { return bombs != 0; }

Target:
public boolean hasBombs() { return bombs > 0; }
Source:
protected void doRun() throws Exception { try { logger.fine("doRun called: Computing Node metrics"); DatadogClient client = DatadogUtilities.getDatadogClient(); String hostname = DatadogUtilities.getHostname("null"); long projectCount = 0; try { projectCount = Jenkins.getInstance().getAllItems(Project.class).size(); } catch (NullPointerException e){ logger.fine("Could not retrieve projects"); } long pluginCount = 0; try { pluginCount = Jenkins.getInstance().pluginManager.getPlugins().size(); } catch (NullPointerException e){ logger.fine("Could not retrieve plugins"); } client.gauge("jenkins.project.count", projectCount, hostname, null); client.gauge("jenkins.plugin.count", pluginCount, hostname, null); } catch (Exception e) { logger.warning("Unexpected exception occurred - " + e.getMessage()); } }

Target:
protected void doRun() throws Exception { try { logger.fine("doRun called: Computing Jenkins metrics"); DatadogClient client = DatadogUtilities.getDatadogClient(); String hostname = DatadogUtilities.getHostname("null"); long projectCount = 0; try { projectCount = Jenkins.getInstance().getAllItems(Project.class).size(); } catch (NullPointerException e){ logger.fine("Could not retrieve projects"); } long pluginCount = 0; try { pluginCount = Jenkins.getInstance().pluginManager.getPlugins().size(); } catch (NullPointerException e){ logger.fine("Could not retrieve plugins"); } client.gauge("jenkins.project.count", projectCount, hostname, null); client.gauge("jenkins.plugin.count", pluginCount, hostname, null); } catch (Exception e) { logger.warning("Unexpected exception occurred - " + e.getMessage()); } }
Source:
private static boolean hasMultipleWindowServices() { synchronized (fgServices) { return fgServices.size() >= 2; } }

Target:
private static boolean hasMultipleWindowServices() { synchronized (fgServices) { return fgServices.size() > 1; } }
Source:
public void clear() { notifyInactive(); Log.d(TAG, "MeteringRepeating clear!"); if (mDeferrableSurface != null) { mDeferrableSurface.close(); } mDeferrableSurface = null; super.clear(); }

Target:
public void clear() { notifyInactive(); if (DEBUG) { Log.d(TAG, "MeteringRepeating clear!"); } if (mDeferrableSurface != null) { mDeferrableSurface.close(); } mDeferrableSurface = null; super.clear(); }
Source:
public void smokeTestExport() throws Exception { ConfiguratorRegistry registry = ConfiguratorRegistry.get(); ConfigurationContext context = new ConfigurationContext(registry); CNode yourAttribute = Util.getUnclassifiedRoot(context).get("scriptApproval"); String exported = Util.toYamlString(yourAttribute); String expected = Util.toStringFromYamlFile(this, "smoke_test_expected.yaml"); assertEquals(exported, expected); }

Target:
public void smokeTestExport() throws Exception { ConfiguratorRegistry registry = ConfiguratorRegistry.get(); ConfigurationContext context = new ConfigurationContext(registry); CNode yourAttribute = getSecurityRoot(context).get("scriptApproval"); String exported = toYamlString(yourAttribute); String expected = toStringFromYamlFile(this, "smoke_test_expected.yaml"); assertEquals(exported, expected); }
Source:
public void testToString() { DateFormat df = new SimpleDateFormat("HH:mm:ss.SSS"); Date d0 = new Date(0); Date d1 = new Date(12345000L); Date d2 = new Date(85166000L); assertEquals("toString", df.format(d0) + " 000 000", ts0.toString()); assertEquals("toString", df.format(d1) + " 000 000", ts1.toString()); assertEquals("toString", df.format(d2) + " 000 000", ts2.toString()); }

Target:
public void testToString() { DateFormat df = new SimpleDateFormat("HH:mm:ss.SSS"); Date d0 = new Date(ts0.getValue()*1000); Date d1 = new Date(ts1.getValue()*1000); Date d2 = new Date(ts2.getValue()*1000); assertEquals("toString", df.format(d0) + " 000 000", ts0.toString()); assertEquals("toString", df.format(d1) + " 000 000", ts1.toString()); assertEquals("toString", df.format(d2) + " 000 000", ts2.toString()); }
Source:
protected void setup(Binder binder) { binder.bind(HiveMetastoreClientFactory.class).in(Scopes.SINGLETON); binder.bind(HiveCluster.class).to(StaticHiveCluster.class).in(Scopes.SINGLETON); configBinder(binder).bindConfig(StaticMetastoreConfig.class); binder.bind(HiveMetastore.class).to(ThriftHiveMetastore.class).in(Scopes.SINGLETON); configBinder(binder).bindConfig(ThriftHiveMetastoreConfig.class); if (buildConfigObject(HiveClientConfig.class).getRecordingPath() != null) { binder.bind(ExtendedHiveMetastore.class) .annotatedWith(ForRecordingHiveMetastore.class) .to(BridgingHiveMetastore.class) .in(Scopes.SINGLETON); binder.bind(ExtendedHiveMetastore.class) .annotatedWith(ForCachingHiveMetastore.class) .to(RecordingHiveMetastore.class) .in(Scopes.SINGLETON); binder.bind(RecordingHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(RecordingHiveMetastore.class) .as(generatedNameOf(RecordingHiveMetastore.class, connectorId)); } else { binder.bind(ExtendedHiveMetastore.class) .annotatedWith(ForCachingHiveMetastore.class) .to(BridgingHiveMetastore.class) .in(Scopes.SINGLETON); } binder.bind(ExtendedHiveMetastore.class).to(CachingHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(HiveMetastore.class) .as(generatedNameOf(ThriftHiveMetastore.class, connectorId)); newExporter(binder).export(ExtendedHiveMetastore.class) .as(generatedNameOf(CachingHiveMetastore.class, connectorId)); }

Target:
protected void setup(Binder binder) { binder.bind(HiveMetastoreClientFactory.class).in(Scopes.SINGLETON); binder.bind(HiveCluster.class).to(StaticHiveCluster.class).in(Scopes.SINGLETON); configBinder(binder).bindConfig(StaticMetastoreConfig.class); configBinder(binder).bindConfig(ThriftHiveMetastoreConfig.class); binder.bind(HiveMetastore.class).to(ThriftHiveMetastore.class).in(Scopes.SINGLETON); if (buildConfigObject(HiveClientConfig.class).getRecordingPath() != null) { binder.bind(ExtendedHiveMetastore.class) .annotatedWith(ForRecordingHiveMetastore.class) .to(BridgingHiveMetastore.class) .in(Scopes.SINGLETON); binder.bind(ExtendedHiveMetastore.class) .annotatedWith(ForCachingHiveMetastore.class) .to(RecordingHiveMetastore.class) .in(Scopes.SINGLETON); binder.bind(RecordingHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(RecordingHiveMetastore.class) .as(generatedNameOf(RecordingHiveMetastore.class, connectorId)); } else { binder.bind(ExtendedHiveMetastore.class) .annotatedWith(ForCachingHiveMetastore.class) .to(BridgingHiveMetastore.class) .in(Scopes.SINGLETON); } binder.bind(ExtendedHiveMetastore.class).to(CachingHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(HiveMetastore.class) .as(generatedNameOf(ThriftHiveMetastore.class, connectorId)); newExporter(binder).export(ExtendedHiveMetastore.class) .as(generatedNameOf(CachingHiveMetastore.class, connectorId)); }
Source:
public void initLandmarkWeights(final int lmIdx, int lmNodeId, final long rowSize) { IntObjectMap<SPTEntry> map = from ? bestWeightMapFrom : bestWeightMapTo; final AtomicInteger maxedout = new AtomicInteger(0); final Map.Entry<Double, Double> finalMaxWeight = new MapEntry<>(0d, 0d); map.forEach(new IntObjectProcedure<SPTEntry>() { @Override public void apply(int nodeId, SPTEntry b) { if (!lms.setWeight(lmIdx, nodeId, rowSize, b.weight, from)) { maxedout.incrementAndGet(); finalMaxWeight.setValue(Math.max(b.weight, finalMaxWeight.getValue())); } } }); if ((double) maxedout.get() / map.size() > 0.1) { if (from){ LOGGER.warn("landmark " + lmIdx + " (" + nodeAccess.getLatitude(lmNodeId) + "," + nodeAccess.getLongitude(lmNodeId) + "): " + "too many backward weights were maxed out (" + maxedout.get() + "/" + map.size() + "). Use a bigger factor than " + lms.factor + ". For example use the following in the config.properties: weighting=" + weighting.getName() + "|maximum=" + finalMaxWeight.getValue() * 1.2); }else{ LOGGER.warn("landmark " + lmIdx + " (" + nodeAccess.getLatitude(lmNodeId) + "," + nodeAccess.getLongitude(lmNodeId) + "): " + "too many delta weights were maxed out (" + maxedout.get() + "/" + map.size() + "). Use a bigger factor than " + lms.factor + ". For example use the following in the config.properties: weighting=" + weighting.getName() + "|maximum=" + finalMaxWeight.getValue() * 1.2); } } }

Target:
public void initLandmarkWeights(final int lmIdx, int lmNodeId, final long rowSize) { IntObjectMap<SPTEntry> map = from ? bestWeightMapFrom : bestWeightMapTo; final AtomicInteger maxedout = new AtomicInteger(0); final Map.Entry<Double, Double> finalMaxWeight = new MapEntry<>(0d, 0d); map.forEach(new IntObjectProcedure<SPTEntry>() { @Override public void apply(int nodeId, SPTEntry b) { if (!lms.setWeight(lmIdx, nodeId, rowSize, b.weight, from)) { maxedout.incrementAndGet(); finalMaxWeight.setValue(Math.max(b.weight, finalMaxWeight.getValue())); } } }); if ((double) maxedout.get() / map.size() > 0.1) { LOGGER.warn("landmark " + lmIdx + " (" + nodeAccess.getLatitude(lmNodeId) + "," + nodeAccess.getLongitude(lmNodeId) + "): " + "too many " + (from ? "backward" : "delta") + " weights were maxed out (" + maxedout.get() + "/" + map.size() + "). Factor is too small " + lms.factor + ". To fix this increase maximum in config.yml: prepare.lm.weighting: " + weighting.getName() + "|maximum=" + finalMaxWeight.getValue() * 1.2); } }
Source:
public Action[] getActions(boolean context) { List<Action> actionsList = new ArrayList<Action>(); actionsList.addAll(ExplorerNodeActionVisitor.getActions(content)); actionsList.add(new FileSearchAction( NbBundle.getMessage(this.getClass(), "ImageNode.getActions.openFileSearchByAttr.text"))); Directory dir = this.getLookup().lookup(Directory.class); if (dir != null) { actionsList.add(ExtractAction.getInstance()); actionsList.add(new AbstractAction( Bundle.ImageNode_action_runIngestMods_text()) { @Override public void actionPerformed(ActionEvent e) { final RunIngestModulesDialog ingestDialog = new RunIngestModulesDialog(dir); ingestDialog.display(); } }); } final Image img = this.getLookup().lookup(Image.class); VirtualDirectory virtualDirectory = this.getLookup().lookup(VirtualDirectory.class); boolean isRootVD = false; if (virtualDirectory != null) { try { if (virtualDirectory.getParent() == null) { isRootVD = true; } } catch (TskCoreException ex) { } } if (img != null || isRootVD) { actionsList.add(new AbstractAction( Bundle.ImageNode_action_runIngestMods_text()) { @Override public void actionPerformed(ActionEvent e) { final RunIngestModulesDialog ingestDialog = new RunIngestModulesDialog(Collections.<Content>singletonList(content)); ingestDialog.display(); } }); } actionsList.add(new NewWindowViewAction( NbBundle.getMessage(this.getClass(), "ImageNode.getActions.viewInNewWin.text"), this)); return actionsList.toArray(new Action[0]); }

Target:
public Action[] getActions(boolean context) { List<Action> actionsList = new ArrayList<Action>(); actionsList.addAll(ExplorerNodeActionVisitor.getActions(content)); actionsList.add(new FileSearchAction( Bundle.ImageNode_getActions_openFileSearchByAttr_text())); actionsList.add(new AbstractAction( Bundle.ImageNode_action_runIngestMods_text()) { @Override public void actionPerformed(ActionEvent e) { final RunIngestModulesDialog ingestDialog = new RunIngestModulesDialog(Collections.<Content>singletonList(content)); ingestDialog.display(); } }); actionsList.add(new NewWindowViewAction( NbBundle.getMessage(this.getClass(), "ImageNode.getActions.viewInNewWin.text"), this)); return actionsList.toArray(new Action[0]); }
Source:
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HealthCheckService healthCheckService = Globals.getDefaultBaseServiceLocator().getService(HealthCheckService.class); fish.payara.nucleus.healthcheck.HealthCheckService payaraHealthCheckService = Globals.getDefaultBaseServiceLocator().getService(fish.payara.nucleus.healthcheck.HealthCheckService.class); if (healthCheckService == null) { throw new ServletException("Could not find Health Check Service"); } if (!healthCheckService.isEnabled()) { response.sendError(SC_FORBIDDEN, "MicroProfile Health Check Service is disabled"); return; } for (Checker checker : payaraHealthCheckService.getConfiguration().getCheckerList()) { String checkName = checker.getName(); System.out.println("Checker name = " + checkName); if (Boolean.valueOf(checker.getEnabled()) && Boolean.valueOf(checker.getDisplayOnHealthEndpoint())) { PayaraHealthCheck payaraHealthCheck = new PayaraHealthCheck(); payaraHealthCheck.setName(checkName); BaseHealthCheck check = payaraHealthCheckService.getCheck(checkName); check.doCheck(); if (check.getChecksDone() > 0) { payaraHealthCheck.setHealthStatus(check.getMostRecentCumulativeStatus() == null ? "" : check.getMostRecentCumulativeStatus().name()); payaraHealthCheck.setHealthCheckResult(check.getMostRecentCumulativeResult()); } healthCheckService.registerHealthCheck(checkName, payaraHealthCheck, READINESS); } else { healthCheckService.unregisterHealthCheck(checkName); } } healthCheckService.performHealthChecks(response, HealthCheckType.fromPath(request.getPathInfo())); }

Target:
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HealthCheckService healthCheckService = Globals.getDefaultBaseServiceLocator().getService(HealthCheckService.class); if (healthCheckService == null) { throw new ServletException("Could not find Health Check Service"); } if (!healthCheckService.isEnabled()) { response.sendError(SC_FORBIDDEN, "MicroProfile Health Check Service is disabled"); return; } healthCheckService.performHealthChecks(response, HealthCheckType.fromPath(request.getPathInfo()), request.getParameter("pretty")); }
Source:
public PreparedPutIterableContentValues prepare() { Checks.checkNotNull(putResolver, "Please specify put resolver"); return new PreparedPutIterableContentValues( storIOSQLiteDb, putResolver, contentValuesIterable, useTransactionIfPossible ); }

Target:
public PreparedPutIterableContentValues prepare() { checkNotNull(putResolver, "Please specify put resolver"); return new PreparedPutIterableContentValues( storIOSQLiteDb, putResolver, contentValuesIterable, useTransactionIfPossible ); }
Source:
protected void verifyQuery(AbstractStatisticalQuery<HostNIC, VdsNetworkInterface> query, VdsNetworkInterface entity) throws Exception { assertEquals(HostNIC.class, query.getParentType()); assertSame(entity, query.resolve(NIC_ID)); List<Statistic> statistics = query.getStatistics(entity); verifyStatistics(statistics, new String[] { "data.current.rx", "data.current.tx", "errors.total.rx", "errors.total.tx" }, new BigDecimal[] { asDec(RxTxCalculator.calcRxTx(50, 10D)), asDec(RxTxCalculator.calcRxTx(50, 20D)), asDec(30), asDec(40) }); Statistic adopted = query.adopt(new Statistic()); assertTrue(adopted.isSetHostNic()); assertEquals(NIC_ID.toString(), adopted.getHostNic().getId()); assertTrue(adopted.getHostNic().isSetHost()); assertEquals(GUIDS[0].toString(), adopted.getHostNic().getHost().getId()); }

Target:
protected void verifyQuery(AbstractStatisticalQuery<HostNIC, VdsNetworkInterface> query, VdsNetworkInterface entity) throws Exception { assertEquals(HostNIC.class, query.getParentType()); assertSame(entity, query.resolve(NIC_ID)); List<Statistic> statistics = query.getStatistics(entity); verifyStatistics(statistics, new String[] { "data.current.rx", "data.current.tx", "errors.total.rx", "errors.total.tx" }, new BigDecimal[] { asDec(RxTxCalculator.percent2bytes(SPEED, RECEIVE_RATE)), asDec(RxTxCalculator.percent2bytes(SPEED, TRANSMIT_RATE)), asDec(RECEIVE_DROP_RATE), asDec(TRANSMIT_DROP_RATE) }); Statistic adopted = query.adopt(new Statistic()); assertTrue(adopted.isSetHostNic()); assertEquals(NIC_ID.toString(), adopted.getHostNic().getId()); assertTrue(adopted.getHostNic().isSetHost()); assertEquals(GUIDS[0].toString(), adopted.getHostNic().getHost().getId()); }
Source:
public DockerTemplate getTemplate(Label label) { for (DockerTemplate t : templates) { if(label == null && !t.getToggleMode()) { return t; } else if (label.matches(t.getLabelSet())) { return t; } } return null; }

Target:
public DockerTemplate getTemplate(Label label) { for (DockerTemplate t : templates) { if(label != null && label.matches(t.getLabelSet())) { return t; } else if(label == null && t.getLabelSet().size() == 0) { return t; } } return null; }
Source:
public List<Key> listKeysCreatedBefore(Date beforeDate) { DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); com.google.appengine.api.datastore.Query q = new com.google.appengine.api.datastore.Query("Message"); q.setKeysOnly(); q.setFilter(new Query.FilterPredicate( "createdDateTime", FilterOperator.LESS_THAN_OR_EQUAL, beforeDate)); PreparedQuery pq = datastore.prepare(q); FetchOptions fetchOptions; fetchOptions = FetchOptions.Builder.withDefaults(); List<Key> result = new ArrayList<>(); for (Entity e: pq.asIterable(fetchOptions)) { result.add(e.getKey()); } return result; }

Target:
public List<Key> listKeysCreatedBefore(Date beforeDate) { DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); com.google.appengine.api.datastore.Query q = new com.google.appengine.api.datastore.Query("Message"); q.setKeysOnly(); q.setFilter(new Query.FilterPredicate( "createdDateTime", FilterOperator.LESS_THAN_OR_EQUAL, beforeDate)); PreparedQuery pq = datastore.prepare(q); List<Key> result = new ArrayList<>(); for (Entity e: pq.asIterable()) { result.add(e.getKey()); } return result; }
Source:
void shouldReturnTotalNumberMoreIssues() { final Issues<Issue> issues = new Issues<>(); IssueBuilder builder = new IssueBuilder(); issues.add(builder.setCategory("errorA").build()); issues.add(builder.setCategory("errorB").build()); PropertyStatistics statistics = new PropertyStatistics(issues, "category", Function.identity()); int actualTotal = statistics.getTotal(); assertThat(actualTotal).isEqualTo(2); }

Target:
void shouldReturnTotalNumberMoreIssues() { Issues<Issue> issues = new Issues<>(); IssueBuilder builder = new IssueBuilder(); issues.add(builder.setCategory("errorA").build()); issues.add(builder.setCategory("errorB").build()); PropertyStatistics statistics = new PropertyStatistics(issues, "category", Function.identity()); int actualTotal = statistics.getTotal(); assertThat(actualTotal).isEqualTo(2); }
Source:
private static ArrayList<String> getStoreInfo(IEntityManagerHelper helper, String subPath) throws Exception { if (helper.getStoreLocation().contains("hdfs:")) { return HadoopUtil.getAllFilesHDFS(helper.getHadoopURL(), new Path(helper.getStoreLocation() + subPath)); } return runRemoteScript(helper.getQaHost(), helper.getUsername(), helper.getPassword(), "ls " + helper.getStoreLocation() + "/store" + subPath, helper.getIdentityFile()); }

Target:
private static ArrayList<String> getStoreInfo(IEntityManagerHelper helper, String subPath) throws Exception { if (helper.getStoreLocation().startsWith("hdfs:")) { return HadoopUtil.getAllFilesHDFS(helper.getStoreLocation(), helper.getStoreLocation() + subPath); } else { return runRemoteScript(helper.getQaHost(), helper.getUsername(), helper.getPassword(), "ls " + helper.getStoreLocation() + "/store" + subPath, helper.getIdentityFile()); } }
Source:
private V computeInternal(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction, boolean computeIfPresent, Metadata metadata, long flags) { assertKeyNotNull(key); assertFunctionNotNull(remappingFunction); InvocationContext ctx = getInvocationContextWithImplicitTransaction(false, 1); ComputeCommand command = commandsFactory.buildComputeCommand(key, remappingFunction, computeIfPresent, metadata, flags); ctx.setLockOwner(command.getKeyLockOwner()); return (V) executeCommandAndCommitIfNeeded(ctx, command); }

Target:
private V computeInternal(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction, boolean computeIfPresent, Metadata metadata, long flags) { return computeInternal(key, remappingFunction, computeIfPresent, metadata, flags, getInvocationContextWithImplicitTransaction(false, 1)); }
Source:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("PutRequest["); sb.append("BlobID=").append(blobId.getID()); sb.append(", ").append("ClientId=").append(clientId); sb.append(", ").append("CorrelationId=").append(correlationId); if (properties != null) { sb.append(", ").append(getBlobProperties()); } else { sb.append(", ").append("Properties=Null"); } if (usermetadata != null) { sb.append(", ").append("UserMetaDataSize=").append(getUsermetadata().capacity()); } else { sb.append(", ").append("UserMetaDataSize=0"); } sb.append(", ").append("blobType=").append(getBlobType()); sb.append(", ").append("blobSize=").append(getBlobSize()); sb.append("]"); return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("PutRequest["); sb.append("BlobID=").append(blobId.getID()); sb.append(", ").append("ClientId=").append(clientId); sb.append(", ").append("CorrelationId=").append(correlationId); if (properties != null) { sb.append(", ").append(properties); } else { sb.append(", ").append("Properties=Null"); } if (usermetadata != null) { sb.append(", ").append("UserMetaDataSize=").append(usermetadata.capacity()); } else { sb.append(", ").append("UserMetaDataSize=0"); } sb.append(", ").append("blobType=").append(blobType); sb.append(", ").append("blobSize=").append(blobSize); sb.append("]"); return sb.toString(); }
Source:
public String createDispoAnnotation(String programId, String itemId, DispoAnnotationData annotation) { String idOfNewAnnotation = ""; DispoItem dispoItem = getQuery().findDispoItemById(programId, itemId); if (dispoItem != null) { dataFactory.initAnnotation(annotation); idOfNewAnnotation = dataFactory.getNewId(); annotation.setId(idOfNewAnnotation); validateResolution(annotation); boolean isValid = annotation.getIsValid(); JSONArray discrepanciesList = dispoItem.getDiscrepanciesList(); if (isValid) { dispoConnector.connectAnnotation(annotation, discrepanciesList); isValid = annotation.getIsValid(); } JSONObject annotationsList = dispoItem.getAnnotationsList(); try { annotationsList.put(idOfNewAnnotation, DispoUtil.annotationToJsonObj(annotation)); } catch (JSONException ex) { throw new OseeCoreException(ex); } String currentStatus = dispoItem.getStatus(); boolean updateStatus = false; if (!currentStatus.equals("COMPLETE") && !currentStatus.equals("PASS") && isValid) { updateStatus = true; } DispoItem updatedItem = dataFactory.createUpdatedItem(annotationsList, discrepanciesList, updateStatus); ArtifactReadable author = getQuery().findUser(); getWriter().updateDispoItem(author, programId, dispoItem.getGuid(), updatedItem); } return idOfNewAnnotation; }

Target:
public String createDispoAnnotation(String programId, String itemId, DispoAnnotationData annotation) { String idOfNewAnnotation = ""; DispoItem dispoItem = getQuery().findDispoItemById(programId, itemId); if (dispoItem != null) { dataFactory.initAnnotation(annotation); idOfNewAnnotation = dataFactory.getNewId(); annotation.setId(idOfNewAnnotation); validateResolution(annotation); boolean isValid = annotation.getIsValid(); JSONArray discrepanciesList = dispoItem.getDiscrepanciesList(); if (isValid) { dispoConnector.connectAnnotation(annotation, discrepanciesList); isValid = annotation.getIsValid(); } JSONObject annotationsList = dispoItem.getAnnotationsList(); try { annotationsList.put(idOfNewAnnotation, DispoUtil.annotationToJsonObj(annotation)); } catch (JSONException ex) { throw new OseeCoreException(ex); } String currentStatus = dispoItem.getStatus(); boolean updateStatus = false; if (!currentStatus.equals(Item_Complete) && !currentStatus.equals(Item_Pass) && isValid) { updateStatus = true; } DispoItem updatedItem = dataFactory.createUpdatedItem(annotationsList, discrepanciesList, updateStatus); ArtifactReadable author = getQuery().findUser(); getWriter().updateDispoItem(author, programId, dispoItem.getGuid(), updatedItem); } return idOfNewAnnotation; }
Source:
public ResponseEntity<String> visualizeNetworks(@ProjectIdentifier @PathVariable("projectId") String projectid, @PathVariable("networkId") String networkId, Principal principal, @CheckAccess @InjectProject IProject project) { ITransformedNetwork transformedNetwork = null; try { transformedNetwork = transformationManager.getTransformedNetwork(networkId); } catch (QuadrigaStorageException qse) { logger.error("Error while retrieving networks for display:", qse); return new ResponseEntity<String>("", HttpStatus.INTERNAL_SERVER_ERROR); } String json = null; if (transformedNetwork != null) { json = jsonCreator.getJson(transformedNetwork.getNodes(), transformedNetwork.getLinks()); } else { return new ResponseEntity<String>(json, HttpStatus.NOT_FOUND); } return new ResponseEntity<String>(json, HttpStatus.OK); }

Target:
public ResponseEntity<String> visualizeNetworks(@ProjectIdentifier @PathVariable("projectId") String projectid, @PathVariable("networkId") String networkId, Principal principal, @CheckAccess @InjectProject IProject project) throws QuadrigaStorageException { boolean isValid = false; try { isValid = nwManager.getNetworkIdsInProject(project.getProjectId()).contains(networkId); } catch (QuadrigaStorageException e) { logger.error("Encountered an error while retrieving the json string", e); return new ResponseEntity<String>("", HttpStatus.INTERNAL_SERVER_ERROR); } if (isValid) { return nwUtils.sendNetworkAsResponseEntity(networkId); } else { return new ResponseEntity<String>("", HttpStatus.UNAUTHORIZED); } }
Source:
private ComponentDto findProject(DbSession dbSession, OrganizationDto organization, SearchWsRequest request) { if (request.getProjectKey() == null) { return null; } ComponentDto project = componentFinder.getByKey(dbSession, request.getProjectKey()); if (!project.getOrganizationUuid().equals(organization.getUuid())) { throwNotFound(project); } if (project.isRoot()) { return project; } ComponentDto component = dbClient.componentDao().selectByUuid(dbSession, project.projectUuid()).orNull(); checkState(component != null, "Project uuid of component uuid '%s' does not exist", project.uuid()); return component; }

Target:
private ComponentDto findProject(DbSession dbSession, OrganizationDto organization, SearchWsRequest request) { if (request.getProjectKey() == null) { return null; } ComponentDto project = componentFinder.getByKey(dbSession, request.getProjectKey()); if (!project.getOrganizationUuid().equals(organization.getUuid())) { throw new NotFoundException(format("Component key '%s' not found", project.getKey())); } if (project.isRoot()) { return project; } ComponentDto component = dbClient.componentDao().selectByUuid(dbSession, project.projectUuid()).orNull(); checkState(component != null, "Project uuid of component uuid '%s' does not exist", project.uuid()); return component; }
Source:
private boolean makeJarBackup(File jarFile) { log("Making JAR backup"); for (int i = 0; i < MAX_RETRY; i++) { if (moveFileToBackup(jarFile)) { return true; } log("Failed to make backup. Might be due to original JAR still in use."); try { log("Wait for a while before trying again."); Thread.sleep(WAIT_TIME); } catch (InterruptedException e) { log("Failed to wait for a while"); } } log("Jar file cannot be backed up. Most likely is in use by another process."); return false; }

Target:
private void makeJarBackup(File jarFile) throws IOException { log("Making JAR backup"); for (int i = 0; i < MAX_RETRY; i++) { try { moveFileToBackup(jarFile); return; } catch (IOException e) { log(String.format("Failed to move file %s to backup. Might be due to original JAR still in use.", jarFile.getName())); } try { log("Wait for a while before trying again."); Thread.sleep(WAIT_TIME); } catch (InterruptedException e) { log("Failed to wait for a while"); } } throw new IOException("Jar file cannot be backed up. Most likely is in use by another process."); }
Source:
public void beforeDestroy(BeforeDestroyEvent event, EntityRef player, CharacterComponent characterComponent, AliveCharacterComponent aliveCharacterComponent) { if (player.hasComponent(PlayerCharacterComponent.class)) { event.consume(); logger.info(player.toFullDescription()); String team = player.getComponent(LASTeamComponent.class).team; player.send(new DoHealEvent(100000, player)); player.send(new CharacterTeleportEvent(LASUtils.getTeleportDestination(team))); } }

Target:
public void beforeDestroy(BeforeDestroyEvent event, EntityRef player, CharacterComponent characterComponent, AliveCharacterComponent aliveCharacterComponent) { if (player.hasComponent(PlayerCharacterComponent.class)) { event.consume(); String team = player.getComponent(LASTeamComponent.class).team; player.send(new DoHealEvent(100000, player)); player.send(new CharacterTeleportEvent(LASUtils.getTeleportDestination(team))); } }