Month: September 2016

ignore reflections library warning

to ignore this kind of warning:

[WARN] [10:16:57] [Reflections.java:208]	 could not create Vfs.Dir from url. ignoring the exception and continuing
org.reflections.ReflectionsException: could not create Vfs.Dir from url, no matching UrlType was found [file:/System/Library/Java/Extensions/libAppleScriptEngine.jnilib]
either use fromURL(final URL url, final List<UrlType> urlTypes) or use the static setDefaultURLTypes(final List<UrlType> urlTypes) or addDefaultURLTypes(UrlType urlType) with your specialized UrlType.
	at org.reflections.vfs.Vfs.fromURL(Vfs.java:109)
	at org.reflections.vfs.Vfs.fromURL(Vfs.java:91)
	at org.reflections.Reflections.scan(Reflections.java:237)
	at org.reflections.Reflections.scan(Reflections.java:204)
	at org.reflections.Reflections.<init>(Reflections.java:129)
	at com.titansolutions.HibernateUtil.buildSessionFactory(HibernateUtil.java:49)
	at com.titansolutions.HibernateUtil.<clinit>(HibernateUtil.java:28)

Just call ReflectionsHelper.registerUrlTypes(); before you use reflections

package com.titansolutions;

import java.net.URL;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.reflections.vfs.Vfs;

import com.google.common.collect.Lists;

public class ReflectionsHelper {
	public static void registerUrlTypes() {

		final List<Vfs.UrlType> urlTypes = Lists.newArrayList();

		// include a list of file extensions / filenames to be recognized
		urlTypes.add(new EmptyIfFileEndingsUrlType(".mar", ".jnilib"));

		urlTypes.addAll(Arrays.asList(Vfs.DefaultUrlTypes.values()));

		Vfs.setDefaultURLTypes(urlTypes);
	}

	private static class EmptyIfFileEndingsUrlType implements Vfs.UrlType {

		private final List<String> fileEndings;

		private EmptyIfFileEndingsUrlType(final String... fileEndings) {

			this.fileEndings = Lists.newArrayList(fileEndings);
		}

		public boolean matches(URL url) {

			final String protocol = url.getProtocol();
			final String externalForm = url.toExternalForm();
			if (!protocol.equals("file")) {
				return false;
			}
			for (String fileEnding : fileEndings) {
				if (externalForm.endsWith(fileEnding))
					return true;
			}
			return false;
		}

		public Vfs.Dir createDir(final URL url) throws Exception {

			return emptyVfsDir(url);
		}

		private static Vfs.Dir emptyVfsDir(final URL url) {

			return new Vfs.Dir() {
				@Override
				public String getPath() {

					return url.toExternalForm();
				}

				@Override
				public Iterable<Vfs.File> getFiles() {

					return Collections.emptyList();
				}

				@Override
				public void close() {

				}
			};
		}
	}
}

read count : 14

Custom memory panel

GKD (General kernel debugger) now supports “custom panel”, you can define many memory areas with the interrupted rules, every time bochs got paused, it will show you the values of the memory areas that you have defined.

custom-panel-1

custom-panel-2

 

read count : 13